diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 22f6664407..a4f839dda9 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,5 +1,5 @@ ############################################################################### -# Copyright (c) 2016-24, Lawrence Livermore National Security, LLC +# Copyright (c) 2016-25, Lawrence Livermore National Security, LLC # and RAJA project contributors. See the RAJA/LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) @@ -11,43 +11,39 @@ # at Lawrence Livermore National Laboratory (LLNL). # This entire pipeline is LLNL-specific # -# Important note: This file is a template provided by llnl/radiuss-shared-ci. -# Remains to set variable values, change the reference to the radiuss-shared-ci -# repo, opt-in and out optional features. The project can then extend it with -# additional stages. +# This file uses GitLab CI Components from radiuss-shared-ci (requires GitLab 17.0+). +# Components provide better versioning, type-safe inputs, and cleaner syntax. # -# In addition, each project should copy over and complete: -# - .gitlab/custom-jobs-and-variables.yml -# - .gitlab/subscribed-pipelines.yml -# -# The jobs should be specified in a file local to the project, -# - .gitlab/jobs/${CI_MACHINE}.yml -# or generated (see LLNL/Umpire for an example). +# In addition, each project should have: +# - .gitlab/custom-jobs.yml - Job templates for child pipelines +# - .gitlab/custom-variables.yml - Machine-specific variables +# - .gitlab/jobs/${CI_MACHINE}.yml - Machine-specific job definitions +############################################################################### + +############################################################################### +# VARIABLES ############################################################################### -# We define the following GitLab pipeline variables: variables: -##### LC GITLAB CONFIGURATION -# Use an LLNL service user to run CI. This prevents from running pipelines as an -# actual user. + +# LC GITLAB CONFIGURATION +# Use an LLNL service user to run CI. This prevents from running pipelines as +# an actual user. LLNL_SERVICE_USER: rajasa # Use the service user workspace. Solves permission issues, stores everything # at the same location whoever triggers a pipeline. # CUSTOM_CI_BUILDS_DIR: "/usr/workspace/rajasa/gitlab-runner" -# Submodules: We don't need to fetch dependencies handled by Spack. +# Optimize submodules usage: only fetch the ones we need. +# Note: We don't need to fetch dependencies handled by Spack. GIT_SUBMODULE_STRATEGY: normal GIT_SUBMODULE_DEPTH: 1 GIT_SUBMODULE_UPDATE_FLAGS: --jobs 3 GIT_SUBMODULE_PATHS: tpl/desul scripts/radiuss-spack-configs scripts/uberenv -##### PROJECT VARIABLES +# PROJECT VARIABLES MP_BRANCH: "develop" -# We build the projects in the CI clone directory (used in -# script/gitlab/build_and_test.sh script). -# TODO: add a clean-up mechanism. - BUILD_ROOT: ${CI_PROJECT_DIR} -##### SHARED_CI CONFIGURATION +# SHARED_CI CONFIGURATION # Required information about GitHub repository GITHUB_PROJECT_NAME: "RAJA" GITHUB_PROJECT_ORG: "LLNL" @@ -57,34 +53,176 @@ variables: JOB_CMD: value: "./scripts/gitlab/build_and_test.sh" expand: false -# Override the pattern describing branches that will skip the "draft PR filter -# test". Add protected branches here. See default value in -# preliminary-ignore-draft-pr.yml. - ALWAYS_RUN_PATTERN: "^develop$|^main$|^v[0-9.]*-RC$" -# We organize the build-and-test stage with sub-pipelines. Each sub-pipeline -# corresponds to a test batch on a given machine. +############################################################################### +# MAIN PIPELINE STAGES +############################################################################### +# IMPORTANT: You must define stages yourself to allow customization. +# The following stages are REQUIRED by RADIUSS Shared CI components: -# High level stages stages: - - prerequisites - - build-and-test + - prerequisites # Required: machine availability checks + - build-and-test # Required: build and test jobs - multi-project -# Template for jobs triggering a build-and-test sub-pipeline: -.build-and-test: - stage: build-and-test +############################################################################### +# INCLUDES +############################################################################### + +include: + # Sets ID tokens for every job using `default:` + - project: 'lc-templates/id_tokens' + file: 'id_tokens.yml' + + # Base pipeline templates and utilities + - component: $CI_SERVER_FQDN/radiuss/radiuss-shared-ci/base-pipeline@v2025.12.0 + inputs: + github_project_name: $GITHUB_PROJECT_NAME + github_project_org: $GITHUB_PROJECT_ORG + github_token: $GITHUB_TOKEN + + # Draft PR filter + - component: $CI_SERVER_FQDN/radiuss/radiuss-shared-ci/utility-draft-pr-filter@v2025.12.0 + inputs: + github_token: $GITHUB_TOKEN + github_project_name: $GITHUB_PROJECT_NAME + github_project_org: $GITHUB_PROJECT_ORG + always_run_pattern: "^develop$|^main$|^v[0-9.]*-RC$" + + # Local custom variables (used for component inputs and forwarded to child pipelines) + - local: '.gitlab/custom-variables.yml' + +############################################################################### +# MACHINE PIPELINES +############################################################################### +# We organize the build-and-test stage with sub-pipelines. Each sub-pipeline +# corresponds to a test batch on a given machine. +# +# Note: .machine-check template is provided by the base-pipeline component +# and includes better error handling, validation, and GitHub status reporting. +# Trigger a build-and-test pipeline for each machine. +# Comment out the machine blocks you don't need. + +# One job to generate the job list for all the subpipelines +generate-job-lists: + stage: prerequisites + tags: [shell, oslic] + variables: + RADIUSS_JOBS_PATH: "scripts/radiuss-spack-configs/gitlab/radiuss-jobs" + LOCAL_JOBS_PATH: ".gitlab/jobs" + script: + - cat ${RADIUSS_JOBS_PATH}/dane.yml ${LOCAL_JOBS_PATH}/dane.yml > dane-jobs.yml + - cat ${RADIUSS_JOBS_PATH}/matrix.yml ${LOCAL_JOBS_PATH}/matrix.yml > matrix-jobs.yml + - cat ${RADIUSS_JOBS_PATH}/corona.yml ${LOCAL_JOBS_PATH}/corona.yml > corona-jobs.yml + - cat ${RADIUSS_JOBS_PATH}/tioga.yml ${LOCAL_JOBS_PATH}/tioga.yml > tioga-jobs.yml + - cat ${RADIUSS_JOBS_PATH}/tuolumne.yml ${LOCAL_JOBS_PATH}/tuolumne.yml > tuolumne-jobs.yml + artifacts: + paths: + - dane-jobs.yml + - matrix-jobs.yml + - corona-jobs.yml + - tioga-jobs.yml + - tuolumne-jobs.yml + +# DANE +dane-up-check: + extends: [.dane, .machine-check] + +dane-build-and-test: + extends: [.dane, .build-and-test] + needs: [dane-up-check, generate-job-lists] + trigger: + include: + - component: $CI_SERVER_FQDN/radiuss/radiuss-shared-ci/dane-pipeline@v2025.12.0 + inputs: + job_cmd: $JOB_CMD + shared_alloc: $DANE_SHARED_ALLOC + job_alloc: $DANE_JOB_ALLOC + github_project_name: $GITHUB_PROJECT_NAME + github_project_org: $GITHUB_PROJECT_ORG + - local: '.gitlab/custom-jobs.yml' + - artifact: 'dane-jobs.yml' + job: 'generate-job-lists' + +# MATRIX +matrix-up-check: + extends: [.matrix, .machine-check] + +matrix-build-and-test: + extends: [.matrix, .build-and-test] + needs: [matrix-up-check, generate-job-lists] trigger: include: - - local: '.gitlab/custom-jobs-and-variables.yml' - - project: 'radiuss/radiuss-shared-ci' - ref: 'v2025.09.1' - file: 'pipelines/${CI_MACHINE}.yml' - - artifact: '${CI_MACHINE}-jobs.yml' + - component: $CI_SERVER_FQDN/radiuss/radiuss-shared-ci/matrix-pipeline@v2025.12.0 + inputs: + job_cmd: $JOB_CMD + shared_alloc: $MATRIX_SHARED_ALLOC + job_alloc: $MATRIX_JOB_ALLOC + github_project_name: $GITHUB_PROJECT_NAME + github_project_org: $GITHUB_PROJECT_ORG + - local: '.gitlab/custom-jobs.yml' + - artifact: 'matrix-jobs.yml' + job: 'generate-job-lists' + +# CORONA +corona-up-check: + extends: [.corona, .machine-check] + +corona-build-and-test: + extends: [.corona, .build-and-test] + needs: [corona-up-check, generate-job-lists] + trigger: + include: + - component: $CI_SERVER_FQDN/radiuss/radiuss-shared-ci/corona-pipeline@v2025.12.0 + inputs: + job_cmd: $JOB_CMD + shared_alloc: $CORONA_SHARED_ALLOC + job_alloc: $CORONA_JOB_ALLOC + github_project_name: $GITHUB_PROJECT_NAME + github_project_org: $GITHUB_PROJECT_ORG + - local: '.gitlab/custom-jobs.yml' + - artifact: 'corona-jobs.yml' + job: 'generate-job-lists' + +# TIOGA +tioga-up-check: + extends: [.tioga, .machine-check] + +tioga-build-and-test: + extends: [.tioga, .build-and-test] + needs: [tioga-up-check, generate-job-lists] + trigger: + include: + - component: $CI_SERVER_FQDN/radiuss/radiuss-shared-ci/tioga-pipeline@v2025.12.0 + inputs: + job_cmd: $JOB_CMD + shared_alloc: $TIOGA_SHARED_ALLOC + job_alloc: $TIOGA_JOB_ALLOC + github_project_name: $GITHUB_PROJECT_NAME + github_project_org: $GITHUB_PROJECT_ORG + - local: '.gitlab/custom-jobs.yml' + - artifact: 'tioga-jobs.yml' + job: 'generate-job-lists' + +# TUOLUMNE +tuolumne-up-check: + extends: [.tuolumne, .machine-check] + +tuolumne-build-and-test: + extends: [.tuolumne, .build-and-test] + needs: [tuolumne-up-check, generate-job-lists] + trigger: + include: + - component: $CI_SERVER_FQDN/radiuss/radiuss-shared-ci/tuolumne-pipeline@v2025.12.0 + inputs: + job_cmd: $JOB_CMD + shared_alloc: $TUOLUMNE_SHARED_ALLOC + job_alloc: $TUOLUMNE_JOB_ALLOC + github_project_name: $GITHUB_PROJECT_NAME + github_project_org: $GITHUB_PROJECT_ORG + - local: '.gitlab/custom-jobs.yml' + - artifact: 'tuolumne-jobs.yml' job: 'generate-job-lists' - strategy: depend - forward: - pipeline_variables: true # If testing develop branch, trigger RAJAPerf pipeline with this version of # RAJA. @@ -100,14 +238,3 @@ trigger-rajaperf: trigger: project: radiuss/rajaperf branch: develop - -include: - # Sets ID tokens for every job using `default:` - - project: 'lc-templates/id_tokens' - file: 'id_tokens.yml' - # [Optional] checks preliminary to running the actual CI test - - project: 'radiuss/radiuss-shared-ci' - ref: 'v2025.09.1' - file: 'utilities/preliminary-ignore-draft-pr.yml' - # pipelines subscribed by the project - - local: '.gitlab/subscribed-pipelines.yml' diff --git a/.gitlab/custom-jobs-and-variables.yml b/.gitlab/custom-jobs-and-variables.yml deleted file mode 100644 index b578273ed2..0000000000 --- a/.gitlab/custom-jobs-and-variables.yml +++ /dev/null @@ -1,86 +0,0 @@ -############################################################################### -# Copyright (c) 2016-25, Lawrence Livermore National Security, LLC and RADIUSS -# project contributors. See the RAJA/LICENSE file for details. -# -# SPDX-License-Identifier: (MIT) -############################################################################### - -# We define the following GitLab pipeline variables: -variables: -# On LLNL's machines, this pipeline creates only one allocation shared among jobs -# in order to save time and resources. This allocation has to be uniquely named -# so that we are sure to retrieve it and avoid collisions. - ALLOC_NAME: ${CI_PROJECT_NAME}_ci_${CI_PIPELINE_ID} - -# Dane -# Arguments for top level allocation - DANE_SHARED_ALLOC: "--exclusive --reservation=ci --time=120 --nodes=1" -# Arguments for job level allocation - DANE_JOB_ALLOC: "--reservation=ci --nodes=1" -# Project specific variants for dane - PROJECT_DANE_VARIANTS: "~shared +openmp +vectorization +tests" -# Project specific deps for dane - PROJECT_DANE_DEPS: - -# Matrix -# Arguments for top level allocation - MATRIX_SHARED_ALLOC: "--exclusive --partition=pci --time=60 --nodes=1" -# Arguments for job level allocation - MATRIX_JOB_ALLOC: "--partition=pci --nodes=1" -# Project specific variants for matrix - PROJECT_MATRIX_VARIANTS: "~shared +cuda cuda_arch=90 +tests" -# Project specific deps for matrix - PROJECT_MATRIX_DEPS: - -# Corona -# Arguments for top level allocation - CORONA_SHARED_ALLOC: "--exclusive --time-limit=60m --nodes=1 -o per-resource.count=2" -# Arguments for job level allocation - CORONA_JOB_ALLOC: "--nodes=1 --begin-time=+5s" -# Project specific variants for corona - PROJECT_CORONA_VARIANTS: "~shared ~openmp +vectorization +tests" -# Project specific deps for corona - PROJECT_CORONA_DEPS: - -# Tioga -# Arguments for top level allocation - TIOGA_SHARED_ALLOC: "--exclusive --queue=pci --time-limit=60m --nodes=1 -o per-resource.count=2" -# Arguments for job level allocation - TIOGA_JOB_ALLOC: "--nodes=1 --begin-time=+5s" -# Project specific variants for corona - PROJECT_TIOGA_VARIANTS: "~shared +openmp +vectorization +tests" -# Project specific deps for corona - PROJECT_TIOGA_DEPS: - -# Tuolumne -# Arguments for top level allocation - TUOLUMNE_SHARED_ALLOC: "--exclusive --queue=pci --time-limit=90m --nodes=1 -o per-resource.count=2" -# Arguments for job level allocation - TUOLUMNE_JOB_ALLOC: "--nodes=1 --begin-time=+5s" -# Project specific variants for corona - PROJECT_TUOLUMNE_VARIANTS: "~shared +openmp +vectorization +tests" -# Project specific deps for corona - PROJECT_TUOLUMNE_DEPS: - -# Configuration shared by build and test jobs specific to this project. -# Not all configuration can be shared. Here projects can fine tune the -# CI behavior. -.custom_job: - artifacts: - reports: - junit: junit.xml - name: "${CI_PROJECT_NAME}-${CI_MACHINE}-${CI_JOB_NAME}-${CI_PIPELINE_ID}" - paths: - - ./*.cmake - -.reproducer_vars: - script: - - | - echo -e " - # Required variables \n - export MODULE_LIST=\"${MODULE_LIST}\" \n - export SPEC=\"${SPEC//\"/\\\"}\" \n - # Allow to set job script for debugging (only this differs from CI) \n - export DEBUG_MODE=true \n - # Using the CI build cache is optional and requires a token. Set it like so: \n - # export REGISTRY_TOKEN=\"\" \n" diff --git a/.gitlab/custom-jobs.yml b/.gitlab/custom-jobs.yml new file mode 100644 index 0000000000..80ca94fd44 --- /dev/null +++ b/.gitlab/custom-jobs.yml @@ -0,0 +1,37 @@ +############################################################################### +# Copyright (c) 2016-25, Lawrence Livermore National Security, LLC and RADIUSS +# project contributors. See the RAJA/LICENSE file for details. +# +# SPDX-License-Identifier: (MIT) +############################################################################### + +# This file defines JOB TEMPLATES ONLY. +# It is included in CHILD pipelines (via trigger: include:) to provide +# templates that your jobs can extend. + +############################################################################### +# JOB CUSTOMIZATION TEMPLATES +############################################################################### + +# Configuration shared by build and test jobs specific to this project. +# Not all configuration can be shared. Here projects can fine tune the +# CI behavior. +.custom_job: + artifacts: + reports: + junit: junit.xml + name: "${CI_PROJECT_NAME}-${CI_MACHINE}-${CI_JOB_NAME}-${CI_PIPELINE_ID}" + paths: + - ./*.cmake + +.reproducer_vars: + script: + - | + echo -e " + # Required variables \n + export MODULE_LIST=\"${MODULE_LIST}\" \n + export SPEC=\"${SPEC//\"/\\\"}\" \n + # Allow to set job script for debugging (only this differs from CI) \n + export DEBUG_MODE=true \n + # Using the CI build cache is optional and requires a token. Set it like so: \n + # export REGISTRY_TOKEN=\"\" \n" diff --git a/.gitlab/custom-variables.yml b/.gitlab/custom-variables.yml new file mode 100644 index 0000000000..5cf8f0f548 --- /dev/null +++ b/.gitlab/custom-variables.yml @@ -0,0 +1,60 @@ +############################################################################### +# Copyright (c) 2016-25, Lawrence Livermore National Security, LLC and RADIUSS +# project contributors. See the RAJA/LICENSE file for details. +# +# SPDX-License-Identifier: (MIT) +############################################################################### + +# This file defines project-specific VARIABLES ONLY. +# It is included in the PARENT pipeline (.gitlab-ci.yml) to provide +# variables that are passed as component inputs and forwarded to child pipelines. + +############################################################################### +# MACHINE-SPECIFIC ALLOCATION VARIABLES +############################################################################### + +variables: + # Allocation name (used for shared allocations) + ALLOC_NAME: ${CI_PROJECT_NAME}_ci_${CI_PIPELINE_ID} + + # Dane (SLURM) allocation settings + DANE_SHARED_ALLOC: "--exclusive --reservation=ci --time=120 --nodes=1" + # Note: we repeat the reservation, helpful when jobs are manually re-triggered. + DANE_JOB_ALLOC: "--reservation=ci --nodes=1" + # Project specific variants for dane + PROJECT_DANE_VARIANTS: "~shared +openmp +vectorization +tests" + # Project specific deps for dane + PROJECT_DANE_DEPS: "" + + # Matrix (SLURM) allocation settings + MATRIX_SHARED_ALLOC: "--exclusive --partition=pci --time=60 --nodes=1" + # Note: we repeat the reservation, helpful when jobs are manually re-triggered. + MATRIX_JOB_ALLOC: "--partition=pci --nodes=1" + # Project specific variants for matrix + PROJECT_MATRIX_VARIANTS: "~shared +cuda cuda_arch=90 +tests" + # Project specific deps for matrix + PROJECT_MATRIX_DEPS: "" + + # Corona (flux) allocation settings + CORONA_SHARED_ALLOC: "--exclusive --time-limit=60m --nodes=1 -o per-resource.count=2" + CORONA_JOB_ALLOC: "--nodes=1 --begin-time=+5s" + # Project specific variants for corona + PROJECT_CORONA_VARIANTS: "~shared ~openmp +vectorization +tests" + # Project specific deps for corona + PROJECT_CORONA_DEPS: "" + + # Tioga (flux) allocation settings + TIOGA_SHARED_ALLOC: "--exclusive --queue=pci --time-limit=60m --nodes=1 -o per-resource.count=2" + TIOGA_JOB_ALLOC: "--nodes=1 --begin-time=+5s" + # Project specific variants for tioga + PROJECT_TIOGA_VARIANTS: "~shared +openmp +vectorization +tests" + # Project specific deps for tioga + PROJECT_TIOGA_DEPS: "" + + # Tuolumne (flux) allocation settings + TUOLUMNE_SHARED_ALLOC: "--exclusive --queue=pci --time-limit=90m --nodes=1 -o per-resource.count=2" + TUOLUMNE_JOB_ALLOC: "--nodes=1 --begin-time=+5s" + # Project specific variants for tuolumne + PROJECT_TUOLUMNE_VARIANTS: "~shared +openmp +vectorization +tests" + # Project specific deps for tuolumne + PROJECT_TUOLUMNE_DEPS: "" diff --git a/.gitlab/jobs/matrix.yml b/.gitlab/jobs/matrix.yml index aab48b372c..0008ca25f2 100644 --- a/.gitlab/jobs/matrix.yml +++ b/.gitlab/jobs/matrix.yml @@ -18,7 +18,7 @@ # when possible so that the comparison with the original job is easier. # Shared job uses toolchain %clang-18-gcc-13, replaced with %llvm@=18.1.8 below -clang_18_1_1_gcc_13_cuda_12_6_0: +clang_18_1_8_gcc_13_cuda_12_6_0: extends: .job_on_matrix variables: ON_MATRIX: "OFF" diff --git a/.gitlab/subscribed-pipelines.yml b/.gitlab/subscribed-pipelines.yml deleted file mode 100644 index 1502195750..0000000000 --- a/.gitlab/subscribed-pipelines.yml +++ /dev/null @@ -1,155 +0,0 @@ -############################################################################### -# Copyright (c) 2016-25, Lawrence Livermore National Security, LLC and RADIUSS -# project contributors. See the RAJA/LICENSE file for details. -# -# SPDX-License-Identifier: (MIT) -############################################################################### - -# The template job to test whether a machine is up. -# Expects CI_MACHINE defined to machine name. -.machine-check: - stage: prerequisites - tags: [shell, oslic] - variables: - GIT_STRATEGY: none - script: - - | - if [[ $(jq '.[env.CI_MACHINE].total_nodes_up' /usr/global/tools/lorenz/data/loginnodeStatus) == 0 ]] - then - echo -e "\e[31mNo node available on ${CI_MACHINE}\e[0m" - curl --url "https://api.github.com/repos/${GITHUB_PROJECT_ORG}/${GITHUB_PROJECT_NAME}/statuses/${CI_COMMIT_SHA}" \ - --header 'Content-Type: application/json' \ - --header "authorization: Bearer ${GITHUB_TOKEN}" \ - --data "{ \"state\": \"failure\", \"target_url\": \"${CI_PIPELINE_URL}\", \"description\": \"GitLab ${CI_MACHINE} down\", \"context\": \"ci/gitlab/${CI_MACHINE}\" }" - exit 1 - fi - -### -# Trigger a build-and-test pipeline for a machine. -# Comment the jobs for machines you do not need. -### - -# One job to generate the job list for all the subpipelines -generate-job-lists: - stage: prerequisites - tags: [shell, oslic] - variables: - RADIUSS_JOBS_PATH: "scripts/radiuss-spack-configs/gitlab/radiuss-jobs" - LOCAL_JOBS_PATH: ".gitlab/jobs" - script: - - cat ${RADIUSS_JOBS_PATH}/dane.yml ${LOCAL_JOBS_PATH}/dane.yml > dane-jobs.yml - - cat ${RADIUSS_JOBS_PATH}/matrix.yml ${LOCAL_JOBS_PATH}/matrix.yml > matrix-jobs.yml - - cat ${RADIUSS_JOBS_PATH}/corona.yml ${LOCAL_JOBS_PATH}/corona.yml > corona-jobs.yml - - cat ${RADIUSS_JOBS_PATH}/tioga.yml ${LOCAL_JOBS_PATH}/tioga.yml > tioga-jobs.yml - - cat ${RADIUSS_JOBS_PATH}/tuolumne.yml ${LOCAL_JOBS_PATH}/tuolumne.yml > tuolumne-jobs.yml - artifacts: - paths: - - dane-jobs.yml - - matrix-jobs.yml - - corona-jobs.yml - - tioga-jobs.yml - - tuolumne-jobs.yml - -# DANE -dane-up-check: - variables: - CI_MACHINE: "dane" - extends: [.machine-check] - rules: - # Runs except if we explicitly deactivate dane by variable. - - if: '$ON_DANE == "OFF"' - when: never - - when: on_success - -dane-build-and-test: - variables: - CI_MACHINE: "dane" - needs: [dane-up-check, generate-job-lists] - extends: [.build-and-test] - rules: - # Runs except if we explicitly deactivate dane by variable. - - if: '$ON_DANE == "OFF"' - when: never - - when: on_success - -# MATRIX -matrix-up-check: - variables: - CI_MACHINE: "matrix" - extends: [.machine-check] - rules: - # Runs except if we explicitly deactivate matrix by variable. - - if: '$ON_MATRIX == "OFF"' - when: never - - when: on_success - -matrix-build-and-test: - variables: - CI_MACHINE: "matrix" - needs: [matrix-up-check, generate-job-lists] - extends: [.build-and-test] - rules: - # Runs except if we explicitly deactivate matrix by variable. - - if: '$ON_MATRIX == "OFF"' - when: never - - when: on_success - -# CORONA -corona-up-check: - variables: - CI_MACHINE: "corona" - extends: [.machine-check] - rules: - - if: '$ON_CORONA == "OFF"' - when: never - - when: on_success - -corona-build-and-test: - variables: - CI_MACHINE: "corona" - needs: [corona-up-check, generate-job-lists] - extends: [.build-and-test] - rules: - - if: '$ON_CORONA == "OFF"' - when: never - - when: on_success - -# TIOGA -tioga-up-check: - variables: - CI_MACHINE: "tioga" - extends: [.machine-check] - rules: - - if: '$ON_TIOGA == "OFF"' - when: never - - when: on_success - -tioga-build-and-test: - variables: - CI_MACHINE: "tioga" - needs: [tioga-up-check, generate-job-lists] - extends: [.build-and-test] - rules: - - if: '$ON_TIOGA == "OFF"' - when: never - - when: on_success - -# TUOLUMNE -tuolumne-up-check: - variables: - CI_MACHINE: "tuolumne" - extends: [.machine-check] - rules: - - if: '$ON_TUOLUMNE == "OFF"' - when: never - - when: on_success - -tuolumne-build-and-test: - variables: - CI_MACHINE: "tuolumne" - needs: [tuolumne-up-check, generate-job-lists] - extends: [.build-and-test] - rules: - - if: '$ON_TUOLUMNE == "OFF"' - when: never - - when: on_success diff --git a/docs/sphinx/dev_guide/ci.rst b/docs/sphinx/dev_guide/ci.rst index 883ab8d016..2441cb4c0a 100644 --- a/docs/sphinx/dev_guide/ci.rst +++ b/docs/sphinx/dev_guide/ci.rst @@ -126,8 +126,9 @@ collaboratively with other projects. These include * `RADIUSS Shared CI `_, a centralized framework for software testing with GitLab CI on LC - machines. The project is developed on GitHub and is mirrored to the LC - CZ GitLab instance. + machines. The project is developed on GitHub and is mirrored to the LC + CZ GitLab instance. As of v2025.12.0, RADIUSS Shared CI provides + reusable GitLab CI Components (requires GitLab 17.0+). * `Spack `_, a multi-platform package manager that builds and installs HPC software stacks. * `Uberenv `_, a Python script @@ -142,10 +143,15 @@ collaboratively with other projects. These include they relate to the Spack configuration. RADIUSS Spack Configs is a submodule in RAJA that lives in ``RAJA/scripts/radiuss-spack-configs/``. -The relationships among these dependencies in a project that uses them is +The relationships among these dependencies in a project that uses them is described in the `RADIUSS Shared CI User Guide `_ along with information about how the framework works and how to set up a project to use it. +.. note:: For detailed information about the GitLab CI Components architecture + and migration from the traditional include-based configuration, see the + `RADIUSS Shared CI Components Migration Guide + `_. + .. important:: The RAJA Spack package is maintained in the `RADIUSS Spack Configs `_ project. After packages are updated there, they are pushed to the Spack repo on GitHub via @@ -163,45 +169,47 @@ GitLab CI Testing Files (specific to LC CZ) The following figure shows directories and files in the RAJA project that support LC GitLab CI testing. -.. figure:: ./figures/RAJA-Gitlab-Files.png +.. figure:: ./figures/RAJA-GitLab-Files.png The figure shows directories and files in the RAJA repo that support GitLab - CI testing. Files in blue are specific to the CI while those in red relates + CI testing. Files in blue are specific to CI while those in red relate to the build (Spack) environment description. The ``build_and_test.sh`` - scripts stands at the interface between CI and Spack. ``uberenv`` and - ``radiuss-spack-configs`` are both Git submodules that are shared and - maintained with other projects. + scripts drives the configuration, compilation, and testing processes in + GitLab. ``uberenv`` and ``radiuss-spack-configs`` are both Git submodules + that are shared and maintained with other projects. Briefly, these files play the following roles in GitLab CI testing: * The `RAJA/.gitlab-ci.yml `_ file is the - top-level file for GitLab CI configuration. It defines variables used - throughout the CI configuration such as GitHub project name and - organization, service user account name, version information for RADIUSS - Shared CI project we are using, and top-level information for triggering - build-and-test sub-pipelines. + top-level file for GitLab CI configuration. It uses GitLab CI Components + (requires GitLab 17.0+) from the RADIUSS Shared CI project. It defines + variables used throughout the CI configuration such as GitHub project name + and organization, service user account name, and includes components for + machine-specific pipelines and utilities. * The `RAJA/.uberenv_config.json `_ file defines information about Spack such as Spack version we are using, location of Spack packages, etc. * The `RAJA/.gitlab `_ - directory contains several files that connect RAJA GitLab pipelines to - shared pipelines defined in the `RADIUSS Shared CI - `_ project, as well as - RAJA-specific jobs and global job customizations that we use, such as job - time limits, etc. These files are modified from templates provided by the - RADIUSS Shared CI project. - * In particular, `RAJA/.gitlab/jobs + directory contains RAJA-specific CI configuration files: + + * ``.gitlab/custom-jobs.yml`` - Job templates for child pipelines, created + and customized by the project based on templates from RADIUSS Shared CI. + * ``.gitlab/custom-variables.yml`` - Machine-specific allocation variables + and build configurations, created and customized by the project based on + templates from RADIUSS Shared CI. + + * The `RAJA/.gitlab/jobs `_ directory - contains the files defining RAJA specific jobs per machine. This file is + contains files defining RAJA specific jobs per machine. These files are appended to the list of shared CI jobs provided by `RADIUSS Spack Configs - `_. Each job ultimately consists - in one Spack spec. + `_. Each job ultimately + corresponds to one Spack spec. * The `RAJA/scripts/gitlab/build_and_test.sh `_ - contains commands that are run during the RAJA build and test process. It is - set in the CI using the ``JOB_CMD`` variable. + script contains commands that are run during the RAJA build and test + process. It is set in the CI using the ``JOB_CMD`` variable. In the following sections, we discuss how these files are used in the steps of the RAJA GitLab CI testing process summarized above. @@ -211,16 +219,63 @@ steps of the RAJA GitLab CI testing process summarized above. Launching CI pipelines (step 2) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -In **step 2** of the diagram above, GitLab launches RAJA test pipelines +In **step 2** of the diagram above, GitLab launches RAJA test pipelines starting with the content of the ``RAJA/.gitlab-ci.yml`` file described above. -Most importantly, this file identifies the location of two files -`RAJA/.gitlab/subscribed-pipelines.yml `_ and -`RAJA/.gitlab/custom-jobs-and-variables.yml `_. -The ``subscribed-pipelines.yml`` file connects the RAJA GitLab environment to -the platform and pipelines defined in the RADIUSS Shared CI project. -The ``custom-jobs-and-variables.yml`` file defines how resources are -allocated to run test jobs on various LC platforms and common build -configuration variants for those platforms +This file includes GitLab CI Components directly from the RADIUSS Shared CI +project using the syntax +``component: $CI_SERVER_FQDN/radiuss/radiuss-shared-ci/@``. +The available components include: + + * ``base-pipeline`` - Provides core templates for machine availability checks + and pipeline orchestration + * ``utility-draft-pr-filter`` - Filters out draft pull requests + * Machine-specific pipeline components (``dane-pipeline``, ``matrix-pipeline``, + ``corona-pipeline``, ``tioga-pipeline``, ``tuolumne-pipeline``, + ``lassen-pipeline``) - Define the build and test workflows for each machine + +.. note:: **Component Versioning:** Components are versioned using the + ``@`` syntax (e.g., ``@v2025.12.0``). RAJA currently uses + ``@v2025.12.0``. When updating to a new version of RADIUSS Shared CI + components, all component references in ``.gitlab-ci.yml`` should be + updated to use the same version to ensure consistency. Version numbers + follow the ``v..`` format. + +Machine pipelines are defined inline in the ``.gitlab-ci.yml`` file using +trigger syntax with component includes. Each project creates and customizes +``.gitlab/custom-variables.yml`` locally (based on templates from RADIUSS +Shared CI) to define allocation settings for each machine, and +``.gitlab/custom-jobs.yml`` to define job-specific templates and behaviors. + +Component Inputs +"""""""""""""""" + +Components accept inputs that configure their behavior. The main inputs used are: + +**Base Pipeline Component:** + * ``github_project_name`` - The GitHub project name (e.g., "RAJA") + * ``github_project_org`` - The GitHub organization (e.g., "LLNL") + * ``github_token`` - Token for GitHub API access (typically ``$GITHUB_TOKEN``) + +**Draft PR Filter Component:** + * ``github_token``, ``github_project_name``, ``github_project_org`` - Same as above + * ``always_run_pattern`` - Regex pattern for branches that should always run + (e.g., ``"^develop$|^main$|^v[0-9.]*-RC$"``) + +**Machine Pipeline Components** (dane, matrix, corona, tioga, tuolumne, lassen): + * ``job_cmd`` - The command to run for each job (e.g., ``"./scripts/gitlab/build_and_test.sh"``) + * ``shared_alloc`` - Scheduler allocation for the shared allocation job + (e.g., ``"--exclusive --time=120 --nodes=1"`` for SLURM) + * ``job_alloc`` - Scheduler allocation for individual jobs within the shared allocation + (e.g., ``"--nodes=1"`` for SLURM) + * ``github_project_name``, ``github_project_org`` - For status reporting + +Allocation settings are defined in ``.gitlab/custom-variables.yml`` and vary by +machine and scheduler type (SLURM for dane/matrix, flux for corona/tioga/tuolumne, +LSF for lassen). For example:: + + # Dane (SLURM) allocation settings + DANE_SHARED_ALLOC: "--exclusive --reservation=ci --time=120 --nodes=1" + DANE_JOB_ALLOC: "--reservation=ci --nodes=1" Each job that is run is defined by a Spack spec in one of two places, depending on whether it is *shared* with other projects or it is specific to RAJA. The diff --git a/docs/sphinx/dev_guide/ci_tasks.rst b/docs/sphinx/dev_guide/ci_tasks.rst index e5c77da403..e99291de43 100644 --- a/docs/sphinx/dev_guide/ci_tasks.rst +++ b/docs/sphinx/dev_guide/ci_tasks.rst @@ -125,11 +125,12 @@ there, modify the job entry, and create a pull request. Changing run parameters ^^^^^^^^^^^^^^^^^^^^^^^ -The parameters for each system/scheduler on which we run GitLab CI for -RAJA, such as job time limits, resource allocations, etc. are defined in the -``RAJA/.gitlab/custom-jobs-and-variables.yml`` file. This information can -remain as is, for the most part, and should not be changed unless absolutely -necessary. +The parameters for each system/scheduler on which we run GitLab CI for RAJA, +such as job time limits, resource allocations, etc. are defined in the +``RAJA/.gitlab/custom-variables.yml`` file. Job-specific templates and +customizations are defined in ``RAJA/.gitlab/custom-jobs.yml``. This +information can remain as is, for the most part, and should not be changed +unless absolutely necessary. For example, sometimes a particular job will take longer to build and run than the default allotted time for jobs on a machine. In this case, the time for the @@ -409,10 +410,11 @@ Specifically, * The RAJA Performance Suite GitLab CI process is driven by the `RAJAPerf/.gitlab-ci.yml - `_ file. - * The ``custom-jobs-and-variables.yml`` and ``subscribed-pipelines.yml`` - files reside in the `RAJAPerf/.gitlab - `_ directory. + `_ file, + which uses GitLab CI Components from radiuss-shared-ci. + * The ``custom-jobs.yml`` and ``custom-variables.yml`` files reside in + `RAJAPerf/.gitlab + `_. * The ``build_and_test.sh`` script resides in the `RAJAPerf/scripts/gitlab `_ directory. * The `RAJAPerf/Dockerfile diff --git a/docs/sphinx/dev_guide/figures/RAJA-GitLab-Files.png b/docs/sphinx/dev_guide/figures/RAJA-GitLab-Files.png new file mode 100644 index 0000000000..583edbdf92 Binary files /dev/null and b/docs/sphinx/dev_guide/figures/RAJA-GitLab-Files.png differ diff --git a/docs/sphinx/dev_guide/figures/RAJA-Gitlab-Files.png b/docs/sphinx/dev_guide/figures/RAJA-Gitlab-Files.png deleted file mode 100644 index c0704c3889..0000000000 Binary files a/docs/sphinx/dev_guide/figures/RAJA-Gitlab-Files.png and /dev/null differ