Guix: Difference between revisions
m (Fix typo in command.) |
m (Link to manual.) |
||
Line 32: | Line 32: | ||
== Generating image to use with singularity == | == Generating image to use with singularity == | ||
You can use Guix to create container for singularity with guix pack: | You can use Guix to create container for singularity with [https://guix.gnu.org/manual/en/html_node/Invoking-guix-pack.html guix pack]: | ||
$ guix pack -f squashfs bash emacs gcc | $ guix pack -f squashfs bash emacs gcc | ||
.... | .... |
Revision as of 10:11, 9 March 2021
The Guix package manager is available on Grid'5000 to provide an alternative way of installing software on nodes.
This page describes the use of Guix on Grid'5000. For additional information about Guix, see:
- The Guix website
- The Guix Reference Card
- The Guix manual, package management section
- The Guix HPC blog, with information about Guix usage in a HPC and reproducible context
How to use Guix on Grid'5000
Guix is available on the standard environment directly through the guix
command.
For example:
guix install hello
Each Grid'5000 site hosts a Guix server communicating with each other. So if you install a package on Nancy and then decide to install the same package in Grenoble the guix server from Grenoble will fetch it from Nancy.
Note: To work properly, a .guix
directory is created in your home directory (it's a Grid'5000-specific directory). If you remove it, Guix will stop working since your profile is stored there.
Compilation
When you try to install or compile a package, the following steps happen:
- Guix first tries to fetch the compiled package from ci.guix.gnu.org
- If not found, it will try to find it on all Grid'5000 Guix servers (on other sites)
- If it still not found, it will be built on a dedicated machine on Grid'5000, which is not accessible to the users
Supported architecture
For now, Guix is only available on nodes with x86_64 architecture (not on POWER or ARM nodes).
Usage example
Generating image to use with singularity
You can use Guix to create container for singularity with guix pack:
$ guix pack -f squashfs bash emacs gcc .... /gnu/store/7pzhxrkjrfk3sh9i4dn2k61gvi1slr7g-squashfs-pack.gz.squashfs $ singularity run /gnu/store/7pzhxrkjrfk3sh9i4dn2k61gvi1slr7g-squashfs-pack.gz.squashfs WARNING: passwd file doesn't exist in container, not updating WARNING: group file doesn't exist in container, not updating /bin/sh: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8) No runscript found in container, executing /bin/sh sh: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8) $ gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/gnu/store/xpdy9vvqym9xv7praqkwsm3gdzn2kv1p-gcc- 10.2.0/libexec/gcc/x86_64-unknown-linux-gnu/10.2.0/lto-wrapper Target: x86_64-unknown-linux-gnu Configured with: Thread model: posix Supported LTO compression algorithms: zlib gcc version 10.2.0 (GCC)
Note: If you forget the bash (or similar) package, singularity run and singularity exec will fail with an unhelpful “no such file or directory” message.
Container
You can easily isolate the execution of your program in a container:
$ guix environment --ad-hoc --container coreutils gcc ddelabroye@chetemi-8 ~ [env]$ gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/gnu/store/xpdy9vvqym9xv7praqkwsm3gdzn2kv1p-gcc- 10.2.0/libexec/gcc/x86_64-unknown-linux-gnu/10.2.0/lto-wrapper Target: x86_64-unknown-linux-gnu Configured with: Thread model: posix Supported LTO compression algorithms: zlib gcc version 10.2.0 (GCC)