Skip to content
Snippets Groups Projects
Commit 164ec210 authored by Sylvester Joosten's avatar Sylvester Joosten
Browse files

Updated to use new upstream container leveraging spack buildcache

parent 425921b7
Branches
Tags
1 merge request!8New v2.1 release version
2.0.5 2.1.0
# Builder with Argonne EIC software
#
FROM eicweb.phy.anl.gov:4567/containers/image_recipes/ubuntu_spack:0.15.3
LABEL maintainer="Sylvester Joosten <sjoosten@anl.gov>" \
name="eic_builder" \
group="eic_builder" \
march="native" \
basedist="ubuntu" \
base="ubuntu"
ENV DOCKERFILE_BASE=ubuntu \
DOCKERFILE_DISTRO=ubuntu \
DOCKERFILE_DISTRO_VERSION=20.04 \
SPACK_ROOT=/opt/spack \
DEBIAN_FRONTEND=noninteractive \
CURRENTLY_BUILDING_DOCKER_IMAGE=1 \
container=docker
## Ensure an up-to-date custom package list
RUN rm -rf $SPACK_ROOT/np-spack \
&& git clone https://eicweb.phy.anl.gov/EIC/np-spack.git $SPACK_ROOT/np-spack \
&& cd $SPACK_ROOT/np-spack && git checkout v`spack --version` && cd - \
&& rm -rf $SPACK_ROOT/np-spack/.git \
&& echo "repos:" > $SPACK_ROOT/etc/spack/repos.yaml \
&& echo " - $SPACK_ROOT/np-spack" >> $SPACK_ROOT/etc/spack/repos.yaml
## Setup our environment definition
COPY spack.yaml /opt/spack-environment/spack.yaml
## Install the software, no garbage collection at this stage
## as this is a raw builder image
RUN cd /opt/spack-environment \
&& spack env activate . \
&& spack install -j32 \
&& spack clean -a
## Install additional python packages
RUN cd /opt/spack-environment && spack env activate . \
&& pip install --trusted-host pypi.org \
--trusted-host files.pythonhosted.org \
--no-cache-dir \
ipython matplotlib scipy
## Build elements prone to change here, to allow us to rebuild
## from runner cache efficiently
RUN cd /opt/spack-environment \
&& spack env activate . \
&& spack add npdet@master \
&& spack install \
&& spack clean -a
## Strip the binaries
#RUN find -L /usr/local/* -type f -exec readlink -f '{}' \; | \
# xargs file -i | \
# grep 'charset=binary' | \
# grep 'x-executable\|x-archive\|x-sharedlib' | \
# awk -F: '{print $1}' | xargs strip -s
# Modifications to the environment that are necessary to run
# Also make sure we keep the /lib/x86_65-linux-gnu in our PATH
RUN cd /opt/spack-environment \
&& spack env activate --sh -d . > /etc/profile.d/z10_spack_environment.sh \
&& sed -i "s?LD_LIBRARY_PATH=?&/lib/x86_64-linux-gnu:?" /etc/profile.d/z10_spack_environment.sh
# Somehow PODIO env isn't automatically set,
# and Gaudi likes BINARY_TAG to be set
RUN cd /opt/spack-environment \
&& spack env activate . \
&& export PODIO=`spack find -p podio | grep software | awk '{print $2}'` \
&& echo "export PODIO=${PODIO};" >> /etc/profile.d/z10_spack_environment.sh \
&& echo "export BINARY_TAG=x86_64-linux-gcc9-opt" >> /etc/profile.d/z10_spack_environment.sh
## make sure we have the entrypoints setup correctly
ENTRYPOINT []
CMD ["bash", "--rcfile", "/etc/profile", "-l"]
USER 0
WORKDIR /
# Builder with Argonne EIC software # Builder with Argonne EIC software
# #
FROM eicweb.phy.anl.gov:4567/containers/image_recipes/eic_spack:1.0.0 FROM eicweb.phy.anl.gov:4567/containers/image_recipes/ubuntu_spack:0.15.3
LABEL maintainer="Sylvester Joosten <sjoosten@anl.gov>" \ LABEL maintainer="Sylvester Joosten <sjoosten@anl.gov>" \
name="eic_builder" \ name="eic_builder" \
...@@ -20,36 +20,57 @@ ENV DOCKERFILE_BASE=ubuntu \ ...@@ -20,36 +20,57 @@ ENV DOCKERFILE_BASE=ubuntu \
## Ensure an up-to-date custom package list ## Ensure an up-to-date custom package list
RUN rm -rf $SPACK_ROOT/np-spack \ RUN rm -rf $SPACK_ROOT/np-spack \
&& git clone https://eicweb.phy.anl.gov/EIC/np-spack.git $SPACK_ROOT/np-spack \ && git clone https://eicweb.phy.anl.gov/EIC/np-spack.git $SPACK_ROOT/np-spack \
&& cd $SPACK_ROOT/np-spack && git checkout v`spack --version` && cd - \
&& rm -rf $SPACK_ROOT/np-spack/.git \ && rm -rf $SPACK_ROOT/np-spack/.git \
&& echo "repos:" > $SPACK_ROOT/etc/spack/repos.yaml \ && echo "repos:" > $SPACK_ROOT/etc/spack/repos.yaml \
&& echo " - $SPACK_ROOT/np-spack" >> $SPACK_ROOT/etc/spack/repos.yaml && echo " - $SPACK_ROOT/np-spack" >> $SPACK_ROOT/etc/spack/repos.yaml
## Install the software, building on the existing root environment. ## Setup our environment definition
RUN cd /opt/spack-environment && spack env activate . \ COPY spack.yaml /opt/spack-environment/spack.yaml
&& spack add npdet@master \
&& spack install \ ## Install the software, no garbage collection at this stage
## as this is a raw builder image
RUN cd /opt/spack-environment \
&& spack env activate . \
&& spack install -j32 \
&& spack clean -a && spack clean -a
## FIXME: ipython etc should be added upstream ## Install additional python packages
RUN cd /opt/spack-environment && spack env activate . \ RUN cd /opt/spack-environment && spack env activate . \
&& pip install --trusted-host pypi.org \ && pip install --trusted-host pypi.org \
--trusted-host files.pythonhosted.org \ --trusted-host files.pythonhosted.org \
--no-cache-dir \ --no-cache-dir \
ipython matplotlib scipy ipython matplotlib scipy
## Build elements prone to change here, to allow us to rebuild
## from runner cache efficiently
RUN cd /opt/spack-environment \
&& spack env activate . \
&& spack add npdet@master \
&& spack install \
&& spack clean -a
## Strip the binaries ## Strip the binaries
#RUN find -L /opt/view/* -type f -exec readlink -f '{}' \; | \ #RUN find -L /usr/local/* -type f -exec readlink -f '{}' \; | \
# xargs file -i | \ # xargs file -i | \
# grep 'charset=binary' | \ # grep 'charset=binary' | \
# grep 'x-executable\|x-archive\|x-sharedlib' | \ # grep 'x-executable\|x-archive\|x-sharedlib' | \
# awk -F: '{print $1}' | xargs strip -s # awk -F: '{print $1}' | xargs strip -s
# Modifications to the environment that are necessary to run # Modifications to the environment that are necessary to run
RUN cd /opt/spack-environment && \ # Also make sure we keep the /lib/x86_65-linux-gnu in our PATH
spack env activate --sh -d . > /etc/profile.d/z10_spack_environment.sh && \ RUN cd /opt/spack-environment \
echo "export BINARY_TAG=x86_64-linux-gcc9-opt" >> /etc/profile.d/z10_spack_environment.sh && spack env activate --sh -d . > /etc/profile.d/z10_spack_environment.sh \
&& sed -i "s?LD_LIBRARY_PATH=?&/lib/x86_64-linux-gnu:?" /etc/profile.d/z10_spack_environment.sh
## # Add some extra environment variables
# Somehow PODIO env isn't automatically set,
# and Gaudi likes BINARY_TAG to be set
RUN cd /opt/spack-environment \
&& spack env activate . \
&& export PODIO=`spack find -p podio | grep software | awk '{print $2}'` \
&& echo "export PODIO=${PODIO};" >> /etc/profile.d/z10_spack_environment.sh \
&& echo "export BINARY_TAG=x86_64-linux-gcc9-opt" >> /etc/profile.d/z10_spack_environment.sh
## make sure we have the entrypoints setup correctly ## make sure we have the entrypoints setup correctly
ENTRYPOINT [] ENTRYPOINT []
......
spack:
specs:
- cmake@3.17.3
- fmt@6.1.2 cxxstd=17
- spdlog@1.5.0
- nlohmann-json
- heppdt@3.04.01
- clhep@2.4.1.3 cxxstd=17
- eigen@3.3.7
- python@3.7.7
- py-pip
- py-numpy
- py-pyyaml
- py-yapf
- xrootd@4.12.3 cxxstd=17 +python
- root@6.22.00 cxxstd=17 +dataframe +fftw +fortran +gdml +http +mlp +pythia8 +root7 +tmva +vc +xrootd +ssl ^mesa+opengl -llvm -osmesa
- pythia8@8244
- hepmc3@3.2.2 +python +rootio
- stow@2.2.2
- podio@0.11.0
- geant4@10.6.2 cxxstd=17 +opengl +vecgeom +x11 +qt ^qt +opengl
- dd4hep@1.13.1 +geant4 +assimp +hepmc3
- acts@0.29.0 +dd4hep +digitization +identification +json +tgeo
- gaudi@33.2
concretization: together
config:
install_tree: /opt/software
view: /usr/local
...@@ -5,7 +5,7 @@ FROM eicweb.phy.anl.gov:4567/containers/eic_container/eic_builder:latest as buil ...@@ -5,7 +5,7 @@ FROM eicweb.phy.anl.gov:4567/containers/eic_container/eic_builder:latest as buil
RUN cd /opt/spack-environment && spack env activate . && spack gc -y RUN cd /opt/spack-environment && spack env activate . && spack gc -y
# Strip all the binaries # Strip all the binaries
RUN find -L /opt/view/* -type f -exec readlink -f '{}' \; | \ RUN find -L /usr/local/* -type f -exec readlink -f '{}' \; | \
xargs file -i | \ xargs file -i | \
grep 'charset=binary' | \ grep 'charset=binary' | \
grep 'x-executable\|x-archive\|x-sharedlib' | \ grep 'x-executable\|x-archive\|x-sharedlib' | \
...@@ -29,15 +29,8 @@ ENV DOCKERFILE_DISTRO=ubuntu \ ...@@ -29,15 +29,8 @@ ENV DOCKERFILE_DISTRO=ubuntu \
## Copy over files from builder ## Copy over files from builder
COPY --from=builder /opt/spack-environment /opt/spack-environment COPY --from=builder /opt/spack-environment /opt/spack-environment
COPY --from=builder /opt/software /opt/software COPY --from=builder /opt/software /opt/software
COPY --from=builder /opt/view /opt/view RUN rm -rf /usr/local
COPY --from=builder /usr/local /usr/local
## Symlink /opt/view to /usr/local
## Maybe in a future release we should install the view directly to /usr/local
## Note that this is mostly useful for downstream use of the container (e.g.
## using the default install prefix for cmake-based builds), as this way
## the users don't have to remember the special /opt/view directory, which is
## more an internal detail of how the container works.
RUN rm -rf /usr/local && ln -s /opt/view /usr/local
## eic-shell and environment scripts. Not strictly needed anymore now we auto-load ## eic-shell and environment scripts. Not strictly needed anymore now we auto-load
## the environment but still provided for backward compatibility (and documentation). ## the environment but still provided for backward compatibility (and documentation).
......
...@@ -9,10 +9,6 @@ mkdir -p config ...@@ -9,10 +9,6 @@ mkdir -p config
cp /etc/profile.d/z10_spack_environment.sh config/spack-env.sh cp /etc/profile.d/z10_spack_environment.sh config/spack-env.sh
## ensure we also have /lib/x86_64-linux-gnu in our library path
## as it contains important ubuntu system libraries
sed -i "s?LD_LIBRARY_PATH=?&/lib/x86_64-linux-gnu:?" config/spack-env.sh
## Spack sets the man-path, which stops bash from using the default man-path ## Spack sets the man-path, which stops bash from using the default man-path
## We can fix this by appending a trailing colon to MANPATH ## We can fix this by appending a trailing colon to MANPATH
sed -i '/MANPATH/ s/;$/:;/' config/spack-env.sh sed -i '/MANPATH/ s/;$/:;/' config/spack-env.sh
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment