Commit e6995006 authored by ulrich_y's avatar ulrich_y
Browse files

Added udocker support for running

parent e974e759
......@@ -12,7 +12,7 @@ echo "Started as $0 $@"
this=./submit.sh
if [ $# -gt 0 ]; then
if [[ $1 == *.conf ]]; then
if [[ $1 == *.conf || $1 == *.tconf ]]; then
# We are a runner
echo "[`date`] Runner start as $0 $@"
......@@ -29,14 +29,20 @@ if [[ $1 == *.conf ]]; then
source $1
olddir=`pwd`
binary="`pwd`/$binary"
runstring="${STAT[$part]}"
runstring="${runstring}\n$seed\n$xi\n$del\n$part\n$flavour\n$cuts"
sha1=$(cat $binary | sha1sum)
sha2=$(make hash)
cd $folder
if [ -z $containerid ]; then
binary="`pwd`/$binary"
sha1=$(cat $binary | sha1sum)
sha2=$(make hash)
cd $folder
else
sha1=$(udocker run $containerid sh -c "cat /monte-carlo/$binary | sha1sum")
sha2=$(udocker run $containerid sh -c "cd /monte-carlo/ && make hash")
binary="udocker run --volume=`pwd`/$folder/out/:/root/out $containerid /monte-carlo/$binary"
fi
echo "[`date`] Runner start as $0 $@"
echo "[`date`] Hash of mcmule: $sha1"
echo "[`date`] SHA of source: $sha2"
......@@ -232,6 +238,12 @@ do
jobs
fi
case "$command" in
image)
img=$1
echo "Using Docker image $img"
containerid=$(udocker create $img)
echo "Created container $containerid"
;;
run)
echo "running with $args"
run $config $@
......@@ -239,6 +251,11 @@ do
conf)
echo "loading config file $1"
config=$1
if [ ! -z "$containerid" ]; then
cat $config > ${config%.conf}.$SLURM_JOB_ID.tconf
echo "containerid=\"$containerid\"" >> ${config%.conf}.$SLURM_JOB_ID.tconf
config=${config%.conf}.$SLURM_JOB_ID.tconf
fi
;;
[#]* )
echo "Comment $command $args"
......
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