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

minor restructure of dockerfile, add dd4hep 4.16/cmake 3.20 fix

parent 57088b95
Branches
No related tags found
1 merge request!35Resolve "singularity container broken because of dd4hep/python issue"
#syntax=docker/dockerfile:1.2
# Builder with Argonne EIC software
#
FROM eicweb.phy.anl.gov:4567/containers/image_recipes/debian_spack:snapshot-20210408
......@@ -19,11 +21,11 @@ ENV DOCKERFILE_BASE=debian \
## install ghostview/ghostscript needed by some of the tools
RUN apt-get -yqq update \
&& apt-get -yqq install --no-install-recommends \
ghostscript \
gv \
&& rm -rf /var/lib/apt/lists/*
#RUN apt-get -yqq update \
# && apt-get -yqq install --no-install-recommends \
# ghostscript \
# gv \
# && rm -rf /var/lib/apt/lists/*
## Setup our environment definition
COPY spack.yaml /opt/spack-environment/spack.yaml
......@@ -39,32 +41,38 @@ COPY np-spack $SPACK_ROOT/np-spack
## Install the software, no garbage collection at this stage
## as this is a raw builder image
RUN cd /opt/spack-environment \
RUN \
cd /opt/spack-environment \
&& spack env activate . \
&& spack install -j64 \
&& 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 yapf
# Modifications to the environment that are necessary to run
# Also make sure we keep the /lib/x86_65-linux-gnu in our PATH
## extra post-spack steps
## Including some small fixes:
## - Somehow PODIO env isn't automatically set,
## - and Gaudi likes BINARY_TAG to be set
RUN cd /opt/spack-environment \
&& echo -n "" \
&& echo "Grabbing environment info" \
&& 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 . \
&& sed -i "s?LD_LIBRARY_PATH=?&/lib/x86_64-linux-gnu:?" /etc/profile.d/z10_spack_environment.sh \
&& cd /opt/spack-environment \
&& echo -n "" \
&& echo "Add extra environment variables for Podio and Gaudi" \
&& 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
&& echo "export BINARY_TAG=x86_64-linux-gcc9-opt" >> /etc/profile.d/z10_spack_environment.sh \
&& cd /opt/spack-environment && spack env activate . \
&& echo -n "" \
&& echo "Installing additional python packages" \
&& pip install --trusted-host pypi.org \
--trusted-host files.pythonhosted.org \
--no-cache-dir \
ipython matplotlib scipy yapf \
&& echo -n "" \
&& echo "Executing cmake patch for dd4hep 16.1" \
&& sed -i "s/FIND_PACKAGE(Python/#&/" /usr/local/cmake/DD4hepBuild.cmake
## make sure we have the entrypoints setup correctly
ENTRYPOINT []
......
......@@ -27,14 +27,14 @@ help: ## This help.
# ==========================================================================
#
build: ## build the image
docker build -t $(APP_NAME):$(VERSION) .
DOCKER_BUILDKIT=1 docker build -t $(APP_NAME):$(VERSION) .
build-unstable: ## build the image
docker build -t $(APP_NAME):$(VERSION)-unstable .
DOCKER_BUILDKIT=1 docker build -t $(APP_NAME):$(VERSION)-unstable .
build-nc: ## Build the container without caching (from scratch)
docker build --no-cache -t $(APP_NAME):$(VERSION) .
DOCKER_BUILDKIT=1 docker build --no-cache -t $(APP_NAME):$(VERSION) .
build-unstable-nc: ## Build the container without caching (from scratch)
docker build --no-cache -t $(APP_NAME):$(VERSION)-unstable .
DOCKER_BUILDKIT=1 docker build --no-cache -t $(APP_NAME):$(VERSION)-unstable .
# ==========================================================================
#
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment