From d5747a61e7cb6178a72ab5568bff40f4bf509638 Mon Sep 17 00:00:00 2001 From: Massimiliano Culpo Date: Fri, 9 Jun 2023 07:56:28 +0200 Subject: Hotfix to avoid building compilers from sources in pcluster pipelines (#38256) The pcluster image has am internal buildcache without an index. Also, we need to force reuse to avoid rebuilding GCC, since the default is to only reuse dependencies - and that is subject to changes in the GCC recipe. --- share/spack/gitlab/cloud_pipelines/.gitlab-ci.yml | 5 ++++- .../gitlab/cloud_pipelines/stacks/aws-pcluster-icelake/spack.yaml | 5 ++++- .../cloud_pipelines/stacks/aws-pcluster-neoverse_n1/spack.yaml | 5 ++++- .../cloud_pipelines/stacks/aws-pcluster-neoverse_v1/spack.yaml | 5 ++++- .../gitlab/cloud_pipelines/stacks/aws-pcluster-skylake/spack.yaml | 5 ++++- 5 files changed, 20 insertions(+), 5 deletions(-) diff --git a/share/spack/gitlab/cloud_pipelines/.gitlab-ci.yml b/share/spack/gitlab/cloud_pipelines/.gitlab-ci.yml index 74176c198f..f46d643993 100644 --- a/share/spack/gitlab/cloud_pipelines/.gitlab-ci.yml +++ b/share/spack/gitlab/cloud_pipelines/.gitlab-ci.yml @@ -736,12 +736,15 @@ deprecated-ci-build: # Use gcc from local container buildcache - - . "./share/spack/setup-env.sh" - . /etc/profile.d/modules.sh + - spack buildcache rebuild-index /bootstrap/local-cache/ - spack mirror add local-cache /bootstrap/local-cache - spack gpg trust /bootstrap/public-key - cd "${CI_PROJECT_DIR}" && curl -sOL https://raw.githubusercontent.com/spack/spack-configs/main/AWS/parallelcluster/postinstall.sh - sed -i -e "s/spack arch -t/echo ${SPACK_TARGET_ARCH}/g" postinstall.sh + - sed -i.bkp s/"spack install gcc"/"spack install --cache-only --reuse gcc"/ postinstall.sh + - diff postinstall.sh postinstall.sh.bkp || echo Done - /bin/bash postinstall.sh -fg - - spack config --scope site add "packages:all:target:\"target=${SPACK_TARGET_ARCH}\"" + - spack config --scope site add "packages:all:target:\"${SPACK_TARGET_ARCH}\"" after_script: - - mv "${CI_PROJECT_DIR}/postinstall.sh" "${CI_PROJECT_DIR}/jobs_scratch_dir/" 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 dc08ddde0a..616d438ace 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 @@ -42,8 +42,11 @@ spack: - spack --version - spack arch # Use gcc from local container buildcache - - - spack mirror add local-cache /bootstrap/local-cache + - - spack buildcache rebuild-index /bootstrap/local-cache/ + - sed -i.bkp s/"spack install gcc"/"spack install --cache-only --reuse gcc"/ /bootstrap/postinstall.sh + - spack mirror add local-cache /bootstrap/local-cache - spack gpg trust /bootstrap/public-key + - diff /bootstrap/postinstall.sh /bootstrap/postinstall.sh.bkp || echo Done - - /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 0dc063af14..861d9f3312 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 @@ -44,8 +44,11 @@ spack: - spack --version - spack arch # Use gcc from local container buildcache - - - spack mirror add local-cache /bootstrap/local-cache + - - spack buildcache rebuild-index /bootstrap/local-cache/ + - sed -i.bkp s/"spack install gcc"/"spack install --cache-only --reuse gcc"/ /bootstrap/postinstall.sh + - spack mirror add local-cache /bootstrap/local-cache - spack gpg trust /bootstrap/public-key + - diff /bootstrap/postinstall.sh /bootstrap/postinstall.sh.bkp || echo Done - - /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 7629f6242f..9303392fb2 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 @@ -44,8 +44,11 @@ spack: - spack --version - spack arch # Use gcc from local container buildcache - - - spack mirror add local-cache /bootstrap/local-cache + - - spack buildcache rebuild-index /bootstrap/local-cache/ + - sed -i.bkp s/"spack install gcc"/"spack install --cache-only --reuse gcc"/ /bootstrap/postinstall.sh + - spack mirror add local-cache /bootstrap/local-cache - spack gpg trust /bootstrap/public-key + - diff /bootstrap/postinstall.sh /bootstrap/postinstall.sh.bkp || echo Done - - /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 ecec12eda1..3c6d4872d6 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 @@ -42,8 +42,11 @@ spack: - spack --version - spack arch # Use gcc from local container buildcache - - - spack mirror add local-cache /bootstrap/local-cache + - - spack buildcache rebuild-index /bootstrap/local-cache/ + - sed -i.bkp s/"spack install gcc"/"spack install --cache-only --reuse gcc"/ /bootstrap/postinstall.sh + - spack mirror add local-cache /bootstrap/local-cache - spack gpg trust /bootstrap/public-key + - diff /bootstrap/postinstall.sh /bootstrap/postinstall.sh.bkp || echo Done - - /bin/bash "${SPACK_ARTIFACTS_ROOT}/postinstall.sh" -fg - spack config --scope site add "packages:all:target:\"target=${SPACK_TARGET_ARCH}\"" - signing-job: -- cgit v1.2.3-70-g09d2