From 2444675d19a573421e45db89f6eb5de6832421d4 Mon Sep 17 00:00:00 2001
From: Sylvester Joosten <sjoosten@anl.gov>
Date: Tue, 1 Dec 2020 14:44:53 +0000
Subject: [PATCH] Explicitly added custom spack packages to repo

---
 containers/builder/Dockerfile | 25 ++++---------------------
 spack                         |  1 +
 2 files changed, 5 insertions(+), 21 deletions(-)
 create mode 160000 spack

diff --git a/containers/builder/Dockerfile b/containers/builder/Dockerfile
index 3c763cdd4..03ff8664a 100644
--- a/containers/builder/Dockerfile
+++ b/containers/builder/Dockerfile
@@ -28,12 +28,12 @@ RUN apt-get -yqq update \
 COPY spack.yaml /opt/spack-environment/spack.yaml
 
 ## Ensure an up-to-date custom package list
+## TODO: We should just remove this from the upstream container
+##       and only initialize the custom packages here for more
+##       transparency
 RUN rm -rf $SPACK_ROOT/np-spack \
- && git clone https://eicweb.phy.anl.gov/EIC/np-spack.git $SPACK_ROOT/np-spack \
+ && cp -r ../../spack $SPACK_ROOT/np-spack
  && cd $SPACK_ROOT/np-spack \
- && git checkout v$(spack --version) \
- && cd - \
- && echo "DISABLED: 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
 
@@ -51,23 +51,6 @@ RUN cd /opt/spack-environment && spack env activate . \
                 --no-cache-dir \
         ipython matplotlib scipy yapf
 
-## --> disabled for now as we are changing them by the hour
-## 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 add eicd@master \
- #&& spack install \
- #&& spack clean -a
-
-## Strip the binaries/DISABLED for builder, do this for release step
-#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 \
diff --git a/spack b/spack
new file mode 160000
index 000000000..833ec2b99
--- /dev/null
+++ b/spack
@@ -0,0 +1 @@
+Subproject commit 833ec2b9997e0c09a40b52aae1861adf4c0f742b
-- 
GitLab