diff --git a/containers/builder/Dockerfile b/containers/builder/Dockerfile index 5c1f58d3373cfa687410502273cb910c6c6d1baf..b4ad45046c3d881c20dbc92707647884ec39e5e7 100644 --- a/containers/builder/Dockerfile +++ b/containers/builder/Dockerfile @@ -19,11 +19,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 @@ -37,6 +37,12 @@ RUN rm -rf $SPACK_ROOT/np-spack \ && echo " - $SPACK_ROOT/np-spack" >> $SPACK_ROOT/etc/spack/repos.yaml COPY np-spack $SPACK_ROOT/np-spack +## FIXME: need to use local filesystem for spack buildcache upstream +RUN ls /spack-mirror \ + && spack mirror remove silicon \ + && spack mirror add local /spack-mirror \ + && spack mirror list + ## Install the software, no garbage collection at this stage ## as this is a raw builder image RUN cd /opt/spack-environment \ @@ -44,27 +50,32 @@ RUN cd /opt/spack-environment \ && 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 []