Commit 53a97b80 authored by Sofiane Bendoukha's avatar Sofiane Bendoukha Committed by Mathis Rosenhauer

Added first support for singularity.

parent 6c86102e
......@@ -93,6 +93,11 @@ SJ_INCFILE=""
# where jupyter is running need a shared home file system.
readonly SJ_FRONTEND_HOST="mistralpp.dkrz.de"
# Image
#
# start the jupyter notebook in a singularity container from a given
# image name.
SJ_IMAGE=""
function clean_up () {
trap - ERR EXIT
......@@ -134,6 +139,7 @@ Available values for OPTION include:
-i file source file prior to running jupyter
-n ntasks request ntasks tasks for job
-p partition run job on partition
-s image singularity image
-t time job runtime
-u username use username for login
......@@ -142,7 +148,7 @@ EOF
function parse_options () {
local option
while getopts 'A:c:di:n:p:t:u:' option; do
while getopts 'A:c:di:n:p:s:t:u:' option; do
case ${option} in
A) SJ_ACCTCODE="$OPTARG"
;;
......@@ -156,6 +162,8 @@ function parse_options () {
;;
p) SJ_PARTITION="$OPTARG"
;;
s) SJ_IMAGE="$OPTARG"
;;
t) SJ_RUNTIME="$OPTARG"
;;
u) SJ_USERNAME="$OPTARG"
......@@ -173,6 +181,7 @@ function parse_options () {
readonly SJ_PARTITION
readonly SJ_RUNTIME
readonly SJ_USERNAME
readonly SJ_IMAGE
}
function ssh_frontend () {
......@@ -216,6 +225,9 @@ function assemble_commandline () {
if [[ -z ${SJ_ACCTCODE} ]]; then
commandline="nohup ${commandline} > /dev/null & echo \$!"
fi
if [[ -n ${SJ_IMAGE} ]]; then
commandline="singularity exec ${SJ_IMAGE} ${commandline}"
fi
commandline="$(source_incfile "${commandline}")"
echo "${commandline}"
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment