Skip to content

Commit 2098e3b

Browse files
authored
Update documentation for SquashFS mount (#156)
1 parent 364f491 commit 2098e3b

File tree

2 files changed

+50
-1
lines changed

2 files changed

+50
-1
lines changed

docs/software/container-engine/edf.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ If false, the container filesystem is read-only.
127127
| **Type** | array |
128128
| **Default** | `[]` |
129129

130-
List of bind mounts in the format `SOURCE:DESTINATION[:FLAGS]`. Flags are optional and can include `ro`, `private`, etc.
130+
List of mounts in the format `SOURCE:DESTINATION[:FLAGS]`. By default, it performs bind mount unless the only flag is `sqsh`, in which it performs [a SquashFS mount][ref-ce-run-mounting-squashfs]. When bind mounting, the flags are forwarded to the system mount operation (e.g., `ro` or `private`).
131131

132132
!!! example
133133
* Literal fixed mount map
@@ -145,6 +145,11 @@ List of bind mounts in the format `SOURCE:DESTINATION[:FLAGS]`. Flags are option
145145
mounts = ["${SCRATCH}:/scratch"]
146146
```
147147

148+
* Mounting a SquashFS image `${SCRATCH}/data.sqsh` to `/data`
149+
```toml
150+
mounts = ["${SCRATCH}/data.sqsh:/data:sqsh"]
151+
```
152+
148153
!!! note
149154
* Mount flags are separated with a plus symbol, for example: `ro+private`.
150155

docs/software/container-engine/run.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,3 +182,47 @@ Using the `enroot import` documentation page as a reference:
182182
machine registry.ethz.ch login <username> password <GITLAB_TOKEN>
183183
machine gitlab.ethz.ch login <username> password <GITLAB_TOKEN>
184184
```
185+
186+
## Working with storage
187+
188+
Directories outside a container can be *mounted* inside a container so that the job inside the container can read/write on them. The directories to mount should be specified in EDF with `mounts`.
189+
190+
!!! example "Specifying directories to mount in EDF"
191+
* Mount `${SCRATCH}` to `/scratch` inside the container
192+
193+
```toml
194+
mounts = ["${SCRATCH}:/scratch"]
195+
```
196+
197+
* Mount `${SCRATCH}` to `${SCRATCH}` inside the container
198+
199+
```toml
200+
mounts = ["${SCRATCH}:${SCRATCH}"]
201+
```
202+
203+
* Mount `${SCRATCH}` to `${SCRATCH}` and `${HOME}/data` to `${HOME}/data`
204+
205+
```toml
206+
mounts = ["${SCRATCH}:${SCRATCH}", "${HOME}/data:${HOME}/data"]
207+
```
208+
209+
!!! note
210+
The source (before `:`) should be present on the cluster: the destination (after `:`) doesn't have to be inside the container.
211+
212+
See [the EDF reference][ref-ce-edf-reference] for the full specifiction of the `mounts` EDF entry.
213+
214+
215+
[](){#ref-ce-run-mounting-squashfs}
216+
### Mounting a SquashFS image
217+
218+
!!! warning
219+
This feature is only available on some vClusters (Daint and Santis, as of 17.06.2025).
220+
221+
A SquashFS image, essentially being a compressed data archive, can also be mounted _as a directory_ so that the image contents are readable inside the container. For this, `:sqsh` should be appended after the destination.
222+
223+
!!! example "Mounting a SquashFS image `${SCRATCH}/data.sqsh` to `/data`"
224+
```toml
225+
mounts = ["${SCRATCH}/data.sqsh:/data:sqsh"]
226+
```
227+
228+
This is particularly useful if a job should read _multiple_ data files _frequently_, which may cause severe file access overheads. Instead, it is recommended to pack data files into one data SquashFS image and mount it inside a container. See the *"magic phase"* in [this documentation](https://tldp.org/HOWTO/SquashFS-HOWTO/creatingandusing.html) for creating a SquashFS image.

0 commit comments

Comments
 (0)