- Instructions on using Docker to run ModelE
- The Docker container contains all the tools needed to compile and run ModelE such as
gfortran
,gdb
,netcdf
, etc. - ModelE source code and ModelE_Support (input files) are assumed to be on the host computer, and accessed via mount points.
docker build -t modele .
- Replace
$(pwd)/modelE
with your/path/to/modelE
source code directory. - Replace
${HOME}/data/ModelE_Support
with your/path/to/Model_Support
.
# run it with default CMD
docker run -it modele
# run interactively
docker run -it modele bash
exit
# --mount type=bind,src=${HOME},dst=/home/user \
docker run -it --user $(id -u):$(id -g) \
--mount type=bind,src=$(pwd)/../modelE,dst=/modelE \
--mount type=bind,src=${HOME}/data/ModelE_Support,dst=/ModelE_Support \
modele bash
ls -l /modelE
ls -l /ModelE_Support
echo $MODELERC
ls -l $MODELERC
exit
- modelE source code
- Editing of source files is assumed to occur on the host computer.
- You can mount your host
modelE
source code folder anywhere in the container. - In the example above, the source is mounted at
/modelE
. - In the example above, we mounted the host folder (found in the current folder at
$(pwd)/modelE
) to the container/modelE
with the line--mount type=bind,src=$(pwd)/modelE,dst=/modelE
.
- ModelE_Support
- You can mount your host
ModelE_Support
folder anywhere in the container. - In this example,
ModelE_Support
is mounted at/ModelE_Support
. - If you mount it anywhere else, you need to edit the
${MODELERC}
file.
- You can mount your host
docker run -it \
--mount type=bind,src=$(pwd)/modelE,dst=/modelE \
--mount type=bind,src=${HOME}/data/ModelE_Support,dst=/ModelE_Support \
modele \
bash
cd /modelE/decks/
# 8x10 lat x lon; no ocean; model month takes O(minute)
RUNNAME=docker_test01
make rundeck RUNSRC=nonProduction/nonProduction_E_AR5_C12 RUN=${RUNNAME}
# fetch input files for this run
../exec/get_input_data -w ${RUNNAME} /ModelE_Support/prod_input_files/
# # 4x5 lat x lon; ocean; model month takes 10x longer
# RUNNAME=docker_test02
# make rundeck RUNSRC=E1oM20 RUN=${RUNNAME}
make clean RUN=${RUNNAME}
# compile for debugging
make -j setup RUN=${RUNNAME} COMPILE_WITH_TRAPS=YES EXTRA_FFLAGS="-g -O0 -fallow-argument-mismatch -I/usr/include/x86_64-linux-gnu " EXTRA_LFLAGS="-g -O0" | tee compile.out
# compile for fast run
make -j setup RUN=${RUNNAME} COMPILE_WITH_TRAPS=NO EXTRA_FFLAGS="-O2 -fallow-argument-mismatch -I/usr/include/x86_64-linux-gnu " EXTRA_LFLAGS="-O2" | tee compile.out
../exec/runE ${RUNNAME} -cold-restart -np 4
../exec/runE ${RUNNAME} -np 4
# docker tag local-image:tagname new-repo:tagname
docker tag modele mankoff/modele:gfortran
docker login -u "user" -p "pass" docker.io
docker push mankoff/modele:gfortran
This section not yet completed.
- You cannot run docker on
discover
, but you can run docker images usingsingularity
. singularity
is like docker but for HPC systems
Pulling down VMs can take some space, don’t do it in ~/
cd ${NOBACKUP}
export SINGULARITY_CACHEDIR="$NOBACKUP/.singularity"
export SINGULARITY_TMPDIR="$NOBACKUP/.singularity"
module load singularity
# singularity build modele.sif docker-daemon://modele # local
# singularity pull lynx.sif docker://nbrown/lynx
# singularity exec -B ./:${TMPDIR} lynx.sif lynx http://www.giss.nasa.gov