From 81f1e6b6a2c3fbbb79582054b49d0c92578f1248 Mon Sep 17 00:00:00 2001 From: Giorgis Georgakoudis Date: Fri, 10 Oct 2025 20:46:08 -0700 Subject: [PATCH 1/5] Update gitlab ci to run on tioga - Remove defunct ruby, lassen job files - Add build-and-test script - Add tioga job file --- .gitlab-ci.yml | 2 +- .gitlab/custom-jobs-and-variables.yml | 4 +- .gitlab/jobs/ruby.yml | 52 -------------------------- .gitlab/jobs/{lassen.yml => tioga.yml} | 16 +++----- .gitlab/subscribed-pipelines.yml | 20 +++++----- buildscripts/gitlab/build-and-test.sh | 34 +++++++++++++++++ 6 files changed, 52 insertions(+), 76 deletions(-) delete mode 100644 .gitlab/jobs/ruby.yml rename .gitlab/jobs/{lassen.yml => tioga.yml} (85%) create mode 100644 buildscripts/gitlab/build-and-test.sh diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 851416009774..5ef586c16b75 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -51,7 +51,7 @@ variables: # Nested variables are allowed and useful to customize the job command. We # prevent variable expansion so that you can define them at job level. JOB_CMD: - value: "buildscripts/gitlab/create-conda-pkgs.sh" + value: "buildscripts/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 diff --git a/.gitlab/custom-jobs-and-variables.yml b/.gitlab/custom-jobs-and-variables.yml index d9a36b152d28..42f4f55703fb 100644 --- a/.gitlab/custom-jobs-and-variables.yml +++ b/.gitlab/custom-jobs-and-variables.yml @@ -15,9 +15,9 @@ variables: # Tioga # Arguments for top level allocation # OPTIONAL: "-o per-resource.count=2" allows to get 2 jobs running on each node. -# TIOGA_SHARED_ALLOC: "--queue=pci --exclusive --time-limit=15m --nodes=1" + TIOGA_SHARED_ALLOC: "--queue=pci --exclusive --time-limit=30m --nodes=1" # Arguments for job level allocation -# TIOGA_JOB_ALLOC: "--nodes=1 --begin-time=+5s" + TIOGA_JOB_ALLOC: "--nodes=1 --begin-time=+5s" # Add variables that should apply to all the jobs on a machine: # TIOGA_MY_VAR: "..." diff --git a/.gitlab/jobs/ruby.yml b/.gitlab/jobs/ruby.yml deleted file mode 100644 index 7fa254b8c9b9..000000000000 --- a/.gitlab/jobs/ruby.yml +++ /dev/null @@ -1,52 +0,0 @@ -############################################################################### -# Copyright (c) 2022-23, Lawrence Livermore National Security, LLC and RADIUSS -# project contributors. See the COPYRIGHT file for details. -# -# SPDX-License-Identifier: (MIT) -############################################################################### - -# We require project to define their job command using a variable (JOB_CMD). -# In customization/gitlab-ci.yml, we encourage to define this variable as -# non-expandable, so that project can use nested variables to configure the job -# command. The caveat is that the reproducer here cannot capture the -# definition of these variables in a generic fashion. By overriding the -# following section, projects can specify the variables to define in the -# reproducer to exactly reproduce the CI build. -.ruby_reproducer_vars: - script: - - export WITH_CUDA="Off" - -# With GitLab CI, included files cannot be empty. -# TODO: remove when you have at least on job defined. -variables: - INCLUDED_FILE_CANNOT_BE_EMPTY: "True" - -############### -# Explanations: -############### -# RADIUSS Shared CI provides a pipeline for each machine, where a template job -# is provided. Each of your jobs must extend this template to be added to the -# list of jobs running on the associated machine. -# -# The job template then expects you to define the "JOB_CMD" variable with the -# one line command used to trigger the build and test of your project. -# -# We suggest that you set your command in such a way that you can then -# customize it per job with variables. E.g.: -# "./path/to/my_ci_script ${A_VARIABLE}" - -## Adding jobs defined by the project. -## Note: placing the extends section first allows you to override part of the -## shared implementation if needed (and if you know what you are doing). -#: -# extends: .job_on_ruby -# variables: -# : "" - -build-run-ruby: - extends: .job_on_ruby - after_script: - - rm -rf ${CI_BUILDS_DIR} - - rm -rf ${CI_PROJET_DIR} - variables: - diff --git a/.gitlab/jobs/lassen.yml b/.gitlab/jobs/tioga.yml similarity index 85% rename from .gitlab/jobs/lassen.yml rename to .gitlab/jobs/tioga.yml index abb4376af9e2..ba905c88308d 100644 --- a/.gitlab/jobs/lassen.yml +++ b/.gitlab/jobs/tioga.yml @@ -12,9 +12,9 @@ # definition of these variables in a generic fashion. By overriding the # following section, projects can specify the variables to define in the # reproducer to exactly reproduce the CI build. -.lassen_reproducer_vars: +.tioga_reproducer_vars: script: - - echo -e "Running on Lassen\n" + - echo -e "Running on tioga\n" # With GitLab CI, included files cannot be empty. # TODO: remove when you have at least on job defined. @@ -39,17 +39,13 @@ variables: ## Note: placing the extends section first allows you to override part of the ## shared implementation if needed (and if you know what you are doing). #: -# extends: .job_on_lassen +# extends: .job_on_tioga # variables: # : "" .base-job: - extends: .job_on_lassen - before_script: - - source /usr/workspace/ggeorgak/lassen/miniconda3-env.sh - - conda config --set anaconda_upload yes + extends: .job_on_tioga after_script: - - source /usr/workspace/ggeorgak/lassen/miniconda3-env.sh - conda config --set anaconda_upload no - rm -rf ${CI_BUILDS_DIR} ${CI_PROJECT_DIR} @@ -62,7 +58,5 @@ variables: - "3.11" - "3.12" -build-pyomp-lassen: +build-and-test-tioga: extends: [.base-job, .python-variants] - variables: - PYOMP_CI_BUILD_PKG: "pyomp" diff --git a/.gitlab/subscribed-pipelines.yml b/.gitlab/subscribed-pipelines.yml index c545c8cc9d9f..714e5618290c 100644 --- a/.gitlab/subscribed-pipelines.yml +++ b/.gitlab/subscribed-pipelines.yml @@ -31,13 +31,13 @@ ## TIOGA -#tioga-up-check: -# variables: -# CI_MACHINE: "tioga" -# extends: [.machine-check] -# -#tioga-build-and-test: -# variables: -# CI_MACHINE: "tioga" -# needs: [tioga-up-check] -# extends: [.build-and-test] +tioga-up-check: + variables: + CI_MACHINE: "tioga" + extends: [.machine-check] + +tioga-build-and-test: + variables: + CI_MACHINE: "tioga" + needs: [tioga-up-check] + extends: [.build-and-test] diff --git a/buildscripts/gitlab/build-and-test.sh b/buildscripts/gitlab/build-and-test.sh new file mode 100644 index 000000000000..1666d1035d2e --- /dev/null +++ b/buildscripts/gitlab/build-and-test.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash + +set -e + +# Create a unique temporary directory for this job. +TMPDIR=/tmp/ggeorgak/${CI_JOB_ID} +mkdir -p ${TMPDIR} +pushd ${TMPDIR} + +# Set the envs directory under the temporary directory. +export CONDA_ENVS_DIRS="${TMPDIR}/_stage/miniconda3/envs" + +# Install miniconda and llvmdev, clang14 environments. +bash ${CI_PROJECT_DIR}/buildscripts/cibuildwheel/setup-miniconda3.sh + +# Export environment variables for building and testing. +export LLVM_DIR="${CONDA_ENVS_DIRS}/llvmdev" +export CLANG_TOOL="${CONDA_ENVS_DIRS}/clang14/bin/clang" +export USE_CXX11_ABI="1" +export PIP_NO_INPUT="1" + +# Create and activate a conda environment with the desired Python version. +conda create -n py-${PYOMP_CI_PYTHON_VERSION} -c conda-forge -y python=${PYOMP_CI_PYTHON_VERSION} +conda activate py-${PYOMP_CI_PYTHON_VERSION} + +# Install pyomp. +python -m pip install -v ${CI_PROJECT_DIR} + +# Run host OpenMP tests. +TEST_DEVICES=0 RUN_TARGET=0 python -m numba.runtests -v -- numba.openmp.tests.test_openmp +# Run device (cpu target) OpenMP tests. +OMP_TARGET_OFFLOAD=mandatory TEST_DEVICES=1 RUN_TARGET=1 python -m numba.runtests -v -- numba.openmp.tests.test_openmp.TestOpenmpTarget + +popd From 2677a3bc6d3f996a35bf0f7bd9d9c469c5e1dcd5 Mon Sep 17 00:00:00 2001 From: Giorgis Georgakoudis Date: Fri, 10 Oct 2025 22:05:19 -0700 Subject: [PATCH 2/5] Source the setup miniconda script to acivate the base env --- buildscripts/gitlab/build-and-test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildscripts/gitlab/build-and-test.sh b/buildscripts/gitlab/build-and-test.sh index 1666d1035d2e..4cb8ed5272e0 100644 --- a/buildscripts/gitlab/build-and-test.sh +++ b/buildscripts/gitlab/build-and-test.sh @@ -11,7 +11,7 @@ pushd ${TMPDIR} export CONDA_ENVS_DIRS="${TMPDIR}/_stage/miniconda3/envs" # Install miniconda and llvmdev, clang14 environments. -bash ${CI_PROJECT_DIR}/buildscripts/cibuildwheel/setup-miniconda3.sh +source ${CI_PROJECT_DIR}/buildscripts/cibuildwheel/setup-miniconda3.sh # Export environment variables for building and testing. export LLVM_DIR="${CONDA_ENVS_DIRS}/llvmdev" From 72611dcc6f1d4cecb9d38f3feada65c2bc534f5a Mon Sep 17 00:00:00 2001 From: Giorgis Georgakoudis Date: Sat, 11 Oct 2025 00:48:04 -0700 Subject: [PATCH 3/5] Fixup: use gcc to avoid issues with the default cray env --- buildscripts/gitlab/build-and-test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildscripts/gitlab/build-and-test.sh b/buildscripts/gitlab/build-and-test.sh index 4cb8ed5272e0..58c5fb23d070 100644 --- a/buildscripts/gitlab/build-and-test.sh +++ b/buildscripts/gitlab/build-and-test.sh @@ -24,7 +24,7 @@ conda create -n py-${PYOMP_CI_PYTHON_VERSION} -c conda-forge -y python=${PYOMP_C conda activate py-${PYOMP_CI_PYTHON_VERSION} # Install pyomp. -python -m pip install -v ${CI_PROJECT_DIR} +CC=gcc CXX=g++ python -m pip install -v ${CI_PROJECT_DIR} # Run host OpenMP tests. TEST_DEVICES=0 RUN_TARGET=0 python -m numba.runtests -v -- numba.openmp.tests.test_openmp From beedbaee74d79c9c813d8abec998ae5d6b1b15ea Mon Sep 17 00:00:00 2001 From: Giorgis Georgakoudis Date: Sat, 11 Oct 2025 01:21:06 -0700 Subject: [PATCH 4/5] Fixup: clone pyomp with history --- buildscripts/gitlab/build-and-test.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/buildscripts/gitlab/build-and-test.sh b/buildscripts/gitlab/build-and-test.sh index 58c5fb23d070..31ab5ece5a55 100644 --- a/buildscripts/gitlab/build-and-test.sh +++ b/buildscripts/gitlab/build-and-test.sh @@ -23,8 +23,14 @@ export PIP_NO_INPUT="1" conda create -n py-${PYOMP_CI_PYTHON_VERSION} -c conda-forge -y python=${PYOMP_CI_PYTHON_VERSION} conda activate py-${PYOMP_CI_PYTHON_VERSION} +# Clone and fetch the commit with history for package versioning. +git clone https://github.com/${GITHUB_PROJECT_ORG}/${GITHUB_PROJECT_NAME}.git --single-branch +cd ${GITHUB_PROJECT_NAME} +git fetch origin ${CI_COMMIT_SHA} +git checkout ${CI_COMMIT_SHA} + # Install pyomp. -CC=gcc CXX=g++ python -m pip install -v ${CI_PROJECT_DIR} +CC=gcc CXX=g++ python -m pip install -v . # Run host OpenMP tests. TEST_DEVICES=0 RUN_TARGET=0 python -m numba.runtests -v -- numba.openmp.tests.test_openmp From b0a3dda40c21f2981e1712a6634dc8ce6b01b371 Mon Sep 17 00:00:00 2001 From: Giorgis Georgakoudis Date: Sat, 11 Oct 2025 15:30:13 -0700 Subject: [PATCH 5/5] Fixup: use pyomp in tmp create and remove dead code --- .gitlab/jobs/tioga.yml | 1 - buildscripts/gitlab/build-and-test.sh | 2 +- buildscripts/gitlab/create-conda-pkgs.sh | 6 +++--- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.gitlab/jobs/tioga.yml b/.gitlab/jobs/tioga.yml index ba905c88308d..a32caf0a7fe7 100644 --- a/.gitlab/jobs/tioga.yml +++ b/.gitlab/jobs/tioga.yml @@ -46,7 +46,6 @@ variables: .base-job: extends: .job_on_tioga after_script: - - conda config --set anaconda_upload no - rm -rf ${CI_BUILDS_DIR} ${CI_PROJECT_DIR} .python-variants: diff --git a/buildscripts/gitlab/build-and-test.sh b/buildscripts/gitlab/build-and-test.sh index 31ab5ece5a55..eb85813ff50c 100644 --- a/buildscripts/gitlab/build-and-test.sh +++ b/buildscripts/gitlab/build-and-test.sh @@ -3,7 +3,7 @@ set -e # Create a unique temporary directory for this job. -TMPDIR=/tmp/ggeorgak/${CI_JOB_ID} +TMPDIR=/tmp/pyomp/${CI_JOB_ID} mkdir -p ${TMPDIR} pushd ${TMPDIR} diff --git a/buildscripts/gitlab/create-conda-pkgs.sh b/buildscripts/gitlab/create-conda-pkgs.sh index 134617cdac81..ddca46a3d42e 100755 --- a/buildscripts/gitlab/create-conda-pkgs.sh +++ b/buildscripts/gitlab/create-conda-pkgs.sh @@ -10,7 +10,7 @@ fi # Create a temporary directory for the build to clone the full repo for package # versioning. -TMPDIR=/tmp/ggeorgak/${CI_JOB_ID} +TMPDIR=/tmp/pyomp/${CI_JOB_ID} mkdir -p ${TMPDIR} pushd ${TMPDIR} @@ -21,7 +21,7 @@ git fetch origin ${CI_COMMIT_SHA} git checkout ${CI_COMMIT_SHA} # Set pkg dir per job to avoid conflicts. -export CONDA_PKGS_DIRS=/tmp/ggeorgak/conda-pkgs-${CI_JOB_ID} +export CONDA_PKGS_DIRS=/tmp/pyomp/conda-pkgs-${CI_JOB_ID} mkdir -p "$CONDA_PKGS_DIRS" function deploy_conda() { @@ -31,7 +31,7 @@ function deploy_conda() { set -x - export CONDA_BLD_PATH="/tmp/ggeorgak/conda-build-${PYOMP_CI_BUILD_PKG}-${PYOMP_CI_PYTHON_VERSION}" + export CONDA_BLD_PATH="/tmp/pyomp/conda-build-${PYOMP_CI_BUILD_PKG}-${PYOMP_CI_PYTHON_VERSION}" conda build --no-lock --no-locking --user python-for-hpc --label ${LABEL} \ -c python-for-hpc/label/${LABEL} -c conda-forge \ --python ${PYOMP_CI_PYTHON_VERSION} \