From 78d6906945377bbcf2a489adc832f98b3f1c17d3 Mon Sep 17 00:00:00 2001
From: Lukas Werner <lks.werner@fau.de>
Date: Wed, 4 Aug 2021 16:02:09 +0200
Subject: [PATCH] NO_SLURM_SUBMIT and partition=work

---
 runner_scripts/root/run.sh | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/runner_scripts/root/run.sh b/runner_scripts/root/run.sh
index edc81c5..6dccef4 100755
--- a/runner_scripts/root/run.sh
+++ b/runner_scripts/root/run.sh
@@ -14,6 +14,7 @@ hash salloc
 hash sed
 hash srun
 hash ssh-keygen
+hash sinfo
 
 function error {
     : "${RV:=${2:-$BUILD_FAILURE_EXIT_CODE}}"
@@ -58,7 +59,7 @@ BASE_DIR=$AUTH_USER_WORK/gitlab-runner/builds/${CUSTOM_ENV_CI_CONCURRENT_PROJECT
 
 runuser "$AUTH_USER" --login --command "mkdir -p $BASE_DIR"
 
-if [[ ("$2" == "step_script" || "$2" == "build_script") && ${CUSTOM_ENV_SUBMIT_TO_SLURM:-} ]]; then
+if [[ ("$2" == "step_script" || "$2" == "build_script") && "${CUSTOM_ENV_NO_SLURM_SUBMIT:-}" != 1 ]]; then
     ## The script is the one specified in the gitlab-ci.yml script directive and the SUBMIT_TO_SLURM variable is set
 
     for E in $(env | grep -E "^CUSTOM_ENV_SLURM_")
@@ -77,6 +78,9 @@ if [[ ("$2" == "step_script" || "$2" == "build_script") && ${CUSTOM_ENV_SUBMIT_T
         error
     fi
 
+    SLURM_PARTITION=work
+    export SLURM_PARTITION
+
     SLURM_NODES=1 # currently only individual nodes can be used
     export SLURM_NODES
 
-- 
GitLab