Skip to content

Commit

Permalink
Move bind dirs to launch config file, construct bind string on the fl…
Browse files Browse the repository at this point in the history
…y. Add matplotlib-scalebar
  • Loading branch information
Dale Roberts committed Nov 27, 2023
1 parent 455f997 commit 65db10c
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 3 deletions.
2 changes: 2 additions & 0 deletions container/container.def
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ Bootstrap: scratch
mkdir -p ${SINGULARITY_ROOTFS}/system
mkdir -p ${SINGULARITY_ROOTFS}/usr
mkdir -p ${SINGULARITY_ROOTFS}/sys/fs/cgroup
mkdir -p ${SINGULARITY_ROOTFS}/iointensive

### Mount points for service sockets
mkdir -p ${SINGULARITY_ROOTFS}/var/lib/sss
Expand All @@ -42,6 +43,7 @@ Bootstrap: scratch
mkdir -p ${SINGULARITY_ROOTFS}/opt/conda/analysis3-23.01
mkdir -p ${SINGULARITY_ROOTFS}/opt/conda/analysis3-23.04
mkdir -p ${SINGULARITY_ROOTFS}/opt/conda/analysis3-23.07
mkdir -p ${SINGULARITY_ROOTFS}/opt/conda/analysis3-23.10

%runscript
/usr/bin/bash -l
1 change: 1 addition & 0 deletions scripts/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -281,5 +281,6 @@ dependencies:
- icclim>=6.4.0 ### Prevent downgrade
- py-cordex
- pdbufr
- matplotlib-scalebar
- pip:
- railroad-diagrams ### Unlisted dependency of pip and pyparsing
2 changes: 1 addition & 1 deletion scripts/install_config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export APPS_OWNERS_GROUP=hh5_w

### Version settings
export ENVIRONMENT=analysis3
export VERSION_TO_MODIFY=23.07
export VERSION_TO_MODIFY=23.10
export STABLE_VERSION=23.04
export UNSTABLE_VERSION=23.07
export FULLENV="${ENVIRONMENT}-${VERSION_TO_MODIFY}"
Expand Down
8 changes: 7 additions & 1 deletion scripts/launcher.sh
Original file line number Diff line number Diff line change
Expand Up @@ -119,4 +119,10 @@ while IFS= read -r -d: i; do
overlay_args="${overlay_args}--overlay=${i} "
done<<<"${CONTAINER_OVERLAY_PATH%:}:"

"$SINGULARITY_BINARY_PATH" -s exec --bind /etc,/half-root,/local,/ram,/run,/system,/usr,/var/lib/sss,/var/run/munge,/sys/fs/cgroup ${overlay_args} "${CONTAINER_PATH}" "${cmd_to_run[@]}"
bind_str=""
for bind_dir in "${bind_dirs[@]}"; do
[[ -d "${bind_dir}" ]] && bind_str="${bind_str}${bind_dir},"
done
bind_str=${bind_str%,}

"$SINGULARITY_BINARY_PATH" -s exec --bind "${bind_str}" "${overlay_args}" "${CONTAINER_PATH}" "${cmd_to_run[@]}"
4 changes: 3 additions & 1 deletion scripts/launcher_conf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@ if [[ "${CONDA_EXE}" ]]; then
export CONDA_BASE_ENV_PATH="${CONDA_EXE//\/bin\/conda/}"
else
export CONDA_BASE_ENV_PATH="__CONDA_BASE__/__APPS_SUBDIR__/__CONDA_INSTALL_BASENAME__"
fi
fi

declare -a bind_dirs=( "/etc" "/half-root" "/local" "/ram" "/run" "/system" "/usr" "/var/lib/sss" "/var/run/munge" "/sys/fs/cgroup" "/iointensive" )

0 comments on commit 65db10c

Please sign in to comment.