|
1 | 1 | [](){#ref-gssr-containers} |
2 | 2 | # gssr - Containers Guide |
3 | 3 |
|
4 | | -CSCS highly recommends that all users leverage on container solutions on our Alps platforms so as to flexibly configure any required user environments of their choice within the containers. Users thus have maximum flexibility as they are not tied to any specific operating systems and/or software stacks. |
5 | | - |
6 | 4 | The following guide will explain how to install and use `gssr` within a container. |
7 | 5 |
|
8 | 6 | Most CSCS users leverage on the base containers with pre-installed CUDA from Nvidia. As such, in the following documentation, we will use a PyTorch base container as an example. |
@@ -36,22 +34,24 @@ Once your `ContainerFile` is ready, you can build it on any Alps platforms with |
36 | 34 |
|
37 | 35 | ```bash |
38 | 36 | srun -A {groupID} --pty bash |
39 | | -# Once you have an interactive session, use podman command to build your container |
| 37 | +# Once you have an interactive session, use podman command to build the |
| 38 | +# container |
40 | 39 | # -v is to mount the fast storage on Alps into the container. |
41 | 40 | podman build -v $SCRATCH:$SCRATCH -t mycontainer:0.1 . |
42 | | -# Export the container from the podman's cache to a local sqshfs file with enroot |
| 41 | +# Export the container from the podman's cache to a local squashFS file with |
| 42 | +# enroot |
43 | 43 | enroot import -x mount -o mycontainer.sqsh podman://local:mycontainer:0.1 |
44 | 44 | ``` |
45 | 45 |
|
46 | | -Now you should have a sqsh file of your container. Please note that you should replace `mycontainer` label to any other label of your choice. The version `0.1` can also be omitted or replaced with another version as required. |
| 46 | +Now you should have a squashFS file of your container. Please note that you should replace `mycontainer` label to any other label of your choice. The version `0.1` can also be omitted or replaced with another version as required. |
47 | 47 |
|
48 | 48 | ## Create CSCS configuration for Container |
49 | 49 |
|
50 | 50 | The next step is to tell CSCS container engine solution where your container is and how you would like to run it. To do so, you will have to create a`{label}.toml` file in your `$HOME/.edf` directory. |
51 | 51 |
|
52 | 52 | ### Example of a `mycontainer.toml` file |
53 | 53 | ``` |
54 | | -image = "/capstor/scratch/cscs/username/directoryWhereYourContainerIs/mycontainer.sqsh" |
| 54 | +image = "/capstor/scratch/cscs/username/{yourDir}/mycontainer.sqsh" |
55 | 55 | mounts = ["/capstor/scratch/cscs/username:/capstor/scratch/cscs/username"] |
56 | 56 | workdir = "/capstor/scratch/cscs/username" |
57 | 57 | writable = true |
|
0 commit comments