Skip to content

Commit

Permalink
docker: Update images to use environment modules
Browse files Browse the repository at this point in the history
  • Loading branch information
Chuck Atkins committed Apr 15, 2021
1 parent 0796252 commit 99d4bf0
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 209 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/everything.yml
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,10 @@ jobs:
- code: scorpio
repo: E3SM-Project/scorpio
ref: scorpio-v1.2.1

defaults:
run:
shell: bash -c "docker exec adios2-ci spack-named-env adios2 bash -e $(echo {0} | sed 's|/home/runner/work|/__w|g')"
shell: bash -c "docker exec adios2-ci bash --login -e $(echo {0} | sed 's|/home/runner/work|/__w|g')"

steps:
- uses: actions/checkout@v2
Expand Down
14 changes: 9 additions & 5 deletions scripts/ci/images/spack/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,22 @@ RUN spack dev-build \
spack clean -a

# Build the environment
RUN spack env create adios2 && \
RUN spack env create --without-view adios2 && \
spack -e adios2 add $(spack find --format "/{hash}") && \
spack -e adios2 install -v && \
rm -rf /root/.spack && \
spack env activate adios2 && \
spack env deactivate
spack env deactivate && \
spack -e adios2 env loads

# Initialize the first-use-of-environment stuff for the adios user
WORKDIR /home/adios
USER adios
RUN spack env activate adios2 && \
spack env deactivate
spack env deactivate && \
echo "source /opt/spack/share/spack/setup-env.sh" >> ~/.bash_profile && \
echo "module use ${SPACK_ROOT}/share/spack/modules/linux-ubuntu18.04-haswell" >> ~/.bash_profile && \
echo "source ${SPACK_ROOT}/var/spack/environments/adios2/loads" >> ~/.bash_profile

ENTRYPOINT ["/usr/local/bin/spack-named-env", "adios2"]
CMD ["bash"]
ENTRYPOINT []
CMD ["bash", "--login"]
16 changes: 10 additions & 6 deletions scripts/docker/Dockerfile.complete
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,23 @@ RUN spack install \
adios2 && \
spack clean -a

# Build the envirponment
RUN spack env create adios2 && \
# Build the environment
RUN spack env create --without-view adios2 && \
spack -e adios2 add $(spack find --format "/{hash}") && \
spack -e adios2 install && \
rm -rf /root/.spack && \
spack env activate adios2 && \
spack env deactivate
spack env deactivate && \
spack -e adios2 env loads

# Initialize the first-use-of-environment stuff for the adios user
WORKDIR /home/adios
USER adios
RUN spack env activate adios2 && \
spack env deactivate
spack env deactivate && \
echo "source /opt/spack/share/spack/setup-env.sh" >> ~/.bash_profile && \
echo "module use ${SPACK_ROOT}/share/spack/modules/linux-ubuntu18.04-haswell" >> ~/.bash_profile && \
echo "source ${SPACK_ROOT}/var/spack/environments/adios2/loads" >> ~/.bash_profile

ENTRYPOINT ["/usr/local/bin/spack-named-env", "adios2"]
CMD ["bash"]
ENTRYPOINT []
CMD ["bash", "--login"]
7 changes: 2 additions & 5 deletions scripts/docker/Dockerfile.dependencies
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,12 @@ RUN cd ${SPACK_ROOT} && \
git checkout -f develop && \
rm -rf .git

# Setup the modified entrypoint
# Fix the python version being used
ENV SPACK_PYTHON=/usr/bin/python3.6
COPY entrypoint.bash $SPACK_ROOT/share/spack/docker/entrypoint.bash
RUN rm -f /usr/local/bin/spack-named-env && \
ln -s $SPACK_ROOT/share/spack/docker/entrypoint.bash \
/usr/local/bin/spack-named-env

# Setup the default configuration
COPY packages.yaml $SPACK_ROOT/etc/spack/packages.yaml
COPY modules.yaml $SPACK_ROOT/etc/spack/modules.yaml
RUN rm -rf /root/.spack && \
spack compiler find --scope site

Expand Down
189 changes: 0 additions & 189 deletions scripts/docker/entrypoint.bash

This file was deleted.

9 changes: 9 additions & 0 deletions scripts/docker/modules.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
modules:
enable:
- tcl
tcl:
hash_length: 0
all:
autoload: 'direct'
projections:
all: '{name}/{version}'
4 changes: 1 addition & 3 deletions testing/contract/scorpio/depends.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,4 @@
set -x
set -e

sudo /opt/spack/bin/spack install parallel-netcdf
sudo /opt/spack/bin/spack -e adios2 add parallel-netcdf
sudo /opt/spack/bin/spack -e adios2 install -v
sudo /opt/spack/bin/spack install -v parallel-netcdf

0 comments on commit 99d4bf0

Please sign in to comment.