diff --git a/runner_scripts/root/cleanup.sh b/runner_scripts/root/cleanup.sh index 92910687470ee0c5dccac525f3d8e68e1e209d0d..6e6421d502c8f167737629922686f49dd2ebb5ea 100755 --- a/runner_scripts/root/cleanup.sh +++ b/runner_scripts/root/cleanup.sh @@ -1,7 +1,13 @@ #!/bin/bash -l set -euf -o pipefail shopt -s inherit_errexit - + +TXT_RED="\e[31m" +TXT_BLUE="\e[94m" +TXT_GREEN="\e[32m" +TXT_CLEAR="\e[0m" +TXT_BOLD="\e[1m" + hash awk hash chown hash diff @@ -13,7 +19,7 @@ hash ssh-keygen function error { : "${RV:=${2:-$BUILD_FAILURE_EXIT_CODE}}" - echo "$1" >&2 + echo -e "${TXT_RED}${TXT_BOLD}$1${TXT_CLEAR}" >&2 return "$RV" } @@ -44,7 +50,7 @@ exit 1 AUTH_USER_WORK=$(runuser "$AUTH_USER" --login --command "echo \$WORK") -: "${AUTH_USER_WORK:?"Could not determine $AUTH_USER's \$WORK directory."}" +: "${AUTH_USER_WORK:?"${TXT_RED}${TXT_BOLD}Could not determine $AUTH_USER's \$WORK directory.${TXT_CLEAR}"}" BASE_DIR=$AUTH_USER_WORK/gitlab-runner/builds/${CUSTOM_ENV_CI_CONCURRENT_PROJECT_ID:?}/${CUSTOM_ENV_CI_PROJECT_NAMESPACE:?}/${CUSTOM_ENV_CI_PROJECT_NAME:?} diff --git a/runner_scripts/root/config.sh b/runner_scripts/root/config.sh index 22f11a609994858eee2d9c1f9ce913052805db66..eef981390677e0f456299e84bea74590ed23031f 100755 --- a/runner_scripts/root/config.sh +++ b/runner_scripts/root/config.sh @@ -2,14 +2,20 @@ set -euf -o pipefail shopt -s inherit_errexit -: "${CUSTOM_ENV_AUTH_USER:?"AUTH_USER CI/CD variable has not been set."}" -: "${CUSTOM_ENV_AUTH_KEY:?"AUTH_KEY secret CI/CD variable has not been set."}" +TXT_RED="\e[31m" +TXT_BLUE="\e[94m" +TXT_GREEN="\e[32m" +TXT_CLEAR="\e[0m" +TXT_BOLD="\e[1m" + +: "${CUSTOM_ENV_AUTH_USER:?"${TXT_RED}${TXT_BOLD}AUTH_USER CI/CD variable has not been set.${TXT_CLEAR}"}" +: "${CUSTOM_ENV_AUTH_KEY:?"${TXT_RED}${TXT_BOLD}AUTH_KEY secret CI/CD variable has not been set.${TXT_CLEAR}"}" AUTH_USER=$CUSTOM_ENV_AUTH_USER AUTH_USER_WORK=$(runuser "$AUTH_USER" --login --command "echo \$WORK") -: "${AUTH_USER_WORK:?"Could not determine $AUTH_USER's \$WORK directory."}" +: "${AUTH_USER_WORK:?"${TXT_RED}${TXT_BOLD}Could not determine $AUTH_USER's \$WORK directory.${TXT_CLEAR}"}" cat << EOS { diff --git a/runner_scripts/root/run.sh b/runner_scripts/root/run.sh index 50e769040590999d8a8850583b2a607c5331894d..c3f1d51aa38e0f67b3a45dcff9d475b6fadad709 100755 --- a/runner_scripts/root/run.sh +++ b/runner_scripts/root/run.sh @@ -4,6 +4,12 @@ shopt -s inherit_errexit MAX_CI_JOB_RUNTIME=120 +TXT_RED="\e[31m" +TXT_BLUE="\e[94m" +TXT_GREEN="\e[32m" +TXT_CLEAR="\e[0m" +TXT_BOLD="\e[1m" + hash awk hash chown hash diff @@ -18,7 +24,7 @@ hash sinfo function error { : "${RV:=${2:-$BUILD_FAILURE_EXIT_CODE}}" - echo "$1" >&2 + echo -e "${TXT_RED}${TXT_BOLD}$1${TXT_CLEAR}" >&2 return "$RV" } @@ -110,6 +116,8 @@ if [[ ("$2" == "step_script" || "$2" == "build_script") && "${CUSTOM_ENV_NO_SLUR \"$AUTH_USER_SHELL\" --login \"$BASE_DIR.tmp/$CUSTOM_ENV_CI_JOB_ID.sh\"" >> "$TMPDIR"/salloc.sh chmod +x "$TMPDIR"/salloc.sh + echo -e "${TXT_GREEN}${TXT_BOLD}Submitting job to node $SLURM_NODELIST...${TXT_CLEAR}" + exec runuser --login "$AUTH_USER" --command "$TMPDIR"/salloc.sh #exec runuser --login "$AUTH_USER" --command "salloc --quiet --chdir \"$BASE_DIR\" ${SALLOC_OPTIONS[@]} \