From 8a9e16dc3b4e35461048a7f70993f061af4017cf Mon Sep 17 00:00:00 2001 From: Stephen Sachs Date: Sun, 8 Dec 2024 20:26:08 +0100 Subject: [PATCH] aws-pcluster stacks: static spack.yaml (#47918) --- .../gitlab/cloud_pipelines/.gitlab-ci.yml | 16 +- .../scripts/pcluster/setup-pcluster.sh | 112 ----------- .../aws-pcluster-neoverse_v1/packages.yaml | 67 ------- .../aws-pcluster-neoverse_v1/spack.yaml | 100 +++++++++- .../aws-pcluster-x86_64_v4/packages.yaml | 143 -------------- .../stacks/aws-pcluster-x86_64_v4/spack.yaml | 174 +++++++++++++++++- 6 files changed, 274 insertions(+), 338 deletions(-) delete mode 100755 share/spack/gitlab/cloud_pipelines/scripts/pcluster/setup-pcluster.sh delete mode 100644 share/spack/gitlab/cloud_pipelines/stacks/aws-pcluster-neoverse_v1/packages.yaml delete mode 100644 share/spack/gitlab/cloud_pipelines/stacks/aws-pcluster-x86_64_v4/packages.yaml diff --git a/share/spack/gitlab/cloud_pipelines/.gitlab-ci.yml b/share/spack/gitlab/cloud_pipelines/.gitlab-ci.yml index 07fd16c88bcff7..95f98840f07719 100644 --- a/share/spack/gitlab/cloud_pipelines/.gitlab-ci.yml +++ b/share/spack/gitlab/cloud_pipelines/.gitlab-ci.yml @@ -810,14 +810,6 @@ ml-darwin-aarch64-mps-build: .aws-pcluster-generate: image: { "name": "ghcr.io/spack/pcluster-amazonlinux-2:v2024-10-07", "entrypoint": [""] } - before_script: - # Use gcc from pre-installed spack store - - - . "./share/spack/setup-env.sh" - - . "/etc/profile.d/modules.sh" - - diff -q "/bootstrap/cloud_pipelines-config.yaml" "share/spack/gitlab/cloud_pipelines/configs/config.yaml" || echo "WARNING Install tree might have changed. You need to rebuild the pcluster-amazonlinux-2 container in spack/gitlab-runners." - - cp "share/spack/gitlab/cloud_pipelines/configs/config.yaml" "etc/spack/" - - /bin/bash "${SPACK_ROOT}/share/spack/gitlab/cloud_pipelines/scripts/pcluster/setup-pcluster.sh" - - rm "etc/spack/config.yaml" # X86_64_V4 (one pipeline per target) .aws-pcluster-x86_64_v4: @@ -826,6 +818,10 @@ ml-darwin-aarch64-mps-build: aws-pcluster-generate-x86_64_v4: extends: [ ".linux_x86_64_v4", ".aws-pcluster-x86_64_v4", ".generate-base", ".tags-x86_64_v4", ".aws-pcluster-generate"] + before_script: + - - . "./share/spack/setup-env.sh" + # TODO: Move this to the container next time it is rebuilt + - export PATH=/home/software/spack/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeh/linux-amzn2-x86_64_v3/gcc-7.3.1/binutils-2.37-qvccg7zpskturysmr4bzbsfrx34kvazo/bin:$PATH aws-pcluster-build-x86_64_v4: extends: [ ".linux_x86_64_v4", ".aws-pcluster-x86_64_v4", ".build" ] @@ -846,6 +842,10 @@ aws-pcluster-build-x86_64_v4: aws-pcluster-generate-neoverse_v1: # TODO: Use updated runner tags: https://github.com/spack/spack-infrastructure/pull/694/files extends: [ ".linux_neoverse_v1", ".aws-pcluster-neoverse_v1", ".generate-neoverse_v1", ".aws-pcluster-generate"] + before_script: + - - . "./share/spack/setup-env.sh" + # TODO: Move this to the container next time it is rebuilt + - export PATH=/home/software/spack/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeh/linux-amzn2-aarch64/gcc-7.3.1/binutils-2.37-2yxz3xsjfmesxujxtlrgcctxlyilynmp/bin:$PATH aws-pcluster-build-neoverse_v1: extends: [ ".linux_neoverse_v1", ".aws-pcluster-neoverse_v1", ".build" ] diff --git a/share/spack/gitlab/cloud_pipelines/scripts/pcluster/setup-pcluster.sh b/share/spack/gitlab/cloud_pipelines/scripts/pcluster/setup-pcluster.sh deleted file mode 100755 index fc77f56e769459..00000000000000 --- a/share/spack/gitlab/cloud_pipelines/scripts/pcluster/setup-pcluster.sh +++ /dev/null @@ -1,112 +0,0 @@ -#!/usr/bin/env bash -# -# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other -# Spack Project Developers. See the top-level COPYRIGHT file for details. -# -# SPDX-License-Identifier: (Apache-2.0 OR MIT) -set -e - -set_pcluster_defaults() { - # Set versions of pre-installed software in packages.yaml - [ -z "${SLURM_ROOT}" ] && ls /etc/systemd/system/slurm* &>/dev/null && \ - SLURM_ROOT=$(dirname $(dirname "$(awk '/ExecStart=/ {print $1}' /etc/systemd/system/slurm* | sed -e 's?^.*=??1' | head -n1)")) - # Fallback to default location if SLURM not in systemd - [ -z "${SLURM_ROOT}" ] && [ -d "/opt/slurm" ] && SLURM_ROOT=/opt/slurm - [ -z "${SLURM_VERSION}" ] && SLURM_VERSION=$(strings "${SLURM_ROOT}"/lib/libslurm.so | grep -e '^VERSION' | awk '{print $2}' | sed -e 's?"??g') - [ -z "${LIBFABRIC_VERSION}" ] && LIBFABRIC_VERSION=$(awk '/Version:/{print $2}' "$(find /opt/amazon/efa/ -name libfabric.pc | head -n1)" | sed -e 's?~??g' -e 's?amzn.*??g') - export SLURM_ROOT SLURM_VERSION LIBFABRIC_VERSION - - envsubst < "${SPACK_ROOT}/share/spack/gitlab/cloud_pipelines/stacks/${SPACK_CI_STACK_NAME}/packages.yaml" > "${SPACK_ROOT}"/etc/spack/packages.yaml -} - -patch_compilers_yaml() { - # Graceful exit if package not found by spack - set -o pipefail - compilers_yaml="${SPACK_ROOT}/etc/spack/compilers.yaml" - [ -f "${compilers_yaml}" ] || { - echo "Cannot find ${compilers_yaml}, compiler setup might now be optimal." - return - } - - # System ld is too old for amzn linux2 - spack_gcc_version=$(spack find --format '{version}' gcc) - binutils_path=$(spack find -p binutils | awk '/binutils/ {print $2}' | head -n1) - if [ -d "${binutils_path}" ] && [ -n "${spack_gcc_version}" ]; then python3 <