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
No related branches found
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 # Builder with Argonne EIC software
# #
FROM eicweb.phy.anl.gov:4567/containers/image_recipes/debian_spack:snapshot-20210408 FROM eicweb.phy.anl.gov:4567/containers/image_recipes/debian_spack:snapshot-20210408
...@@ -19,11 +21,11 @@ ENV DOCKERFILE_BASE=debian \ ...@@ -19,11 +21,11 @@ ENV DOCKERFILE_BASE=debian \
## install ghostview/ghostscript needed by some of the tools ## install ghostview/ghostscript needed by some of the tools
RUN apt-get -yqq update \ #RUN apt-get -yqq update \
&& apt-get -yqq install --no-install-recommends \ # && apt-get -yqq install --no-install-recommends \
ghostscript \ # ghostscript \
gv \ # gv \
&& rm -rf /var/lib/apt/lists/* # && rm -rf /var/lib/apt/lists/*
## Setup our environment definition ## Setup our environment definition
COPY spack.yaml /opt/spack-environment/spack.yaml COPY spack.yaml /opt/spack-environment/spack.yaml
...@@ -39,32 +41,38 @@ COPY np-spack $SPACK_ROOT/np-spack ...@@ -39,32 +41,38 @@ COPY np-spack $SPACK_ROOT/np-spack
## Install the software, no garbage collection at this stage ## Install the software, no garbage collection at this stage
## as this is a raw builder image ## as this is a raw builder image
RUN cd /opt/spack-environment \ RUN \
cd /opt/spack-environment \
&& spack env activate . \ && spack env activate . \
&& spack install -j64 \ && spack install -j64 \
&& spack clean -a && spack clean -a
## Install additional python packages ## extra post-spack steps
RUN cd /opt/spack-environment && spack env activate . \ ## Including some small fixes:
&& pip install --trusted-host pypi.org \ ## - Somehow PODIO env isn't automatically set,
--trusted-host files.pythonhosted.org \ ## - and Gaudi likes BINARY_TAG to be set
--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
RUN cd /opt/spack-environment \ RUN cd /opt/spack-environment \
&& echo -n "" \
&& echo "Grabbing environment info" \
&& spack env activate --sh -d . > /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 && sed -i "s?LD_LIBRARY_PATH=?&/lib/x86_64-linux-gnu:?" /etc/profile.d/z10_spack_environment.sh \
&& cd /opt/spack-environment \
# Add some extra environment variables && echo -n "" \
# Somehow PODIO env isn't automatically set, && echo "Add extra environment variables for Podio and Gaudi" \
# and Gaudi likes BINARY_TAG to be set && spack env activate . \
RUN cd /opt/spack-environment \
&& spack env activate . \
&& export PODIO=`spack find -p podio | grep software | awk '{print $2}'` \ && export PODIO=`spack find -p podio | grep software | awk '{print $2}'` \
&& echo "export PODIO=${PODIO};" >> /etc/profile.d/z10_spack_environment.sh \ && 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 ## make sure we have the entrypoints setup correctly
ENTRYPOINT [] ENTRYPOINT []
......
...@@ -27,14 +27,14 @@ help: ## This help. ...@@ -27,14 +27,14 @@ help: ## This help.
# ========================================================================== # ==========================================================================
# #
build: ## build the image build: ## build the image
docker build -t $(APP_NAME):$(VERSION) . DOCKER_BUILDKIT=1 docker build -t $(APP_NAME):$(VERSION) .
build-unstable: ## build the image 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) 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) 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