From da779dd4af03cd40e53dd338871c4ea6dca22b33 Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Mon, 1 Jul 2024 13:25:48 -0500 Subject: [PATCH 01/22] Use vault for centos7 and pull all RPM hacks to one file --- .circleci/test_docker_container.sh | 6 +----- centos6-vault.repo | 27 --------------------------- centos7-altarch-vault.repo | 27 +++++++++++++++++++++++++++ centos7-x86_64-vault.repo | 27 +++++++++++++++++++++++++++ linux-anvil-aarch64-cuda/Dockerfile | 24 ++++-------------------- linux-anvil-aarch64/Dockerfile | 7 ++++--- linux-anvil-alma/Dockerfile | 6 ++++-- linux-anvil-comp7/Dockerfile | 11 ++++------- linux-anvil-cuda/Dockerfile | 13 ++++--------- linux-anvil-ppc64le-cuda/Dockerfile | 11 ++++------- linux-anvil-ppc64le/Dockerfile | 7 ++++--- scripts/fix_rpm | 29 +++++++++++++++++++++++++++++ scripts/yum_clean_all | 7 ------- 13 files changed, 112 insertions(+), 90 deletions(-) delete mode 100644 centos6-vault.repo create mode 100644 centos7-altarch-vault.repo create mode 100644 centos7-x86_64-vault.repo create mode 100755 scripts/fix_rpm diff --git a/.circleci/test_docker_container.sh b/.circleci/test_docker_container.sh index d249abd0..6e52c31e 100755 --- a/.circleci/test_docker_container.sh +++ b/.circleci/test_docker_container.sh @@ -21,10 +21,6 @@ conda list conda install --yes --quiet conda-forge-pinning -c conda-forge set +e -conda info | grep "__glibc=2.12" -exit_code="$?" -if [[ "$exit_code" == 0 ]]; then - /usr/bin/sudo -n yum install -y mesa-libGL mesa-dri-drivers libselinux libXdamage libXxf86vm libXext libXfixes libXinerama libXrandr libXcursor libXcomposite libX11 libXi -fi +/usr/bin/sudo -n yum install mesa-libGL mesa-dri-drivers libselinux libXdamage libXxf86vm libXext touch /home/conda/feedstock_root/build_artifacts/conda-forge-build-done diff --git a/centos6-vault.repo b/centos6-vault.repo deleted file mode 100644 index 041ec2e7..00000000 --- a/centos6-vault.repo +++ /dev/null @@ -1,27 +0,0 @@ -[base] -name=CentOS-6.10 - Base -baseurl=https://vault.centos.org/6.10/os/$basearch/ -gpgcheck=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 - -#released updates -[updates] -name=CentOS-6.10 - Updates -baseurl=https://vault.centos.org/6.10/updates/$basearch/ -gpgcheck=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 - -#additional packages that may be useful -[extras] -name=CentOS-6.10 - Extras -baseurl=https://vault.centos.org/6.10/extras/$basearch/ -gpgcheck=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 - -#additional packages that extend functionality of existing packages -[centosplus] -name=CentOS-6.10 - Plus -baseurl=https://vault.centos.org/6.10/centosplus/$basearch/ -gpgcheck=1 -enabled=0 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 diff --git a/centos7-altarch-vault.repo b/centos7-altarch-vault.repo new file mode 100644 index 00000000..9d582f19 --- /dev/null +++ b/centos7-altarch-vault.repo @@ -0,0 +1,27 @@ +[base] +name=CentOS-7 - Base +baseurl=https://vault.centos.org/altarch/7.9.2009/os/$basearch/ +gpgcheck=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 + +#released updates +[updates] +name=CentOS-7 - Updates +baseurl=https://vault.centos.org/altarch/7.9.2009/updates/$basearch/ +gpgcheck=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 + +#additional packages that may be useful +[extras] +name=CentOS-7 - Extras +baseurl=https://vault.centos.org/altarch/7.9.2009/extras/$basearch/ +gpgcheck=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 + +#additional packages that extend functionality of existing packages +[centosplus] +name=CentOS-7 - Plus +baseurl=https://vault.centos.org/altarch/7.9.2009/centosplus/$basearch/ +gpgcheck=1 +enabled=0 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 diff --git a/centos7-x86_64-vault.repo b/centos7-x86_64-vault.repo new file mode 100644 index 00000000..c0539757 --- /dev/null +++ b/centos7-x86_64-vault.repo @@ -0,0 +1,27 @@ +[base] +name=CentOS-7 - Base +baseurl=https://vault.centos.org/7.9.2009/os/$basearch/ +gpgcheck=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 + +#released updates +[updates] +name=CentOS-7 - Updates +baseurl=https://vault.centos.org/7.9.2009/updates/$basearch/ +gpgcheck=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 + +#additional packages that may be useful +[extras] +name=CentOS-7 - Extras +baseurl=https://vault.centos.org/7.9.2009/extras/$basearch/ +gpgcheck=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 + +#additional packages that extend functionality of existing packages +[centosplus] +name=CentOS-7 - Plus +baseurl=https://vault.centos.org/7.9.2009/centosplus/$basearch/ +gpgcheck=1 +enabled=0 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 diff --git a/linux-anvil-aarch64-cuda/Dockerfile b/linux-anvil-aarch64-cuda/Dockerfile index fed7ccbe..6c232442 100644 --- a/linux-anvil-aarch64-cuda/Dockerfile +++ b/linux-anvil-aarch64-cuda/Dockerfile @@ -34,29 +34,13 @@ RUN ldconfig -v 2>/dev/null | grep -v ^$'\t' | cut -f1 -d":" >> /etc/ld.so.conf. # bust the docker cache so that we always rerun the installs below ADD https://loripsum.net/api /opt/docker/etc/gibberish -# Resolves a nasty NOKEY warning that appears when using yum. -# Naming convention changed with cos8 - see: -# * https://lists.centos.org/pipermail/centos-devel/2019-September/017847.html -# * https://www.centos.org/keys/#project-keys -RUN if [ "${DISTRO_NAME}${DISTRO_VER}" = "centos7" ]; then \ - rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 && \ - rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-7-aarch64; \ - elif [ "${DISTRO_NAME}${DISTRO_VER}" = "centos8" ]; then \ - rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial; \ - elif [ "${DISTRO_NAME}${DISTRO_VER}" = "ubi8" ]; then \ - rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release; \ - fi - # Add custom `yum_clean_all` script before using `yum` COPY scripts/yum_clean_all /opt/docker/bin/ -# Fallback to CentOS vault for CentOS 8 support. -RUN if [ "${DISTRO_NAME}${DISTRO_VER}" = "centos8" ]; then \ - find /etc/yum.repos.d/ -name "CentOS-*.repo" -exec \ - sed -i 's/mirrorlist/#mirrorlist/g;s|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' {} \; && \ - yum update -y --disablerepo=cuda && \ - /opt/docker/bin/yum_clean_all; \ - fi +# Add the archived repo URL and fix RPM imports +ADD centos7-x86_64-vault.repo /tmp/centos7-x86_64-vault.repo +ADD centos7-altarch-vault.repo /tmp/centos7-altarch-vault.repo +RUN scripts/fix_rpm # Install basic requirements. RUN yum update -y --disablerepo=cuda && \ diff --git a/linux-anvil-aarch64/Dockerfile b/linux-anvil-aarch64/Dockerfile index 8e4f3e41..f5078fb1 100644 --- a/linux-anvil-aarch64/Dockerfile +++ b/linux-anvil-aarch64/Dockerfile @@ -18,9 +18,10 @@ ENV LANGUAGE=en_US.UTF-8 # bust the docker cache so that we always rerun the installs below ADD https://loripsum.net/api /opt/docker/etc/gibberish -# Resolves a nasty NOKEY warning that appears when using yum. -RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-${DISTRO_VER} && \ - rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-${DISTRO_VER}-aarch64 +# Add the archived repo URL and fix RPM imports +ADD centos7-x86_64-vault.repo /tmp/centos7-x86_64-vault.repo +ADD centos7-altarch-vault.repo /tmp/centos7-altarch-vault.repo +RUN scripts/fix_rpm # (arm64v8/centos:7 only) Fix language override to get a working en_US.UTF-8 locale; backports: # https://github.com/CentOS/sig-cloud-instance-build/commit/2892c17fa8a520e58c3f42cd56587863fe675670 diff --git a/linux-anvil-alma/Dockerfile b/linux-anvil-alma/Dockerfile index 5d804919..77f5e491 100644 --- a/linux-anvil-alma/Dockerfile +++ b/linux-anvil-alma/Dockerfile @@ -23,8 +23,10 @@ ADD qemu-s390x-static /usr/bin/qemu-s390x-static # bust the docker cache so that we always rerun the installs below ADD https://loripsum.net/api /opt/docker/etc/gibberish -# Resolves a nasty NOKEY warning that appears when using yum. -RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux +# Add the archived repo URL and fix RPM imports +ADD centos7-x86_64-vault.repo /tmp/centos7-x86_64-vault.repo +ADD centos7-altarch-vault.repo /tmp/centos7-altarch-vault.repo +RUN scripts/fix_rpm # Install basic requirements. COPY scripts/yum_clean_all /opt/docker/bin/ diff --git a/linux-anvil-comp7/Dockerfile b/linux-anvil-comp7/Dockerfile index fd661e7f..a4cad4f9 100644 --- a/linux-anvil-comp7/Dockerfile +++ b/linux-anvil-comp7/Dockerfile @@ -20,13 +20,10 @@ ADD qemu-s390x-static /usr/bin/qemu-s390x-static # bust the docker cache so that we always rerun the installs below ADD https://loripsum.net/api /opt/docker/etc/gibberish -# Remove outdated repo URLs -RUN rm -rf /etc/yum.repos.d/* -# Add the archived centos6 repo URL -ADD centos6-vault.repo /etc/yum.repos.d/vault.repo - -# Resolves a nasty NOKEY warning that appears when using yum. -RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-${DISTRO_VER} +# Add the archived repo URL and fix RPM imports +ADD centos7-x86_64-vault.repo /tmp/centos7-x86_64-vault.repo +ADD centos7-altarch-vault.repo /tmp/centos7-altarch-vault.repo +RUN scripts/fix_rpm # Install basic requirements. COPY scripts/yum_clean_all /opt/docker/bin/ diff --git a/linux-anvil-cuda/Dockerfile b/linux-anvil-cuda/Dockerfile index a95965e6..af2df742 100644 --- a/linux-anvil-cuda/Dockerfile +++ b/linux-anvil-cuda/Dockerfile @@ -19,13 +19,6 @@ ENV LANG en_US.UTF-8 # Set path to CUDA install (this is a symlink to /usr/local/cuda-${CUDA_VER}) ENV CUDA_HOME /usr/local/cuda -# Remove outdated repo URLs -RUN if [[ "$DISTRO_VER" == "6" ]]; then rm -rf /etc/yum.repos.d/CentOS-*; fi -# Add the archived centos6 repo URL -ADD centos6-vault.repo /tmp/vault.repo -RUN if [[ "$DISTRO_VER" == "6" ]]; then cp /tmp/vault.repo /etc/yum.repos.d/vault.repo; fi -RUN rm /tmp/vault.repo - # we want to persist a path in ldconfig (to avoid having to always set LD_LIBRARY_PATH), but *after* the existing entries; # since entries in ld.so.conf.d have precedence before the preconfigured directories, we first add the latter to the former RUN ldconfig -v 2>/dev/null | grep -v ^$'\t' | cut -f1 -d":" >> /etc/ld.so.conf.d/cuda-$CUDA_VER.conf \ @@ -50,8 +43,10 @@ RUN ldconfig -v 2>/dev/null | grep -v ^$'\t' | cut -f1 -d":" >> /etc/ld.so.conf. # bust the docker cache so that we always rerun the installs below ADD https://loripsum.net/api /opt/docker/etc/gibberish -# Resolves a nasty NOKEY warning that appears when using yum. -RUN find /etc/pki/rpm-gpg/ -type f | xargs -I {} rpm --import "{}" +# Add the archived repo URL and fix RPM imports +ADD centos7-x86_64-vault.repo /tmp/centos7-x86_64-vault.repo +ADD centos7-altarch-vault.repo /tmp/centos7-altarch-vault.repo +RUN scripts/fix_rpm # Install basic requirements. COPY scripts/yum_clean_all /opt/docker/bin/ diff --git a/linux-anvil-ppc64le-cuda/Dockerfile b/linux-anvil-ppc64le-cuda/Dockerfile index a6faf5a7..33c85eea 100644 --- a/linux-anvil-ppc64le-cuda/Dockerfile +++ b/linux-anvil-ppc64le-cuda/Dockerfile @@ -67,13 +67,10 @@ RUN if [ "${DISTRO_NAME}${DISTRO_VER}" = "centos7" ]; then \ # Add custom `yum_clean_all` script before using `yum` COPY scripts/yum_clean_all /opt/docker/bin/ -# Fallback to CentOS vault for CentOS 8 support. -RUN if [ "${DISTRO_NAME}${DISTRO_VER}" = "centos8" ]; then \ - find /etc/yum.repos.d/ -name "CentOS-*.repo" -exec \ - sed -i 's/mirrorlist/#mirrorlist/g;s|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' {} \; && \ - yum update -y --disablerepo=cuda && \ - /opt/docker/bin/yum_clean_all; \ - fi +# Add the archived repo URL and fix RPM imports +ADD centos7-x86_64-vault.repo /tmp/centos7-x86_64-vault.repo +ADD centos7-altarch-vault.repo /tmp/centos7-altarch-vault.repo +RUN scripts/fix_rpm # Install basic requirements. RUN yum update -y --disablerepo=cuda && \ diff --git a/linux-anvil-ppc64le/Dockerfile b/linux-anvil-ppc64le/Dockerfile index ec23d7e2..d5f263f5 100644 --- a/linux-anvil-ppc64le/Dockerfile +++ b/linux-anvil-ppc64le/Dockerfile @@ -20,9 +20,10 @@ ENV LANGUAGE=en_US.UTF-8 # bust the docker cache so that we always rerun the installs below ADD https://loripsum.net/api /opt/docker/etc/gibberish -# Resolves a nasty NOKEY warning that appears when using yum. -RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-${DISTRO_VER} && \ - rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-AltArch-${DISTRO_VER}-ppc64le +# Add the archived repo URL and fix RPM imports +ADD centos7-x86_64-vault.repo /tmp/centos7-x86_64-vault.repo +ADD centos7-altarch-vault.repo /tmp/centos7-altarch-vault.repo +RUN scripts/fix_rpm # Install basic requirements. COPY scripts/yum_clean_all /opt/docker/bin/ diff --git a/scripts/fix_rpm b/scripts/fix_rpm new file mode 100755 index 00000000..5d9d6459 --- /dev/null +++ b/scripts/fix_rpm @@ -0,0 +1,29 @@ +#!/bin/bash + +set -exo pipefail + +# Remove outdated repo URLs +if [[ "$DISTRO_VER" == "7" ]]; then + rm -rf /etc/yum.repos.d/CentOS-*; + if [[ "$(uname -m)" == "x86_64" ]]; then + cp /tmp/centos7-x86_64-vault.repo /etc/yum.repos.d/vault.repo + else + cp /tmp/centos7-altarch-vault.repo /etc/yum.repos.d/vault.repo + fi +fi + +# Resolves a nasty NOKEY warning that appears when using yum. +if [[ "${DISTRO_NAME}${DISTRO_VER}" == "centos7" ]]; then \ + rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 && \ + if [[ "$(uname -m)" == "ppc64le" ]]; then + rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-AltArch-7-ppc64le; + elif [[ "$(uname -m)" == "aarch64" ]]; then + rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-AltArch-7-aarch64; + fi +elif [[ "${DISTRO_NAME}${DISTRO_VER}" == "centos8" ]]; then \ + rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial; \ +elif [[ "${DISTRO_NAME}${DISTRO_VER}" == "ubi8" ]]; then \ + rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release; \ +elif [[ "${DISTRO_NAME}${DISTRO_VER}" == "almalinux8" ]]; then \ + rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux +fi diff --git a/scripts/yum_clean_all b/scripts/yum_clean_all index 995efd82..c21e93f7 100755 --- a/scripts/yum_clean_all +++ b/scripts/yum_clean_all @@ -1,12 +1,5 @@ #! /bin/sh -eu # (centos:6 only) If glibc-common is updated, we have to manually purge non-en_US locales. -if grep -F 'CentOS release 6' /etc/centos-release ; then - if locale -a | grep nds_DE ; then - cp /usr/lib/locale/locale-archive /usr/lib/locale/locale-archive.tmpl - localedef -i en_US -f UTF-8 en_US.UTF-8 - : > /usr/lib/locale/locale-archive.tmpl - fi -fi yum clean all rm -rf /var/cache/yum/* From bf0465d51ced4d4a0ccffda72d925ed19500cb74 Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Mon, 1 Jul 2024 13:29:40 -0500 Subject: [PATCH 02/22] Fix gpgkey file --- centos7-altarch-vault.repo | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/centos7-altarch-vault.repo b/centos7-altarch-vault.repo index 9d582f19..97d115a1 100644 --- a/centos7-altarch-vault.repo +++ b/centos7-altarch-vault.repo @@ -2,21 +2,21 @@ name=CentOS-7 - Base baseurl=https://vault.centos.org/altarch/7.9.2009/os/$basearch/ gpgcheck=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-AltArch-7-$basearch #released updates [updates] name=CentOS-7 - Updates baseurl=https://vault.centos.org/altarch/7.9.2009/updates/$basearch/ gpgcheck=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-AltArch-7-$basearch #additional packages that may be useful [extras] name=CentOS-7 - Extras baseurl=https://vault.centos.org/altarch/7.9.2009/extras/$basearch/ gpgcheck=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-AltArch-7-$basearch #additional packages that extend functionality of existing packages [centosplus] @@ -24,4 +24,4 @@ name=CentOS-7 - Plus baseurl=https://vault.centos.org/altarch/7.9.2009/centosplus/$basearch/ gpgcheck=1 enabled=0 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-AltArch-7-$basearch From 035b69732075d49a9a0355d4916bf7e423eefd29 Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Mon, 1 Jul 2024 13:54:28 -0500 Subject: [PATCH 03/22] Fix running fix_rpm --- linux-anvil-aarch64-cuda/Dockerfile | 3 ++- linux-anvil-aarch64/Dockerfile | 3 ++- linux-anvil-alma/Dockerfile | 3 ++- linux-anvil-comp7/Dockerfile | 3 ++- linux-anvil-cuda/Dockerfile | 3 ++- linux-anvil-ppc64le-cuda/Dockerfile | 3 ++- linux-anvil-ppc64le/Dockerfile | 3 ++- 7 files changed, 14 insertions(+), 7 deletions(-) diff --git a/linux-anvil-aarch64-cuda/Dockerfile b/linux-anvil-aarch64-cuda/Dockerfile index 6c232442..18a3a4ca 100644 --- a/linux-anvil-aarch64-cuda/Dockerfile +++ b/linux-anvil-aarch64-cuda/Dockerfile @@ -40,7 +40,8 @@ COPY scripts/yum_clean_all /opt/docker/bin/ # Add the archived repo URL and fix RPM imports ADD centos7-x86_64-vault.repo /tmp/centos7-x86_64-vault.repo ADD centos7-altarch-vault.repo /tmp/centos7-altarch-vault.repo -RUN scripts/fix_rpm +ADD scripts/fix_rpm /opt/docker/bin/fix_rpm +RUN /opt/docker/bin/fix_rpm # Install basic requirements. RUN yum update -y --disablerepo=cuda && \ diff --git a/linux-anvil-aarch64/Dockerfile b/linux-anvil-aarch64/Dockerfile index f5078fb1..9248da41 100644 --- a/linux-anvil-aarch64/Dockerfile +++ b/linux-anvil-aarch64/Dockerfile @@ -21,7 +21,8 @@ ADD https://loripsum.net/api /opt/docker/etc/gibberish # Add the archived repo URL and fix RPM imports ADD centos7-x86_64-vault.repo /tmp/centos7-x86_64-vault.repo ADD centos7-altarch-vault.repo /tmp/centos7-altarch-vault.repo -RUN scripts/fix_rpm +ADD scripts/fix_rpm /opt/docker/bin/fix_rpm +RUN /opt/docker/bin/fix_rpm # (arm64v8/centos:7 only) Fix language override to get a working en_US.UTF-8 locale; backports: # https://github.com/CentOS/sig-cloud-instance-build/commit/2892c17fa8a520e58c3f42cd56587863fe675670 diff --git a/linux-anvil-alma/Dockerfile b/linux-anvil-alma/Dockerfile index 77f5e491..b8a79264 100644 --- a/linux-anvil-alma/Dockerfile +++ b/linux-anvil-alma/Dockerfile @@ -26,7 +26,8 @@ ADD https://loripsum.net/api /opt/docker/etc/gibberish # Add the archived repo URL and fix RPM imports ADD centos7-x86_64-vault.repo /tmp/centos7-x86_64-vault.repo ADD centos7-altarch-vault.repo /tmp/centos7-altarch-vault.repo -RUN scripts/fix_rpm +ADD scripts/fix_rpm /opt/docker/bin/fix_rpm +RUN /opt/docker/bin/fix_rpm # Install basic requirements. COPY scripts/yum_clean_all /opt/docker/bin/ diff --git a/linux-anvil-comp7/Dockerfile b/linux-anvil-comp7/Dockerfile index a4cad4f9..d7793962 100644 --- a/linux-anvil-comp7/Dockerfile +++ b/linux-anvil-comp7/Dockerfile @@ -23,7 +23,8 @@ ADD https://loripsum.net/api /opt/docker/etc/gibberish # Add the archived repo URL and fix RPM imports ADD centos7-x86_64-vault.repo /tmp/centos7-x86_64-vault.repo ADD centos7-altarch-vault.repo /tmp/centos7-altarch-vault.repo -RUN scripts/fix_rpm +ADD scripts/fix_rpm /opt/docker/bin/fix_rpm +RUN /opt/docker/bin/fix_rpm # Install basic requirements. COPY scripts/yum_clean_all /opt/docker/bin/ diff --git a/linux-anvil-cuda/Dockerfile b/linux-anvil-cuda/Dockerfile index af2df742..6975dd55 100644 --- a/linux-anvil-cuda/Dockerfile +++ b/linux-anvil-cuda/Dockerfile @@ -46,7 +46,8 @@ ADD https://loripsum.net/api /opt/docker/etc/gibberish # Add the archived repo URL and fix RPM imports ADD centos7-x86_64-vault.repo /tmp/centos7-x86_64-vault.repo ADD centos7-altarch-vault.repo /tmp/centos7-altarch-vault.repo -RUN scripts/fix_rpm +ADD scripts/fix_rpm /opt/docker/bin/fix_rpm +RUN /opt/docker/bin/fix_rpm # Install basic requirements. COPY scripts/yum_clean_all /opt/docker/bin/ diff --git a/linux-anvil-ppc64le-cuda/Dockerfile b/linux-anvil-ppc64le-cuda/Dockerfile index 33c85eea..dfec19ee 100644 --- a/linux-anvil-ppc64le-cuda/Dockerfile +++ b/linux-anvil-ppc64le-cuda/Dockerfile @@ -70,7 +70,8 @@ COPY scripts/yum_clean_all /opt/docker/bin/ # Add the archived repo URL and fix RPM imports ADD centos7-x86_64-vault.repo /tmp/centos7-x86_64-vault.repo ADD centos7-altarch-vault.repo /tmp/centos7-altarch-vault.repo -RUN scripts/fix_rpm +ADD scripts/fix_rpm /opt/docker/bin/fix_rpm +RUN /opt/docker/bin/fix_rpm # Install basic requirements. RUN yum update -y --disablerepo=cuda && \ diff --git a/linux-anvil-ppc64le/Dockerfile b/linux-anvil-ppc64le/Dockerfile index d5f263f5..fdf0dbcb 100644 --- a/linux-anvil-ppc64le/Dockerfile +++ b/linux-anvil-ppc64le/Dockerfile @@ -23,7 +23,8 @@ ADD https://loripsum.net/api /opt/docker/etc/gibberish # Add the archived repo URL and fix RPM imports ADD centos7-x86_64-vault.repo /tmp/centos7-x86_64-vault.repo ADD centos7-altarch-vault.repo /tmp/centos7-altarch-vault.repo -RUN scripts/fix_rpm +ADD scripts/fix_rpm /opt/docker/bin/fix_rpm +RUN /opt/docker/bin/fix_rpm # Install basic requirements. COPY scripts/yum_clean_all /opt/docker/bin/ From b119e81e276e4f5b343cc292fc90b74e0ed7e7e2 Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Mon, 1 Jul 2024 14:03:20 -0500 Subject: [PATCH 04/22] drop centos 6 image --- .github/workflows/ci.yaml | 6 ------ linux-anvil-cos7-x86_64/Dockerfile | 7 +++++-- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index ee01fa94..dad61642 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -17,12 +17,6 @@ jobs: fail-fast: false matrix: cfg: - - DOCKERIMAGE: linux-anvil-comp7 - DOCKERTAG: latest - DISTRO_NAME: "centos" - DISTRO_VER: "6" - SHORT_DESCRIPTION: "conda-forge build image for Cent0S 6 on x86_64" - - DOCKERIMAGE: linux-anvil-cos7-x86_64 DOCKERTAG: latest DISTRO_NAME: "centos" diff --git a/linux-anvil-cos7-x86_64/Dockerfile b/linux-anvil-cos7-x86_64/Dockerfile index e711c960..a0eefd9a 100644 --- a/linux-anvil-cos7-x86_64/Dockerfile +++ b/linux-anvil-cos7-x86_64/Dockerfile @@ -20,8 +20,11 @@ ADD qemu-s390x-static /usr/bin/qemu-s390x-static # bust the docker cache so that we always rerun the installs below ADD https://loripsum.net/api /opt/docker/etc/gibberish -# Resolves a nasty NOKEY warning that appears when using yum. -RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-${DISTRO_VER} +# Add the archived repo URL and fix RPM imports +ADD centos7-x86_64-vault.repo /tmp/centos7-x86_64-vault.repo +ADD centos7-altarch-vault.repo /tmp/centos7-altarch-vault.repo +ADD scripts/fix_rpm /opt/docker/bin/fix_rpm +RUN /opt/docker/bin/fix_rpm # Install basic requirements. COPY scripts/yum_clean_all /opt/docker/bin/ From 88e11b5d65e44b738257dbecf60689768c11b9f4 Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Mon, 1 Jul 2024 14:06:04 -0500 Subject: [PATCH 05/22] delete cos6 folder --- linux-anvil-comp7/Dockerfile | 53 ----------------------------- linux-anvil-comp7/entrypoint_source | 2 -- 2 files changed, 55 deletions(-) delete mode 100644 linux-anvil-comp7/Dockerfile delete mode 100644 linux-anvil-comp7/entrypoint_source diff --git a/linux-anvil-comp7/Dockerfile b/linux-anvil-comp7/Dockerfile deleted file mode 100644 index d7793962..00000000 --- a/linux-anvil-comp7/Dockerfile +++ /dev/null @@ -1,53 +0,0 @@ -ARG DISTRO_NAME -ARG DISTRO_VER -FROM ${DISTRO_NAME}:${DISTRO_VER} - -LABEL maintainer="conda-forge " - -ARG DISTRO_NAME -ARG DISTRO_VER -ENV DISTRO_NAME=${DISTRO_NAME} \ - DISTRO_VER=${DISTRO_VER} - -# Set an encoding to make things work smoothly. -ENV LANG en_US.UTF-8 - -# Add qemu in here so that we can use this image on regular linux hosts with qemu user installed -ADD qemu-aarch64-static /usr/bin/qemu-aarch64-static -ADD qemu-ppc64le-static /usr/bin/qemu-ppc64le-static -ADD qemu-s390x-static /usr/bin/qemu-s390x-static - -# bust the docker cache so that we always rerun the installs below -ADD https://loripsum.net/api /opt/docker/etc/gibberish - -# Add the archived repo URL and fix RPM imports -ADD centos7-x86_64-vault.repo /tmp/centos7-x86_64-vault.repo -ADD centos7-altarch-vault.repo /tmp/centos7-altarch-vault.repo -ADD scripts/fix_rpm /opt/docker/bin/fix_rpm -RUN /opt/docker/bin/fix_rpm - -# Install basic requirements. -COPY scripts/yum_clean_all /opt/docker/bin/ -RUN yum update -y && \ - yum install -y \ - bzip2 \ - sudo \ - tar \ - which && \ - /opt/docker/bin/yum_clean_all - -# Run common commands -COPY scripts/run_commands /opt/docker/bin/run_commands -RUN /opt/docker/bin/run_commands - -# Add a file for users to source to activate the `conda` -# environment `base`. Also add a file that wraps that for -# use with the `ENTRYPOINT`. -COPY linux-anvil-comp7/entrypoint_source /opt/docker/bin/entrypoint_source -COPY scripts/entrypoint /opt/docker/bin/entrypoint - -# Ensure that all containers start with tini and the user selected process. -# Activate the `conda` environment `base` and the devtoolset compiler. -# Provide a default command (`bash`), which will start if the user doesn't specify one. -ENTRYPOINT [ "/opt/conda/bin/tini", "--", "/opt/docker/bin/entrypoint" ] -CMD [ "/bin/bash" ] diff --git a/linux-anvil-comp7/entrypoint_source b/linux-anvil-comp7/entrypoint_source deleted file mode 100644 index 6dfd4211..00000000 --- a/linux-anvil-comp7/entrypoint_source +++ /dev/null @@ -1,2 +0,0 @@ -# Activate the `base` conda environment. -conda activate base From 4c0312758d4f1bb19e6089ba708f68a3d70bb394 Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Mon, 1 Jul 2024 14:11:02 -0500 Subject: [PATCH 06/22] debug --- scripts/fix_rpm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/fix_rpm b/scripts/fix_rpm index 5d9d6459..51468e44 100755 --- a/scripts/fix_rpm +++ b/scripts/fix_rpm @@ -10,6 +10,10 @@ if [[ "$DISTRO_VER" == "7" ]]; then else cp /tmp/centos7-altarch-vault.repo /etc/yum.repos.d/vault.repo fi + + for f in /etc/yum.repos.d/*; do + cat $f + done fi # Resolves a nasty NOKEY warning that appears when using yum. From 074cc8d419b22bdeeebbc3b1435243fccd2030a0 Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Mon, 1 Jul 2024 14:32:29 -0500 Subject: [PATCH 07/22] fix again --- scripts/fix_rpm | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/scripts/fix_rpm b/scripts/fix_rpm index 51468e44..74b81875 100755 --- a/scripts/fix_rpm +++ b/scripts/fix_rpm @@ -10,10 +10,8 @@ if [[ "$DISTRO_VER" == "7" ]]; then else cp /tmp/centos7-altarch-vault.repo /etc/yum.repos.d/vault.repo fi - - for f in /etc/yum.repos.d/*; do - cat $f - done + # Need to remove again because of some cache. Not sure where + yum update -y && rm -rf /etc/yum.repos.d/CentOS-* && yum update -y; fi # Resolves a nasty NOKEY warning that appears when using yum. From 81db62ee68d5f7a7388d0d7214780e8c00db5caa Mon Sep 17 00:00:00 2001 From: Marcel Bargull Date: Mon, 1 Jul 2024 22:03:47 +0200 Subject: [PATCH 08/22] Disable rpm repos instead of removing them Signed-off-by: Marcel Bargull --- centos7-altarch-vault.repo | 8 ++++---- centos7-x86_64-vault.repo | 8 ++++---- scripts/fix_rpm | 6 ++---- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/centos7-altarch-vault.repo b/centos7-altarch-vault.repo index 97d115a1..076cbbbf 100644 --- a/centos7-altarch-vault.repo +++ b/centos7-altarch-vault.repo @@ -1,25 +1,25 @@ -[base] +[vault-base] name=CentOS-7 - Base baseurl=https://vault.centos.org/altarch/7.9.2009/os/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-AltArch-7-$basearch #released updates -[updates] +[vault-updates] name=CentOS-7 - Updates baseurl=https://vault.centos.org/altarch/7.9.2009/updates/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-AltArch-7-$basearch #additional packages that may be useful -[extras] +[vault-extras] name=CentOS-7 - Extras baseurl=https://vault.centos.org/altarch/7.9.2009/extras/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-AltArch-7-$basearch #additional packages that extend functionality of existing packages -[centosplus] +[vault-centosplus] name=CentOS-7 - Plus baseurl=https://vault.centos.org/altarch/7.9.2009/centosplus/$basearch/ gpgcheck=1 diff --git a/centos7-x86_64-vault.repo b/centos7-x86_64-vault.repo index c0539757..ec4ea188 100644 --- a/centos7-x86_64-vault.repo +++ b/centos7-x86_64-vault.repo @@ -1,25 +1,25 @@ -[base] +[vault-base] name=CentOS-7 - Base baseurl=https://vault.centos.org/7.9.2009/os/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 #released updates -[updates] +[vault-updates] name=CentOS-7 - Updates baseurl=https://vault.centos.org/7.9.2009/updates/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 #additional packages that may be useful -[extras] +[vault-extras] name=CentOS-7 - Extras baseurl=https://vault.centos.org/7.9.2009/extras/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 #additional packages that extend functionality of existing packages -[centosplus] +[vault-centosplus] name=CentOS-7 - Plus baseurl=https://vault.centos.org/7.9.2009/centosplus/$basearch/ gpgcheck=1 diff --git a/scripts/fix_rpm b/scripts/fix_rpm index 74b81875..fb6d2fbd 100755 --- a/scripts/fix_rpm +++ b/scripts/fix_rpm @@ -2,16 +2,14 @@ set -exo pipefail -# Remove outdated repo URLs +# Disable outdated repos; use vault instead if [[ "$DISTRO_VER" == "7" ]]; then - rm -rf /etc/yum.repos.d/CentOS-*; + sed -i '/^\[/a\enabled=0' /etc/yum.repos.d/CentOS-Base.repo if [[ "$(uname -m)" == "x86_64" ]]; then cp /tmp/centos7-x86_64-vault.repo /etc/yum.repos.d/vault.repo else cp /tmp/centos7-altarch-vault.repo /etc/yum.repos.d/vault.repo fi - # Need to remove again because of some cache. Not sure where - yum update -y && rm -rf /etc/yum.repos.d/CentOS-* && yum update -y; fi # Resolves a nasty NOKEY warning that appears when using yum. From 74e348755d22a0fdf4a62e2b0026d51ecc61a362 Mon Sep 17 00:00:00 2001 From: Marcel Bargull Date: Mon, 1 Jul 2024 22:04:09 +0200 Subject: [PATCH 09/22] cleanup Signed-off-by: Marcel Bargull --- scripts/yum_clean_all | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/yum_clean_all b/scripts/yum_clean_all index c21e93f7..6405c9ec 100755 --- a/scripts/yum_clean_all +++ b/scripts/yum_clean_all @@ -1,5 +1,4 @@ #! /bin/sh -eu -# (centos:6 only) If glibc-common is updated, we have to manually purge non-en_US locales. yum clean all rm -rf /var/cache/yum/* From d962e75dcfb04cc09bdac76e47e2de6aab18419d Mon Sep 17 00:00:00 2001 From: Marcel Bargull Date: Mon, 1 Jul 2024 22:16:35 +0200 Subject: [PATCH 10/22] Also disable explicitly enabled yum repos Signed-off-by: Marcel Bargull --- scripts/fix_rpm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/fix_rpm b/scripts/fix_rpm index fb6d2fbd..6c6865fe 100755 --- a/scripts/fix_rpm +++ b/scripts/fix_rpm @@ -4,7 +4,7 @@ set -exo pipefail # Disable outdated repos; use vault instead if [[ "$DISTRO_VER" == "7" ]]; then - sed -i '/^\[/a\enabled=0' /etc/yum.repos.d/CentOS-Base.repo + sed -i '/^enabled=/d; /^\[/a\enabled=0' /etc/yum.repos.d/CentOS-Base.repo if [[ "$(uname -m)" == "x86_64" ]]; then cp /tmp/centos7-x86_64-vault.repo /etc/yum.repos.d/vault.repo else From 2546295d48c299327a44471754868c9a158566e7 Mon Sep 17 00:00:00 2001 From: Marcel Bargull Date: Mon, 1 Jul 2024 22:20:08 +0200 Subject: [PATCH 11/22] Use GPG keys from main and SIG AltArch Signed-off-by: Marcel Bargull --- centos7-altarch-vault.repo | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/centos7-altarch-vault.repo b/centos7-altarch-vault.repo index 076cbbbf..bdf1ecfc 100644 --- a/centos7-altarch-vault.repo +++ b/centos7-altarch-vault.repo @@ -2,21 +2,24 @@ name=CentOS-7 - Base baseurl=https://vault.centos.org/altarch/7.9.2009/os/$basearch/ gpgcheck=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-AltArch-7-$basearch +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 + file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-AltArch-7-$basearch #released updates [vault-updates] name=CentOS-7 - Updates baseurl=https://vault.centos.org/altarch/7.9.2009/updates/$basearch/ gpgcheck=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-AltArch-7-$basearch +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 + file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-AltArch-7-$basearch #additional packages that may be useful [vault-extras] name=CentOS-7 - Extras baseurl=https://vault.centos.org/altarch/7.9.2009/extras/$basearch/ gpgcheck=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-AltArch-7-$basearch +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 + file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-AltArch-7-$basearch #additional packages that extend functionality of existing packages [vault-centosplus] @@ -24,4 +27,5 @@ name=CentOS-7 - Plus baseurl=https://vault.centos.org/altarch/7.9.2009/centosplus/$basearch/ gpgcheck=1 enabled=0 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-AltArch-7-$basearch +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 + file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-AltArch-7-$basearch From f913e45b428b8660b7d6ad8186b7e5cc4e0ed4ca Mon Sep 17 00:00:00 2001 From: jakirkham Date: Mon, 1 Jul 2024 13:29:12 -0700 Subject: [PATCH 12/22] For ARM do language override before RPM fix Otherwise the RPM fix runs into errors to due encoding issues. --- linux-anvil-aarch64/Dockerfile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/linux-anvil-aarch64/Dockerfile b/linux-anvil-aarch64/Dockerfile index 9248da41..869e11df 100644 --- a/linux-anvil-aarch64/Dockerfile +++ b/linux-anvil-aarch64/Dockerfile @@ -18,15 +18,16 @@ ENV LANGUAGE=en_US.UTF-8 # bust the docker cache so that we always rerun the installs below ADD https://loripsum.net/api /opt/docker/etc/gibberish +# (arm64v8/centos:7 only) Fix language override to get a working en_US.UTF-8 locale; backports: +# https://github.com/CentOS/sig-cloud-instance-build/commit/2892c17fa8a520e58c3f42cd56587863fe675670 +RUN sed -i 's/override_install_langs=en_US\.UTF-8/override_install_langs=en_US.utf8/' /etc/yum.conf + # Add the archived repo URL and fix RPM imports ADD centos7-x86_64-vault.repo /tmp/centos7-x86_64-vault.repo ADD centos7-altarch-vault.repo /tmp/centos7-altarch-vault.repo ADD scripts/fix_rpm /opt/docker/bin/fix_rpm RUN /opt/docker/bin/fix_rpm -# (arm64v8/centos:7 only) Fix language override to get a working en_US.UTF-8 locale; backports: -# https://github.com/CentOS/sig-cloud-instance-build/commit/2892c17fa8a520e58c3f42cd56587863fe675670 -RUN sed -i 's/override_install_langs=en_US\.UTF-8/override_install_langs=en_US.utf8/' /etc/yum.conf # Install basic requirements. COPY scripts/yum_clean_all /opt/docker/bin/ RUN yum update -y && \ From 8f385baf784e8c7d86de9516e8166b3953525316 Mon Sep 17 00:00:00 2001 From: Marcel Bargull Date: Mon, 1 Jul 2024 22:35:25 +0200 Subject: [PATCH 13/22] Fix RPM-GPG-KEY-* name for aarch64 Signed-off-by: Marcel Bargull --- centos7-aarch64-vault.repo | 31 +++++++++++++++++++ ...h-vault.repo => centos7-ppc64le-vault.repo | 0 scripts/fix_rpm | 8 ++--- 3 files changed, 33 insertions(+), 6 deletions(-) create mode 100644 centos7-aarch64-vault.repo rename centos7-altarch-vault.repo => centos7-ppc64le-vault.repo (100%) diff --git a/centos7-aarch64-vault.repo b/centos7-aarch64-vault.repo new file mode 100644 index 00000000..1d1d0cf1 --- /dev/null +++ b/centos7-aarch64-vault.repo @@ -0,0 +1,31 @@ +[vault-base] +name=CentOS-7 - Base +baseurl=https://vault.centos.org/altarch/7.9.2009/os/$basearch/ +gpgcheck=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 + file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7-$basearch + +#released updates +[vault-updates] +name=CentOS-7 - Updates +baseurl=https://vault.centos.org/altarch/7.9.2009/updates/$basearch/ +gpgcheck=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 + file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7-$basearch + +#additional packages that may be useful +[vault-extras] +name=CentOS-7 - Extras +baseurl=https://vault.centos.org/altarch/7.9.2009/extras/$basearch/ +gpgcheck=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 + file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7-$basearch + +#additional packages that extend functionality of existing packages +[vault-centosplus] +name=CentOS-7 - Plus +baseurl=https://vault.centos.org/altarch/7.9.2009/centosplus/$basearch/ +gpgcheck=1 +enabled=0 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 + file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7-$basearch diff --git a/centos7-altarch-vault.repo b/centos7-ppc64le-vault.repo similarity index 100% rename from centos7-altarch-vault.repo rename to centos7-ppc64le-vault.repo diff --git a/scripts/fix_rpm b/scripts/fix_rpm index 6c6865fe..d26362d2 100755 --- a/scripts/fix_rpm +++ b/scripts/fix_rpm @@ -5,11 +5,7 @@ set -exo pipefail # Disable outdated repos; use vault instead if [[ "$DISTRO_VER" == "7" ]]; then sed -i '/^enabled=/d; /^\[/a\enabled=0' /etc/yum.repos.d/CentOS-Base.repo - if [[ "$(uname -m)" == "x86_64" ]]; then - cp /tmp/centos7-x86_64-vault.repo /etc/yum.repos.d/vault.repo - else - cp /tmp/centos7-altarch-vault.repo /etc/yum.repos.d/vault.repo - fi + cp "/tmp/centos7-$(uname -m)-vault.repo" /etc/yum.repos.d/vault.repo fi # Resolves a nasty NOKEY warning that appears when using yum. @@ -18,7 +14,7 @@ if [[ "${DISTRO_NAME}${DISTRO_VER}" == "centos7" ]]; then \ if [[ "$(uname -m)" == "ppc64le" ]]; then rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-AltArch-7-ppc64le; elif [[ "$(uname -m)" == "aarch64" ]]; then - rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-AltArch-7-aarch64; + rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7-aarch64; fi elif [[ "${DISTRO_NAME}${DISTRO_VER}" == "centos8" ]]; then \ rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial; \ From 95f0e6b4eb97ed2d17db8bb8921a9539e71e4ee5 Mon Sep 17 00:00:00 2001 From: Marcel Bargull Date: Mon, 1 Jul 2024 22:38:27 +0200 Subject: [PATCH 14/22] Fix RPM-GPG-KEY-* name for aarch64 #2 Signed-off-by: Marcel Bargull --- linux-anvil-aarch64-cuda/Dockerfile | 5 +++-- linux-anvil-aarch64/Dockerfile | 5 +++-- linux-anvil-cos7-x86_64/Dockerfile | 5 +++-- linux-anvil-cuda/Dockerfile | 5 +++-- linux-anvil-ppc64le-cuda/Dockerfile | 5 +++-- linux-anvil-ppc64le/Dockerfile | 5 +++-- 6 files changed, 18 insertions(+), 12 deletions(-) diff --git a/linux-anvil-aarch64-cuda/Dockerfile b/linux-anvil-aarch64-cuda/Dockerfile index 18a3a4ca..800a812b 100644 --- a/linux-anvil-aarch64-cuda/Dockerfile +++ b/linux-anvil-aarch64-cuda/Dockerfile @@ -38,8 +38,9 @@ ADD https://loripsum.net/api /opt/docker/etc/gibberish COPY scripts/yum_clean_all /opt/docker/bin/ # Add the archived repo URL and fix RPM imports -ADD centos7-x86_64-vault.repo /tmp/centos7-x86_64-vault.repo -ADD centos7-altarch-vault.repo /tmp/centos7-altarch-vault.repo +ADD centos7-x86_64-vault.repo /tmp/ +ADD centos7-aarch64-vault.repo /tmp/ +ADD centos7-ppc64le-vault.repo /tmp/ ADD scripts/fix_rpm /opt/docker/bin/fix_rpm RUN /opt/docker/bin/fix_rpm diff --git a/linux-anvil-aarch64/Dockerfile b/linux-anvil-aarch64/Dockerfile index 869e11df..c388c7b8 100644 --- a/linux-anvil-aarch64/Dockerfile +++ b/linux-anvil-aarch64/Dockerfile @@ -23,8 +23,9 @@ ADD https://loripsum.net/api /opt/docker/etc/gibberish RUN sed -i 's/override_install_langs=en_US\.UTF-8/override_install_langs=en_US.utf8/' /etc/yum.conf # Add the archived repo URL and fix RPM imports -ADD centos7-x86_64-vault.repo /tmp/centos7-x86_64-vault.repo -ADD centos7-altarch-vault.repo /tmp/centos7-altarch-vault.repo +ADD centos7-x86_64-vault.repo /tmp/ +ADD centos7-aarch64-vault.repo /tmp/ +ADD centos7-ppc64le-vault.repo /tmp/ ADD scripts/fix_rpm /opt/docker/bin/fix_rpm RUN /opt/docker/bin/fix_rpm diff --git a/linux-anvil-cos7-x86_64/Dockerfile b/linux-anvil-cos7-x86_64/Dockerfile index a0eefd9a..181c257c 100644 --- a/linux-anvil-cos7-x86_64/Dockerfile +++ b/linux-anvil-cos7-x86_64/Dockerfile @@ -21,8 +21,9 @@ ADD qemu-s390x-static /usr/bin/qemu-s390x-static ADD https://loripsum.net/api /opt/docker/etc/gibberish # Add the archived repo URL and fix RPM imports -ADD centos7-x86_64-vault.repo /tmp/centos7-x86_64-vault.repo -ADD centos7-altarch-vault.repo /tmp/centos7-altarch-vault.repo +ADD centos7-x86_64-vault.repo /tmp/ +ADD centos7-aarch64-vault.repo /tmp/ +ADD centos7-ppc64le-vault.repo /tmp/ ADD scripts/fix_rpm /opt/docker/bin/fix_rpm RUN /opt/docker/bin/fix_rpm diff --git a/linux-anvil-cuda/Dockerfile b/linux-anvil-cuda/Dockerfile index 6975dd55..42a60bb4 100644 --- a/linux-anvil-cuda/Dockerfile +++ b/linux-anvil-cuda/Dockerfile @@ -44,8 +44,9 @@ RUN ldconfig -v 2>/dev/null | grep -v ^$'\t' | cut -f1 -d":" >> /etc/ld.so.conf. ADD https://loripsum.net/api /opt/docker/etc/gibberish # Add the archived repo URL and fix RPM imports -ADD centos7-x86_64-vault.repo /tmp/centos7-x86_64-vault.repo -ADD centos7-altarch-vault.repo /tmp/centos7-altarch-vault.repo +ADD centos7-x86_64-vault.repo /tmp/ +ADD centos7-aarch64-vault.repo /tmp/ +ADD centos7-ppc64le-vault.repo /tmp/ ADD scripts/fix_rpm /opt/docker/bin/fix_rpm RUN /opt/docker/bin/fix_rpm diff --git a/linux-anvil-ppc64le-cuda/Dockerfile b/linux-anvil-ppc64le-cuda/Dockerfile index dfec19ee..4a5e584c 100644 --- a/linux-anvil-ppc64le-cuda/Dockerfile +++ b/linux-anvil-ppc64le-cuda/Dockerfile @@ -68,8 +68,9 @@ RUN if [ "${DISTRO_NAME}${DISTRO_VER}" = "centos7" ]; then \ COPY scripts/yum_clean_all /opt/docker/bin/ # Add the archived repo URL and fix RPM imports -ADD centos7-x86_64-vault.repo /tmp/centos7-x86_64-vault.repo -ADD centos7-altarch-vault.repo /tmp/centos7-altarch-vault.repo +ADD centos7-x86_64-vault.repo /tmp/ +ADD centos7-aarch64-vault.repo /tmp/ +ADD centos7-ppc64le-vault.repo /tmp/ ADD scripts/fix_rpm /opt/docker/bin/fix_rpm RUN /opt/docker/bin/fix_rpm diff --git a/linux-anvil-ppc64le/Dockerfile b/linux-anvil-ppc64le/Dockerfile index fdf0dbcb..78d86bed 100644 --- a/linux-anvil-ppc64le/Dockerfile +++ b/linux-anvil-ppc64le/Dockerfile @@ -21,8 +21,9 @@ ENV LANGUAGE=en_US.UTF-8 ADD https://loripsum.net/api /opt/docker/etc/gibberish # Add the archived repo URL and fix RPM imports -ADD centos7-x86_64-vault.repo /tmp/centos7-x86_64-vault.repo -ADD centos7-altarch-vault.repo /tmp/centos7-altarch-vault.repo +ADD centos7-x86_64-vault.repo /tmp/ +ADD centos7-aarch64-vault.repo /tmp/ +ADD centos7-ppc64le-vault.repo /tmp/ ADD scripts/fix_rpm /opt/docker/bin/fix_rpm RUN /opt/docker/bin/fix_rpm From 8b65989f035c0ba0d97c91289f593a1fb3334062 Mon Sep 17 00:00:00 2001 From: Marcel Bargull Date: Mon, 1 Jul 2024 22:41:45 +0200 Subject: [PATCH 15/22] Fix RPM-GPG-KEY-* name for aarch64 #3 Signed-off-by: Marcel Bargull --- linux-anvil-alma/Dockerfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/linux-anvil-alma/Dockerfile b/linux-anvil-alma/Dockerfile index b8a79264..d8cbda53 100644 --- a/linux-anvil-alma/Dockerfile +++ b/linux-anvil-alma/Dockerfile @@ -24,8 +24,9 @@ ADD qemu-s390x-static /usr/bin/qemu-s390x-static ADD https://loripsum.net/api /opt/docker/etc/gibberish # Add the archived repo URL and fix RPM imports -ADD centos7-x86_64-vault.repo /tmp/centos7-x86_64-vault.repo -ADD centos7-altarch-vault.repo /tmp/centos7-altarch-vault.repo +ADD centos7-x86_64-vault.repo /tmp/ +ADD centos7-aarch64-vault.repo /tmp/ +ADD centos7-ppc64le-vault.repo /tmp/ ADD scripts/fix_rpm /opt/docker/bin/fix_rpm RUN /opt/docker/bin/fix_rpm From f1bddc6331ba2f91955f103d9e62355713fd8a27 Mon Sep 17 00:00:00 2001 From: Marcel Bargull Date: Mon, 1 Jul 2024 22:42:20 +0200 Subject: [PATCH 16/22] cleanup Signed-off-by: Marcel Bargull --- scripts/fix_rpm | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/scripts/fix_rpm b/scripts/fix_rpm index d26362d2..92b13d0c 100755 --- a/scripts/fix_rpm +++ b/scripts/fix_rpm @@ -9,17 +9,17 @@ if [[ "$DISTRO_VER" == "7" ]]; then fi # Resolves a nasty NOKEY warning that appears when using yum. -if [[ "${DISTRO_NAME}${DISTRO_VER}" == "centos7" ]]; then \ - rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 && \ +if [[ "${DISTRO_NAME}${DISTRO_VER}" == "centos7" ]]; then + rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 if [[ "$(uname -m)" == "ppc64le" ]]; then - rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-AltArch-7-ppc64le; + rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-AltArch-7-ppc64le elif [[ "$(uname -m)" == "aarch64" ]]; then - rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7-aarch64; + rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7-aarch64 fi -elif [[ "${DISTRO_NAME}${DISTRO_VER}" == "centos8" ]]; then \ - rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial; \ -elif [[ "${DISTRO_NAME}${DISTRO_VER}" == "ubi8" ]]; then \ - rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release; \ -elif [[ "${DISTRO_NAME}${DISTRO_VER}" == "almalinux8" ]]; then \ +elif [[ "${DISTRO_NAME}${DISTRO_VER}" == "centos8" ]]; then + rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial +elif [[ "${DISTRO_NAME}${DISTRO_VER}" == "ubi8" ]]; then + rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release +elif [[ "${DISTRO_NAME}${DISTRO_VER}" == "almalinux8" ]]; then rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux fi From 02f36622d8ed7be57919e37d14076afd0c2d1e2b Mon Sep 17 00:00:00 2001 From: jakirkham Date: Mon, 1 Jul 2024 13:45:01 -0700 Subject: [PATCH 17/22] Revert Alma changes --- linux-anvil-alma/Dockerfile | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/linux-anvil-alma/Dockerfile b/linux-anvil-alma/Dockerfile index d8cbda53..5d804919 100644 --- a/linux-anvil-alma/Dockerfile +++ b/linux-anvil-alma/Dockerfile @@ -23,12 +23,8 @@ ADD qemu-s390x-static /usr/bin/qemu-s390x-static # bust the docker cache so that we always rerun the installs below ADD https://loripsum.net/api /opt/docker/etc/gibberish -# Add the archived repo URL and fix RPM imports -ADD centos7-x86_64-vault.repo /tmp/ -ADD centos7-aarch64-vault.repo /tmp/ -ADD centos7-ppc64le-vault.repo /tmp/ -ADD scripts/fix_rpm /opt/docker/bin/fix_rpm -RUN /opt/docker/bin/fix_rpm +# Resolves a nasty NOKEY warning that appears when using yum. +RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux # Install basic requirements. COPY scripts/yum_clean_all /opt/docker/bin/ From a5513339da12f853c3a7d3cd60d0a9aa40969b5e Mon Sep 17 00:00:00 2001 From: jakirkham Date: Mon, 1 Jul 2024 14:02:48 -0700 Subject: [PATCH 18/22] Revert CUDA arch image changes --- linux-anvil-aarch64-cuda/Dockerfile | 26 ++++++++++++++++++++------ linux-anvil-ppc64le-cuda/Dockerfile | 13 +++++++------ 2 files changed, 27 insertions(+), 12 deletions(-) diff --git a/linux-anvil-aarch64-cuda/Dockerfile b/linux-anvil-aarch64-cuda/Dockerfile index 800a812b..fed7ccbe 100644 --- a/linux-anvil-aarch64-cuda/Dockerfile +++ b/linux-anvil-aarch64-cuda/Dockerfile @@ -34,15 +34,29 @@ RUN ldconfig -v 2>/dev/null | grep -v ^$'\t' | cut -f1 -d":" >> /etc/ld.so.conf. # bust the docker cache so that we always rerun the installs below ADD https://loripsum.net/api /opt/docker/etc/gibberish +# Resolves a nasty NOKEY warning that appears when using yum. +# Naming convention changed with cos8 - see: +# * https://lists.centos.org/pipermail/centos-devel/2019-September/017847.html +# * https://www.centos.org/keys/#project-keys +RUN if [ "${DISTRO_NAME}${DISTRO_VER}" = "centos7" ]; then \ + rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 && \ + rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-7-aarch64; \ + elif [ "${DISTRO_NAME}${DISTRO_VER}" = "centos8" ]; then \ + rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial; \ + elif [ "${DISTRO_NAME}${DISTRO_VER}" = "ubi8" ]; then \ + rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release; \ + fi + # Add custom `yum_clean_all` script before using `yum` COPY scripts/yum_clean_all /opt/docker/bin/ -# Add the archived repo URL and fix RPM imports -ADD centos7-x86_64-vault.repo /tmp/ -ADD centos7-aarch64-vault.repo /tmp/ -ADD centos7-ppc64le-vault.repo /tmp/ -ADD scripts/fix_rpm /opt/docker/bin/fix_rpm -RUN /opt/docker/bin/fix_rpm +# Fallback to CentOS vault for CentOS 8 support. +RUN if [ "${DISTRO_NAME}${DISTRO_VER}" = "centos8" ]; then \ + find /etc/yum.repos.d/ -name "CentOS-*.repo" -exec \ + sed -i 's/mirrorlist/#mirrorlist/g;s|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' {} \; && \ + yum update -y --disablerepo=cuda && \ + /opt/docker/bin/yum_clean_all; \ + fi # Install basic requirements. RUN yum update -y --disablerepo=cuda && \ diff --git a/linux-anvil-ppc64le-cuda/Dockerfile b/linux-anvil-ppc64le-cuda/Dockerfile index 4a5e584c..a6faf5a7 100644 --- a/linux-anvil-ppc64le-cuda/Dockerfile +++ b/linux-anvil-ppc64le-cuda/Dockerfile @@ -67,12 +67,13 @@ RUN if [ "${DISTRO_NAME}${DISTRO_VER}" = "centos7" ]; then \ # Add custom `yum_clean_all` script before using `yum` COPY scripts/yum_clean_all /opt/docker/bin/ -# Add the archived repo URL and fix RPM imports -ADD centos7-x86_64-vault.repo /tmp/ -ADD centos7-aarch64-vault.repo /tmp/ -ADD centos7-ppc64le-vault.repo /tmp/ -ADD scripts/fix_rpm /opt/docker/bin/fix_rpm -RUN /opt/docker/bin/fix_rpm +# Fallback to CentOS vault for CentOS 8 support. +RUN if [ "${DISTRO_NAME}${DISTRO_VER}" = "centos8" ]; then \ + find /etc/yum.repos.d/ -name "CentOS-*.repo" -exec \ + sed -i 's/mirrorlist/#mirrorlist/g;s|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' {} \; && \ + yum update -y --disablerepo=cuda && \ + /opt/docker/bin/yum_clean_all; \ + fi # Install basic requirements. RUN yum update -y --disablerepo=cuda && \ From 9e83468f07d6393aca2d7cdb7894e1135f01daff Mon Sep 17 00:00:00 2001 From: jakirkham Date: Mon, 1 Jul 2024 14:12:13 -0700 Subject: [PATCH 19/22] Drop all CentOS 7 repos in one directory Also clean them up after so they are removed final squashed image. --- .../centos7-aarch64-vault.repo | 0 .../centos7-ppc64le-vault.repo | 0 .../centos7-x86_64-vault.repo | 0 linux-anvil-aarch64/Dockerfile | 4 +--- linux-anvil-cos7-x86_64/Dockerfile | 4 +--- linux-anvil-cuda/Dockerfile | 4 +--- linux-anvil-ppc64le/Dockerfile | 4 +--- scripts/fix_rpm | 4 +++- 8 files changed, 7 insertions(+), 13 deletions(-) rename centos7-aarch64-vault.repo => centos7-repos/centos7-aarch64-vault.repo (100%) rename centos7-ppc64le-vault.repo => centos7-repos/centos7-ppc64le-vault.repo (100%) rename centos7-x86_64-vault.repo => centos7-repos/centos7-x86_64-vault.repo (100%) diff --git a/centos7-aarch64-vault.repo b/centos7-repos/centos7-aarch64-vault.repo similarity index 100% rename from centos7-aarch64-vault.repo rename to centos7-repos/centos7-aarch64-vault.repo diff --git a/centos7-ppc64le-vault.repo b/centos7-repos/centos7-ppc64le-vault.repo similarity index 100% rename from centos7-ppc64le-vault.repo rename to centos7-repos/centos7-ppc64le-vault.repo diff --git a/centos7-x86_64-vault.repo b/centos7-repos/centos7-x86_64-vault.repo similarity index 100% rename from centos7-x86_64-vault.repo rename to centos7-repos/centos7-x86_64-vault.repo diff --git a/linux-anvil-aarch64/Dockerfile b/linux-anvil-aarch64/Dockerfile index c388c7b8..b21da605 100644 --- a/linux-anvil-aarch64/Dockerfile +++ b/linux-anvil-aarch64/Dockerfile @@ -23,9 +23,7 @@ ADD https://loripsum.net/api /opt/docker/etc/gibberish RUN sed -i 's/override_install_langs=en_US\.UTF-8/override_install_langs=en_US.utf8/' /etc/yum.conf # Add the archived repo URL and fix RPM imports -ADD centos7-x86_64-vault.repo /tmp/ -ADD centos7-aarch64-vault.repo /tmp/ -ADD centos7-ppc64le-vault.repo /tmp/ +ADD centos7-repos /tmp/ ADD scripts/fix_rpm /opt/docker/bin/fix_rpm RUN /opt/docker/bin/fix_rpm diff --git a/linux-anvil-cos7-x86_64/Dockerfile b/linux-anvil-cos7-x86_64/Dockerfile index 181c257c..8d171f4e 100644 --- a/linux-anvil-cos7-x86_64/Dockerfile +++ b/linux-anvil-cos7-x86_64/Dockerfile @@ -21,9 +21,7 @@ ADD qemu-s390x-static /usr/bin/qemu-s390x-static ADD https://loripsum.net/api /opt/docker/etc/gibberish # Add the archived repo URL and fix RPM imports -ADD centos7-x86_64-vault.repo /tmp/ -ADD centos7-aarch64-vault.repo /tmp/ -ADD centos7-ppc64le-vault.repo /tmp/ +ADD centos7-repos /tmp/ ADD scripts/fix_rpm /opt/docker/bin/fix_rpm RUN /opt/docker/bin/fix_rpm diff --git a/linux-anvil-cuda/Dockerfile b/linux-anvil-cuda/Dockerfile index 42a60bb4..85034368 100644 --- a/linux-anvil-cuda/Dockerfile +++ b/linux-anvil-cuda/Dockerfile @@ -44,9 +44,7 @@ RUN ldconfig -v 2>/dev/null | grep -v ^$'\t' | cut -f1 -d":" >> /etc/ld.so.conf. ADD https://loripsum.net/api /opt/docker/etc/gibberish # Add the archived repo URL and fix RPM imports -ADD centos7-x86_64-vault.repo /tmp/ -ADD centos7-aarch64-vault.repo /tmp/ -ADD centos7-ppc64le-vault.repo /tmp/ +ADD centos7-repos /tmp/ ADD scripts/fix_rpm /opt/docker/bin/fix_rpm RUN /opt/docker/bin/fix_rpm diff --git a/linux-anvil-ppc64le/Dockerfile b/linux-anvil-ppc64le/Dockerfile index 78d86bed..6102253a 100644 --- a/linux-anvil-ppc64le/Dockerfile +++ b/linux-anvil-ppc64le/Dockerfile @@ -21,9 +21,7 @@ ENV LANGUAGE=en_US.UTF-8 ADD https://loripsum.net/api /opt/docker/etc/gibberish # Add the archived repo URL and fix RPM imports -ADD centos7-x86_64-vault.repo /tmp/ -ADD centos7-aarch64-vault.repo /tmp/ -ADD centos7-ppc64le-vault.repo /tmp/ +ADD centos7-repos /tmp/ ADD scripts/fix_rpm /opt/docker/bin/fix_rpm RUN /opt/docker/bin/fix_rpm diff --git a/scripts/fix_rpm b/scripts/fix_rpm index 92b13d0c..b1c6a8e0 100755 --- a/scripts/fix_rpm +++ b/scripts/fix_rpm @@ -5,9 +5,11 @@ set -exo pipefail # Disable outdated repos; use vault instead if [[ "$DISTRO_VER" == "7" ]]; then sed -i '/^enabled=/d; /^\[/a\enabled=0' /etc/yum.repos.d/CentOS-Base.repo - cp "/tmp/centos7-$(uname -m)-vault.repo" /etc/yum.repos.d/vault.repo + cp "/tmp/centos7-repos/centos7-$(uname -m)-vault.repo" /etc/yum.repos.d/vault.repo fi +rm -rf "/tmp/centos7-repos" + # Resolves a nasty NOKEY warning that appears when using yum. if [[ "${DISTRO_NAME}${DISTRO_VER}" == "centos7" ]]; then rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 From cb73812710e3160b5ac5af61cd538f843eb6fbba Mon Sep 17 00:00:00 2001 From: jakirkham Date: Mon, 1 Jul 2024 14:13:12 -0700 Subject: [PATCH 20/22] Stick to CentOS 7 --- scripts/fix_rpm | 6 ------ 1 file changed, 6 deletions(-) diff --git a/scripts/fix_rpm b/scripts/fix_rpm index b1c6a8e0..df3d9719 100755 --- a/scripts/fix_rpm +++ b/scripts/fix_rpm @@ -18,10 +18,4 @@ if [[ "${DISTRO_NAME}${DISTRO_VER}" == "centos7" ]]; then elif [[ "$(uname -m)" == "aarch64" ]]; then rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7-aarch64 fi -elif [[ "${DISTRO_NAME}${DISTRO_VER}" == "centos8" ]]; then - rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial -elif [[ "${DISTRO_NAME}${DISTRO_VER}" == "ubi8" ]]; then - rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release -elif [[ "${DISTRO_NAME}${DISTRO_VER}" == "almalinux8" ]]; then - rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux fi From 686126b383042951c9065db18c0f2c502e859d8f Mon Sep 17 00:00:00 2001 From: jakirkham Date: Mon, 1 Jul 2024 14:16:48 -0700 Subject: [PATCH 21/22] Fix `ADD` to include destination directory name --- linux-anvil-aarch64/Dockerfile | 2 +- linux-anvil-cos7-x86_64/Dockerfile | 2 +- linux-anvil-cuda/Dockerfile | 2 +- linux-anvil-ppc64le/Dockerfile | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/linux-anvil-aarch64/Dockerfile b/linux-anvil-aarch64/Dockerfile index b21da605..dc895121 100644 --- a/linux-anvil-aarch64/Dockerfile +++ b/linux-anvil-aarch64/Dockerfile @@ -23,7 +23,7 @@ ADD https://loripsum.net/api /opt/docker/etc/gibberish RUN sed -i 's/override_install_langs=en_US\.UTF-8/override_install_langs=en_US.utf8/' /etc/yum.conf # Add the archived repo URL and fix RPM imports -ADD centos7-repos /tmp/ +ADD centos7-repos /tmp/centos7-repos ADD scripts/fix_rpm /opt/docker/bin/fix_rpm RUN /opt/docker/bin/fix_rpm diff --git a/linux-anvil-cos7-x86_64/Dockerfile b/linux-anvil-cos7-x86_64/Dockerfile index 8d171f4e..99dadf66 100644 --- a/linux-anvil-cos7-x86_64/Dockerfile +++ b/linux-anvil-cos7-x86_64/Dockerfile @@ -21,7 +21,7 @@ ADD qemu-s390x-static /usr/bin/qemu-s390x-static ADD https://loripsum.net/api /opt/docker/etc/gibberish # Add the archived repo URL and fix RPM imports -ADD centos7-repos /tmp/ +ADD centos7-repos /tmp/centos7-repos ADD scripts/fix_rpm /opt/docker/bin/fix_rpm RUN /opt/docker/bin/fix_rpm diff --git a/linux-anvil-cuda/Dockerfile b/linux-anvil-cuda/Dockerfile index 85034368..028d71c0 100644 --- a/linux-anvil-cuda/Dockerfile +++ b/linux-anvil-cuda/Dockerfile @@ -44,7 +44,7 @@ RUN ldconfig -v 2>/dev/null | grep -v ^$'\t' | cut -f1 -d":" >> /etc/ld.so.conf. ADD https://loripsum.net/api /opt/docker/etc/gibberish # Add the archived repo URL and fix RPM imports -ADD centos7-repos /tmp/ +ADD centos7-repos /tmp/centos7-repos ADD scripts/fix_rpm /opt/docker/bin/fix_rpm RUN /opt/docker/bin/fix_rpm diff --git a/linux-anvil-ppc64le/Dockerfile b/linux-anvil-ppc64le/Dockerfile index 6102253a..7e388af2 100644 --- a/linux-anvil-ppc64le/Dockerfile +++ b/linux-anvil-ppc64le/Dockerfile @@ -21,7 +21,7 @@ ENV LANGUAGE=en_US.UTF-8 ADD https://loripsum.net/api /opt/docker/etc/gibberish # Add the archived repo URL and fix RPM imports -ADD centos7-repos /tmp/ +ADD centos7-repos /tmp/centos7-repos ADD scripts/fix_rpm /opt/docker/bin/fix_rpm RUN /opt/docker/bin/fix_rpm From 7af579c34a17e2f1af24b36531964cbd7bcd1bdf Mon Sep 17 00:00:00 2001 From: jakirkham Date: Mon, 1 Jul 2024 14:22:02 -0700 Subject: [PATCH 22/22] Consolidate `if`s in `fix_rpm` --- scripts/fix_rpm | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/scripts/fix_rpm b/scripts/fix_rpm index df3d9719..788c3766 100755 --- a/scripts/fix_rpm +++ b/scripts/fix_rpm @@ -2,16 +2,12 @@ set -exo pipefail -# Disable outdated repos; use vault instead -if [[ "$DISTRO_VER" == "7" ]]; then +if [[ "${DISTRO_NAME}${DISTRO_VER}" == "centos7" ]]; then + # Disable outdated repos; use vault instead sed -i '/^enabled=/d; /^\[/a\enabled=0' /etc/yum.repos.d/CentOS-Base.repo cp "/tmp/centos7-repos/centos7-$(uname -m)-vault.repo" /etc/yum.repos.d/vault.repo -fi - -rm -rf "/tmp/centos7-repos" -# Resolves a nasty NOKEY warning that appears when using yum. -if [[ "${DISTRO_NAME}${DISTRO_VER}" == "centos7" ]]; then + # Resolves a nasty NOKEY warning that appears when using yum. rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 if [[ "$(uname -m)" == "ppc64le" ]]; then rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-AltArch-7-ppc64le @@ -19,3 +15,5 @@ if [[ "${DISTRO_NAME}${DISTRO_VER}" == "centos7" ]]; then rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7-aarch64 fi fi + +rm -rf "/tmp/centos7-repos"