From 693c312f2f4c70c98fde5db9ee86ebd791c81ca1 Mon Sep 17 00:00:00 2001 From: "ryan.danehy@pnnl.gov" Date: Tue, 8 Aug 2023 15:47:01 -0700 Subject: [PATCH 01/14] Attempt 1 at Getting pipeline status to show up --- .gitlab/pnnl-ci.yml | 73 +++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 70 insertions(+), 3 deletions(-) diff --git a/.gitlab/pnnl-ci.yml b/.gitlab/pnnl-ci.yml index d25387a59..7e643e25e 100644 --- a/.gitlab/pnnl-ci.yml +++ b/.gitlab/pnnl-ci.yml @@ -70,7 +70,18 @@ variables: export CTEST_CMD=$CTEST_CMD sbatch -A EXASGD --exclusive -N 1 -n 8 -p $SLURM_Q -t $TIMELIMIT $SLURM_ARGS -o output -e output $WORKDIR/BUILD.sh $BUILD_SCRIPT_ARGS + + export jobid=$(echo $jobid | cut -f4 -d' ') + echo $jobid > "$WORKDIR/jobid_${jobid}" + + partition=$(squeue -j $jobid -h --format="%P") + export partition=$(echo $partition | cut -f2 -d'=' | cut -f1 -d' ') + + echo "Job $jobid submitted to partition $partition" + popd + res=1 + set +xv while :; do @@ -126,18 +137,74 @@ pnnl_cleanup: script: - | set -x + if [[ ! -e partition ]]; then + echo "No partition file found" + export part="none" + else + export part=$(cat partition) + fi + + export newell_status="gcc@8.5.0/cuda/11.4" + export incline_status="gcc@8.5/rocm/4.5.1" + export marianas_status="gcc@10.2/cuda/11.4" + + + if [[ "$part" == *"newell"* ]]; then + export STATUS_NAME=$newell_status + + elif [[ "$part" == *"incline"* ]]; then + export STATUS_NAME="$incline_status" + + elif [[ "$part" == *"marianas"* ]]; then + export STATUS_NAME="$marianas_status" + curl -L \ -X POST \ -H @${GITHUB_CURL_HEADERS} \ https://api.github.com/repos/${STATUS_PROJECT}/statuses/${CI_COMMIT_SHA} \ - -d "{\"state\":\"${CI_JOB_NAME}\",\"target_url\":\"${CI_PIPELINE_URL}\",\"context\":\"${STATUS_NAME}\"}" + -d "{\"state\":\"${CI_JOB_NAME}\",\"target_url\":\"${CI_PIPELINE_URL}\",\"description\":\"${STATUS_NAME}\",\"context\":\"${MY_CLUSTER}\"}" + environment: + name: reporting-github + +.report-pending: + extends: + - .pnnl_nohpc_tags + variables: + STATUS_PROJECT: LLNL/hiop + STATUS_NAME: PNNL_GitLab + GIT_STRATEGY: none + script: + - | + set -x + curl -L \ + -X POST \ + -H @${GITHUB_CURL_HEADER}\ + https://api.github.com/repos/${STATUS_PROJECT}/statuses/${CI_COMMIT_SHA} \ + -d "{\"state\":\"${CI_JOB_NAME}\",\"target_url\":\"${CI_PIPELINE_URL}\",\"context\":\"${MY_CLUSTER}\"}" environment: name: reporting-github -pending: + +pending-incline: + extends: + - .report-pending + variables: + MY_CLUSTER: "incline" stage: .pre + +pending-newell: extends: - - .report-status + - .report-pending + variables: + MY_CLUSTER: "newell" + stage: .pre + +pending-marianas: + extends: + - .report-pending + variables: + MY_CLUSTER: "marianas" + stage: .pre success: stage: .post From 5d2402b7737998ee76664684296d337f7d2df83f Mon Sep 17 00:00:00 2001 From: "ryan.danehy@pnnl.gov" Date: Tue, 8 Aug 2023 15:51:51 -0700 Subject: [PATCH 02/14] Attempt 2 at Getting pipeline status to show up --- .gitlab/pnnl-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab/pnnl-ci.yml b/.gitlab/pnnl-ci.yml index 7e643e25e..6fcc890e0 100644 --- a/.gitlab/pnnl-ci.yml +++ b/.gitlab/pnnl-ci.yml @@ -180,7 +180,7 @@ pnnl_cleanup: -X POST \ -H @${GITHUB_CURL_HEADER}\ https://api.github.com/repos/${STATUS_PROJECT}/statuses/${CI_COMMIT_SHA} \ - -d "{\"state\":\"${CI_JOB_NAME}\",\"target_url\":\"${CI_PIPELINE_URL}\",\"context\":\"${MY_CLUSTER}\"}" + -d "{\"state\":\"pending\",\"target_url\":\"${CI_PIPELINE_URL}\",\"context\":\"${MY_CLUSTER}\"}" environment: name: reporting-github From 927d8eca5c2cdc88a64a2606d4a3133d6a5156ac Mon Sep 17 00:00:00 2001 From: "ryan.danehy@pnnl.gov" Date: Tue, 8 Aug 2023 16:23:29 -0700 Subject: [PATCH 03/14] Attempt 3 at Getting pipeline status to show up --- .gitlab/pnnl-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab/pnnl-ci.yml b/.gitlab/pnnl-ci.yml index 6fcc890e0..1076b457c 100644 --- a/.gitlab/pnnl-ci.yml +++ b/.gitlab/pnnl-ci.yml @@ -180,7 +180,7 @@ pnnl_cleanup: -X POST \ -H @${GITHUB_CURL_HEADER}\ https://api.github.com/repos/${STATUS_PROJECT}/statuses/${CI_COMMIT_SHA} \ - -d "{\"state\":\"pending\",\"target_url\":\"${CI_PIPELINE_URL}\",\"context\":\"${MY_CLUSTER}\"}" + -d '{"state":"pending",\"target_url\":\"${CI_PIPELINE_URL}\",\"context\":\"${MY_CLUSTER}\"}'' environment: name: reporting-github From ecc06e7d91f4c9ca4e69c6f8fc629bb84a01810f Mon Sep 17 00:00:00 2001 From: "ryan.danehy@pnnl.gov" Date: Tue, 8 Aug 2023 16:25:20 -0700 Subject: [PATCH 04/14] Attempt 3 at Getting pipeline status to show up --- .gitlab/pnnl-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab/pnnl-ci.yml b/.gitlab/pnnl-ci.yml index 1076b457c..2d9348fee 100644 --- a/.gitlab/pnnl-ci.yml +++ b/.gitlab/pnnl-ci.yml @@ -180,7 +180,7 @@ pnnl_cleanup: -X POST \ -H @${GITHUB_CURL_HEADER}\ https://api.github.com/repos/${STATUS_PROJECT}/statuses/${CI_COMMIT_SHA} \ - -d '{"state":"pending",\"target_url\":\"${CI_PIPELINE_URL}\",\"context\":\"${MY_CLUSTER}\"}'' + -d '{"state":"pending",\"target_url\":\"${CI_PIPELINE_URL}\",\"context\":\"${MY_CLUSTER}\"}' environment: name: reporting-github From a565040e2e307a850dc9b05f2032cf24492fa746 Mon Sep 17 00:00:00 2001 From: "ryan.danehy@pnnl.gov" Date: Tue, 8 Aug 2023 16:34:14 -0700 Subject: [PATCH 05/14] Attempt 4 at Getting pipeline status to show up --- .gitlab/pnnl-ci.yml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/.gitlab/pnnl-ci.yml b/.gitlab/pnnl-ci.yml index 2d9348fee..9ebf12c1c 100644 --- a/.gitlab/pnnl-ci.yml +++ b/.gitlab/pnnl-ci.yml @@ -178,12 +178,20 @@ pnnl_cleanup: set -x curl -L \ -X POST \ - -H @${GITHUB_CURL_HEADER}\ - https://api.github.com/repos/${STATUS_PROJECT}/statuses/${CI_COMMIT_SHA} \ - -d '{"state":"pending",\"target_url\":\"${CI_PIPELINE_URL}\",\"context\":\"${MY_CLUSTER}\"}' + -H @${GITHUB_CURL_HEADERS} \ + https://api.github.com/repos/${STATUS_PROJECT}/statuses/${CI_COMMIT_SHA} \ + -d "{\"state\":\"${CI_JOB_NAME}\",\"target_url\":\"${CI_PIPELINE_URL}\",\"context\":\"${STATUS_NAME}\"}" environment: name: reporting-github +pending: +stage: .pre +extends: .report-pending +parallel: + matrix: + - MY_CLUSTER: "incline" + - MY_CLUSTER: "newell" + - MY_CLUSTER: "marianas" pending-incline: extends: From 12180704e5185604892fb19197c385db846fc666 Mon Sep 17 00:00:00 2001 From: "ryan.danehy@pnnl.gov" Date: Tue, 8 Aug 2023 16:36:23 -0700 Subject: [PATCH 06/14] Attempt 4 at Getting pipeline status to show up --- .gitlab/pnnl-ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitlab/pnnl-ci.yml b/.gitlab/pnnl-ci.yml index 9ebf12c1c..8e3eb3580 100644 --- a/.gitlab/pnnl-ci.yml +++ b/.gitlab/pnnl-ci.yml @@ -186,7 +186,8 @@ pnnl_cleanup: pending: stage: .pre -extends: .report-pending +extends: + - .report-pending parallel: matrix: - MY_CLUSTER: "incline" From 2119cdf26118bbe70c9b5018e5c8ab3d84c802a5 Mon Sep 17 00:00:00 2001 From: "ryan.danehy@pnnl.gov" Date: Tue, 8 Aug 2023 16:37:48 -0700 Subject: [PATCH 07/14] Attempt 4 at Getting pipeline status to show up --- .gitlab/pnnl-ci.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.gitlab/pnnl-ci.yml b/.gitlab/pnnl-ci.yml index 8e3eb3580..eb23e1639 100644 --- a/.gitlab/pnnl-ci.yml +++ b/.gitlab/pnnl-ci.yml @@ -185,14 +185,14 @@ pnnl_cleanup: name: reporting-github pending: -stage: .pre -extends: - - .report-pending -parallel: - matrix: - - MY_CLUSTER: "incline" - - MY_CLUSTER: "newell" - - MY_CLUSTER: "marianas" + stage: .pre + extends: + - .report-pending + parallel: + matrix: + - MY_CLUSTER: "incline" + - MY_CLUSTER: "newell" + - MY_CLUSTER: "marianas" pending-incline: extends: From 4692c339e9ed33445835b186a9e110c7b7707e0f Mon Sep 17 00:00:00 2001 From: "ryan.danehy@pnnl.gov" Date: Tue, 8 Aug 2023 16:40:20 -0700 Subject: [PATCH 08/14] Attempt 5 at Getting pipeline status to show up --- .gitlab/pnnl-ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitlab/pnnl-ci.yml b/.gitlab/pnnl-ci.yml index eb23e1639..07b56d731 100644 --- a/.gitlab/pnnl-ci.yml +++ b/.gitlab/pnnl-ci.yml @@ -173,6 +173,7 @@ pnnl_cleanup: STATUS_PROJECT: LLNL/hiop STATUS_NAME: PNNL_GitLab GIT_STRATEGY: none + STATE: pending script: - | set -x @@ -180,7 +181,7 @@ pnnl_cleanup: -X POST \ -H @${GITHUB_CURL_HEADERS} \ https://api.github.com/repos/${STATUS_PROJECT}/statuses/${CI_COMMIT_SHA} \ - -d "{\"state\":\"${CI_JOB_NAME}\",\"target_url\":\"${CI_PIPELINE_URL}\",\"context\":\"${STATUS_NAME}\"}" + -d "{\"state\":\"${state}\",\"target_url\":\"${CI_PIPELINE_URL}\",\"context\":\"${STATUS_NAME}\"}" environment: name: reporting-github From e6099d3582dbfd312fb6bb0282c32c63d4e0f805 Mon Sep 17 00:00:00 2001 From: "ryan.danehy@pnnl.gov" Date: Tue, 8 Aug 2023 16:42:18 -0700 Subject: [PATCH 09/14] Attempt 5 at Getting pipeline status to show up --- .gitlab/pnnl-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab/pnnl-ci.yml b/.gitlab/pnnl-ci.yml index 07b56d731..10cfb5591 100644 --- a/.gitlab/pnnl-ci.yml +++ b/.gitlab/pnnl-ci.yml @@ -181,7 +181,7 @@ pnnl_cleanup: -X POST \ -H @${GITHUB_CURL_HEADERS} \ https://api.github.com/repos/${STATUS_PROJECT}/statuses/${CI_COMMIT_SHA} \ - -d "{\"state\":\"${state}\",\"target_url\":\"${CI_PIPELINE_URL}\",\"context\":\"${STATUS_NAME}\"}" + -d "{\"state\":\"${STATE}\",\"target_url\":\"${CI_PIPELINE_URL}\",\"context\":\"${STATUS_NAME}\"}" environment: name: reporting-github From c8c2bf65036f9f9424b62d95cf4b827af4270d02 Mon Sep 17 00:00:00 2001 From: "ryan.danehy@pnnl.gov" Date: Fri, 18 Aug 2023 08:29:49 -0700 Subject: [PATCH 10/14] Put pending jobs in matrix --- .gitlab/pnnl-ci.yml | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/.gitlab/pnnl-ci.yml b/.gitlab/pnnl-ci.yml index 10cfb5591..e831adcd7 100644 --- a/.gitlab/pnnl-ci.yml +++ b/.gitlab/pnnl-ci.yml @@ -181,7 +181,7 @@ pnnl_cleanup: -X POST \ -H @${GITHUB_CURL_HEADERS} \ https://api.github.com/repos/${STATUS_PROJECT}/statuses/${CI_COMMIT_SHA} \ - -d "{\"state\":\"${STATE}\",\"target_url\":\"${CI_PIPELINE_URL}\",\"context\":\"${STATUS_NAME}\"}" + -d "{\"state\":\"${STATE}\",\"target_url\":\"${CI_PIPELINE_URL}\",\"context\":\"${MY_CLUSTER}\"}" environment: name: reporting-github @@ -195,27 +195,6 @@ pending: - MY_CLUSTER: "newell" - MY_CLUSTER: "marianas" -pending-incline: - extends: - - .report-pending - variables: - MY_CLUSTER: "incline" - stage: .pre - -pending-newell: - extends: - - .report-pending - variables: - MY_CLUSTER: "newell" - stage: .pre - -pending-marianas: - extends: - - .report-pending - variables: - MY_CLUSTER: "marianas" - stage: .pre - success: stage: .post extends: From 8ba160f21c7890ee63c42e94d55f28bbe3d7d972 Mon Sep 17 00:00:00 2001 From: "ryan.danehy@pnnl.gov" Date: Fri, 18 Aug 2023 08:46:14 -0700 Subject: [PATCH 11/14] Slight bug fix --- .gitlab/pnnl-ci.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.gitlab/pnnl-ci.yml b/.gitlab/pnnl-ci.yml index e831adcd7..7ab148396 100644 --- a/.gitlab/pnnl-ci.yml +++ b/.gitlab/pnnl-ci.yml @@ -157,7 +157,7 @@ pnnl_cleanup: elif [[ "$part" == *"marianas"* ]]; then export STATUS_NAME="$marianas_status" - + fi curl -L \ -X POST \ -H @${GITHUB_CURL_HEADERS} \ @@ -199,6 +199,11 @@ success: stage: .post extends: - .report-status + parallel: + matrix: + - MY_CLUSTER: "incline" + - MY_CLUSTER: "newell" + - MY_CLUSTER: "marianas" failure: stage: .post @@ -206,3 +211,8 @@ failure: - .report-status rules: - when: on_failure + parallel: + matrix: + - MY_CLUSTER: "incline" + - MY_CLUSTER: "newell" + - MY_CLUSTER: "marianas" From de0ec65545291f37cbbba545b81a23538491475a Mon Sep 17 00:00:00 2001 From: "ryan.danehy@pnnl.gov" Date: Fri, 18 Aug 2023 09:07:55 -0700 Subject: [PATCH 12/14] add states to after check jobs --- .gitlab/pnnl-ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitlab/pnnl-ci.yml b/.gitlab/pnnl-ci.yml index 7ab148396..d397449a9 100644 --- a/.gitlab/pnnl-ci.yml +++ b/.gitlab/pnnl-ci.yml @@ -199,6 +199,8 @@ success: stage: .post extends: - .report-status + variables: + STATE: success parallel: matrix: - MY_CLUSTER: "incline" @@ -211,6 +213,8 @@ failure: - .report-status rules: - when: on_failure + variables: + STATE: failure parallel: matrix: - MY_CLUSTER: "incline" From c20d9e785ecc7ce1c33ac3e2b5de3197b443aace Mon Sep 17 00:00:00 2001 From: "ryan.danehy@pnnl.gov" Date: Fri, 18 Aug 2023 09:25:15 -0700 Subject: [PATCH 13/14] add states to after check jobs --- .gitlab/pnnl-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab/pnnl-ci.yml b/.gitlab/pnnl-ci.yml index d397449a9..6ddaf5739 100644 --- a/.gitlab/pnnl-ci.yml +++ b/.gitlab/pnnl-ci.yml @@ -214,7 +214,7 @@ failure: rules: - when: on_failure variables: - STATE: failure + STATE: failed parallel: matrix: - MY_CLUSTER: "incline" From 5887aace178b43ed24bd9eeb2289bc2c3660feb4 Mon Sep 17 00:00:00 2001 From: "ryan.danehy@pnnl.gov" Date: Fri, 18 Aug 2023 09:56:09 -0700 Subject: [PATCH 14/14] fix states variable --- .gitlab/pnnl-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab/pnnl-ci.yml b/.gitlab/pnnl-ci.yml index 6ddaf5739..096e6bdea 100644 --- a/.gitlab/pnnl-ci.yml +++ b/.gitlab/pnnl-ci.yml @@ -162,7 +162,7 @@ pnnl_cleanup: -X POST \ -H @${GITHUB_CURL_HEADERS} \ https://api.github.com/repos/${STATUS_PROJECT}/statuses/${CI_COMMIT_SHA} \ - -d "{\"state\":\"${CI_JOB_NAME}\",\"target_url\":\"${CI_PIPELINE_URL}\",\"description\":\"${STATUS_NAME}\",\"context\":\"${MY_CLUSTER}\"}" + -d "{\"state\":\"${STATE}\",\"target_url\":\"${CI_PIPELINE_URL}\",\"description\":\"${STATUS_NAME}\",\"context\":\"${MY_CLUSTER}\"}" environment: name: reporting-github @@ -214,7 +214,7 @@ failure: rules: - when: on_failure variables: - STATE: failed + STATE: failure parallel: matrix: - MY_CLUSTER: "incline"