Update container authored by Rémy Mozul's avatar Rémy Mozul
Important notice: in the following a generic name `lmgc90_user_xxxx` is used in the instruction, but each time the `xxxx` is met, it must be replaced by the real name of the version used. For example the `2020.rc1` or `2020`.
# Singularity # Singularity
Here are provided some very basics directions on how to use LMGC90 in a Singularity container. Here are provided some very basics directions on how to use LMGC90 in a Singularity container.
On how to install and use Singularity properly, check their [official website](https://sylabs.io/guides/3.6/user-guide/). On how to install and use Singularity properly, check their [official website](https://sylabs.io/guides/3.6/user-guide/).
For a direct use, download the image file: For a direct use, download the image file:
* [lmgc90_user_2020_rc1.sif](https://seafile.lmgc.univ-montp2.fr/f/989e8b26d2d14e4aac08/?dl=1) * [lmgc90_user_202.sif](https://seafile.lmgc.univ-montp2.fr/f/f6b75bb93927479cbf28/?dl=1)
On a server or computer with singularity installed, you can directly use the On a server or computer with singularity installed, you can directly use the
singularity image to run a single command with: singularity image to run a single command with:
```cmd ```cmd
cd path_to_example cd path_to_example
singularity run lmgc90_user_2020_rc1.sif python command.py singularity run lmgc90_user_xxxx.sif python command.py
``` ```
It is preferred to stay in the same image ; for example in order to It is preferred to stay in the same image ; for example in order to
run several python commands: run several python commands:
```cmd ```cmd
singularity shell lmgc90_user_2020_rc1.sif singularity shell lmgc90_user_xxxx.sif
python gen_sample.py --novisu && python command.py python gen_sample.py --novisu && python command.py
exit exit
``` ```
...@@ -30,7 +33,7 @@ Bootstrap: docker ...@@ -30,7 +33,7 @@ Bootstrap: docker
From: ubuntu:focal From: ubuntu:focal
%files %files
lmgc90_user_2020.rc1 /root/lmgc90 lmgc90_user_xxxx /root/lmgc90
%environment %environment
export SHELL=/bin/bash export SHELL=/bin/bash
...@@ -54,7 +57,7 @@ From: ubuntu:focal ...@@ -54,7 +57,7 @@ From: ubuntu:focal
``` ```
Then the image file can be created with: Then the image file can be created with:
```cmd ```cmd
singularity build --fakeroot lmgc90_user_2020_rc1.sif lmgc90.def singularity build --fakeroot lmgc90_user_xxxx.sif lmgc90.def
``` ```
...@@ -64,8 +67,6 @@ Here are provided some very basics directions on how to use LMGC90 in a Docker c ...@@ -64,8 +67,6 @@ Here are provided some very basics directions on how to use LMGC90 in a Docker c
On how to install and use Docker properly, check their [official website](https://docs.docker.com/). On how to install and use Docker properly, check their [official website](https://docs.docker.com/).
To build an image, use the following content to create a `docker_lmgc90` file. To build an image, use the following content to create a `docker_lmgc90` file.
Of course the `lmgc90_user_2020_rc1` must be replaced by the actual
path to the sources of lmgc90 to use:
```file ```file
FROM ubuntu:focal FROM ubuntu:focal
...@@ -79,7 +80,7 @@ RUN apt-get install -y cython3 ...@@ -79,7 +80,7 @@ RUN apt-get install -y cython3
RUN apt-get install -y libhdf5-dev hdf5-tools python3-h5py RUN apt-get install -y libhdf5-dev hdf5-tools python3-h5py
# get the sources # get the sources
COPY lmgc90_user_2020_rc1 /root/lmgc90 COPY lmgc90_user_xxxx /root/lmgc90
# build the sources # build the sources
WORKDIR /root/lmgc90/build WORKDIR /root/lmgc90/build
...@@ -91,10 +92,9 @@ WORKDIR /root/compute ...@@ -91,10 +92,9 @@ WORKDIR /root/compute
RUN rm -rf /root/lmgc90 RUN rm -rf /root/lmgc90
``` ```
Then build the docker image with (again adapt `lmgc90_user:2020.rc1` Then build the docker image with (again replace the `xxxx` by your revision), do not forget the ending dot character:
with something relevant to your sources directory):
```cmd ```cmd
docker build -t lmgc90_user:2020.rc1 -f docker_lmgc90 . docker build -t lmgc90_user:xxxx -f docker_lmgc90 .
``` ```
Then, next to a `example` directory containing a `gen_sample.py` (with Then, next to a `example` directory containing a `gen_sample.py` (with
...@@ -106,7 +106,7 @@ docker run -it -v $PWD/example:/root/compute lmgc90_user:2020.rc1 python command ...@@ -106,7 +106,7 @@ docker run -it -v $PWD/example:/root/compute lmgc90_user:2020.rc1 python command
To stay in the container for, let's say run python in interactive mode, or run To stay in the container for, let's say run python in interactive mode, or run
several commands, preferably use: several commands, preferably use:
```cmd ```cmd
docker run -it -v $PWD/example:/root/compute lmgc90_user:2020.rc1 /bin/bash docker run -it -v $PWD/example:/root/compute lmgc90_user:xxxx /bin/bash
python gen_sample.py --novisu python gen_sample.py --novisu
python command.py python command.py
exit exit
... ...
......