Skip to content

Commit 425ccc3

Browse files
author
torri
committed
WIP on the squashfs part
1 parent f969e85 commit 425ccc3

File tree

1 file changed

+105
-0
lines changed

1 file changed

+105
-0
lines changed

docs/getting_access/non_standard.md

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,3 +128,108 @@ EOF
128128

129129
```
130130
You can see the original blog post on how they used this solution in Deucalion [here](https://www.eessi.io/docs/blog/2024/06/28/espresso-portable-test-run-eurohpc/#running-espresso-on-deucalion-via-eessi-cvmfsexec).
131+
132+
## Via `squashfs` + cvmfs's `shrinkwrap` utility
133+
134+
CernVM-FS provides the Shrinkwrap utility, allowing users to create a portable snapshot of a CVMFS repository. This can be exported and distributed without the need of a CVMFS client or network access.
135+
136+
To create an export of EESSI in user space, you will first need to create the config file `software.eessi.io.config`:
137+
138+
```bash
139+
CVMFS_REPOSITORIES=software.eessi.io
140+
CVMFS_REPOSITORY_NAME=software.eessi.io
141+
CVMFS_CONFIG_REPOSITORY=cvmfs-config.cern.ch
142+
CVMFS_SERVER_URL='http://aws-eu-west-s1-sync.eessi.science/cvmfs/software.eessi.io'
143+
CVMFS_HTTP_PROXY=DIRECT # Avoid filling up any local squid's cache
144+
CVMFS_CACHE_BASE=/tmp/shrinkwrap
145+
CVMFS_KEYS_DIR=/etc/cvmfs/keys/eessi.io # Need to be provided for shrinkwrap
146+
CVMFS_SHARED_CACHE=no # Important as libcvmfs does not support shared caches
147+
CVMFS_USER=cvmfs
148+
CVMFS_UID_MAP=uid.map
149+
CVMFS_GID_MAP=gid.map
150+
151+
```
152+
You will need to create the files `uid.map` and `gid.map` with the respective value you will use preceded by a `*`. P.e., assuming UID 1000, set the two following files:
153+
154+
```bash
155+
$ cat uid.map
156+
* 1000
157+
158+
$ cat gid.map
159+
* 1000
160+
```
161+
In addition, you need to create a spec file `software.eessi.io.spec` with the files you want to include and/or exclude in the shrinkwrap. Contents are:
162+
163+
```bash
164+
/versions/2023.06/compat/linux/x86_64/*
165+
/versions/2023.06/init/*
166+
/versions/2023.06/scripts/*
167+
/versions/2023.06/software/linux/x86_64/intel/skylake_avx512/.lmod/*
168+
/versions/2023.06/software/linux/x86_64/intel/skylake_avx512/modules/*
169+
/versions/2023.06/software/linux/x86_64/intel/skylake_avx512/software/*
170+
# Exclude the Gentoo ebuild repo and cache files
171+
!/versions/2023.06/compat/linux/x86_64/var/db/repos/gentoo
172+
!/versions/2023.06/compat/linux/x86_64/var/cache
173+
174+
```
175+
176+
Then, execute `cvmfs_shrinkwrap`to create the export:
177+
178+
```bash
179+
$ cvmfs_shrinkwrap -r software.eessi.io -f software.eessi.io.config -t software.eessi.io.spec --dest-base /tmp/cvmfs -j 4
180+
181+
LibCvmfs version 2.12, revision 31
182+
(libcvmfs) (manager 'standard') switching proxy from (none) to DIRECT. Reason: set random start proxy from the first proxy group [Current host: http://aws-eu-west-s1-sync.eessi.science/cvmfs/software.eessi.io]
183+
(libcvmfs) (manager 'external') switching proxy from (none) to DIRECT. Reason: cloned [Current host: http://aws-eu-west-s1-sync.eessi.science/cvmfs/software.eessi.io]
184+
(libcvmfs) Starting 4 workers
185+
(libcvmfs) cntByte|0|Byte count of projected repository
186+
cntDir|1|Number of directories from source repository
187+
cntFile|0|Number of files from source repository
188+
cntSymlink|0|Number of symlinks from source repository
189+
dataBytes|0|Bytes transferred from source to destination
190+
dataBytesDeduped|0|Number of bytes not copied due to deduplication
191+
dataFiles|0|Number of data files transferred from source to destination
192+
dataFilesDeduped|0|Number of files not copied due to deduplication
193+
entriesDest|1|Number of file system entries processed in the destination
194+
entriesSrc|1|Number of file system entries processed in the source
195+
196+
....
197+
198+
# This takes a long time
199+
```
200+
201+
Once completed, the contents will be available in /tmp/cvmfs. You can create an squashfs image from it:
202+
203+
```bash
204+
sudo mksquashfs /tmp/cvmfs software.eessi.io.sqsh
205+
206+
```
207+
208+
This squashfs image can be mounted in any container:
209+
210+
```bash
211+
apptainer shell -B software.eessi.io.sqsh:/cvmfs:image-src=/ docker://ubuntu
212+
213+
```
214+
215+
Right now its a manual process but there is work in progress towards an automated solution.
216+
217+
218+
219+
220+
221+
222+
223+
224+
225+
226+
227+
228+
229+
230+
231+
232+
233+
234+
235+

0 commit comments

Comments
 (0)