Newer
Older
# yaml-language-server: $schema=gitlab-ci
# yaml-language-server: $format.enable=false
stages:
- environment
- concretize
- install
- deploy
workflow:
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
- if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS
when: never
- if: $CI_COMMIT_TAG =~ /^v[0-9].*$/
- environment: [helvetios]
stack: ["pinot-noir"]
app_image: ["registry.c4science.ch/scitas-stack/rhel9-kuma"]
path_suffix: ['']
app_image: ["registry.c4science.ch/scitas-stack/rhel9-kuma"]
- environment: [jed]
slurm_options: ["-c 72 -p jed -q jed"]
stack: ["pinot-noir"]
app_image: ["registry.c4science.ch/scitas-stack/rhel9-kuma"]
path_suffix: ['']
app_image: ["registry.c4science.ch/scitas-stack/rhel9-kuma"]
app_image: ["registry.c4science.ch/scitas-stack/rhel9-kuma"]
CI_DATA_ST: "/scratch/${path_suffix}scitas-stack/ci"
CI_DATA_LT: "/work/scitas-ge/scitas-stack/ci"
COMMAND_OPTIONS_SBATCH: ${slurm_options}
PYTHONUNBUFFERED: 1
# ------------------------------------------------------------------------------
# ------------------------------------------------------------------------------
.squashfs_var:
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
variables:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
variables:
MOUNT_POINT: $(jq -Mrc .stack.mount_point ${CI_PROJECT_DIR}/stacks/${stack}/config.json)
STACK_VERSION: $(jq -Mrc .stack.version ${CI_PROJECT_DIR}/stacks/${stack}/config.json)
image_name: ${stack}-${environment}-${SQUASHFS_ID}-${CI_PIPELINE_ID}
squashfs_image: $(ls -t1 ${CI_DATA_LT}/squashfs-cache/${image_name}*.sqfs 2> /dev/null | head -1)
APPTAINER_EXEC_OPTIONS: >-
${apptainer_options}
--cleanenv
-H $(mktemp -d -p ${FAKEHOME}/):/home/$(id -un)
--bind ${CI_DATA_LT}/buildcache:${MOUNT_POINT}/buildcache
--bind ${CI_DATA_LT}/spack-mirror:${MOUNT_POINT}/spack-mirror
--bind ${CI_DATA_LT}/squashfs-cache/:/squashfs-cache
--bind ${CI_DATA_ST}/overlayfs:/overlayfs
--fusemount "host:${CI_PROJECT_DIR}/ci/squashfuse_ll.sh ${CI_DATA_ST} ${image_name} ${squashfs_image} /overlayfs/lower-${image_name}"
--fusemount "container:${CI_PROJECT_DIR}/ci/fuse-overlayfs.sh ${image_name} ${MOUNT_POINT}/${stack}/${environment}/${STACK_VERSION}"
# ------------------------------------------------------------------------------
# ------------------------------------------------------------------------------
spack:checkout:
variables:
APPTAINER_EXEC_OPTIONS: >-
--cleanenv
--bind ${CI_DATA_LT}
--bind ${CI_DATA_ST}
before_script:
- git config --global --add --bool advice.detachedHead false
- ./ci/prepare_squashfs.sh
timeout: 1h
spack:setup:
stage: environment
extends:
- .parallel_job
extends:
- .parallel_job
script:
- ${STACK_LOCATION}/spack/bin/spack --color always -e ${environment} config blame compilers
- ${STACK_LOCATION}/spack/bin/spack -e ${environment}
config blame | tee config-${environment}-${stack}.log
- ${STACK_LOCATION}/spack/bin/spack --color always -e ${environment}
concretize | tee concretize-${environment}-${stack}.log
- ${STACK_LOCATION}/spack/bin/spack --color always -e ${environment}
mirror create -D -d ${MOUNT_POINT}/spack-mirror -a || /usr//bin/true
- cp ${SPACK_SYSTEM_CONFIG_PATH}/spack.lock spack-${environment}-${stack}.lock
- config-*.log
- concretize-*.log
- spack-*.lock
# Cleaning patches in case one has a different hash
- ${STACK_LOCATION}/spack/bin/spack
--color always
-e ${environment}
clean -m
- ${STACK_LOCATION}/spack/bin/spack
--color always
-e ${environment} install
--log-file ${CI_PROJECT_DIR}/spack-install-${environment}.xml
--log-format junit
--only-concrete
--fail-fast
--show-log-on-error
- ${STACK_LOCATION}/spack/bin/spack
--color always
-e ${environment}
find -vl | tee spack-find-${environment}-${stack}.log
- ${STACK_LOCATION}/spack/bin/spack
--color always
-e ${environment}
buildcache create
--update-index
${MOUNT_POINT}/buildcache
- ${STACK_LOCATION}/spack/bin/spack
-e ${environment} module
lmod refresh --yes | tee spack-modules-${environment}-${stack}.log
- ${CI_PROJECT_DIR}/ci/update_squashfs.sh
paths:
- spack-*.log
- spack-*.xml
spack:mksquashfs:
stage: deploy
extends:
- .parallel_job
script:
- mkfir -p /squashfs-cache/releases/
- mksquashfs ${STACK_LOCATION} /squashfs-cache/releases/${stack}-${environment}-${SQUASHFS_ID}-${CI_COMMIT_TAG}.sqfs
- job: spack:install
rules:
- if: $CI_COMMIT_TAG && $CI_COMMIT_TAG =~ /v[0-9]+.*/