From 4fa71bb07df6e11b4dfa5246b6af5f2bc1dc5811 Mon Sep 17 00:00:00 2001 From: Harshula Jayasuriya Date: Fri, 18 Aug 2023 16:53:15 +1000 Subject: [PATCH] base-spack: add improvements from the dev Dockerfile * Set default value of SPACK_PACKAGES_REPO_VERSION to main * Change granularity to generic. * Delete repos.yaml. Use the spack repo add command. --- containers/Dockerfile.base-spack | 11 ++++++----- containers/repos.yaml | 3 --- 2 files changed, 6 insertions(+), 8 deletions(-) delete mode 100644 containers/repos.yaml diff --git a/containers/Dockerfile.base-spack b/containers/Dockerfile.base-spack index 5253209..61ffa63 100644 --- a/containers/Dockerfile.base-spack +++ b/containers/Dockerfile.base-spack @@ -6,7 +6,7 @@ ENV SPACK_ROOT=/opt/spack ENV SPACK_PACKAGES_REPO_ROOT=/opt/spack_packages ENV GNUPGHOME=$SPACK_ROOT/opt/spack/gpg -ARG SPACK_PACKAGES_REPO_VERSION +ARG SPACK_PACKAGES_REPO_VERSION=main ARG SPACK_REPO_VERSION=v0.20.1 LABEL au.org.access-nri.ci.spack-packages-repo-version ${SPACK_PACKAGES_REPO_VERSION} @@ -15,10 +15,13 @@ LABEL au.org.access-nri.ci.spack-repo-version ${SPACK_REPO_VERSION} # Install spack RUN git clone -c feature.manyFiles=true https://github.com/spack/spack.git $SPACK_ROOT --branch ${SPACK_REPO_VERSION} --single-branch --depth=1 +RUN sed -i 's/granularity: microarchitectures/granularity: generic/' $SPACK_ROOT/etc/spack/defaults/concretizer.yaml + # Enables setting Spack setup type via SHELL command # docker-shell: Use for build RUN steps # interactive-shell: Use for interactive shell instances # spack-env: Use for CMD invocations (e.g. CI runners) +# $SPACK_ROOT/share/spack/templates/container/bootstrap-base.dockerfile: RUN ln -s $SPACK_ROOT/share/spack/docker/entrypoint.bash \ /usr/local/bin/docker-shell && \ ln -s $SPACK_ROOT/share/spack/docker/entrypoint.bash \ @@ -29,13 +32,11 @@ RUN ln -s $SPACK_ROOT/share/spack/docker/entrypoint.bash \ # Setup Spack environment for subsequent RUN steps SHELL ["docker-shell"] -# Bootstrap Spack -RUN spack bootstrap now - # Set up ACCESS Spack package repo RUN git clone https://github.com/ACCESS-NRI/spack_packages.git ${SPACK_PACKAGES_REPO_ROOT} --branch ${SPACK_PACKAGES_REPO_VERSION} --single-branch --depth=1 -COPY repos.yaml $SPACK_ROOT/etc/spack/repos.yaml +RUN spack repo add $SPACK_PACKAGES_REPO_ROOT && \ + spack bootstrap now # TODO # Think about setting up spack S3 build cache for CI here diff --git a/containers/repos.yaml b/containers/repos.yaml deleted file mode 100644 index e0b8eda..0000000 --- a/containers/repos.yaml +++ /dev/null @@ -1,3 +0,0 @@ -repos: - - /opt/spack_packages - - $spack/var/spack/repos/builtin