From 27aebae2565a278996db603e97b87577b268ff77 Mon Sep 17 00:00:00 2001 From: Stephen Sachs Date: Tue, 23 May 2023 14:03:03 +0200 Subject: [PATCH] [pcluster pipeline] Use local buildcache instead of upstream spack Spack currently does not relocate compiler references from upstream spack installations. When using a buildcache we don't need an upstream spack. --- share/spack/gitlab/cloud_pipelines/.gitlab-ci.yml | 12 +++++------- .../stacks/aws-pcluster-icelake/spack.yaml | 10 ++++------ .../stacks/aws-pcluster-neoverse_n1/spack.yaml | 10 ++++------ .../stacks/aws-pcluster-neoverse_v1/spack.yaml | 10 ++++------ .../stacks/aws-pcluster-skylake/spack.yaml | 10 ++++------ 5 files changed, 21 insertions(+), 31 deletions(-) diff --git a/share/spack/gitlab/cloud_pipelines/.gitlab-ci.yml b/share/spack/gitlab/cloud_pipelines/.gitlab-ci.yml index cc82f74dd7f..6a7fc889d60 100644 --- a/share/spack/gitlab/cloud_pipelines/.gitlab-ci.yml +++ b/share/spack/gitlab/cloud_pipelines/.gitlab-ci.yml @@ -792,16 +792,14 @@ deprecated-ci-build: .aws-pcluster-generate: before_script: - # Setup postinstall Spack as upstream installation + # Use gcc from local container buildcache - - . "./share/spack/setup-env.sh" - . /etc/profile.d/modules.sh - - if [[ -f /bootstrap/spack/etc/spack/packages.yaml ]]; then cp /bootstrap/spack/etc/spack/packages.yaml ./etc/spack/; fi - - if [[ -f /bootstrap/spack/etc/spack/config.yaml ]]; then cp /bootstrap/spack/etc/spack/config.yaml ./etc/spack/; fi - - if [[ -f /bootstrap/spack/etc/spack/modules.xyaml ]]; then cp /bootstrap/spack/etc/spack/modules.yaml ./etc/spack/; fi - - if [[ -f /bootstrap/spack/etc/spack/mirrors.yaml ]]; then cp /bootstrap/spack/etc/spack/mirrors.yaml ./etc/spack/; fi - - if [[ -d /bootstrap/spack/opt/spack ]]; then spack config add "upstreams:postinstall:install_tree:/bootstrap/spack/opt/spack"; fi + - spack mirror add local-cache /bootstrap/local-cache + - spack gpg trust /bootstrap/public-key + - spack install --cache-only $(spack buildcache list gcc | tail -n1) - cd "${CI_PROJECT_DIR}" && curl -sOL https://raw.githubusercontent.com/spack/spack-configs/main/AWS/parallelcluster/postinstall.sh - - sed -i -e '/nohup/s/&$//' -e 's/nohup//' -e "s/spack arch -t/echo ${SPACK_TARGET_ARCH}/g" postinstall.sh + - sed -i -e "s/spack arch -t/echo ${SPACK_TARGET_ARCH}/g" postinstall.sh - /bin/bash postinstall.sh -fg - spack config --scope site add "packages:all:target:\"target=${SPACK_TARGET_ARCH}\"" after_script: diff --git a/share/spack/gitlab/cloud_pipelines/stacks/aws-pcluster-icelake/spack.yaml b/share/spack/gitlab/cloud_pipelines/stacks/aws-pcluster-icelake/spack.yaml index 6a068b6b879..3498e0018a2 100644 --- a/share/spack/gitlab/cloud_pipelines/stacks/aws-pcluster-icelake/spack.yaml +++ b/share/spack/gitlab/cloud_pipelines/stacks/aws-pcluster-icelake/spack.yaml @@ -41,12 +41,10 @@ spack: - . /etc/profile.d/modules.sh - spack --version - spack arch - # Setup postinstall Spack as upstream installation - - - if [[ -f /bootstrap/spack/etc/spack/packages.yaml ]]; then cp /bootstrap/spack/etc/spack/packages.yaml ./etc/spack/; fi - - if [[ -f /bootstrap/spack/etc/spack/config.yaml ]]; then cp /bootstrap/spack/etc/spack/config.yaml ./etc/spack/; fi - - if [[ -f /bootstrap/spack/etc/spack/modules.yaml ]]; then cp /bootstrap/spack/etc/spack/modules.yaml ./etc/spack/; fi - - if [[ -f /bootstrap/spack/etc/spack/mirrors.yaml ]]; then cp /bootstrap/spack/etc/spack/mirrors.yaml ./etc/spack/; fi - - if [[ -d /bootstrap/spack/opt/spack ]]; then spack config add "upstreams:postinstall:install_tree:/bootstrap/spack/opt/spack"; fi + # Use gcc from local container buildcache + - - spack mirror add local-cache /bootstrap/local-cache + - spack gpg trust /bootstrap/public-key + - spack install --cache-only $(spack buildcache list gcc | tail -n1) - - /bin/bash "${SPACK_ARTIFACTS_ROOT}/postinstall.sh" -fg - spack config --scope site add "packages:all:target:\"target=${SPACK_TARGET_ARCH}\"" - signing-job: diff --git a/share/spack/gitlab/cloud_pipelines/stacks/aws-pcluster-neoverse_n1/spack.yaml b/share/spack/gitlab/cloud_pipelines/stacks/aws-pcluster-neoverse_n1/spack.yaml index 0f8aea19847..eb240491503 100644 --- a/share/spack/gitlab/cloud_pipelines/stacks/aws-pcluster-neoverse_n1/spack.yaml +++ b/share/spack/gitlab/cloud_pipelines/stacks/aws-pcluster-neoverse_n1/spack.yaml @@ -43,12 +43,10 @@ spack: - . /etc/profile.d/modules.sh - spack --version - spack arch - # Setup postinstall Spack as upstream installation - - - if [[ -f /bootstrap/spack/etc/spack/packages.yaml ]]; then cp /bootstrap/spack/etc/spack/packages.yaml ./etc/spack/; fi - - if [[ -f /bootstrap/spack/etc/spack/config.yaml ]]; then cp /bootstrap/spack/etc/spack/config.yaml ./etc/spack/; fi - - if [[ -f /bootstrap/spack/etc/spack/modules.yaml ]]; then cp /bootstrap/spack/etc/spack/modules.yaml ./etc/spack/; fi - - if [[ -f /bootstrap/spack/etc/spack/mirrors.yaml ]]; then cp /bootstrap/spack/etc/spack/mirrors.yaml ./etc/spack/; fi - - if [[ -d /bootstrap/spack/opt/spack ]]; then spack config add "upstreams:postinstall:install_tree:/bootstrap/spack/opt/spack"; fi + # Use gcc from local container buildcache + - - spack mirror add local-cache /bootstrap/local-cache + - spack gpg trust /bootstrap/public-key + - spack install --cache-only $(spack buildcache list gcc | tail -n1) - - /bin/bash "${SPACK_ARTIFACTS_ROOT}/postinstall.sh" -fg - spack config --scope site add "packages:all:target:\"target=${SPACK_TARGET_ARCH}\"" - signing-job: diff --git a/share/spack/gitlab/cloud_pipelines/stacks/aws-pcluster-neoverse_v1/spack.yaml b/share/spack/gitlab/cloud_pipelines/stacks/aws-pcluster-neoverse_v1/spack.yaml index ad80b258ddc..c393898b06d 100644 --- a/share/spack/gitlab/cloud_pipelines/stacks/aws-pcluster-neoverse_v1/spack.yaml +++ b/share/spack/gitlab/cloud_pipelines/stacks/aws-pcluster-neoverse_v1/spack.yaml @@ -43,12 +43,10 @@ spack: - . /etc/profile.d/modules.sh - spack --version - spack arch - # Setup postinstall Spack as upstream installation - - - if [[ -f /bootstrap/spack/etc/spack/packages.yaml ]]; then cp /bootstrap/spack/etc/spack/packages.yaml ./etc/spack/; fi - - if [[ -f /bootstrap/spack/etc/spack/config.yaml ]]; then cp /bootstrap/spack/etc/spack/config.yaml ./etc/spack/; fi - - if [[ -f /bootstrap/spack/etc/spack/modules.yaml ]]; then cp /bootstrap/spack/etc/spack/modules.yaml ./etc/spack/; fi - - if [[ -f /bootstrap/spack/etc/spack/mirrors.yaml ]]; then cp /bootstrap/spack/etc/spack/mirrors.yaml ./etc/spack/; fi - - if [[ -d /bootstrap/spack/opt/spack ]]; then spack config add "upstreams:postinstall:install_tree:/bootstrap/spack/opt/spack"; fi + # Use gcc from local container buildcache + - - spack mirror add local-cache /bootstrap/local-cache + - spack gpg trust /bootstrap/public-key + - spack install --cache-only $(spack buildcache list gcc | tail -n1) - - /bin/bash "${SPACK_ARTIFACTS_ROOT}/postinstall.sh" -fg - spack config --scope site add "packages:all:target:\"target=${SPACK_TARGET_ARCH}\"" - signing-job: diff --git a/share/spack/gitlab/cloud_pipelines/stacks/aws-pcluster-skylake/spack.yaml b/share/spack/gitlab/cloud_pipelines/stacks/aws-pcluster-skylake/spack.yaml index 7ae5f338f74..825d0fad77a 100644 --- a/share/spack/gitlab/cloud_pipelines/stacks/aws-pcluster-skylake/spack.yaml +++ b/share/spack/gitlab/cloud_pipelines/stacks/aws-pcluster-skylake/spack.yaml @@ -41,12 +41,10 @@ spack: - . /etc/profile.d/modules.sh - spack --version - spack arch - # Setup postinstall Spack as upstream installation - - - if [[ -f /bootstrap/spack/etc/spack/packages.yaml ]]; then cp /bootstrap/spack/etc/spack/packages.yaml ./etc/spack/; fi - - if [[ -f /bootstrap/spack/etc/spack/config.yaml ]]; then cp /bootstrap/spack/etc/spack/config.yaml ./etc/spack/; fi - - if [[ -f /bootstrap/spack/etc/spack/modules.yaml ]]; then cp /bootstrap/spack/etc/spack/modules.yaml ./etc/spack/; fi - - if [[ -f /bootstrap/spack/etc/spack/mirrors.yaml ]]; then cp /bootstrap/spack/etc/spack/mirrors.yaml ./etc/spack/; fi - - if [[ -d /bootstrap/spack/opt/spack ]]; then spack config add "upstreams:postinstall:install_tree:/bootstrap/spack/opt/spack"; fi + # Use gcc from local container buildcache + - - spack mirror add local-cache /bootstrap/local-cache + - spack gpg trust /bootstrap/public-key + - spack install --cache-only $(spack buildcache list gcc | tail -n1) - - /bin/bash "${SPACK_ARTIFACTS_ROOT}/postinstall.sh" -fg - spack config --scope site add "packages:all:target:\"target=${SPACK_TARGET_ARCH}\"" - signing-job: