Skip to content

Commit

Permalink
reduce size by bringing all spack commands into a single script that …
Browse files Browse the repository at this point in the history
…deletes everything but the view after successfully building
  • Loading branch information
white238 committed Aug 17, 2023
1 parent 73a71a2 commit 8d1d50f
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 79 deletions.
40 changes: 0 additions & 40 deletions scripts/set-up-spack.sh

This file was deleted.

1 change: 0 additions & 1 deletion scripts/ubuntu/apt-install-defaults-plus-args.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ packages=(
# fetchers
ca-certificates
curl
git
wget
# interactive tools
valgrind
Expand Down
16 changes: 7 additions & 9 deletions ubuntu/20.04/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ FROM ubuntu:20.04@sha256:33a5cc25d22c45900796a1aca487ad7a7cb09f09ea00b779e3b2026

LABEL maintainer="Chris White <[email protected]>,@vsoch"

ARG uptodate_github_commit_spack__spack__develop=e381e166ec27bb56c2d3bc856e7020224a005d1d
ENV spack_commit=${uptodate_github_commit_spack__spack__develop}
ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=America/Los_Angeles

Expand All @@ -14,12 +12,12 @@ ENV PATH=/opt/view/bin:/opt/spack/bin:$PATH \
CMAKE_PREFIX_PATH=/opt/view \
ACLOCAL_PATH=/opt/view/share/aclocal

# Install repository scripts dir to /opt/scripts
RUN apt-get -qq update && apt-get -qq install -y --no-install-recommends git
# TODO: REMOVE THE BRANCH BEFORE MERGING
RUN GIT_SSL_NO_VERIFY=1 git clone -b task/white238/reduce_size https://github.com/rse-ops/docker-images.git && cp -R docker-images/scripts /opt/scripts && rm -rf docker-images

# Install base packages
WORKDIR /opt
COPY ./scripts /opt/scripts
# Install spack
RUN ./scripts/ubuntu/apt-install-defaults-plus-args.sh && \
./scripts/install-cmake-binary.sh && \
./scripts/set-up-spack.sh
# Tell spack to use this one without arguments
# NOTE: this has to be here, setting it earlier will kill spack
ENV SPACK_ENV=/opt/env
./scripts/install-cmake-binary.sh
18 changes: 9 additions & 9 deletions ubuntu/22.04/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ FROM ubuntu:22.04@sha256:ec050c32e4a6085b423d36ecd025c0d3ff00c38ab93a3d71a460ff1

LABEL maintainer="@vsoch"

ARG uptodate_github_commit_spack__spack__develop=e381e166ec27bb56c2d3bc856e7020224a005d1d
ENV spack_commit=${uptodate_github_commit_spack__spack__develop}
ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=America/Los_Angeles

Expand All @@ -14,12 +12,14 @@ ENV PATH=/opt/view/bin:/opt/spack/bin:$PATH \
CMAKE_PREFIX_PATH=/opt/view \
ACLOCAL_PATH=/opt/view/share/aclocal

# Install repository scripts dir to /opt/scripts
RUN apt-get -qq update && apt-get -qq install -y --no-install-recommends git
# TODO: Fix the git commands before merging
RUN GIT_SSL_NO_VERIFY=1 git clone -b task/white238/reduce_size https://github.com/white238/docker-images.git && \
cp -R docker-images/scripts /opt/scripts && \
rm -rf docker-images

# Install base packages
WORKDIR /opt
COPY ./scripts /opt/scripts
# Install spack
RUN ./scripts/ubuntu/apt-install-defaults-plus-args.sh && \
./scripts/install-cmake-binary.sh && \
./scripts/set-up-spack.sh
# Tell spack to use this one without arguments
# NOTE: this has to be here, setting it earlier will kill spack
ENV SPACK_ENV=/opt/env
./scripts/install-cmake-binary.sh
17 changes: 8 additions & 9 deletions ubuntu/23.04/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# TODO: fix this, it is pointing at 22.04 not 23.04
FROM ubuntu:22.04@sha256:ec050c32e4a6085b423d36ecd025c0d3ff00c38ab93a3d71a460ff1c44fa6d77

LABEL maintainer="@vsoch"

ARG uptodate_github_commit_spack__spack__develop=e381e166ec27bb56c2d3bc856e7020224a005d1d
ENV spack_commit=${uptodate_github_commit_spack__spack__develop}
ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=America/Los_Angeles

Expand All @@ -14,12 +13,12 @@ ENV PATH=/opt/view/bin:/opt/spack/bin:$PATH \
CMAKE_PREFIX_PATH=/opt/view \
ACLOCAL_PATH=/opt/view/share/aclocal

# Install repository scripts dir to /opt/scripts
RUN apt-get -qq update && apt-get -qq install -y --no-install-recommends git
# TODO: REMOVE THE BRANCH BEFORE MERGING
RUN GIT_SSL_NO_VERIFY=1 git clone -b task/white238/reduce_size https://github.com/rse-ops/docker-images.git && cp -R docker-images/scripts /opt/scripts && rm -rf docker-images

# Install base packages
WORKDIR /opt
COPY ./scripts /opt/scripts
# Install spack
RUN ./scripts/ubuntu/apt-install-defaults-plus-args.sh && \
./scripts/install-cmake-binary.sh && \
./scripts/set-up-spack.sh
# Tell spack to use this one without arguments
# NOTE: this has to be here, setting it earlier will kill spack
ENV SPACK_ENV=/opt/env
./scripts/install-cmake-binary.sh
17 changes: 6 additions & 11 deletions ubuntu/clang/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ARG ubuntu_version
FROM ghcr.io/rse-ops/ubuntu:$ubuntu_version
FROM white238:ubuntu22_base

# Install llvm with spack
ARG llvm_version
Expand All @@ -12,16 +12,11 @@ ENV llvm_spec="llvm@${llvm_version}+llvm_dylib+link_llvm_dylib~split_dwarf~lldb~
CXX=/opt/view/bin/clang++ \
CPP=/opt/view/bin/clang-cpp

# build compiler and set defaults
RUN spack external find hwloc ncurses \
&& spack spec --reuse "${llvm_spec}" \
&& spack add "${llvm_spec}" \
&& spack mirror add develop https://binaries.spack.io/releases/develop \
&& spack buildcache keys --install --trust \
&& spack install --fail-fast \
&& spack compiler add \
&& spack config add "packages:all:compiler:[${COMPILER_NAME}@${COMPILER_VERSION}]" \
&& update-alternatives --install /usr/bin/cc cc ${CC} 50 \
# build compiler and set defaults then remove spack to keep image size small
ARG uptodate_github_commit_spack__spack__develop=b8590fbd057621c9b71c5b274b21e1802d52bc45
ENV spack_commit=${uptodate_github_commit_spack__spack__develop}
RUN ./scripts/build-with-spack.sh "${llvm_spec}"
RUN update-alternatives --install /usr/bin/cc cc ${CC} 50 \
&& update-alternatives --install /usr/bin/c++ c++ ${CXX} 50 \
&& update-alternatives --install /usr/bin/cpp cpp ${CPP} 50 \
&& update-alternatives --install /usr/bin/c89 c89 ${CC} 50 \
Expand Down

0 comments on commit 8d1d50f

Please sign in to comment.