From 8ade8a77dd337a4d673575749f2545b1629aa254 Mon Sep 17 00:00:00 2001 From: Massimiliano Culpo Date: Thu, 30 Sep 2021 23:34:47 +0200 Subject: 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 --- share/spack/docker/amazonlinux-2.dockerfile | 10 +++++----- share/spack/docker/centos-7.dockerfile | 11 ++++++----- share/spack/docker/leap-15.dockerfile | 20 ++++++++++---------- share/spack/docker/ubuntu-1604.dockerfile | 3 +-- share/spack/docker/ubuntu-1804.dockerfile | 7 +------ 5 files changed, 23 insertions(+), 28 deletions(-) (limited to 'share') 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 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"] -- cgit v1.2.3-60-g2f50