Public Repository

Last pushed: a year ago
Short Description
Container of MicroBoone version 05.15.00
Full Description

Docker Container of MicroBoone code version 05.15.00

What is this docker?

This docker will setup uboonecode version 05.15.00, based on the exisiting centos67-nu_v1_18_01-e9-prof docker
Dockerfile that build this docker:

FROM paterno/centos67-nu_v1_18_01-e9-prof
COPY uboone_setup.sh /etc/uboone_setup.sh
COPY pullProducts /products/pullProducts
# maybe mount as volume is better
COPY lar_exec.sh /products/lar_exec.sh
RUN cd /products && \
    chmod u+x pullProducts && \
    chmod u+x execute_lar.sh && \
    ./pullProducts -r $PWD slf6 uboone-05.15.00 e9 prof &&\
    echo 'source /etc/uboone_setup.sh' >> /etc/profile
CMD ["bash", "-lc ./products/lar_exec.sh"]

where pullProduct is actually from the website that holds pullProducts.
We can build the docker with:

docker build -t jyan/uboone-05_15:latest .

if assuming the above Dockerfile is under current directory ..

How this docker setup MicroBoone code

The setup script for uboone is from Jim's Github repo for Dockerfile. Since we write source /etc/uboone_setup.sh >> /etc/profile, the following setup commands will be invoked when we enter the container via bash -l.

# uboone_setup.sh
export UPS_OVERRIDE="-H Linux64bit+2.6-2.12"
source /products/setup
setup uboonecode v05_15_00 -q e9:prof

If we need aother/newer version of uboonecode, we need to modify the both the argument to pullProduct in docker file and setup in uboone_setup.sh, then rebuild the docker.

An example to run experiment in this docker

The /products/lar_exec.sh script inside the container will kick off the simulation:

# lar_exec.sh
echo execute lar/simulation
lar -c prod_muminus_0.1-2.0GeV_isotropic_uboone.fcl -o prod_muminus_0.1-2.0GeV_isotropic_uboone_gen.root
lar -c standard_g4_uboone.fcl -s prod_muminus_0.1-2.0GeV_isotropic_uboone_gen.root -o prod_muminus_0.1-2.0GeV_isotropic_uboone_g4.root
rm prod_muminus_0.1-2.0GeV_isotropic_uboone_gen.root
lar -c standard_detsim_uboone.fcl -s prod_muminus_0.1-2.0GeV_isotropic_uboone_g4.root -o prod_muminus_0.1-2.0GeV_isotropic_uboone_detsim.root
rm prod_muminus_0.1-2.0GeV_isotropic_uboone_g4.root
lar -c reco_uboone_mcc7_driver_stage1.fcl -s prod_muminus_0.1-2.0GeV_isotropic_uboone_detsim.root -o prod_muminus_0.1-2.0GeV_isotropic_uboone_reco1.root
rm prod_muminus_0.1-2.0GeV_isotropic_uboone_detsim.root
lar -c reco_uboone_mcc7_driver_stage2.fcl -s prod_muminus_0.1-2.0GeV_isotropic_uboone_reco1.root -o prod_muminus_0.1-2.0GeV_isotropic_uboone_reco2.root
rm prod_muminus_0.1-2.0GeV_isotropic_uboone_reco1.root
echo finish lar/simulation

So you can ran the docker with:

docker run jyan/uboone-05_15 bash -lc "./products/lar_exec.sh"

The -l option is required to load $PATH as login and -c option will execute the following string as shell script.

To run the docker interactively, use -it option:

docker run -it --volume=/local/path:/docker/path jyan/uboone-05_15 bash -l

With --volume option, we can write similar script at /local/path (outside the docker) and mount the /local/path directory of the script to /docker/path (say /mnt). This may be more flexible in terms of debug and test.

Run it on Edison @ NERSC with SLURM

To run our docker on edison, we need to submit it using SLURM script. NERSC uses shifter as its docker engine, instead of docker engine. We are able to run the uboone docker on Edison's debug partition.

#!/bin/bash

#SBATCH --partition=debug
#SBATCH --ntasks-per-node=1
#SBATCH --nodes=1
#SBATCH --image=docker:jyan/uboone-05_15:latest
#SBATCH --volume="/global/cscratch1/sd/timm/test_timm/run_uboone:/mnt"
#SBATCH -t 00:29:00

module load shifter
srun shifter bash -lc "cd /mnt; ./lar_exec.sh >uboone.out 2>&1" &
job_pid=$!

# Wait for the user job to finish
wait $job_pid
user_retcode=$?

exit $user_retcode

Notice that it seems now we cannot mount /global/homes directory to docker when executing docker on Edison. However, Steven managed to mount the same directory but via /global/cscratch1/sd.

Docker Pull Command
Owner
jyan