Skip to content
Snippets Groups Projects
Commit 8c64a411 authored by Ujwal Kundur's avatar Ujwal Kundur
Browse files

Integration Test Scenario #5

Use Debian_base as the base image instead of oneAPI.
Final Lean image is based on oneAPI with required files copied from
staging.
parent ea0eacba
No related branches found
No related tags found
No related merge requests found
This commit is part of merge request !306. Comments created here will be created in the context of that merge request.
...@@ -185,7 +185,6 @@ oneapi_jug_dev:default: ...@@ -185,7 +185,6 @@ oneapi_jug_dev:default:
- docker build -t ${CI_REGISTRY_IMAGE}/${BUILD_IMAGE}:${INTERNAL_TAG} - docker build -t ${CI_REGISTRY_IMAGE}/${BUILD_IMAGE}:${INTERNAL_TAG}
-f containers/oneapi/onedev.Dockerfile -f containers/oneapi/onedev.Dockerfile
containers/oneapi containers/oneapi
--no-cache
- !reference [.build, script] - !reference [.build, script]
......
...@@ -2,89 +2,28 @@ ...@@ -2,89 +2,28 @@
# Container based on Jug_dev with Intel oneAPI support. # Container based on Jug_dev with Intel oneAPI support.
# Start with Debian base and layer oneAPI on top, prevents spack compiler errors.
## ======================================================================================== ## ========================================================================================
## STAGE 1: Set up Intel OneAPI Toolkit ## STAGE 1: spack builder image
## Use Intel's HPC-kit ## EIC builder image with spack
## ======================================================================================== ## ========================================================================================
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 ${DOCKER_REGISTRY}debian_base:${INTERNAL_TAG} as builder
COPY bashrc /root/.bashrc
ENV CLICOLOR_FORCE=1 \
LANGUAGE=en_US.UTF-8 \
LANG=en_US.UTF-8 \
LC_ALL=en_US.UTF-8
## Install additional packages. Remove the auto-cleanup functionality ## Install some extra spack dependencies
## 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)
## 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 \ RUN --mount=type=cache,target=/var/cache/apt \
rm -f /etc/apt/apt.conf.d/docker-clean \ rm -f /etc/apt/apt.conf.d/docker-clean \
&& ln -fs /usr/share/zoneinfo/America/New_York /etc/localtime \
&& echo "US/Eastern" > /etc/timezone \
&& apt-get -yqq update \ && apt-get -yqq update \
&& apt-get -yqq upgrade \
&& apt-get -yqq install --no-install-recommends \ && apt-get -yqq install --no-install-recommends \
bc \
ca-certificates \
clang-format \
clang-tidy \
curl \
file \
build-essential \
gdb \
gfortran \
ghostscript \
git \
gnupg2 \
gv \
iproute2 \
iputils-ping \
iputils-tracepath \
less \
libcbor-xs-perl \
libjson-xs-perl \
libyaml-cpp-dev \
locales \
lua-posix \
make \
nano \
openssh-client \
parallel \
poppler-utils \
python3 \ python3 \
python3-dev \ python3-dev \
python3-distutils \ python3-distutils \
time \ python-is-python3 \
unzip \ && rm -rf /var/lib/apt/lists/*
valgrind \
vim-nox \
wget \
&& localedef -i en_US -f UTF-8 en_US.UTF-8 \
&& gcc --version \
&& curl -L \
"https://packages.gitlab.com/install/repositories/runner/gitlab-runner/script.deb.sh" \
| bash \
&& sed -i "s/bookworm/buster/" \
/etc/apt/sources.list.d/runner_gitlab-runner.list \
&& apt-get -yqq update \
&& apt-get -yqq install --no-install-recommends \
gitlab-runner \
&& apt-get -yqq autoremove \
&& rm -rf /var/lib/apt/lists/*
## ========================================================================================
## STAGE 2: spack builder image
## EIC builder image with spack
## ========================================================================================
FROM oneapi AS builder
## Setup spack ## Setup spack
...@@ -236,7 +175,7 @@ USER 0 ...@@ -236,7 +175,7 @@ USER 0
WORKDIR / WORKDIR /
## ======================================================================================== ## ========================================================================================
## STAGE 3: staging image with unnecessariy packages removed and stripped binaries ## STAGE 2: staging image with unnecessariy packages removed and stripped binaries
## ======================================================================================== ## ========================================================================================
FROM builder AS staging FROM builder AS staging
...@@ -286,25 +225,94 @@ ADD https://dl.min.io/client/mc/release/linux-amd64/mc /usr/local/bin ...@@ -286,25 +225,94 @@ ADD https://dl.min.io/client/mc/release/linux-amd64/mc /usr/local/bin
RUN chmod a+x /usr/local/bin/mc RUN chmod a+x /usr/local/bin/mc
## ======================================================================================== ## ========================================================================================
## STAGE 4 ## STAGE 3: Set up Intel OneAPI Toolkit
## Lean target image ## Use Intel's HPC-kit and Create Lean image from staging
## ======================================================================================== ## ========================================================================================
FROM staging AS lean FROM intel/oneapi-hpckit:2022.1.2-devel-ubuntu18.04 AS oneapi
# We cannot use a new base image and copy from staging
# So, remove spack and clean-up existing image COPY bashrc /root/.bashrc
RUN rm -rf $SPACK_ROOT \
&& rm -rf /var/cache/spack-mirror \ ENV CLICOLOR_FORCE=1 \
&& export PATH=$OLD_PATH \ LANGUAGE=en_US.UTF-8 \
&& unset OLD_PATH \ LANG=en_US.UTF-8 \
&& rm -rf /usr/local \ LC_ALL=en_US.UTF-8
## 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)
## 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 \
rm -f /etc/apt/apt.conf.d/docker-clean \
&& ln -fs /usr/share/zoneinfo/America/New_York /etc/localtime \
&& echo "US/Eastern" > /etc/timezone \
&& apt-get -yqq update \
&& apt-get -yqq upgrade \
&& apt-get -yqq install --no-install-recommends \
bc \
ca-certificates \
clang-format \
clang-tidy \
curl \
file \
build-essential \
gdb \
ghostscript \
git \
gnupg2 \
gv \
iproute2 \
iputils-ping \
iputils-tracepath \
less \
libcbor-xs-perl \
libjson-xs-perl \
libyaml-cpp-dev \
locales \
lua-posix \
make \
nano \
openssh-client \
parallel \
poppler-utils \
python3 \
python3-dev \
python3-distutils \
time \
unzip \
valgrind \
vim-nox \
wget \
&& localedef -i en_US -f UTF-8 en_US.UTF-8 \
&& gcc --version \
&& curl -L \
"https://packages.gitlab.com/install/repositories/runner/gitlab-runner/script.deb.sh" \
| bash \
&& sed -i "s/bookworm/buster/" \
/etc/apt/sources.list.d/runner_gitlab-runner.list \
&& apt-get -yqq update \
&& apt-get -yqq install --no-install-recommends \
gitlab-runner \
&& apt-get -yqq autoremove \
&& rm -rf /var/lib/apt/lists/*
## copy over everything we need from staging in a single layer
RUN --mount=from=staging,target=/staging \
rm -rf /usr/local \
&& cp -r /staging/opt/spack-environment /opt/spack-environment \
&& cp -r /staging/opt/software /opt/software \
&& cp -r /staging/usr/._local /usr/._local \
&& cd /usr/._local \ && cd /usr/._local \
&& PREFIX_PATH=$(realpath $(ls | tail -n1)) \ && PREFIX_PATH=$(realpath $(ls | tail -n1)) \
&& echo "Found spack true prefix path to be $PREFIX_PATH" \ && echo "Found spack true prefix path to be $PREFIX_PATH" \
&& cd - \ && cd - \
&& ln -s ${PREFIX_PATH} /usr/local && ln -s ${PREFIX_PATH} /usr/local \
&& cp /staging/etc/profile.d/*.sh /etc/profile.d/ \
&& cp /staging/etc/eic-env.sh /etc/eic-env.sh \
&& cp /staging/etc/jug_info /etc/jug_info \
&& cp -r /staging/.singularity.d /.singularity.d
## set the jug_dev version and add the afterburner ## set the jug_dev version and add the afterburner
## TODO: move afterburner to spack when possible ## TODO: move afterburner to spack when possible
...@@ -319,4 +327,3 @@ CMD ["bash", "--rcfile", "/etc/profile", "-l"] ...@@ -319,4 +327,3 @@ CMD ["bash", "--rcfile", "/etc/profile", "-l"]
USER 0 USER 0
WORKDIR / WORKDIR /
SHELL ["/usr/local/bin/eic-shell"] SHELL ["/usr/local/bin/eic-shell"]
...@@ -46,17 +46,3 @@ spack: ...@@ -46,17 +46,3 @@ spack:
all: all:
compiler: [gcc] compiler: [gcc]
view: /usr/local view: /usr/local
compilers::
- compiler:
spec: gcc@11.2.0
paths:
cc: /usr/bin/gcc
cxx: /usr/bin/g++
f77: /usr/bin/gfortran
fc: /usr/bin/gfortran
flags: {}
operating_system: ubuntu18.04
target: x86_64
modules: []
environment: {}
extra_rpaths: []
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment