Skip to content

arn-all/milady-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 

Repository files navigation

MILADY Docker

User guide

Milady users can run the code without compilation thanks to the pre-built image we provide. Depending on your environment (workstation, cluster, supercomputer), you will have to rely on different tools for running the image:

  • Docker Engine (on workstations)
  • Singularity (on shared resources, for rootless execution)
  • pcocc (CEA alternative to Singularity, available on TGCC resources)

Locally, using Docker

You can pull and run the pre-built image using the following commands:

  1. Pull the image from Docker Hub:
docker pull aallera/milady:latest 
  1. Run the container with the current directory mounted as a volume (of course without compiling the code):
docker run -it --rm -v "$(pwd):/workspace" aallera/milady

The option -it enables the interactive mode with a pseudo-TTY session, allowing to kill the process before it ends (ctrl-C).

Pass extra parameters to mpirun

Optionally, additional options to mpirun such as the number of processors (default is -np 4) can be passed as:

docker run -it --rm -v "$(pwd):/workspace" aallera/milady -np 8

Run an interactive shell in the container

docker run -it --rm -v "$(pwd):/workspace" aallera/milady shell

On Irene Joliot-Curie (CEA-TGCC) using pcocc

Locally (takes a long time):

docker save milady:<tag> | gzip > milady_<tag>.tar.gz

On Irene (after transfering the created file):

gzip -d milady_latest.tar.gz
pcocc image import docker-archive:milady_latest.tar milady

Interactive use:

# (optional) ccc_mprun  -p skylake -m scratch,work -s
pcocc run --mount "$(pwd):/workspace" -s -I milady -- -np 16

Submit as a job:

#!/bin/bash
#MSUB -n 4
#MSUB -c 8
#MSUB -q skylake
#MSUB -T 600
#MSUB -A <your submission group>
pcocc run -n ${BRIDGE_MSUB_NPROC}  -I my_docker_image [arg1, ...]

On Jean-Zay (IDRIS) using Singularity

  1. Start a pre/post session to access a large RAM node (singularity build takes more ram than the standard 5 Go).
srun --pty --nodes=1 -A yxs@cpu --ntasks-per-node=1 --cpus-per-task=10 --partition=prepost --hint=nomultithread --time=01:00:00 bash
  1. Build singularity image (.sif)
singularity build milady.sif docker://aallera/milady:1.0.1
  1. Add to allowed directory
idrcontmgr cp milady.sif
  1. Start a shell, with access to $WORK. Other directories are read-only.
singularity shell $SINGULARITY_ALLOWED_DIR/milady.sif --bind $WORK/:/MLD/work

Developer: Build the Docker Image

Build the image

  1. Clone the current repository
  2. Clone the milady repository inside it
./clone_milady.sh
  1. Build the Docker image using the following command:
docker build -t milady .

This command will compile the MILADY code during the image build process.

Push the Docker Image to Docker Hub

  1. Create a free account on Docker Hub (https://hub.docker.com/) if you don’t have one already.
  2. Log in to your Docker Hub account on your machine using the following command:
docker login
  1. Tag your local image with your Docker Hub username and a custom name for the image:
docker tag milady YOUR_DOCKERHUB_USERNAME/milady:<tag>

Replace YOUR_DOCKERHUB_USERNAME with your actual Docker Hub username and <tag> with a version.

  1. Push the tagged image to Docker Hub:
docker push YOUR_DOCKERHUB_USERNAME/milady:<tag>