Skip to content
Snippets Groups Projects

OneAPI Integration Testing

Merged Ujwal Kundur requested to merge ujwalk-oneapi-integration-testing into master
3 files
+ 92
100
Compare changes
  • Side-by-side
  • Inline
Files
3
  • 8c64a411
    Integration Test Scenario #5 · 8c64a411
    Ujwal Kundur authored
    Use Debian_base as the base image instead of oneAPI.
    Final Lean image is based on oneAPI with required files copied from
    staging.
@@ -2,89 +2,28 @@
# 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
## Use Intel's HPC-kit
## STAGE 1: spack builder image
## 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
COPY bashrc /root/.bashrc
ENV CLICOLOR_FORCE=1 \
LANGUAGE=en_US.UTF-8 \
LANG=en_US.UTF-8 \
LC_ALL=en_US.UTF-8
FROM ${DOCKER_REGISTRY}debian_base:${INTERNAL_TAG} as builder
## 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
## Install some extra spack dependencies
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 \
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-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/*
## ========================================================================================
## STAGE 2: spack builder image
## EIC builder image with spack
## ========================================================================================
FROM oneapi AS builder
python-is-python3 \
&& rm -rf /var/lib/apt/lists/*
## Setup spack
@@ -236,7 +175,7 @@ USER 0
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
@@ -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
## ========================================================================================
## STAGE 4
## Lean target image
## STAGE 3: Set up Intel OneAPI Toolkit
## 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
RUN rm -rf $SPACK_ROOT \
&& rm -rf /var/cache/spack-mirror \
&& export PATH=$OLD_PATH \
&& unset OLD_PATH \
&& rm -rf /usr/local \
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
## 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 \
&& PREFIX_PATH=$(realpath $(ls | tail -n1)) \
&& echo "Found spack true prefix path to be $PREFIX_PATH" \
&& 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
## TODO: move afterburner to spack when possible
@@ -319,4 +327,3 @@ CMD ["bash", "--rcfile", "/etc/profile", "-l"]
USER 0
WORKDIR /
SHELL ["/usr/local/bin/eic-shell"]
Loading