Skip to content

Commit 7f7d859

Browse files
committed
Update up to before 'Accessing native resources'
1 parent fe3fd45 commit 7f7d859

File tree

1 file changed

+23
-17
lines changed

1 file changed

+23
-17
lines changed

docs/software/container-engine.md

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ $ srun --environment=ubuntu --pty bash
7878

7979
Specifying the `--environment` option to the Slurm command (e.g., `srun` or `salloc`) will make it run inside the EDF environment:
8080

81-
!!! example
81+
!!! example "Specifying EDF with an absolute path"
8282
```bash
8383
$ srun --environment=$SCRATCH/edf/debian.toml cat /etc/os-release
8484
PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
@@ -90,7 +90,7 @@ Specifying the `--environment` option to the Slurm command (e.g., `srun` or `sal
9090
`--environment` can be a relative path from the current working directory (i.e., where the Slurm command is executed).
9191
A relative path should be prepended by `./`:
9292

93-
!!! example
93+
!!! example "Specifying EDF with a relative path"
9494
```bash
9595
$ ls
9696
debian.toml
@@ -104,7 +104,7 @@ A relative path should be prepended by `./`:
104104

105105
If an EDF is located in the [EDF search path][ref-ce-edf-search-path], `--environment` also accepts the EDF filename without the `.toml` extension:
106106

107-
!!! example
107+
!!! example "Specifying EDF in the default search path"
108108
```bash
109109
$ srun --environment=debian cat /etc/os-release
110110
PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
@@ -117,7 +117,7 @@ If an EDF is located in the [EDF search path][ref-ce-edf-search-path], `--enviro
117117

118118
The recommended approach is to use `--environment` as part of the Slurm command (e.g., `srun` or `salloc`):
119119

120-
!!! example
120+
!!! example "Adding `--environment` to `srun`"
121121
```bash
122122
#!/bin/bash
123123
#SBATCH --job-name=edf-example
@@ -142,7 +142,7 @@ The default EDF search path can be changed through the `EDF_PATH` environment va
142142
`EDF_PATH` must be a colon-separated list of absolute paths to directories, where the CE searches each directory in order.
143143
If an EDF is located in the search path, its name can be used in the `--environment` option without the `.toml` extension.
144144

145-
!!! example
145+
!!! example "Using `EDF_PATH` to control the default search path"
146146
```bash
147147
$ ls ~/.edf
148148
debian.toml
@@ -220,13 +220,16 @@ After the import is complete, images are available in Squashfs format in the cur
220220

221221
To use an image from a different registry, the corresponding registry URL has to be prepended to the image reference, using a hash character (#) as a separator:
222222

223-
!!! example
223+
!!! example "Using a third-party registry within an EDF"
224224
```bash
225-
# Usage within an EDF
226-
$ cat $HOME/.edf/nvhpc-23.7.toml
225+
$ cat ${HOME}/.edf/example.toml # (1)
227226
image = "nvcr.io#nvidia/nvhpc:23.7-runtime-cuda11.8-ubuntu22.04"
227+
```
228+
229+
1. Assuming `example.toml` was already written at `${HOME}/.edf`.
228230

229-
# Usage on the command line
231+
!!! example "Using a third-party registry on the command line"
232+
```bash
230233
$ enroot import docker://nvcr.io#nvidia/nvhpc:23.7-runtime-cuda11.8-ubuntu22.04
231234
```
232235

@@ -295,27 +298,30 @@ This can be done in multiple ways in TOML: for example, both of the following us
295298
enabled = "true"
296299
```
297300

298-
To avoid mistakes, notice a few key features of TOML:
301+
??? note "Relevant details of the TOML format"
302+
* All property assignments belong to the section immediately preceding them (the statement in square brackets), which defines the table they refer to.
303+
304+
* Tables, on the other hand, do not automatically belong to the tables declared before them; to nest tables, their name has to list their parents using the dot notations (so the previous example defines the table `ssh` inside `hooks`, which in turn is inside `com`, which is inside `annotations`).
305+
306+
* An assignment can implicitly define subtables if the key you assign is a dotted list. As a reference, see the examples made earlier in this section, where assigning a string to the `com.hooks.ssh.enabled` attribute within the `[annotations]` table is exactly equivalent to assigning to the `enabled` attribute within the `[annotations.com.hooks.ssh]` subtable.
307+
308+
* Attributes can be added to a table only in one place in the TOML file. In other words, each table must be defined in a single square bracket section. For example, Case 3 in the example below is invalid because the `ssh` table was doubly defined both in the `[annotations]` and in the `[annotations.com.hooks.ssh]` sections. See the [TOML format](https://toml.io/en/) spec for more details.
299309

300-
* All property assignments belong to the section immediately preceding them (the statement in square brackets), which defines the table they refer to.
301-
* Tables, on the other hand, do not automatically belong to the tables declared before them; to nest tables, their name has to list their parents using the dot notations (so the previous example defines the table `ssh` inside `hooks`, which in turn is inside `com`, which is inside `annotations`).
302-
* An assignment can implicitly define subtables if the key you assign is a dotted list. As a reference, see the examples made earlier in this section, where assigning a string to the `com.hooks.ssh.enabled` attribute within the `[annotations]` table is exactly equivalent to assigning to the `enabled` attribute within the `[annotations.com.hooks.ssh]` subtable.
303-
* Attributes can be added to a table only in one place in the TOML file. In other words, each table must be defined in a single square bracket section. For example, Case 3 in the example below is invalid because the `ssh` table was doubly defined both in the `[annotations]` and in the `[annotations.com.hooks.ssh]` sections. See the [TOML format](https://toml.io/en/) spec for more details.
304-
* Case 1 (valid):
310+
!!! example "Valid usage"
305311
```bash
306312
[annotations.com.hooks.ssh]
307313
authorize_ssh_key = "/capstor/scratch/cscs/<username>/tests/edf/authorized_keys"
308314
enabled = "true"
309315
```
310316

311-
* Case 2 (valid):
317+
!!! example "Valid usage"
312318
```bash
313319
[annotations]
314320
com.hooks.ssh.authorize_ssh_key = "/capstor/scratch/cscs/<username>/tests/edf/authorized_keys"
315321
com.hooks.ssh.enabled = "true"
316322
```
317323

318-
* Case 3 (**invalid**):
324+
!!! example "**Invalid** usage"
319325
```bash
320326
[annotations]
321327
com.hooks.ssh.authorize_ssh_key = "/capstor/scratch/cscs/<username>/tests/edf/authorized_keys"

0 commit comments

Comments
 (0)