Skip to content

Commit ebf231a

Browse files
committed
Update run.md
1 parent a605539 commit ebf231a

File tree

2 files changed

+33
-31
lines changed

2 files changed

+33
-31
lines changed

docs/software/container-engine/index.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Save this file below as `ubuntu.toml` in `${HOME}/.edf` directory (the default
3232
Create `${HOME}/.edf` if the folder doesn't exist.
3333
A more detailed explanation of each entry for the EDF can be seen in the [EDF reference][ref-ce-edf-reference].
3434

35-
```bash
35+
```console
3636
image = "library/ubuntu:24.04"
3737
mounts = ["/capstor/scratch/cscs/${USER}:/capstor/scratch/cscs/${USER}"]
3838
workdir = "/capstor/scratch/cscs/${USER}"
@@ -44,19 +44,18 @@ Use Slurm on the login node to launch a program inside the environment.
4444
Notice that the environment (EDF) is specified with the `--environment` option.
4545
CE pulls the image automatically when the container starts.
4646

47-
```bash
47+
```console
4848
$ srun --environment=ubuntu echo "Hello"
4949
Hello
5050
```
5151

5252
Or, use `--pty` to directly enter the environment.
5353

54-
```bash
54+
```console
5555
$ srun --environment=ubuntu --pty bash
5656
[compute-node]$
5757
```
5858

59-
!!! example "Entering the environment on Daint"
6059
```console
6160
[daint-ln002]$ srun --environment=ubuntu --pty bash # (1)
6261

docs/software/container-engine/run.md

Lines changed: 30 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,37 +2,40 @@
22

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

5-
```console title="EDF with an absolute path"
6-
$ srun --environment=$SCRATCH/edf/debian.toml cat /etc/os-release
7-
PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
8-
NAME="Debian GNU/Linux"
9-
VERSION_ID="12"
10-
...
11-
```
5+
!!! example "EDF with an absolute path"
6+
```console
7+
$ srun --environment=$SCRATCH/edf/debian.toml cat /etc/os-release
8+
PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
9+
NAME="Debian GNU/Linux"
10+
VERSION_ID="12"
11+
...
12+
```
1213

1314
`--environment` can be a relative path from the current working directory (i.e., where the Slurm command is executed).
1415
A relative path should be prepended by `./`:
1516

16-
```console title="EDF with a relative path"
17-
$ ls
18-
debian.toml
17+
!!! example "EDF with a relative path"
18+
```console
19+
$ ls
20+
debian.toml
1921

20-
$ srun --environment=./debian.toml cat /etc/os-release
21-
PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
22-
NAME="Debian GNU/Linux"
23-
VERSION_ID="12"
24-
...
25-
```
22+
$ srun --environment=./debian.toml cat /etc/os-release
23+
PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
24+
NAME="Debian GNU/Linux"
25+
VERSION_ID="12"
26+
...
27+
```
2628

2729
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:
2830

29-
```console title="EDF in the default search path"
30-
$ srun --environment=debian cat /etc/os-release
31-
PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
32-
NAME="Debian GNU/Linux"
33-
VERSION_ID="12"
34-
...
35-
```
31+
!!! example "EDF in the default search path"
32+
```console
33+
$ srun --environment=debian cat /etc/os-release
34+
PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
35+
NAME="Debian GNU/Linux"
36+
VERSION_ID="12"
37+
...
38+
```
3639

3740
### Use from batch scripts
3841

@@ -63,7 +66,7 @@ The default EDF search path can be changed through the `EDF_PATH` environment va
6366
If an EDF is located in the search path, its name can be used in the `--environment` option without the `.toml` extension.
6467

6568
!!! example "Using `EDF_PATH` to control the default search path"
66-
```bash
69+
```console
6770
$ ls ~/.edf
6871
debian.toml
6972

@@ -140,7 +143,7 @@ To use an image from a different registry, the corresponding registry URL has to
140143
!!! example "Using a third-party registry"
141144
* Within an EDF
142145

143-
```bash
146+
```console
144147
$ cat ${HOME}/.edf/example.toml # (1)
145148
image = "nvcr.io#nvidia/nvhpc:23.7-runtime-cuda11.8-ubuntu22.04"
146149
```
@@ -149,15 +152,15 @@ To use an image from a different registry, the corresponding registry URL has to
149152

150153
* On the command line
151154

152-
```bash
155+
```console
153156
$ enroot import docker://nvcr.io#nvidia/nvhpc:23.7-runtime-cuda11.8-ubuntu22.04
154157
```
155158

156159
To import images from private repositories, access credentials should be configured by individual users in the `$HOME/.config/enroot/.credentials` file, following the [netrc file format](https://everything.curl.dev/usingcurl/netrc).
157160
Using the `enroot import` documentation page as a reference:
158161

159162
??? example "`netrc` example"
160-
```bash
163+
```console
161164
# NVIDIA NGC catalog (both endpoints are required)
162165
machine nvcr.io login $oauthtoken password <token>
163166
machine authn.nvidia.com login $oauthtoken password <token>

0 commit comments

Comments
 (0)