From 7d99e5aa7b026ce50b12d7e9a9447b39c667ccec Mon Sep 17 00:00:00 2001 From: Richard Berger Date: Tue, 29 Aug 2023 16:15:46 -0600 Subject: [PATCH 1/2] CI: Add missing SITE_ID_TOKEN --- .gitlab-ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8a77dd7792..7910906246 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -81,6 +81,9 @@ before_script: ################# .job: &job_def + id_tokens: + SITE_ID_TOKEN: + aud: https://re-git.lanl.gov tags: - darwin-slurm-shared variables: From ea44c51f4acf3dfe0acdae29ecb96332df511894 Mon Sep 17 00:00:00 2001 From: Richard Berger Date: Tue, 29 Aug 2023 16:16:00 -0600 Subject: [PATCH 2/2] CI: simplify sections --- .gitlab-ci.yml | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7910906246..8f3eb005cb 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -12,8 +12,8 @@ variables: SINGULARITY_EOS_CUDA_VERSION: "11.6.0" SINGULARITY_EOS_BUILD_TYPE: "RelWithDebInfo" SINGULARITY_EOS_SPACK_SPEC: "singularity-eos@main+mpi+hdf5+python+tests%gcc@${SINGULARITY_EOS_GCC_VERSION} ^openmpi@${SINGULARITY_EOS_OPENMPI_VERSION}" - COLOR_CYAN: '\033[1;36m' - COLOR_PLAIN: '\033[0m' + COLOR_CYAN: "\e[1;36m" + COLOR_PLAIN: "\e[0m" # set to different spack upstream for testing SINGULARITY_EOS_TEMP_SPACK_DIR: "" # uncomment for debugging the CI and persist the Spack installation @@ -21,12 +21,14 @@ variables: # DEVEL_SPACK_CHECKOUT: "${CI_PROJECT_DIR}/spack" before_script: + - echo "Running on $(hostname)" + - section() { echo $'\e[0K'"section_$1:$(date +%s):$2"$'\r\e[0K'"${3+${COLOR_CYAN}$3${COLOR_PLAIN}}"; } - export PYTHONNOUSERSITE=1 - export SPACK_DISABLE_LOCAL_CONFIG=true - export SPACK_USER_CACHE_PATH=${SPACK_USER_CACHE_PATH:-/tmp/spack-local} - export DEVEL_SPACK_CHECKOUT=${DEVEL_SPACK_CHECKOUT:-/tmp/spack} - export SINGULARITY_EOS_SPACK_DIR=${SINGULARITY_EOS_TEMP_SPACK_DIR:=$XCAP_OSS_SPACK_DIR} - - echo -e "\e[0Ksection_start:`date +%s`:spack_init[collapsed=true]\r\e[0K${COLOR_CYAN}Creating Spack instance at ${DEVEL_SPACK_CHECKOUT}${COLOR_PLAIN}" + - section start "spack_init[collapsed=true]" "Creating Spack instance at ${DEVEL_SPACK_CHECKOUT}" - | rsync -rpl \ --exclude=".git" \ @@ -39,7 +41,7 @@ before_script: - source ${DEVEL_SPACK_CHECKOUT}/share/spack/setup-env.sh - spack --version - spack compiler list - - echo -e "\e[0Ksection_end:`date +%s`:spack_init\r\e[0K" + - section end spack_init ########################## # Build Matrix Variables # @@ -109,7 +111,7 @@ before_script: - | if [[ "${CI_COMMIT_BRANCH}" == "${CI_DEFAULT_BRANCH}" ]]; then - echo -e "\e[0Ksection_start:`date +%s`:spack_build[collapsed=true]\r\e[0K${COLOR_CYAN}Building via Spack${COLOR_PLAIN}" + section start "spack_build[collapsed=true]" "Building via Spack" mkdir -p spack_build_env spack env create spack_build_env spack env activate spack_build_env @@ -117,9 +119,9 @@ before_script: spack config add upstreams:default:install_tree:${SINGULARITY_EOS_SPACK_DIR}/opt/spack/ spack dev-build -j $(nproc) ${SINGULARITY_EOS_SPACK_SPEC} spack env deactivate - echo -e "\e[0Ksection_end:`date +%s`:spack_build\r\e[0K" + section end spack_build fi - - echo -e "\e[0Ksection_start:`date +%s`:spack_env[collapsed=true]\r\e[0K${COLOR_CYAN}Creating Spack environment${COLOR_PLAIN}" + - section start "spack_env[collapsed=true]" "Creating Spack environment" - mkdir -p spack_env - spack env create spack_env - spack env activate spack_env @@ -128,7 +130,7 @@ before_script: - spack spec -I ${SINGULARITY_EOS_SPACK_SPEC} - spack add ${SINGULARITY_EOS_SPACK_SPEC} - spack install -j $(nproc) --show-log-on-error --no-checksum --yes-to-all -u cmake - - echo -e "\e[0Ksection_end:`date +%s`:spack_env\r\e[0K" + - section end spack_env - | if [[ -n ${SINGULARITY_USE_CUDA} ]]; then