Skip to content

Commit 348e077

Browse files
authored
Update README.md
removing references to remote builds, cleaning up
1 parent 34ac6b7 commit 348e077

File tree

1 file changed

+26
-38
lines changed

1 file changed

+26
-38
lines changed

Intro-to-Containers/README.md

Lines changed: 26 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Intro to Containers (Under Construction)
1+
# Intro to Containers
22

33
<br>
44

@@ -14,7 +14,6 @@
1414
* [Build from Docker registry](#build-from-docker-registry)
1515

1616

17-
<h3 style="color:#FBFCFC; background-color:#34495E;"> <a href="#build-remotely-using-sylabs" style="text-decoration=none; color:#FBFCFC;"> Build remotely using Sylabs </a> </h3>
1817

1918
* [Logging In](#logging-in)
2019
* [Working on the Command Line](#working-on-the-command-line)
@@ -24,67 +23,56 @@
2423
<br><br><br><br><br><br><br><br><br><br><br><br>
2524

2625

27-
# Singularity
26+
# Apptainer
2827

29-
> Note: look in .singularity for working files
28+
> Note: look in .Apptainer for working files
3029
3130
```console
3231
[laptop ~]$ ssh netid@hpc.arizona.edu
3332
[netid@gatekeeper ~]$ shell
3433
(puma) [netid@wentletrap ~]$ ocelote
3534
(ocelote) [netid@wentletrap ~]$ interactive
36-
[netid@i16n2 ~]$ singularity help
37-
[netid@i16n2 ~]$ singularity help build
35+
[netid@i16n2 ~]$ Apptainer help
36+
[netid@i16n2 ~]$ Apptainer help build
3837
```
3938

4039
## Creating a Container
4140

4241
### Pull from Docker registry
4342
> Less reproducible -- image can change
4443
```console
45-
[netid@i16n2 ~]$ singularity pull docker://godlovedc/lolcow
44+
Apptainer pull docker://godlovedc/lolcow
4645
```
4746

4847
### Pull from container library
4948
> More reproducible
5049
```console
51-
[netid@i16n2 ~]$ singularity pull library://sylabsed/examples/lolcow
50+
Apptainer pull library://sylabsed/examples/lolcow
5251
```
5352

5453
### Build from Docker registry
5554
> More options, converts to latest format, & needs a name
5655
```console
57-
[netid@i16n2 ~]$ singularity build lolcow.sif docker://godlovedc/lolcow
56+
Apptainer build lolcow.sif docker://godlovedc/lolcow
5857
```
5958

60-
## Build remotely using Sylabs
61-
### Steps:
6259

63-
1. Log into [https://cloud.sylabs.io](https://cloud.sylabs.io)
64-
2. Generate an access token (API key)
65-
3. Start an interactive session:
66-
```console
67-
[netid@i16n2 ~]$ singularity remote login
68-
[netid@i16n2 ~]$ singularity build --remote nersc.sif nersc.recipe
69-
[netid@i16n2 ~]$ singularity run nersc.sif
70-
```
71-
72-
# Running Singularity on HPC
60+
## Running Apptainer on HPC
7361

7462
```console
75-
[netid@i16n2 ~]$ singularity shell lolcow_latest.sif
76-
Singularity>
77-
Singularity> exit
63+
[netid@i16n2 ~]$ Apptainer shell lolcow_latest.sif
64+
Apptainer>
65+
Apptainer> exit
7866
```
7967

8068
```console
81-
[netid@i16n2 ~]$ singularity run lolcow_latest.sif
69+
[netid@i16n2 ~]$ Apptainer run lolcow_latest.sif
8270
[netid@i16n2 ~]$ # Or
8371
[netid@i16n2 ~]$ ./lolcow_latest.sif
8472
```
8573

8674
```console
87-
[netid@i16n2 ~]$ singularity run library://sylabsed/examples/lolcow
75+
[netid@i16n2 ~]$ Apptainer run library://sylabsed/examples/lolcow
8876
INFO: Using cached image
8977
_______________________________________
9078
/ Wrinkles should merely indicate where \
@@ -99,7 +87,7 @@ INFO: Using cached image
9987
|| ||
10088
```
10189

102-
# Singularity on HPC - Running Batch
90+
# Apptainer on HPC - Running Batch
10391
```sh
10492
#!/bin/bash
10593
#SBATCH --job-name=lolcow
@@ -112,19 +100,19 @@ INFO: Using cached image
112100

113101

114102
cd /path/to/container
115-
singularity run lolcow_latest.sif
103+
Apptainer run lolcow_latest.sif
116104
```
117105

118-
# Singularity on HPC - Creating and Running
106+
# Apptainer on HPC - Creating and Running
119107
This example does not run cleanly, demonstrating that the container needs compatibility with the kernel on the compute node.
120108

121-
1. Copy the ```TFlow_example.py``` file from ```/contrib/singularity/nvidia```
109+
1. Copy the ```TFlow_example.py``` file from ```/contrib/Apptainer/nvidia```
122110
```console
123-
[netid@i16n8 ~]$ cp /contrib/singularity/nvidia/TFlow_example.py ./
111+
[netid@i16n8 ~]$ cp /contrib/Apptainer/nvidia/TFlow_example.py ./
124112
```
125113

126114
```
127-
[netid@i16n8 ~]$ singularity exec docker://tensorflow/tensorflow python -m TFlow_example.py
115+
[netid@i16n8 ~]$ Apptainer exec docker://tensorflow/tensorflow python -m TFlow_example.py
128116
INFO: Converting OCI blobs to SIF format
129117
INFO: Starting build...
130118
Getting image source signatures
@@ -156,26 +144,26 @@ step: 1000, loss: 0.082219, W: 0.292872, b: 0.506447
156144
[netid@i16n8 ~]$
157145
```
158146

159-
# Singularity on HPC - File Paths
147+
# Apptainer on HPC - File Paths
160148
Access to your files outside the container: Binding
161149
You automatically get ```/home```, ```/tmp```, ```/xdisk```, ```/groups```, and ```$PWD```
162150
```console
163151
[netid@i16n8 ~]$ echo "Hello from inside the container" > $HOME/hostfile.txt
164-
[netid@i16n8 ~]$ singularity exec lolcow_latest.sif cat $HOME/hostfile.txt
152+
[netid@i16n8 ~]$ Apptainer exec lolcow_latest.sif cat $HOME/hostfile.txt
165153
Hello from inside the container
166154
```
167155

168156
```console
169157
[netid@i16n8 ~]$ echo "Drink milk (and never eat hamburgers)." > data/cow_advice.txt
170-
[netid@i16n8 ~]$ singularity exec --bind $PWD/data:/mnt lolcow_latest.sif cat /mnt/cow_advice.txt
158+
[netid@i16n8 ~]$ Apptainer exec --bind $PWD/data:/mnt lolcow_latest.sif cat /mnt/cow_advice.txt
171159
Drink milk (and never eat hamburgers).
172160
```
173161
Alternatives:
174162
```console
175-
$ singularity shell --bind /data my-container.sif
163+
$ Apptainer shell --bind /data my-container.sif
176164
```
177165
```console
178-
$ export SINGULARITY_BINDPATH=/data
166+
$ export Apptainer_BINDPATH=/data
179167
```
180168

181169
# GPUs and Containers
@@ -190,7 +178,7 @@ We show four ways to run tensorflow containers on HPC. We just use Tensorflow as
190178
| ----------| ---- |
191179
| UA HPC Containers Documentation | https://public.confluence.arizona.edu/display/UAHPC/Containers |
192180
| UA HPC Examples Github | https://ua-researchcomputing-hpc.github.io |
193-
| NIH Containers Documentation | https://hpc.nih.gov/apps/singularity.html |
181+
| NIH Containers Documentation | https://hpc.nih.gov/apps/Apptainer.html |
194182
| Sylabs User Guide | https://sylabs.io/guides/3.5/user-guide/introduction.html |
195183
| Sylabs Examples | https://github.com/sylabs/examples |
196184
| TACC Container Basics | https://containers-at-tacc.readthedocs.io/en/latest/ |

0 commit comments

Comments
 (0)