From 01d1f07cb3671faadd4b9b13ba702c08793bb239 Mon Sep 17 00:00:00 2001 From: Hannes Vogt Date: Wed, 12 Mar 2025 09:01:12 +0100 Subject: [PATCH 1/4] Add warning for mounting location --- docs/guides/storage.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/guides/storage.md b/docs/guides/storage.md index 99e41aeb..d303622f 100644 --- a/docs/guides/storage.md +++ b/docs/guides/storage.md @@ -27,7 +27,7 @@ The main reasons for this include: As a result, using virtual environments can be slow, and these problems are only exacerbated when the virtual environment is loaded simultaneously by many ranks in an MPI job. One solution is to use the tool `mksquashfs` to compresses the contents of a directory - files, inodes and sub-directories - into a single file. -This file can be mounted as a read-only file [Squashfs](https://en.wikipedia.org/wiki/SquashFS) file system, which is much faster because a single file is accessed instead of the many small files that were in the original environment. +This file can be mounted as a read-only [Squashfs](https://en.wikipedia.org/wiki/SquashFS) file system, which is much faster because a single file is accessed instead of the many small files that were in the original environment. #### Step 1: create the virtual environment @@ -95,7 +95,7 @@ mksquashfs $SCRATCH/sqfs-demo/.pyenv pyenv.squashfs \ The default installed version of `mksquashfs` on Alps does not support the best `zstd` compression method. Every uenv contains a better version of `mksquashfs`, which is used by the uenv to compress itself when it is built. - The exact location inside the uenv depends on the target architecure, and version, and will be of the form: + The exact location inside the uenv depends on the target architecture, and version, and will be of the form: ``` /user-environment/linux-sles15-${arch}/gcc-7.5.0/squashfs-${version}-${hash}/bin/mksquashfs ``` @@ -116,6 +116,9 @@ Note that the original virtual environment is still installed in `$SCRATCH/sqfs- A benefit of this approach is that the squashfs file can be copied to a location that is not subject to the Scratch cleaning policy. +??? warning + Most likely, your virtual environment is not relocatable as it contains symlinks to paths in the original location on the filesystem. Therefore, you need to mount the image in the exact same location where you created the virtual environment. + #### Step 4: (optional) regenerate the virtual environment The squashfs file is immutable - it is not possible to modify the contents of `.pyenv` while it is mounted. From ae7f2f59b67d1862783e565dadfaf89e54f28aed Mon Sep 17 00:00:00 2001 From: Ben Cumming Date: Wed, 12 Mar 2025 09:37:52 +0100 Subject: [PATCH 2/4] Update docs/guides/storage.md Co-authored-by: Hannes Vogt --- docs/guides/storage.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guides/storage.md b/docs/guides/storage.md index d303622f..67605d42 100644 --- a/docs/guides/storage.md +++ b/docs/guides/storage.md @@ -116,7 +116,7 @@ Note that the original virtual environment is still installed in `$SCRATCH/sqfs- A benefit of this approach is that the squashfs file can be copied to a location that is not subject to the Scratch cleaning policy. -??? warning +!!! warning Most likely, your virtual environment is not relocatable as it contains symlinks to paths in the original location on the filesystem. Therefore, you need to mount the image in the exact same location where you created the virtual environment. #### Step 4: (optional) regenerate the virtual environment From 5837e1588738d1807d468baa81a8f7798dc375ef Mon Sep 17 00:00:00 2001 From: Ben Cumming Date: Wed, 12 Mar 2025 09:38:03 +0100 Subject: [PATCH 3/4] Update docs/guides/storage.md Co-authored-by: Hannes Vogt --- docs/guides/storage.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guides/storage.md b/docs/guides/storage.md index 67605d42..0609b8c4 100644 --- a/docs/guides/storage.md +++ b/docs/guides/storage.md @@ -117,7 +117,7 @@ Note that the original virtual environment is still installed in `$SCRATCH/sqfs- A benefit of this approach is that the squashfs file can be copied to a location that is not subject to the Scratch cleaning policy. !!! warning - Most likely, your virtual environment is not relocatable as it contains symlinks to paths in the original location on the filesystem. Therefore, you need to mount the image in the exact same location where you created the virtual environment. + Virtual environment are usually not relocatable as they contains symlinks to absolute locations inside the virtual environment. Therefore, you need to mount the image in the exact same location where you created the virtual environment. #### Step 4: (optional) regenerate the virtual environment From e77c45ce7c2400c0a2f6e3f9001539b6560c5a3d Mon Sep 17 00:00:00 2001 From: Ben Cumming Date: Wed, 12 Mar 2025 09:47:18 +0100 Subject: [PATCH 4/4] Update docs/guides/storage.md --- docs/guides/storage.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guides/storage.md b/docs/guides/storage.md index 0609b8c4..f2d7b902 100644 --- a/docs/guides/storage.md +++ b/docs/guides/storage.md @@ -117,7 +117,7 @@ Note that the original virtual environment is still installed in `$SCRATCH/sqfs- A benefit of this approach is that the squashfs file can be copied to a location that is not subject to the Scratch cleaning policy. !!! warning - Virtual environment are usually not relocatable as they contains symlinks to absolute locations inside the virtual environment. Therefore, you need to mount the image in the exact same location where you created the virtual environment. + Virtual environment are usually not relocatable as they contain symlinks to absolute locations inside the virtual environment. Therefore, you need to mount the image in the exact same location where you created the virtual environment. #### Step 4: (optional) regenerate the virtual environment