Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft: Pipeline status #651

Open
wants to merge 14 commits into
base: develop
Choose a base branch
from
76 changes: 73 additions & 3 deletions .gitlab/pnnl-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -126,27 +137,86 @@ 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="[email protected]/cuda/11.4"
export incline_status="[email protected]/rocm/4.5.1"
export marianas_status="[email protected]/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"
fi
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\":\"${STATE}\",\"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
STATE: pending
script:
- |
set -x
curl -L \
-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\":\"${MY_CLUSTER}\"}"
environment:
name: reporting-github

pending:
stage: .pre
extends:
- .report-status
extends:
- .report-pending
parallel:
matrix:
- MY_CLUSTER: "incline"
- MY_CLUSTER: "newell"
- MY_CLUSTER: "marianas"

success:
stage: .post
extends:
- .report-status
variables:
STATE: success
parallel:
matrix:
- MY_CLUSTER: "incline"
- MY_CLUSTER: "newell"
- MY_CLUSTER: "marianas"

failure:
stage: .post
extends:
- .report-status
rules:
- when: on_failure
variables:
STATE: failure
parallel:
matrix:
- MY_CLUSTER: "incline"
- MY_CLUSTER: "newell"
- MY_CLUSTER: "marianas"
Loading