summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMassimiliano Culpo <massimiliano.culpo@gmail.com>2021-09-30 23:34:47 +0200
committerGitHub <noreply@github.com>2021-09-30 23:34:47 +0200
commit8ade8a77dd337a4d673575749f2545b1629aa254 (patch)
tree0082ad6be1f7cf0c3d92934b01e5605722592e73
parent7bda430de0cb239bbb7ab86c7b6a7aa500fb9441 (diff)
downloadspack-8ade8a77dd337a4d673575749f2545b1629aa254.tar.gz
spack-8ade8a77dd337a4d673575749f2545b1629aa254.tar.bz2
spack-8ade8a77dd337a4d673575749f2545b1629aa254.tar.xz
spack-8ade8a77dd337a4d673575749f2545b1629aa254.zip
Build container images on Github Actions and push to multiple registries (#26247)
Modifications: - Modify the workflow to build container images without pushing when the workflow file itself is modified - Strip the leading ghcr.io/spack/ from env.container env.versioned to prepare pushing to multiple registries - Fixed CentOS 7 and Amazon Linux builds - Login and push to Docker Hub as well as Github Action - Add a badge to README.md with the status of docker images
-rw-r--r--.github/workflows/build-containers.yml38
-rw-r--r--README.md1
-rw-r--r--share/spack/docker/amazonlinux-2.dockerfile10
-rw-r--r--share/spack/docker/centos-7.dockerfile11
-rw-r--r--share/spack/docker/leap-15.dockerfile20
-rw-r--r--share/spack/docker/ubuntu-1604.dockerfile3
-rw-r--r--share/spack/docker/ubuntu-1804.dockerfile7
7 files changed, 51 insertions, 39 deletions
diff --git a/.github/workflows/build-containers.yml b/.github/workflows/build-containers.yml
index d2dd2d825e..74c7c9e1b1 100644
--- a/.github/workflows/build-containers.yml
+++ b/.github/workflows/build-containers.yml
@@ -1,8 +1,16 @@
-name: Build & Deploy Docker Containers
+name: Containers
on:
+ # This Workflow can be triggered manually
+ workflow_dispatch:
# Build new Spack develop containers nightly.
schedule:
- cron: '34 0 * * *'
+ # Run on pull requests that modify this file
+ pull_request:
+ branches:
+ - develop
+ paths:
+ - '.github/workflows/build-containers.yml'
# Let's also build & tag Spack containers on releases.
release:
types: [published]
@@ -29,7 +37,7 @@ jobs:
- name: Set Container Tag Normal (Nightly)
run: |
- container="ghcr.io/spack/${{ matrix.dockerfile[0]}}:latest"
+ container="${{ matrix.dockerfile[0] }}:latest"
echo "container=${container}" >> $GITHUB_ENV
echo "versioned=${container}" >> $GITHUB_ENV
@@ -37,7 +45,7 @@ jobs:
- name: Set Container Tag on Release
if: github.event_name == 'release'
run: |
- versioned="ghcr.io/spack/${{matrix.dockerfile[0]}}:${GITHUB_REF##*/}"
+ versioned="${{matrix.dockerfile[0]}}:${GITHUB_REF##*/}"
echo "versioned=${versioned}" >> $GITHUB_ENV
- name: Check ${{ matrix.dockerfile[1] }} Exists
@@ -48,6 +56,12 @@ jobs:
exit 1;
fi
+ - name: Set up QEMU
+ uses: docker/setup-qemu-action@v1
+
+ - name: Set up Docker Buildx
+ uses: docker/setup-buildx-action@v1
+
- name: Log in to GitHub Container Registry
uses: docker/login-action@v1
with:
@@ -55,18 +69,20 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- - name: Set up QEMU
- uses: docker/setup-qemu-action@v1
-
- - name: Set up Docker Buildx
- uses: docker/setup-buildx-action@v1
+ - name: Log in to DockerHub
+ uses: docker/login-action@v1
+ with:
+ username: ${{ secrets.DOCKERHUB_USERNAME }}
+ password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build & Deploy ${{ matrix.dockerfile[1] }}
uses: docker/build-push-action@v2
with:
file: share/spack/docker/${{matrix.dockerfile[1]}}
platforms: ${{ matrix.dockerfile[2] }}
- push: true
+ push: ${{ github.event_name != 'pull_request' }}
tags: |
- ${{ env.container }}
- ${{ env.versioned }}
+ spack/${{ env.container }}
+ spack/${{ env.versioned }}
+ ghcr.io/spack/${{ env.container }}
+ ghcr.io/spack/${{ env.versioned }}
diff --git a/README.md b/README.md
index 7e3fe88a43..186c0a1462 100644
--- a/README.md
+++ b/README.md
@@ -4,6 +4,7 @@
[![Bootstrapping](https://github.com/spack/spack/actions/workflows/bootstrap.yml/badge.svg)](https://github.com/spack/spack/actions/workflows/bootstrap.yml)
[![macOS Builds (nightly)](https://github.com/spack/spack/workflows/macOS%20builds%20nightly/badge.svg?branch=develop)](https://github.com/spack/spack/actions?query=workflow%3A%22macOS+builds+nightly%22)
[![codecov](https://codecov.io/gh/spack/spack/branch/develop/graph/badge.svg)](https://codecov.io/gh/spack/spack)
+[![Containers](https://github.com/spack/spack/actions/workflows/build-containers.yml/badge.svg)](https://github.com/spack/spack/actions/workflows/build-containers.yml)
[![Read the Docs](https://readthedocs.org/projects/spack/badge/?version=latest)](https://spack.readthedocs.io)
[![Slack](https://slack.spack.io/badge.svg)](https://slack.spack.io)
diff --git a/share/spack/docker/amazonlinux-2.dockerfile b/share/spack/docker/amazonlinux-2.dockerfile
index 70a99388a2..d4066f76c4 100644
--- a/share/spack/docker/amazonlinux-2.dockerfile
+++ b/share/spack/docker/amazonlinux-2.dockerfile
@@ -21,16 +21,15 @@ RUN yum update -y \
gnupg2 \
hostname \
iproute \
- Lmod \
make \
patch \
- python \
- python-pip \
- python-setuptools \
+ python3 \
+ python3-pip \
+ python3-setuptools \
tcl \
unzip \
which \
- && pip install boto3 \
+ && pip3 install boto3 \
&& rm -rf /var/cache/yum \
&& yum clean all
@@ -64,6 +63,7 @@ WORKDIR /root
SHELL ["docker-shell"]
# TODO: add a command to Spack that (re)creates the package cache
+RUN spack bootstrap untrust spack-install
RUN spack spec hdf5+mpi
ENTRYPOINT ["/bin/bash", "/opt/spack/share/spack/docker/entrypoint.bash"]
diff --git a/share/spack/docker/centos-7.dockerfile b/share/spack/docker/centos-7.dockerfile
index c8dc75a0f3..a8c6d64a2c 100644
--- a/share/spack/docker/centos-7.dockerfile
+++ b/share/spack/docker/centos-7.dockerfile
@@ -23,16 +23,16 @@ RUN yum update -y \
gnupg2 \
hostname \
iproute \
- Lmod \
make \
patch \
- python \
- python-pip \
- python-setuptools \
+ patchelf \
+ python3 \
+ python3-pip \
+ python3-setuptools \
tcl \
unzip \
which \
- && pip install boto3 \
+ && pip3 install boto3 \
&& rm -rf /var/cache/yum \
&& yum clean all
@@ -66,6 +66,7 @@ WORKDIR /root
SHELL ["docker-shell"]
# TODO: add a command to Spack that (re)creates the package cache
+RUN spack bootstrap untrust spack-install
RUN spack spec hdf5+mpi
ENTRYPOINT ["/bin/bash", "/opt/spack/share/spack/docker/entrypoint.bash"]
diff --git a/share/spack/docker/leap-15.dockerfile b/share/spack/docker/leap-15.dockerfile
index 1da72615ad..65375c359b 100644
--- a/share/spack/docker/leap-15.dockerfile
+++ b/share/spack/docker/leap-15.dockerfile
@@ -1,20 +1,20 @@
-FROM opensuse/leap:15.2
+FROM opensuse/leap:15.3
MAINTAINER Christian Goll <cgoll@suse.com>
ENV DOCKERFILE_BASE=opensuse \
DOCKERFILE_DISTRO=opensuse_leap \
- DOCKERFILE_DISTRO_VERSION=15.2 \
+ DOCKERFILE_DISTRO_VERSION=15.3 \
SPACK_ROOT=/opt/spack \
DEBIAN_FRONTEND=noninteractive \
CURRENTLY_BUILDING_DOCKER_IMAGE=1 \
container=docker
-RUN zypper ref && \
- zypper up -y && \
- zypper in -y python3-base python3-boto3\
- xz gzip tar bzip2 curl patch \
- gcc-c++ gcc-fortran make cmake automake &&\
- zypper clean
+RUN zypper ref && \
+ zypper up -y && \
+ zypper in -y python3-base python3-boto3 \
+ xz gzip tar bzip2 curl patch patchelf file \
+ gcc-c++ gcc-fortran make cmake automake && \
+ zypper clean
# clean up manpages
RUN rm -rf /var/cache/zypp/* \
@@ -51,8 +51,8 @@ RUN [ -f ~/.profile ] \
WORKDIR /root
SHELL ["docker-shell"]
-# Find tools which are in distro
-RUN ${SPACK_ROOT}/bin/spack external find --scope system
+# Disable bootstrapping from sources
+RUN ${SPACK_ROOT}/bin/spack bootstrap untrust spack-install
# TODO: add a command to Spack that (re)creates the package cache
RUN ${SPACK_ROOT}/bin/spack spec hdf5+mpi
diff --git a/share/spack/docker/ubuntu-1604.dockerfile b/share/spack/docker/ubuntu-1604.dockerfile
index c07cde5918..dd7fcb1910 100644
--- a/share/spack/docker/ubuntu-1604.dockerfile
+++ b/share/spack/docker/ubuntu-1604.dockerfile
@@ -21,9 +21,7 @@ RUN apt-get -yqq update \
git \
gnupg2 \
iproute2 \
- lmod \
locales \
- lua-posix \
make \
python3 \
python3-pip \
@@ -69,6 +67,7 @@ WORKDIR /root
SHELL ["docker-shell"]
# TODO: add a command to Spack that (re)creates the package cache
+RUN spack bootstrap untrust spack-install
RUN spack spec hdf5+mpi
ENTRYPOINT ["/bin/bash", "/opt/spack/share/spack/docker/entrypoint.bash"]
diff --git a/share/spack/docker/ubuntu-1804.dockerfile b/share/spack/docker/ubuntu-1804.dockerfile
index 9ba3bc6179..280f0b9a7d 100644
--- a/share/spack/docker/ubuntu-1804.dockerfile
+++ b/share/spack/docker/ubuntu-1804.dockerfile
@@ -21,9 +21,7 @@ RUN apt-get -yqq update \
git \
gnupg2 \
iproute2 \
- lmod \
locales \
- lua-posix \
make \
python3 \
python3-pip \
@@ -65,14 +63,11 @@ RUN [ -f ~/.profile ] \
&& sed -i 's/mesg n/( tty -s \&\& mesg n || true )/g' ~/.profile \
|| true
-# [WORKAROUND]
-# https://bugs.launchpad.net/ubuntu/+source/lua-posix/+bug/1752082
-RUN ln -s posix_c.so /usr/lib/$(uname -m)-linux-gnu/lua/5.2/posix.so
-
WORKDIR /root
SHELL ["docker-shell"]
# TODO: add a command to Spack that (re)creates the package cache
+RUN spack bootstrap untrust spack-install
RUN spack spec hdf5+mpi
ENTRYPOINT ["/bin/bash", "/opt/spack/share/spack/docker/entrypoint.bash"]