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
variables:
# ------------------------------------------------------------------------------
.parallel_job:
# - environment: [helvetios]
# slurm_options: ["-c 36"]
Nicolas Richart
committed
- environment: [jed]
slurm_options: ["-c 72 -p jed -q jed"]
# - environment: [izar]
# slurm_options: ['-c 40 --gres gpu:2']
# apptainer_options: ['-nv']
tags:
- ${environment}
- stack
variables:
COMMAND_OPTIONS_SBATCH: ${slurm_options}
APPTAINER_EXEC_OPTIONS: ${apptainer_options} --bind ${BUILDCACHE}:/buildcache:rw --bind ${SPACK_PATH}:/spack:rw --bind ${STACK_PATH}:/stack:rw --writable-tmpfs
SPACK_DISABLE_LOCAL_CONFIG: "true"
SPACK_USER_CACHE_PATH: "/tmp/spack_cache_${CI_JOB_ID}"
SPACK_SITE_CONFIG_PATH: "/stack/spack/etc"
BUILDCACHE: "/work/scitas-ge/richart/ci/buildcache"
SPACK_PATH: "/work/scitas-ge/richart/ci/${environment}/spack"
STACK_PATH: "/work/scitas-ge/richart/ci/${environment}/stack"
# ------------------------------------------------------------------------------
spack:setup:
- SPACK_VERSION=$(jq -r .spack.version config.json)
- |
if [ ! -d /spack/spack ]; then
git clone https://github.com/spack/spack.git -b $SPACK_VERSION /spack/spack
else
cd /spack/spack
git fetch
git checkout $SPACK_VERSION
- |
mkdir -p /stack/extra_repos/
EXTERNAL_REPOS=$(jq -r '.spack.repos | keys[]' config.json)
for repo in ${EXTERNAL_REPOS}
do
repo_branch=$(jq -r ".spack.repos.\"${repo}\".branch" config.json)
if [ ! -d /stack/extra_repos/${repo} ]; then
url_branch=$(jq -r ".spack.repos.\"${repo}\".url" config.json)
git clone -b ${repo_branch} ${url_branch} /stack/extra_repos/$repo
else
cd /stack/extra_repos/$repo
git fetch
/spack/spack/bin/spack gpg publish -d /buildcache
fi
extends:
- .parallel_job
script:
- COMPILER_LIST_SPECS=$(jq -r '.stack.compilers | map("\(.spec)@\(.version)")[]' config.json)
- /spack/spack/bin/spack install
--log-file spack-install.xml
--log-format junit
--fail-fast
--show-log-on-error
--use-cache
${COMPILER_LIST_SPECS}
- |
echo 'definitions: [ compilers: [' ${COMPILER_LIST_SPECS} ']]' > compiler_definitions.yaml
- /spack/spack/bin/spack compiler find --scope site /usr
- |
for compiler in ${COMPILER_LIST_SPECS}; do
/spack/spack/bin/spack compiler find --scope site $(/spack/spack/bin/spack location -i ${compiler})
done
artifacts:
reports:
junit: spack-install.xml
- /spack/spack/bin/spack -e . concretize
--log-file spack-install.xml
--log-format junit
--only-concrete
--fail-fast
--show-log-on-error
--use-cache
needs:
- job: spack:concretize