Skip to content

Commit

Permalink
Merge branch 'woptim/update-radiuss-packages'
Browse files Browse the repository at this point in the history
  • Loading branch information
adrienbernede committed Oct 4, 2024
2 parents fac3943 + 4f2a68f commit 20aab08
Show file tree
Hide file tree
Showing 33 changed files with 1,290 additions and 640 deletions.
56 changes: 39 additions & 17 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,51 @@
# SPDX-License-Identifier: (MIT)
##############################################################################

#[create-unique-path--]
#[create-unique-path--]
variables:
SPACK_PARENT_DIR: ${CI_BUILDS_DIR}/../../llnl-stack-${CI_COMMIT_SHORT_SHA}
SPACK_PATH: ${CI_BUILDS_DIR}/../../llnl-stack-${CI_COMMIT_SHORT_SHA}/spack
#[--create-unique-path]
SPACK_DEBUG: "-d"
ENV_NAME: ""
# Use the umdev LLNL service user to run CI. This prevents from running
# pipelines as an actual user.
LLNL_SERVICE_USER: bradiuss
# Use the service user workspace. Solves permission issues, stores everything
# at the same location whoever triggers a pipeline.
CUSTOM_CI_BUILDS_DIR: /usr/workspace/bradiuss/gitlab-runner
# Unique paths
MY_SPACK_PARENT_DIR: ${CUSTOM_CI_BUILDS_DIR}/llnl-stack-${CI_PIPELINE_ID}
MY_SPACK_PATH: ${CUSTOM_CI_BUILDS_DIR}/llnl-stack-${CI_PIPELINE_ID}/spack
MY_SPACK_USER_CACHE: /dev/shm/llnl-stack-${CI_PIPELINE_ID}-${CI_JOB_ID}/spack-cache
SPACK_USER_CACHE_PATH: ${CUSTOM_CI_BUILDS_DIR}/llnl-stack-${CI_PIPELINE_ID}/spack-user-cache
#[--create-unique-path]
SPACK_DISABLE_LOCAL_CONFIG: ""
MY_SPACK_DEBUG: ""

# We only do one generation per stage because we found conflicts otherwise
#[one-generate-per-stage--]
stages:
- setup
- generate-quartz
- generate-lassen
- generate
- build
- clean
#[--one-generate-per-stage]

.on-quartz:
tags: [shell, quartz]
include:
- project: 'lc-templates/id_tokens'
file: 'id_tokens.yml'
- local: .gitlab/core-ci.yml
rules:
- if: $MY_ENV_NAME != null
- local: spack-environments/${MY_ENV_NAME}/pipeline.yml
rules:
- if: $MY_ENV_NAME != null

.on-lassen:
tags: [shell, lassen]
# Run a simple jobs to display instructions when no env name was specified.
no-env-name:
tags: [shell, oslic]
rules:
- if: $MY_ENV_NAME == null
when: always
- when: never
stage: setup
script:
echo -e "\e[31mVariable \"MY_ENV_NAME\" was not set.\e[0m"
echo -e "\e[31m\"MY_ENV_NAME\" is required and should point to an existing directory in spack-environments.\e[0m"
echo -e "\e[31m\"MY_ENV_NAME\" can only be defined in GitLab UI (see documentation).\e[0m"
echo -e "\e[31mAvailable environments \e[0m"
echo -e "\e[31$(ls --ignore empty spack-environments)\e[0m"

include:
- local: .gitlab/generate.yml
52 changes: 52 additions & 0 deletions .gitlab/core-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
##############################################################################
# Copyright (c) 2019-2021, Lawrence Livermore National Security, LLC and
# RADIUSS project contributors. See the COPYRIGHT file for details.
#
# SPDX-License-Identifier: (MIT)
##############################################################################

.on-oslic:
tags: [shell, oslic]

.on-ruby:
tags: [shell, ruby]

.on-lassen:
tags: [shell, lassen]

# Generate CI pipelines for the package in $MY_ENV_NAME
#[get-spack--]
get-spack:
extends: [.on-oslic]
stage: setup
script:
- scripts/get-spack
#[--get-spack]

.generate-pipeline:
script:
- . ${MY_SPACK_PATH}/share/spack/setup-env.sh
- spack ${MY_SPACK_DEBUG} env activate --without-view spack-environments/${MY_ENV_NAME}
- spack ${MY_SPACK_DEBUG} config blame mirrors
- spack ${MY_SPACK_DEBUG} mirror add --oci-username ${CI_REGISTRY_USER} --oci-password ${CI_REGISTRY_PASSWORD} buildcache-destination oci://${CI_REGISTRY_IMAGE}
- spack ${MY_SPACK_DEBUG} config blame mirrors
# - spack ${MY_SPACK_DEBUG} concretize || spack ${MY_SPACK_DEBUG} concretize
- spack ${MY_SPACK_DEBUG} --color=always
--config-scope "${CI_PROJECT_DIR}/.gitlab/spack"
ci generate
--check-index-only
--artifacts-root "${CI_PROJECT_DIR}/jobs_scratch_dir"
--output-file "${CI_PROJECT_DIR}/jobs_scratch_dir/pipeline.yml"
- cp -r spack-environments/${MY_ENV_NAME}/${SYS_TYPE} ${CI_PROJECT_DIR}/jobs_scratch_dir/concrete_environment/
artifacts:
paths:
- "${CI_PROJECT_DIR}/jobs_scratch_dir"

#[rm-spack--]
rm-spack:
extends: [.on-oslic]
stage: clean
script:
- scripts/remove-spack
#[--rm-spack]

96 changes: 0 additions & 96 deletions .gitlab/generate.yml

This file was deleted.

26 changes: 26 additions & 0 deletions .gitlab/lassen.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
##############################################################################
# Copyright (c) 2019-2021, Lawrence Livermore National Security, LLC and
# RADIUSS project contributors. See the COPYRIGHT file for details.
#
# SPDX-License-Identifier: (MIT)
##############################################################################

# lassen
generate-on-lassen:
extends: [.generate-pipeline, .on-lassen]
stage: generate
before_script:
- scripts/print-variables

build-on-lassen:
stage: build
trigger:
include:
- artifact: "jobs_scratch_dir/pipeline.yml"
job: generate-on-lassen
- project: "lc-templates/id_tokens"
file: "id_tokens.yml"
strategy: depend
forward:
pipeline_variables: true
needs: [generate-on-lassen]
28 changes: 28 additions & 0 deletions .gitlab/ruby.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
##############################################################################
# Copyright (c) 2019-2021, Lawrence Livermore National Security, LLC and
# RADIUSS project contributors. See the COPYRIGHT file for details.
#
# SPDX-License-Identifier: (MIT)
##############################################################################

# ruby
generate-on-ruby:
extends: [.generate-pipeline, .on-ruby]
stage: generate
before_script:
- scripts/print-variables

#[send-variable-child--]
build-on-ruby:
stage: build
trigger:
include:
- artifact: "jobs_scratch_dir/pipeline.yml"
job: generate-on-ruby
- project: "lc-templates/id_tokens"
file: "id_tokens.yml"
strategy: depend
forward:
pipeline_variables: true
needs: [generate-on-ruby]
#[--send-variable-child]
76 changes: 76 additions & 0 deletions .gitlab/spack/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
##############################################################################
# Copyright (c) 2021-2024, Lawrence Livermore National Security, LLC and
# RADIUSS Stack Testing project contributors.
# See the LICENSE file for details.
#
# SPDX-License-Identifier: MIT
##############################################################################

ci:
target: gitlab
pipeline-gen:

- any-job:
before_script:
- . ${MY_SPACK_PATH}/share/spack/setup-env.sh
- export SPACK_DISABLE_LOCAL_CONFIG=""
- export SPACK_USER_CACHE_PATH="${MY_SPACK_USER_CACHE}"
- spack --version

- submapping:
- match:
- arch=linux-rhel8-ivybridge
build-job:
tags: [ruby, shell]
script::
- spack ${MY_SPACK_DEBUG} env activate --without-view ${SPACK_CONCRETE_ENV_DIR}
- spack ${MY_SPACK_DEBUG} config blame mirrors
- spack ${MY_SPACK_DEBUG} mirror rm buildcache-destination
- spack ${MY_SPACK_DEBUG} mirror add --oci-username ${CI_REGISTRY_USER} --oci-password ${CI_REGISTRY_PASSWORD} buildcache-destination oci://${CI_REGISTRY_IMAGE}
- spack ${MY_SPACK_DEBUG} config blame mirrors
#- spack ${MY_SPACK_DEBUG} ci rebuild
- echo Building ${SPACK_JOB_SPEC_PKG_NAME} /${SPACK_JOB_SPEC_DAG_HASH}
- spack --color=always --backtrace
install
--include-build-deps
--no-check-signature
--use-buildcache=package:never,dependencies:only
/${SPACK_JOB_SPEC_DAG_HASH}
- echo Pushing ${SPACK_JOB_SPEC_PKG_NAME} /${SPACK_JOB_SPEC_DAG_HASH}
- spack buildcache push buildcache-destination /${SPACK_JOB_SPEC_DAG_HASH}
- match:
- 'target=ppc64le:'
build-job:
tags: [lassen, shell]
script::
- spack ${MY_SPACK_DEBUG} env activate --without-view ${SPACK_CONCRETE_ENV_DIR}
- spack ${MY_SPACK_DEBUG} config blame mirrors
- spack ${MY_SPACK_DEBUG} mirror rm buildcache-destination
- spack ${MY_SPACK_DEBUG} mirror add --oci-username ${CI_REGISTRY_USER} --oci-password ${CI_REGISTRY_PASSWORD} buildcache-destination oci://${CI_REGISTRY_IMAGE}
- spack ${MY_SPACK_DEBUG} config blame mirrors
#- spack ${MY_SPACK_DEBUG} ci rebuild
- echo Building ${SPACK_JOB_SPEC_PKG_NAME} /${SPACK_JOB_SPEC_DAG_HASH}
- spack --color=always --backtrace
install
--include-build-deps
--no-check-signature
--use-buildcache=package:never,dependencies:only
/${SPACK_JOB_SPEC_DAG_HASH}
- echo Pushing ${SPACK_JOB_SPEC_PKG_NAME} /${SPACK_JOB_SPEC_DAG_HASH}
- spack buildcache push buildcache-destination /${SPACK_JOB_SPEC_DAG_HASH}
match_behavior: first

- reindex-job:
tags: [oslic, shell]
before_script:
- . ${MY_SPACK_PATH}/share/spack/setup-env.sh
- export SPACK_DISABLE_LOCAL_CONFIG=""
- export SPACK_USER_CACHE_PATH="${MY_SPACK_USER_CACHE}"
- spack --version
- spack ${MY_SPACK_DEBUG} config blame mirrors
- spack ${MY_SPACK_DEBUG} mirror add --oci-username ${CI_REGISTRY_USER} --oci-password ${CI_REGISTRY_PASSWORD} buildcache-destination oci://${CI_REGISTRY_IMAGE}
- spack ${MY_SPACK_DEBUG} config blame mirrors
- noop-job:
tags: [oslic, shell]
- cleanup-job:
tags: [oslic, shell]
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "cmake/blt"]
path = cmake/blt
url = https://github.com/LLNL/blt.git
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
# SPDX-License-Identifier: (MIT)
################################################################################

cmake_minimum_required(VERSION 3.8)
project( radiuss-spack-testing )

################################
# CONFIG
################################
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Access the [documentation](https://radiuss-spack-testing.readthedocs.io/).

The primary goal of this repo is to be used in Gitlab. The Gitlab CI configuration is such that it will use Spack pipeline feature to generate and run a pipeline that builds one of the environments in the `spack-environments` directory.

The specific environment to be built is controlled by the CI variable `ENV_NAME`.
The specific environment to be built is controlled by the CI variable `MY_ENV_NAME`.

### Installing

Expand Down
1 change: 1 addition & 0 deletions cmake/blt
Submodule blt added at 5a792c
Loading

0 comments on commit 20aab08

Please sign in to comment.