Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker: Update images to use environment modules #2675

Merged
merged 1 commit into from
Apr 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
2 changes: 2 additions & 0 deletions testing/contract/scorpio/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ echo "source_dir = \"${source_dir}\""
echo "build_dir = \"${build_dir}\""
echo "install_dir = \"${install_dir}\""
echo "test_dir = \"${test_dir}\""

module load parallel-netcdf