Skip to content

Commit

Permalink
base-spack: add improvements from the dev Dockerfile
Browse files Browse the repository at this point in the history
* Set default value of SPACK_PACKAGES_REPO_VERSION to main
* Change granularity to generic.
* Delete repos.yaml. Use the spack repo add command.
  • Loading branch information
harshula committed Aug 21, 2023
1 parent 24955d2 commit 4fa71bb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
11 changes: 6 additions & 5 deletions containers/Dockerfile.base-spack
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -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 \
Expand All @@ -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
Expand Down
3 changes: 0 additions & 3 deletions containers/repos.yaml

This file was deleted.

0 comments on commit 4fa71bb

Please sign in to comment.