Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: updates to running a container

...

In order to build a container on a remote host or HPC, you need to use the the --remote  flag since we typically do not have admin privileges. An example build command using the definition file above on Hercules is: singularity build --remote wb_container.sif /work2/noaa/jcsda/agriffin/JEDI_WB/wb_container/wb_container.def 


Running a container

Running a container is done by using the singularity exec  command. The singularity exec  command will run a specific command against an instance. An example of how we can use this inside an EWOK task is the line in the runtime file for weather bench scores (src/runtime/wbScoresRun.sh): `singularity exec -B $WORKDIR:/$WORKDIR -B $JEDI_WORKFLOW:/jedi-workflow -B /work2/noaa/jcsda/cgas/jedi/wb_files:/work2/noaa/jcsda/cgas/jedi/wb_files /work2/noaa/jcsda/agriffin/JEDI_WB/wb_container/wb_container

...

.sif bash -c "cd $WORKDIR && python3 /jedi-workflow/ewok/src/runtime/evaluation_deterministic.py"`. Note, -B  will "bind"/mount the directories you need onto the container. 

Note, you can also run singularity shell work2/noaa/jcsda/agriffin/JEDI_WB/wb_container/wb_container.sif  to spawn a new shell within your container.TODO