From ff2205a2f4cb170f840fcc0ab964320f3721fc85 Mon Sep 17 00:00:00 2001
From: Ujwal Kundur <pes2ug19cs197@pesu.pes.edu>
Date: Thu, 30 Jun 2022 00:24:17 +0000
Subject: [PATCH] Repo Cleanup

---
 .gitlab-ci.yml                | 14 +++++++-------
 containers/debian/Dockerfile  |  4 ++--
 containers/jug/dev.Dockerfile | 19 +++++++++++--------
 containers/jug/eic-env.sh     |  2 +-
 4 files changed, 21 insertions(+), 18 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index d5ad63182..914992517 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -70,23 +70,23 @@ workflow:
 ##  Workflows:
 ##  - master      --> config + all build stages + singularity
 #                            + nightly build:jug + nightly singularity
-##  - v3.0-stable --> config + all build stages + singularity
-##  - v3.0.0      --> config + all build stages + singularity
+##  - v4.0-stable --> config + all build stages + singularity
+##  - v4.0.0      --> config + all build stages + singularity
 ##  - MR          --> config + all build stages
 ##
 ##  Container images tags
 ##  - master      --> testing
 ##  - <nightly>   --> nightly (run as part of master)
-##  - v3.0-stable --> 3.0-stable
-##  - v3.0.0      --> 3.0-stable, 3.0.0
+##  - v4.0-stable --> 4.0-stable
+##  - v4.0.0      --> 4.0-stable, 4.0.0
 ##  - acadia     
-##  - MR          --> 3.0-unstable (on all registries)
+##  - MR          --> 4.0-unstable (on all registries)
 ##                --> unstable-mr-XXX (on eicweb only, untag at end of pipeline)
 ##  - all other   --> do nothing
 ##
 ## caching strategy for dispatch to multiple nodes and to avoid
 ##  --> try this strategy: https://medium.com/titansoft-engineering/docker-build-cache-sharing-on-multi-hosts-with-buildkit-and-buildx-eb8f7005918e
-##  (first try with buildx didn't pan out, let's try again later)
+
 
 version:
   stage: config
@@ -201,7 +201,7 @@ cuda_base:default:
     BUILD_IMAGE: "cuda_base"
   script:
     - docker build -t ${CI_REGISTRY_IMAGE}/${BUILD_IMAGE}:${INTERNAL_TAG} 
-                   containers/oneapi
+                   containers/cuda
     - !reference [.build, script]
 
 jug_dev:default:
diff --git a/containers/debian/Dockerfile b/containers/debian/Dockerfile
index d0caed73b..a0228889c 100644
--- a/containers/debian/Dockerfile
+++ b/containers/debian/Dockerfile
@@ -17,7 +17,7 @@ ENV CLICOLOR_FORCE=1                                                    \
 
 ## Install additional packages. Remove the auto-cleanup functionality
 ## for docker, as we're using the new buildkit cache instead.
-## We also install gitlab-runner, from the buster package (as bullseye is not available atm)
+## We also install gitlab-runner, from the bullseye package (as bookworm is not available atm)
 ## TODO: libyaml-cpp-dev is a dependency for afterburner. We can probably remove
 ##       this once afterburner is added to spack
 RUN --mount=type=cache,target=/var/cache/apt                            \
@@ -70,7 +70,7 @@ RUN --mount=type=cache,target=/var/cache/apt                            \
  && curl -L                                                             \
     "https://packages.gitlab.com/install/repositories/runner/gitlab-runner/script.deb.sh" \
     | bash                                                              \
- && sed -i "s/bookworm/buster/"                                         \
+ && sed -i "s/bookworm/bullseye/"                                       \
            /etc/apt/sources.list.d/runner_gitlab-runner.list            \
  && apt-get -yqq update                                                 \
  && apt-get -yqq install --no-install-recommends                        \
diff --git a/containers/jug/dev.Dockerfile b/containers/jug/dev.Dockerfile
index 385096846..51077b7ef 100644
--- a/containers/jug/dev.Dockerfile
+++ b/containers/jug/dev.Dockerfile
@@ -8,7 +8,7 @@ ARG INTERNAL_TAG="testing"
 ## ========================================================================================
 FROM ${DOCKER_REGISTRY}debian_base:${INTERNAL_TAG} as builder
 
-## instal some extra spack dependencies
+## install some extra spack dependencies
 RUN --mount=type=cache,target=/var/cache/apt                            \
     rm -f /etc/apt/apt.conf.d/docker-clean                              \
  && apt-get -yqq update                                                 \
@@ -32,7 +32,7 @@ RUN echo "Part 1: regular spack install (as in containerize)"           \
       git cherry-pick -n $SPACK_CHERRYPICKS ;                           \
     fi                                                                  \
  && cd -                                                                \
- && mkdir -p $SPACK_ROOT/opt/spack                                      \
+ && mkdir -p $SPACK_ROOT                                                \
  && cp -r /tmp/spack-staging/bin $SPACK_ROOT/bin                        \
  && cp -r /tmp/spack-staging/etc $SPACK_ROOT/etc                        \
  && cp -r /tmp/spack-staging/lib $SPACK_ROOT/lib                        \
@@ -73,6 +73,11 @@ RUN --mount=type=cache,target=/var/cache/spack-mirror                   \
  && spack mirror add docker /var/cache/spack-mirror                     \
  && spack mirror list
 
+## This variable will change whenevery either spack.yaml or our spack package
+## overrides change, triggering a rebuild
+ARG CACHE_BUST="hash"
+ARG CACHE_NUKE=""
+
 ## Setup our custom environment and package overrides
 COPY spack $SPACK_ROOT/eic-spack
 RUN spack repo add --scope site "$SPACK_ROOT/eic-spack"                 \
@@ -83,10 +88,6 @@ RUN spack repo add --scope site "$SPACK_ROOT/eic-spack"                 \
  && spack env activate .                                                \
  && spack concretize
 
-## This variable will change whenevery either spack.yaml or our spack package
-## overrides change, triggering a rebuild
-ARG CACHE_BUST="hash"
-ARG CACHE_NUKE=""
 
 ## Now execute the main build (or fetch from cache if possible)
 ## note, no-check-signature is needed to allow the quicker signature-less
@@ -136,7 +137,9 @@ RUN --mount=type=cache,target=/var/cache/pip                            \
     --trusted-host pypi.org                                             \
     --trusted-host files.pythonhosted.org                               \
     --cache-dir /var/cache/pip                                          \
-    --requirement /usr/local/etc/requirements.txt
+    --requirement /usr/local/etc/requirements.txt                       \
+    --no-warn-script-location
+    # ^ Supress not on PATH Warnings
 
 ## Including some small fixes:
 ##   - Somehow PODIO env isn't automatically set, 
@@ -171,7 +174,7 @@ FROM builder as staging
 RUN cd /opt/spack-environment && spack env activate . && spack gc -y
 # Strip all the binaries
 # This reduces the image by factor of x2, so worth the effort
-# note that we do not strip python libraries as can cause issues in some cases
+# note that we do not strip python libraries as it can cause issues in some cases
 RUN find -L /usr/local/*                                                \
          -type d -name site-packages -prune -false -o                   \
          -type f -not -name "zdll.lib" -not -name libtensorflow-lite.a  \
diff --git a/containers/jug/eic-env.sh b/containers/jug/eic-env.sh
index f4123dcce..6e9cbdecb 100755
--- a/containers/jug/eic-env.sh
+++ b/containers/jug/eic-env.sh
@@ -27,7 +27,7 @@ if [ -f /etc/jug_info ]; then
     esac
     ps1_preamble="${container}${sigil}> "
     export PS1_SIGIL=${sigil}
-    unset ${sigil}
+    unset sigil
   fi
   unset version
   unset container
-- 
GitLab