From 9244c265e290a02f5677e6bd0c7ce8fd23fb5063 Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Fri, 21 Aug 2026 16:18:34 -0700 Subject: [PATCH 1/8] add ci on UOregon Frank cluster --- .gitlab/uoregon-gitlab-ci.yml | 154 ++++++++++++++++++ host-configs/uoregon/amd_mi300a.cmake | 29 ++++ host-configs/uoregon/intel_pvc.cmake | 22 +++ host-configs/uoregon/nvidia_dgx_spark.cmake | 24 +++ host-configs/uoregon/nvidia_gh200.cmake | 26 +++ host-configs/uoregon/nvidia_grace_grace.cmake | 20 +++ host-configs/uoregon/nvidia_rtx5080.cmake | 24 +++ 7 files changed, 299 insertions(+) create mode 100644 .gitlab/uoregon-gitlab-ci.yml create mode 100644 host-configs/uoregon/amd_mi300a.cmake create mode 100644 host-configs/uoregon/intel_pvc.cmake create mode 100644 host-configs/uoregon/nvidia_dgx_spark.cmake create mode 100644 host-configs/uoregon/nvidia_gh200.cmake create mode 100644 host-configs/uoregon/nvidia_grace_grace.cmake create mode 100644 host-configs/uoregon/nvidia_rtx5080.cmake diff --git a/.gitlab/uoregon-gitlab-ci.yml b/.gitlab/uoregon-gitlab-ci.yml new file mode 100644 index 0000000000..fbeb6940d7 --- /dev/null +++ b/.gitlab/uoregon-gitlab-ci.yml @@ -0,0 +1,154 @@ +############################################################################### +# Copyright (c) Lawrence Livermore National Security, LLC and other +# RAJA Project Developers. See top-level LICENSE and COPYRIGHT +# files for dates and other details. No copyright assignment is required +# to contribute to RAJA. +# +# SPDX-License-Identifier: (BSD-3-Clause) +############################################################################### + +############################################################################### +# VARIABLES +############################################################################### + +variables: + # GIT_STRATEGY: fetch + # GIT_DEPTH: 1 + GIT_SUBMODULE_STRATEGY: normal + GIT_SUBMODULE_DEPTH: 1 + GIT_SUBMODULE_UPDATE_FLAGS: --jobs 3 + GIT_SUBMODULE_PATHS: blt tpl/camp tpl/desul + +############################################################################### +# MAIN PIPELINE STAGES +############################################################################### + +stages: + - build-and-test + +############################################################################### +# JOBS +############################################################################### + +.common-setup: + stage: build-and-test + rules: + - if: '$CI_COMMIT_BRANCH == "develop" || $CI_COMMIT_BRANCH == "balos1/add-uoregon-gitlab-ci"' + variables: + OMP_NUM_THREADS: "8" + OMP_PLACES: "cores" + OMP_PROC_BIND: "close" + before_script: + - | + if [ "${CI_PIPELINE_SOURCE}" = "schedule" ]; then + export BUILD_TYPE=Debug + elif [ "${CI_COMMIT_REF_NAME}" = "develop" ]; then + export BUILD_TYPE=Release + else + export BUILD_TYPE=RelWithDebInfo + fi + +.junit-artifacts: + artifacts: + when: always + paths: + - build/junit.xml + reports: + junit: build/junit.xml + +NVIDIA-RTX5080: + extends: [.common-setup, .junit-artifacts] + tags: [uo-gpu, nvidia-rtx5080, x86_64-nvidiagpu] + image: nvcr.io/nvidia/cuda:13.3.0-devel-ubuntu26.04 + timeout: 2h + script: + - apt-get update && apt-get install -y build-essential cmake git python3 + - export CMAKE_BUILD_PARALLEL_LEVEL=4 + - >- + cmake -S ${CI_PROJECT_DIR} -B build + -DCMAKE_BUILD_TYPE=${BUILD_TYPE} + -C ${CI_PROJECT_DIR}/host-configs/uoregon/nvidia_rtx5080.cmake + - cmake --build build + - ctest --test-dir build --output-on-failure --output-junit junit.xml + +NVIDIA-GH200: + extends: [.common-setup, .junit-artifacts] + tags: [uo-gpu, nvidia-gh200, arm64-nvidiagpu] + image: nvcr.io/nvidia/cuda:13.1.0-devel-ubuntu24.04 + timeout: 2h + script: + - apt-get update && apt-get install -y build-essential cmake git python3 + - export CMAKE_BUILD_PARALLEL_LEVEL=8 + - >- + cmake -S ${CI_PROJECT_DIR} -B build + -DCMAKE_BUILD_TYPE=${BUILD_TYPE} + -C ${CI_PROJECT_DIR}/host-configs/uoregon/nvidia_gh200.cmake + - cmake --build build + - ctest --test-dir build --output-on-failure --output-junit junit.xml + +NVIDIA-GRACE-GRACE: + extends: [.common-setup, .junit-artifacts] + tags: [grace, hpsf, hpsf-neoverse_v2, hpsf-aarch64] + image: ubuntu:latest + timeout: 2h + script: + - apt-get update && apt-get install -y build-essential cmake git python3 + - export CMAKE_BUILD_PARALLEL_LEVEL=8 + - >- + cmake -S ${CI_PROJECT_DIR} -B build + -DCMAKE_BUILD_TYPE=${BUILD_TYPE} + -C ${CI_PROJECT_DIR}/host-configs/uoregon/nvidia_grace_grace.cmake + - cmake --build build + - ctest --test-dir build --output-on-failure --output-junit junit.xml + +NVIDIA-DGX-SPARK: + extends: [.common-setup, .junit-artifacts] + tags: [uo-gpu, nvidia-gb10, aarch64-nvidiagpu] + image: nvcr.io/nvidia/cuda:13.1.1-devel-ubuntu24.04 + timeout: 2h + script: + - apt-get update && apt-get install -y build-essential cmake git python3 + - export CMAKE_BUILD_PARALLEL_LEVEL=8 + - >- + cmake -S ${CI_PROJECT_DIR} -B build + -DCMAKE_BUILD_TYPE=${BUILD_TYPE} + -C ${CI_PROJECT_DIR}/host-configs/uoregon/nvidia_dgx_spark.cmake + - cmake --build build --verbose + - ctest --test-dir build --output-on-failure --output-junit junit.xml + +INTEL-DATA-CENTER-MAX-1100: + extends: [.common-setup, .junit-artifacts] + tags: [uo-gpu, intel-data-center-max-1100, x86_64-intelgpu] + image: intel/oneapi:2026.0.0-devel-ubuntu24.04 + timeout: 2h + script: + - apt-get update && apt-get install -y build-essential cmake git python3 intel-ocloc + - sycl-ls + - export ONEAPI_DEVICE_SELECTOR=level_zero:gpu + - export CMAKE_BUILD_PARALLEL_LEVEL=8 + - >- + cmake -S ${CI_PROJECT_DIR} -B build + -DCMAKE_BUILD_TYPE=${BUILD_TYPE} + -C ${CI_PROJECT_DIR}/host-configs/uoregon/intel_pvc.cmake + - cmake --build build + - >- + ctest --test-dir build --output-on-failure --output-junit junit.xml + --exclude-regex 'test-forall-basic-msg-Sycl|test-tensor-register-double-Subtract' + +AMD-MI300A: + extends: [.common-setup, .junit-artifacts] + tags: [uo-gpu, odyssey, amd-mi300, x86_64-amdgpu] + image: rocm/dev-ubuntu-26.04:7.14.0-full + timeout: 2h + script: + - apt-get update && apt-get install -y build-essential cmake git python3 + - export CMAKE_BUILD_PARALLEL_LEVEL=8 + - export HSA_XNACK=1 + - export HIP_VISIBLE_DEVICES=3 + - export LD_LIBRARY_PATH=/opt/rocm/lib:/opt/rocm/lib64:${LD_LIBRARY_PATH} + - >- + cmake -S ${CI_PROJECT_DIR} -B build + -DCMAKE_BUILD_TYPE=${BUILD_TYPE} + -C ${CI_PROJECT_DIR}/host-configs/uoregon/amd_mi300a.cmake + - cmake --build build + - ctest --test-dir build --output-on-failure --output-junit junit.xml diff --git a/host-configs/uoregon/amd_mi300a.cmake b/host-configs/uoregon/amd_mi300a.cmake new file mode 100644 index 0000000000..7dea973486 --- /dev/null +++ b/host-configs/uoregon/amd_mi300a.cmake @@ -0,0 +1,29 @@ +############################################################################### +# Copyright (c) Lawrence Livermore National Security, LLC and other +# RAJA Project Developers. See top-level LICENSE and COPYRIGHT +# files for dates and other details. No copyright assignment is required +# to contribute to RAJA. +# +# SPDX-License-Identifier: (BSD-3-Clause) +############################################################################### + +set(BLT_CXX_STD c++20 CACHE STRING "") +set(ENABLE_TESTS ON CACHE BOOL "") +set(RAJA_ENABLE_EXERCISES OFF CACHE BOOL "") +set(RAJA_RANGE_ALIGN 4 CACHE STRING "") +set(RAJA_RANGE_MIN_LENGTH 32 CACHE STRING "") +set(RAJA_DATA_ALIGN 64 CACHE STRING "") +set(RAJA_HOST_CONFIG_LOADED ON CACHE BOOL "") + +set(CMAKE_PREFIX_PATH "/opt/rocm" CACHE PATH "") +set(CMAKE_C_COMPILER hipcc CACHE FILEPATH "") +set(CMAKE_CXX_COMPILER hipcc CACHE FILEPATH "") +set(CMAKE_CXX_FLAGS "-Werror -Wno-deprecated-attributes" CACHE STRING "") +set(ENABLE_HIP ON CACHE BOOL "") +set(ENABLE_OPENMP ON CACHE BOOL "") +set(CMAKE_HIP_ARCHITECTURES gfx942 CACHE STRING "") +set(AMDGPU_TARGETS gfx942 CACHE STRING "") +set(ROCPRIM_DIR "/opt/rocm" CACHE PATH "") +set(RAJA_HIPCC_FLAGS_RELEASE "-O2" CACHE STRING "") +set(RAJA_HIPCC_FLAGS_RELWITHDEBINFO "-g -O2" CACHE STRING "") +set(RAJA_HIPCC_FLAGS_DEBUG "-g -O0" CACHE STRING "") diff --git a/host-configs/uoregon/intel_pvc.cmake b/host-configs/uoregon/intel_pvc.cmake new file mode 100644 index 0000000000..f82f1d6054 --- /dev/null +++ b/host-configs/uoregon/intel_pvc.cmake @@ -0,0 +1,22 @@ +############################################################################### +# Copyright (c) Lawrence Livermore National Security, LLC and other +# RAJA Project Developers. See top-level LICENSE and COPYRIGHT +# files for dates and other details. No copyright assignment is required +# to contribute to RAJA. +# +# SPDX-License-Identifier: (BSD-3-Clause) +############################################################################### + +set(BLT_CXX_STD c++20 CACHE STRING "") +set(ENABLE_TESTS ON CACHE BOOL "") +set(RAJA_ENABLE_EXERCISES OFF CACHE BOOL "") +set(RAJA_RANGE_ALIGN 4 CACHE STRING "") +set(RAJA_RANGE_MIN_LENGTH 32 CACHE STRING "") +set(RAJA_DATA_ALIGN 64 CACHE STRING "") +set(RAJA_HOST_CONFIG_LOADED ON CACHE BOOL "") + +set(CMAKE_CXX_COMPILER icpx CACHE FILEPATH "") +set(CMAKE_CXX_FLAGS "-fsycl -w -fp-model=precise -fsycl-unnamed-lambda" CACHE STRING "") +set(CMAKE_EXE_LINKER_FLAGS "-fsycl" CACHE STRING "") +set(RAJA_ENABLE_SYCL ON CACHE BOOL "") +set(ENABLE_ALL_WARNINGS OFF CACHE BOOL "") diff --git a/host-configs/uoregon/nvidia_dgx_spark.cmake b/host-configs/uoregon/nvidia_dgx_spark.cmake new file mode 100644 index 0000000000..1dc0ddfd47 --- /dev/null +++ b/host-configs/uoregon/nvidia_dgx_spark.cmake @@ -0,0 +1,24 @@ +############################################################################### +# Copyright (c) Lawrence Livermore National Security, LLC and other +# RAJA Project Developers. See top-level LICENSE and COPYRIGHT +# files for dates and other details. No copyright assignment is required +# to contribute to RAJA. +# +# SPDX-License-Identifier: (BSD-3-Clause) +############################################################################### + +set(BLT_CXX_STD c++20 CACHE STRING "") +set(ENABLE_TESTS ON CACHE BOOL "") +set(RAJA_ENABLE_EXERCISES OFF CACHE BOOL "") +set(RAJA_RANGE_ALIGN 4 CACHE STRING "") +set(RAJA_RANGE_MIN_LENGTH 32 CACHE STRING "") +set(RAJA_DATA_ALIGN 64 CACHE STRING "") +set(RAJA_HOST_CONFIG_LOADED ON CACHE BOOL "") + +set(CMAKE_CXX_COMPILER g++ CACHE FILEPATH "") +set(CMAKE_CXX_FLAGS "-Werror" CACHE STRING "") +set(ENABLE_CUDA ON CACHE BOOL "") +set(CMAKE_CUDA_ARCHITECTURES native CACHE STRING "") +set(CMAKE_CUDA_FLAGS_RELEASE "-O2" CACHE STRING "") +set(CMAKE_CUDA_FLAGS_RELWITHDEBINFO "-g -lineinfo -O2" CACHE STRING "") +set(CMAKE_CUDA_FLAGS_DEBUG "-g -G -O0" CACHE STRING "") diff --git a/host-configs/uoregon/nvidia_gh200.cmake b/host-configs/uoregon/nvidia_gh200.cmake new file mode 100644 index 0000000000..68215e2291 --- /dev/null +++ b/host-configs/uoregon/nvidia_gh200.cmake @@ -0,0 +1,26 @@ +############################################################################### +# Copyright (c) Lawrence Livermore National Security, LLC and other +# RAJA Project Developers. See top-level LICENSE and COPYRIGHT +# files for dates and other details. No copyright assignment is required +# to contribute to RAJA. +# +# SPDX-License-Identifier: (BSD-3-Clause) +############################################################################### + +set(BLT_CXX_STD c++20 CACHE STRING "") +set(ENABLE_TESTS ON CACHE BOOL "") +set(RAJA_ENABLE_EXERCISES OFF CACHE BOOL "") +set(RAJA_RANGE_ALIGN 4 CACHE STRING "") +set(RAJA_RANGE_MIN_LENGTH 32 CACHE STRING "") +set(RAJA_DATA_ALIGN 64 CACHE STRING "") +set(RAJA_HOST_CONFIG_LOADED ON CACHE BOOL "") + +set(CMAKE_CXX_COMPILER g++ CACHE FILEPATH "") +set(CMAKE_CXX_FLAGS "-Werror" CACHE STRING "") +set(ENABLE_CUDA ON CACHE BOOL "") +set(ENABLE_OPENMP ON CACHE BOOL "") +set(CMAKE_CUDA_ARCHITECTURES 90 CACHE STRING "") +set(RAJA_ENABLE_BOUNDS_CHECK ON CACHE BOOL "") +set(CMAKE_CUDA_FLAGS_RELEASE "-O2" CACHE STRING "") +set(CMAKE_CUDA_FLAGS_RELWITHDEBINFO "-g -lineinfo -O2" CACHE STRING "") +set(CMAKE_CUDA_FLAGS_DEBUG "-g -G -O0" CACHE STRING "") diff --git a/host-configs/uoregon/nvidia_grace_grace.cmake b/host-configs/uoregon/nvidia_grace_grace.cmake new file mode 100644 index 0000000000..021b595332 --- /dev/null +++ b/host-configs/uoregon/nvidia_grace_grace.cmake @@ -0,0 +1,20 @@ +############################################################################### +# Copyright (c) Lawrence Livermore National Security, LLC and other +# RAJA Project Developers. See top-level LICENSE and COPYRIGHT +# files for dates and other details. No copyright assignment is required +# to contribute to RAJA. +# +# SPDX-License-Identifier: (BSD-3-Clause) +############################################################################### + +set(BLT_CXX_STD c++20 CACHE STRING "") +set(ENABLE_TESTS ON CACHE BOOL "") +set(RAJA_ENABLE_EXERCISES OFF CACHE BOOL "") +set(RAJA_RANGE_ALIGN 4 CACHE STRING "") +set(RAJA_RANGE_MIN_LENGTH 32 CACHE STRING "") +set(RAJA_DATA_ALIGN 64 CACHE STRING "") +set(RAJA_HOST_CONFIG_LOADED ON CACHE BOOL "") + +set(CMAKE_CXX_COMPILER g++ CACHE FILEPATH "") +set(CMAKE_CXX_FLAGS "-Werror -Wno-error=template-id-cdtor -Wno-error=free-nonheap-object" CACHE STRING "") +set(ENABLE_OPENMP ON CACHE BOOL "") diff --git a/host-configs/uoregon/nvidia_rtx5080.cmake b/host-configs/uoregon/nvidia_rtx5080.cmake new file mode 100644 index 0000000000..f148841544 --- /dev/null +++ b/host-configs/uoregon/nvidia_rtx5080.cmake @@ -0,0 +1,24 @@ +############################################################################### +# Copyright (c) Lawrence Livermore National Security, LLC and other +# RAJA Project Developers. See top-level LICENSE and COPYRIGHT +# files for dates and other details. No copyright assignment is required +# to contribute to RAJA. +# +# SPDX-License-Identifier: (BSD-3-Clause) +############################################################################### + +set(BLT_CXX_STD c++20 CACHE STRING "") +set(ENABLE_TESTS ON CACHE BOOL "") +set(RAJA_ENABLE_EXERCISES OFF CACHE BOOL "") +set(RAJA_RANGE_ALIGN 4 CACHE STRING "") +set(RAJA_RANGE_MIN_LENGTH 32 CACHE STRING "") +set(RAJA_DATA_ALIGN 64 CACHE STRING "") +set(RAJA_HOST_CONFIG_LOADED ON CACHE BOOL "") + +set(CMAKE_CXX_COMPILER g++ CACHE FILEPATH "") +set(CMAKE_CXX_FLAGS "-Werror" CACHE STRING "") +set(ENABLE_CUDA ON CACHE BOOL "") +set(CMAKE_CUDA_ARCHITECTURES 120 CACHE STRING "") +set(CMAKE_CUDA_FLAGS_RELEASE "-O2" CACHE STRING "") +set(CMAKE_CUDA_FLAGS_RELWITHDEBINFO "-g -lineinfo -O2" CACHE STRING "") +set(CMAKE_CUDA_FLAGS_DEBUG "-g -G -O0" CACHE STRING "") From e74ef68b5085ee812377a970bc7bed6f643e0dda Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Tue, 25 Aug 2026 12:22:11 -0700 Subject: [PATCH 2/8] add test artifacts --- .gitlab/uoregon-gitlab-ci.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.gitlab/uoregon-gitlab-ci.yml b/.gitlab/uoregon-gitlab-ci.yml index fbeb6940d7..4e0db5853e 100644 --- a/.gitlab/uoregon-gitlab-ci.yml +++ b/.gitlab/uoregon-gitlab-ci.yml @@ -53,6 +53,7 @@ stages: when: always paths: - build/junit.xml + - build/Testing/ reports: junit: build/junit.xml @@ -69,7 +70,7 @@ NVIDIA-RTX5080: -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -C ${CI_PROJECT_DIR}/host-configs/uoregon/nvidia_rtx5080.cmake - cmake --build build - - ctest --test-dir build --output-on-failure --output-junit junit.xml + - ctest --test-dir build --output-on-failure --output-junit junit.xml -T test NVIDIA-GH200: extends: [.common-setup, .junit-artifacts] @@ -84,7 +85,7 @@ NVIDIA-GH200: -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -C ${CI_PROJECT_DIR}/host-configs/uoregon/nvidia_gh200.cmake - cmake --build build - - ctest --test-dir build --output-on-failure --output-junit junit.xml + - ctest --test-dir build --output-on-failure --output-junit junit.xml -T test NVIDIA-GRACE-GRACE: extends: [.common-setup, .junit-artifacts] @@ -99,7 +100,7 @@ NVIDIA-GRACE-GRACE: -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -C ${CI_PROJECT_DIR}/host-configs/uoregon/nvidia_grace_grace.cmake - cmake --build build - - ctest --test-dir build --output-on-failure --output-junit junit.xml + - ctest --test-dir build --output-on-failure --output-junit junit.xml -T test NVIDIA-DGX-SPARK: extends: [.common-setup, .junit-artifacts] @@ -114,7 +115,7 @@ NVIDIA-DGX-SPARK: -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -C ${CI_PROJECT_DIR}/host-configs/uoregon/nvidia_dgx_spark.cmake - cmake --build build --verbose - - ctest --test-dir build --output-on-failure --output-junit junit.xml + - ctest --test-dir build --output-on-failure --output-junit junit.xml -T test INTEL-DATA-CENTER-MAX-1100: extends: [.common-setup, .junit-artifacts] @@ -132,7 +133,7 @@ INTEL-DATA-CENTER-MAX-1100: -C ${CI_PROJECT_DIR}/host-configs/uoregon/intel_pvc.cmake - cmake --build build - >- - ctest --test-dir build --output-on-failure --output-junit junit.xml + ctest --test-dir build --output-on-failure --output-junit junit.xml -T test --exclude-regex 'test-forall-basic-msg-Sycl|test-tensor-register-double-Subtract' AMD-MI300A: @@ -151,4 +152,4 @@ AMD-MI300A: -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -C ${CI_PROJECT_DIR}/host-configs/uoregon/amd_mi300a.cmake - cmake --build build - - ctest --test-dir build --output-on-failure --output-junit junit.xml + - ctest --test-dir build --output-on-failure --output-junit junit.xml -T test From faa8cea692b4562311b7376ce757fcdce807ba76 Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Tue, 25 Aug 2026 12:31:58 -0700 Subject: [PATCH 3/8] enable CI on PRs --- .gitlab/uoregon-gitlab-ci.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.gitlab/uoregon-gitlab-ci.yml b/.gitlab/uoregon-gitlab-ci.yml index 4e0db5853e..c3117c86d8 100644 --- a/.gitlab/uoregon-gitlab-ci.yml +++ b/.gitlab/uoregon-gitlab-ci.yml @@ -33,7 +33,18 @@ stages: .common-setup: stage: build-and-test rules: - - if: '$CI_COMMIT_BRANCH == "develop" || $CI_COMMIT_BRANCH == "balos1/add-uoregon-gitlab-ci"' + # Direct pushes to the mirrored develop branch. + - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' + when: always + # GitHub PRs mirrored as branches named pr_. + - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH =~ /^pr[0-9]+(_.*)?$/' + when: always + # Native GitLab or externally integrated GitHub PR pipelines targeting develop. + - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop"' + when: always + - if: '$CI_PIPELINE_SOURCE == "external_pull_request_event" && $CI_EXTERNAL_PULL_REQUEST_TARGET_BRANCH_NAME == "develop"' + when: always + - when: never variables: OMP_NUM_THREADS: "8" OMP_PLACES: "cores" From 23d27ac563f078117a3ae6cbdac9299875199179 Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Tue, 25 Aug 2026 15:06:26 -0700 Subject: [PATCH 4/8] add github workflow to poll UOregon CI status --- .github/workflows/uoregon-gitlab-status.yml | 280 ++++++++++++++++++++ 1 file changed, 280 insertions(+) create mode 100644 .github/workflows/uoregon-gitlab-status.yml diff --git a/.github/workflows/uoregon-gitlab-status.yml b/.github/workflows/uoregon-gitlab-status.yml new file mode 100644 index 0000000000..c344505486 --- /dev/null +++ b/.github/workflows/uoregon-gitlab-status.yml @@ -0,0 +1,280 @@ +name: GitLab UOregon CI + +on: + push: + branches: [develop] + pull_request_target: + branches: [develop] + types: [opened, synchronize, reopened] + +permissions: + statuses: write + +concurrency: + group: gitlab-uoregon-${{ github.event_name }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + gitlab-pipeline: + runs-on: ubuntu-latest + + timeout-minutes: 190 + + steps: + - name: Wait for GitLab pipeline + shell: bash + env: + COMMIT_SHA: ${{ github.event.pull_request.head.sha || github.sha }} + PR_NUMBER: ${{ github.event.pull_request.number || '' }} + + GITHUB_TOKEN: ${{ github.token }} + GITHUB_REPOSITORY: ${{ github.repository }} + + GITLAB_PROJECT_ID: "84" + GITLAB_URL: https://gitlab.spack.io + GITLAB_PIPELINE_SOURCE: push + + STATUS_CONTEXT: gitlab/uoregon + POLL_TIMEOUT_SECONDS: "10800" + POLL_INTERVAL_SECONDS: "30" + + run: | + set -Eeuo pipefail + + target_url="${GITLAB_URL}/raja/RAJA/-/pipelines?sha=${COMMIT_SHA}" + pipeline_id="" + finalized=false + last_status="" + + post_status() { + local state="$1" + local description="$2" + local payload + + # GitHub limits status descriptions; keep unexpected text bounded. + description="${description:0:140}" + + payload="$( + jq -n \ + --arg state "${state}" \ + --arg target_url "${target_url}" \ + --arg description "${description}" \ + --arg context "${STATUS_CONTEXT}" \ + '{ + state: $state, + target_url: $target_url, + description: $description, + context: $context + }' + )" + + curl \ + --fail \ + --silent \ + --show-error \ + --retry 2 \ + --retry-delay 2 \ + --retry-max-time 60 \ + --retry-all-errors \ + --connect-timeout 10 \ + --max-time 30 \ + --request POST \ + --header "Accept: application/vnd.github+json" \ + --header "Authorization: Bearer ${GITHUB_TOKEN}" \ + --header "Content-Type: application/json" \ + --header "X-GitHub-Api-Version: 2026-03-10" \ + --data-binary "${payload}" \ + --output /dev/null \ + "https://api.github.com/repos/${GITHUB_REPOSITORY}/statuses/${COMMIT_SHA}" + } + + gitlab_get() { + curl \ + --fail \ + --silent \ + --show-error \ + --retry 2 \ + --retry-delay 2 \ + --retry-max-time 60 \ + --retry-all-errors \ + --connect-timeout 10 \ + --max-time 30 \ + --header "Accept: application/json" \ + "$@" + } + + finish() { + local state="$1" + local description="$2" + local exit_code="$3" + + post_status "${state}" "${description}" + finalized=true + exit "${exit_code}" + } + + on_exit() { + rc=$? + + # Avoid recursively invoking this trap. + trap - EXIT INT TERM + + if [[ "${finalized}" != "true" ]]; then + post_status \ + error \ + "GitLab UOregon status bridge failed unexpectedly" || true + + if (( rc == 0 )); then + rc=1 + fi + fi + + exit "${rc}" + } + + trap on_exit EXIT + trap 'exit 130' INT + trap 'exit 143' TERM + + post_status pending "Waiting for the GitLab UOregon pipeline" + + if [[ -n "${PR_NUMBER}" ]]; then + ref_prefix="pr${PR_NUMBER}_" + else + ref_prefix="" + fi + + deadline=$((SECONDS + POLL_TIMEOUT_SECONDS)) + + while (( SECONDS < deadline )); do + if [[ -z "${pipeline_id}" ]]; then + query_args=( + --get + --data-urlencode "sha=${COMMIT_SHA}" + --data-urlencode "source=${GITLAB_PIPELINE_SOURCE}" + --data-urlencode "order_by=id" + --data-urlencode "sort=desc" + --data-urlencode "per_page=100" + ) + + # The develop ref is exact and can be filtered server-side. + if [[ -z "${PR_NUMBER}" ]]; then + query_args+=(--data-urlencode "ref=develop") + fi + + if ! pipelines="$( + gitlab_get \ + "${query_args[@]}" \ + "${GITLAB_URL}/api/v4/projects/${GITLAB_PROJECT_ID}/pipelines" + )"; then + sleep "${POLL_INTERVAL_SECONDS}" + continue + fi + + if ! pipeline="$( + jq -c \ + --arg sha "${COMMIT_SHA}" \ + --arg source "${GITLAB_PIPELINE_SOURCE}" \ + --arg prefix "${ref_prefix}" ' + if type != "array" then + error("GitLab pipelines response is not an array") + else + [ + .[] + | select( + .sha == $sha + and .source == $source + ) + | if $prefix == "" then + select(.ref == "develop") + else + select( + ((.ref // "") | startswith($prefix)) + ) + end + ] + | sort_by(.id) + | last // empty + end + ' <<< "${pipelines}" + )"; then + sleep "${POLL_INTERVAL_SECONDS}" + continue + fi + + if [[ -z "${pipeline}" ]]; then + sleep "${POLL_INTERVAL_SECONDS}" + continue + fi + + pipeline_id="$( + jq -er \ + '.id | select(. != null) | tostring' \ + <<< "${pipeline}" + )" + + echo "Monitoring GitLab pipeline ${pipeline_id}" + else + if ! pipeline="$( + gitlab_get \ + "${GITLAB_URL}/api/v4/projects/${GITLAB_PROJECT_ID}/pipelines/${pipeline_id}" + )"; then + sleep "${POLL_INTERVAL_SECONDS}" + continue + fi + fi + + status="$( + jq -er \ + '.status | select(type == "string")' \ + <<< "${pipeline}" + )" + + pipeline_url="$( + jq -r '.web_url // empty' <<< "${pipeline}" + )" + + # Do not allow an unexpected API response to place an arbitrary + # external URL into the GitHub status. + if [[ -n "${pipeline_url}" && + "${pipeline_url}" == "${GITLAB_URL}/"* ]]; then + target_url="${pipeline_url}" + fi + + if [[ "${status}" != "${last_status}" ]]; then + echo "GitLab pipeline ${pipeline_id} status: ${status}" + last_status="${status}" + fi + + case "${status}" in + success) + finish \ + success \ + "GitLab UOregon pipeline passed" \ + 0 + ;; + + failed|canceled|skipped|manual) + finish \ + failure \ + "GitLab UOregon pipeline: ${status}" \ + 1 + ;; + + created|waiting_for_resource|preparing|waiting_for_callback|pending|running|scheduled|canceling) + sleep "${POLL_INTERVAL_SECONDS}" + ;; + + *) + finish \ + error \ + "Unknown GitLab pipeline status: ${status}" \ + 1 + ;; + esac + done + + finish \ + error \ + "Timed out waiting for the GitLab UOregon pipeline" \ + 1 From 02aac22b751ccbadef30a70e896610728583d3d0 Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Tue, 25 Aug 2026 15:28:38 -0700 Subject: [PATCH 5/8] add branch back to push for testing --- .github/workflows/uoregon-gitlab-status.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/uoregon-gitlab-status.yml b/.github/workflows/uoregon-gitlab-status.yml index c344505486..7200d75e5f 100644 --- a/.github/workflows/uoregon-gitlab-status.yml +++ b/.github/workflows/uoregon-gitlab-status.yml @@ -2,7 +2,8 @@ name: GitLab UOregon CI on: push: - branches: [develop] + # TODO(CJB): remove balos1/add-uoregon-gitlab-ci from the list of branches before merging + branches: [develop, balos1/add-uoregon-gitlab-ci] pull_request_target: branches: [develop] types: [opened, synchronize, reopened] @@ -25,7 +26,9 @@ jobs: shell: bash env: COMMIT_SHA: ${{ github.event.pull_request.head.sha || github.sha }} - PR_NUMBER: ${{ github.event.pull_request.number || '' }} + # TODO(CJB): change this back to the commented outline before merging + # PR_NUMBER: ${{ github.event.pull_request.number || '' }} + PR_NUMBER: ${{ github.event.pull_request.number || (github.ref_name == 'balos1/add-uoregon-gitlab-ci' && '2080') || '' }} GITHUB_TOKEN: ${{ github.token }} GITHUB_REPOSITORY: ${{ github.repository }} From e6f68bb22b056df661c235e7ca4509b963582fd7 Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Wed, 26 Aug 2026 13:36:21 -0700 Subject: [PATCH 6/8] fix polling --- .github/workflows/uoregon-gitlab-status.yml | 13 +++++++------ .gitlab/uoregon-gitlab-ci.yml | 4 ++++ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/.github/workflows/uoregon-gitlab-status.yml b/.github/workflows/uoregon-gitlab-status.yml index 7200d75e5f..bb12002e2e 100644 --- a/.github/workflows/uoregon-gitlab-status.yml +++ b/.github/workflows/uoregon-gitlab-status.yml @@ -26,9 +26,8 @@ jobs: shell: bash env: COMMIT_SHA: ${{ github.event.pull_request.head.sha || github.sha }} - # TODO(CJB): change this back to the commented outline before merging - # PR_NUMBER: ${{ github.event.pull_request.number || '' }} - PR_NUMBER: ${{ github.event.pull_request.number || (github.ref_name == 'balos1/add-uoregon-gitlab-ci' && '2080') || '' }} + GITHUB_BRANCH: ${{ github.event.pull_request.head.ref || github.ref_name }} + PR_NUMBER: ${{ github.event.pull_request.number || '' }} GITHUB_TOKEN: ${{ github.token }} GITHUB_REPOSITORY: ${{ github.repository }} @@ -161,7 +160,7 @@ jobs: ) # The develop ref is exact and can be filtered server-side. - if [[ -z "${PR_NUMBER}" ]]; then + if [[ "${GITHUB_BRANCH}" == "develop" ]]; then query_args+=(--data-urlencode "ref=develop") fi @@ -178,6 +177,7 @@ jobs: jq -c \ --arg sha "${COMMIT_SHA}" \ --arg source "${GITLAB_PIPELINE_SOURCE}" \ + --arg branch "${GITHUB_BRANCH}" \ --arg prefix "${ref_prefix}" ' if type != "array" then error("GitLab pipelines response is not an array") @@ -188,11 +188,12 @@ jobs: .sha == $sha and .source == $source ) - | if $prefix == "" then + | if $branch == "develop" then select(.ref == "develop") else select( - ((.ref // "") | startswith($prefix)) + .ref == $branch + or ((.ref // "") | startswith($prefix)) ) end ] diff --git a/.gitlab/uoregon-gitlab-ci.yml b/.gitlab/uoregon-gitlab-ci.yml index c3117c86d8..58cab622a2 100644 --- a/.gitlab/uoregon-gitlab-ci.yml +++ b/.gitlab/uoregon-gitlab-ci.yml @@ -36,6 +36,10 @@ stages: # Direct pushes to the mirrored develop branch. - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' when: always + # Temporary exception while validating the GitHub status bridge in PR #2080. + # Remove this rule after the bridge is merged and validated. + - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "balos1/add-uoregon-gitlab-ci"' + when: always # GitHub PRs mirrored as branches named pr_. - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH =~ /^pr[0-9]+(_.*)?$/' when: always From d790fc79640fb86e33a6a764dfc5df5c9f74bdd9 Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Thu, 27 Aug 2026 14:40:53 -0700 Subject: [PATCH 7/8] delay 90 minutes --- .github/workflows/uoregon-gitlab-status.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/uoregon-gitlab-status.yml b/.github/workflows/uoregon-gitlab-status.yml index bb12002e2e..5f7823e026 100644 --- a/.github/workflows/uoregon-gitlab-status.yml +++ b/.github/workflows/uoregon-gitlab-status.yml @@ -18,8 +18,8 @@ concurrency: jobs: gitlab-pipeline: runs-on: ubuntu-latest - - timeout-minutes: 190 + environment: delayed-90-minutes + timeout-minutes: 130 steps: - name: Wait for GitLab pipeline @@ -37,7 +37,7 @@ jobs: GITLAB_PIPELINE_SOURCE: push STATUS_CONTEXT: gitlab/uoregon - POLL_TIMEOUT_SECONDS: "10800" + POLL_TIMEOUT_SECONDS: "7200" POLL_INTERVAL_SECONDS: "30" run: | From dfa534a00262473b5d235e9d03e93d9abc855915 Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Thu, 27 Aug 2026 15:22:35 -0700 Subject: [PATCH 8/8] typo --- .github/workflows/uoregon-gitlab-status.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/uoregon-gitlab-status.yml b/.github/workflows/uoregon-gitlab-status.yml index 5f7823e026..5467cb129a 100644 --- a/.github/workflows/uoregon-gitlab-status.yml +++ b/.github/workflows/uoregon-gitlab-status.yml @@ -2,7 +2,7 @@ name: GitLab UOregon CI on: push: - # TODO(CJB): remove balos1/add-uoregon-gitlab-ci from the list of branches before merging + # TODO(CJB): remove balos1/add-uoregon-gitlab-ci from the list of branches after merging branches: [develop, balos1/add-uoregon-gitlab-ci] pull_request_target: branches: [develop]