diff --git a/containers/builder/Dockerfile b/containers/builder/Dockerfile index 5c1f58d3373cfa687410502273cb910c6c6d1baf..abd3dc77e2676f0a3f1a4b6008791f020c81d14f 100644 --- a/containers/builder/Dockerfile +++ b/containers/builder/Dockerfile @@ -1,3 +1,5 @@ +#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 [] diff --git a/gitlab-ci/docker/Makefile b/gitlab-ci/docker/Makefile index 876327160e5d7ace219bbaa4860030b6cc29692b..d70b8478e1131397ace16da0b0dcd681a32185b3 100644 --- a/gitlab-ci/docker/Makefile +++ b/gitlab-ci/docker/Makefile @@ -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 . # ========================================================================== #