From fb066714a878a40b3e6ba39c670b29d03f0fcc62 Mon Sep 17 00:00:00 2001
From: Ujwal Kundur <ujwal.kundur@gmail.com>
Date: Mon, 20 Jun 2022 18:37:59 +0530
Subject: [PATCH] Integration Test Scenario #2

Previous testing failed due to intel/oneapi-hpckit not being used
despite being the first command in the Dockerfile.
The most probable cause is the name of the Dockerfile being the same as
jug/dev.Dockerfile.

Another change is the addition of another Build stage to reduce
final image size.
---
 .gitlab-ci.yml                                     |  2 +-
 .../oneapi/{dev.Dockerfile => onedev.Dockerfile}   | 14 ++++++++------
 2 files changed, 9 insertions(+), 7 deletions(-)
 rename containers/oneapi/{dev.Dockerfile => onedev.Dockerfile} (98%)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index f901d42a7..6c79ec74f 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -222,7 +222,7 @@ oneapi_jug_dev:default:
     ## Copy jug_dev files into build context
     - cp -r containers/jug/* containers/oneapi
     - docker build -t ${CI_REGISTRY_IMAGE}/${BUILD_IMAGE}:${INTERNAL_TAG} 
-                      -f containers/oneapi/dev.Dockerfile
+                      -f containers/oneapi/onedev.Dockerfile
                       containers/oneapi
     - !reference [.build, script]
 
diff --git a/containers/oneapi/dev.Dockerfile b/containers/oneapi/onedev.Dockerfile
similarity index 98%
rename from containers/oneapi/dev.Dockerfile
rename to containers/oneapi/onedev.Dockerfile
index 490a03c02..7dc4ccfa2 100644
--- a/containers/oneapi/dev.Dockerfile
+++ b/containers/oneapi/onedev.Dockerfile
@@ -8,10 +8,8 @@
 ## ========================================================================================
 
 
-ARG DOCKER_REGISTRY="eicweb.phy.anl.gov:4567/containers/eic_container/"
-ARG INTERNAL_TAG="testing" 
 
-FROM  intel/oneapi-hpckit:2022.1.2-devel-ubuntu18.04 as oneapi
+FROM  intel/oneapi-hpckit:2022.1.2-devel-ubuntu18.04 AS oneapi
 
 
 COPY bashrc /root/.bashrc
@@ -87,7 +85,7 @@ RUN --mount=type=cache,target=/var/cache/apt                            \
 ## EIC builder image with spack
 ## ========================================================================================
 
-FROM oneapi as builder
+FROM oneapi AS builder
 
 
 ## Setup spack
@@ -208,7 +206,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, 
@@ -238,7 +238,7 @@ WORKDIR /
 ## ========================================================================================
 ## STAGE 3: staging image with unnecessariy packages removed and stripped binaries
 ## ========================================================================================
-FROM builder as staging
+FROM builder AS staging
 
 RUN cd /opt/spack-environment && spack env activate . && spack gc -y
 # Strip all the binaries
@@ -290,6 +290,8 @@ RUN chmod a+x /usr/local/bin/mc
 ## Lean target image
 ## ========================================================================================
 
+FROM staging AS lean
+
 # We cannot use a new base image and copy from staging
 # So, remove spack and clean-up existing image
 RUN rm -rf $SPACK_ROOT                                                  \
-- 
GitLab