From d93991289726fb67442db012a668ca277539ca6f Mon Sep 17 00:00:00 2001 From: Dimitrios Bellos <34098719+DimitriosBellos@users.noreply.github.com> Date: Mon, 7 Feb 2022 15:16:45 +0000 Subject: [PATCH] Support for Docker and Singularity (#24) * Support for Docker and Singularity * Rephrasing of certain sentences for a better clarity of meaning. --- .dockerignore | 23 +++++++++++++++++++++++ Dockerfile | 16 ++++++++++++++++ README.md | 36 ++++++++++++++++++++++++++++++++++++ 3 files changed, 75 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..68d2cc1 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,23 @@ +**/__pycache__ +**/.classpath +**/.dockerignore +**/.env +**/.project +**/.settings +**/.toolstarget +**/.vs +**/.vscode +**/*.*proj.user +**/*.dbmdl +**/*.jfm +**/bin +**/charts +**/docker-compose* +**/compose* +**/Dockerfile* +**/node_modules +**/npm-debug.log +**/obj +**/secrets.dev.yaml +**/values.dev.yaml +README.md diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..94c7adb --- /dev/null +++ b/Dockerfile @@ -0,0 +1,16 @@ +FROM nvidia/cuda:11.3.1-devel-ubuntu20.04 + +WORKDIR /app +COPY . . + +RUN apt update +RUN apt install -y git +RUN apt install -y libfftw3-dev +RUN apt install -y g++ +RUN apt install -y python3 +RUN apt install -y python3-pip +RUN export CXX=$(which g++) +RUN export CUDACXX=$(which nvcc) +RUN git submodule update --init --recursive +RUN pip install . + diff --git a/README.md b/README.md index c3f8eb8..90908e9 100644 --- a/README.md +++ b/README.md @@ -79,6 +79,42 @@ To run the tests, follow the installation instructions for developers and then d pytest ``` +## Docker + +Parakeet can also be installed and used via Docker (https://www.docker.com/get-started). To download parakeet's docker container you can do the following: + +```sh +docker pull quay.io/rosalindfranklininstitute/parakeet:master +``` + +To use parakeet with docker with GPU support the host machine should have the approprate Nvidia drivers installed. + +To easily input and output data from the container the volume mechanism can be used, where a workspace directory of the host machine is mounted to a directory in the container (in the folder /mnt in the example below). For this reason it is advised that all the relevent files (e.g. config.yaml, sample.h5, etc.) should be present in the host workspace directory. + +Below is an example on how to use parakeet with docker to simulate the exit wave: + +```sh +docker run --gpus all -v :/mnt --rm -i -t parakeet:master parakeet.simulate.exit_wave -c /mnt/config.yaml -d gpu -s /mnt/sample.h5 -e /mnt/exit_wave.h5 +``` + +## Singularity + +Parakeet can also be installed and used via Singularity (https://sylabs.io/guides/2.6/user-guide/installation.html). To download parakeet's singularity container you can do the following: + +```sh +singularity pull library://rosalindfranklininstitute/parakeet/parakeet:master +``` + +Again similar to docker, to use parakeet with singularity and GPU support, the host machine should have the approprate Nvidia drivers installed. + +To easily input and output data from the container, a workspace directory in the host machine, where all the relevent files (e.g. config.yaml, sample.h5, etc.) should be present, can be binded to a directory in the container. + +Below is an example on how to use parakeet with singularity to simulate the exit wave: + +```sh +singularity run --nv --bind :/mnt parakeet.sif parakeet.simulate.exit_wave -c /mnt/config_new.yaml -d gpu -s /mnt/sample.h5 -e /mnt/exit_wave.h5 +``` + ## Usage Simulation of datasets is split into a number of different commands. Each