From e5f99f1e86a8cd90ea24ce55ab0d6323d346553b Mon Sep 17 00:00:00 2001 From: "Michael J. Sullivan" Date: Tue, 2 Jul 2024 19:04:16 -0700 Subject: [PATCH] Actually fix it? (#93) * Actually fix it? I did at least partially test it this time. * we need to do it *twice* --- .../linux/build/Dockerfile-centos.template | 2 +- .../linux/build/Dockerfile-linux.template | 24 +++++++++++++------ integration/linux/build/centos-7/Dockerfile | 2 +- integration/linux/build/centos-8/Dockerfile | 2 +- .../linux/build/linux-aarch64/Dockerfile | 24 +++++++++++++------ .../linux/build/linux-x86_64/Dockerfile | 24 +++++++++++++------ 6 files changed, 54 insertions(+), 24 deletions(-) diff --git a/integration/linux/build/Dockerfile-centos.template b/integration/linux/build/Dockerfile-centos.template index 69061e1..2951a57 100644 --- a/integration/linux/build/Dockerfile-centos.template +++ b/integration/linux/build/Dockerfile-centos.template @@ -11,7 +11,7 @@ ENV LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/usr/local/lib" RUN (echo precedence ::ffff:0:0/96 100 >> /etc/gai.conf \ && source /etc/os-release; \ - [ "$VERSION" = "7" -o "$VERSION" = "8" ] && (cd /etc/yum.repos.d/ \ + [ "$VERSION" = "7 (Core)" -o "$VERSION" = "8" ] && (cd /etc/yum.repos.d/ \ && sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-* \ && sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-* \ && yum update -y) || true) diff --git a/integration/linux/build/Dockerfile-linux.template b/integration/linux/build/Dockerfile-linux.template index ca777ac..dc30dce 100644 --- a/integration/linux/build/Dockerfile-linux.template +++ b/integration/linux/build/Dockerfile-linux.template @@ -20,17 +20,27 @@ ENV NODE_VERSION %%PLACEHOLDER%% ENV YARN_VERSION %%PLACEHOLDER%% ENV GCC_VERSION 11 -RUN (echo precedence ::ffff:0:0/96 100 >> /etc/gai.conf \ - && source /etc/os-release; \ - [ "$VERSION" = "7" -o "$VERSION" = "8" ] && (cd /etc/yum.repos.d/ \ +# rpm on centos 7 iterates over all fds up to the limit, which is +# extremely slow. Force it to be small with ulimit. +# +# We need to disable the mirrorlist both at the start *and* after +# installing centos-release-scl, which adds new things. Ugh. +RUN ulimit -n 1024 && echo precedence ::ffff:0:0/96 100 >> /etc/gai.conf && ( \ + source /etc/os-release; \ + [ "$VERSION" = "7 (Core)" -o "$VERSION" = "8" ] && echo YES && (cd /etc/yum.repos.d/ \ && sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-* \ - && sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-* \ + && sed -i 's|# \?baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-* \ && yum update -y) || true) -# rpm on centos 7 iterates over all fds up to the limit, which is -# extremely slow. Force it to be small. RUN ulimit -n 1024 \ - && yum install -y centos-release-scl epel-release \ + && yum install -y centos-release-scl epel-release \ + && ( \ + source /etc/os-release; \ + [ "$VERSION" = "7 (Core)" -o "$VERSION" = "8" ] && echo YES && (cd /etc/yum.repos.d/ \ + && sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-* \ + && sed -i 's|# \?baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-* \ + && yum update -y) || true) \ + \ && yum install -y \ devtoolset-${GCC_VERSION} make patch flex bison \ wget zlib-devel openssl-devel sqlite-devel bzip2 bzip2-devel \ diff --git a/integration/linux/build/centos-7/Dockerfile b/integration/linux/build/centos-7/Dockerfile index c3a3221..8398ac3 100644 --- a/integration/linux/build/centos-7/Dockerfile +++ b/integration/linux/build/centos-7/Dockerfile @@ -17,7 +17,7 @@ ENV LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/usr/local/lib" RUN (echo precedence ::ffff:0:0/96 100 >> /etc/gai.conf \ && source /etc/os-release; \ - [ "$VERSION" = "7" -o "$VERSION" = "8" ] && (cd /etc/yum.repos.d/ \ + [ "$VERSION" = "7 (Core)" -o "$VERSION" = "8" ] && (cd /etc/yum.repos.d/ \ && sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-* \ && sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-* \ && yum update -y) || true) diff --git a/integration/linux/build/centos-8/Dockerfile b/integration/linux/build/centos-8/Dockerfile index ff7e10a..3f9c041 100644 --- a/integration/linux/build/centos-8/Dockerfile +++ b/integration/linux/build/centos-8/Dockerfile @@ -17,7 +17,7 @@ ENV LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/usr/local/lib" RUN (echo precedence ::ffff:0:0/96 100 >> /etc/gai.conf \ && source /etc/os-release; \ - [ "$VERSION" = "7" -o "$VERSION" = "8" ] && (cd /etc/yum.repos.d/ \ + [ "$VERSION" = "7 (Core)" -o "$VERSION" = "8" ] && (cd /etc/yum.repos.d/ \ && sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-* \ && sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-* \ && yum update -y) || true) diff --git a/integration/linux/build/linux-aarch64/Dockerfile b/integration/linux/build/linux-aarch64/Dockerfile index 5a411ea..77f9371 100644 --- a/integration/linux/build/linux-aarch64/Dockerfile +++ b/integration/linux/build/linux-aarch64/Dockerfile @@ -26,17 +26,27 @@ ENV NODE_VERSION 16.16.0 ENV YARN_VERSION 1.22.19 ENV GCC_VERSION 10 -RUN (echo precedence ::ffff:0:0/96 100 >> /etc/gai.conf \ - && source /etc/os-release; \ - [ "$VERSION" = "7" -o "$VERSION" = "8" ] && (cd /etc/yum.repos.d/ \ +# rpm on centos 7 iterates over all fds up to the limit, which is +# extremely slow. Force it to be small with ulimit. +# +# We need to disable the mirrorlist both at the start *and* after +# installing centos-release-scl, which adds new things. Ugh. +RUN ulimit -n 1024 && echo precedence ::ffff:0:0/96 100 >> /etc/gai.conf && ( \ + source /etc/os-release; \ + [ "$VERSION" = "7 (Core)" -o "$VERSION" = "8" ] && echo YES && (cd /etc/yum.repos.d/ \ && sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-* \ - && sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-* \ + && sed -i 's|# \?baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-* \ && yum update -y) || true) -# rpm on centos 7 iterates over all fds up to the limit, which is -# extremely slow. Force it to be small. RUN ulimit -n 1024 \ - && yum install -y centos-release-scl epel-release \ + && yum install -y centos-release-scl epel-release \ + && ( \ + source /etc/os-release; \ + [ "$VERSION" = "7 (Core)" -o "$VERSION" = "8" ] && echo YES && (cd /etc/yum.repos.d/ \ + && sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-* \ + && sed -i 's|# \?baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-* \ + && yum update -y) || true) \ + \ && yum install -y \ devtoolset-${GCC_VERSION} make patch flex bison \ wget zlib-devel openssl-devel sqlite-devel bzip2 bzip2-devel \ diff --git a/integration/linux/build/linux-x86_64/Dockerfile b/integration/linux/build/linux-x86_64/Dockerfile index 5671ee0..e4b2e4f 100644 --- a/integration/linux/build/linux-x86_64/Dockerfile +++ b/integration/linux/build/linux-x86_64/Dockerfile @@ -26,17 +26,27 @@ ENV NODE_VERSION 16.16.0 ENV YARN_VERSION 1.22.19 ENV GCC_VERSION 11 -RUN (echo precedence ::ffff:0:0/96 100 >> /etc/gai.conf \ - && source /etc/os-release; \ - [ "$VERSION" = "7" -o "$VERSION" = "8" ] && (cd /etc/yum.repos.d/ \ +# rpm on centos 7 iterates over all fds up to the limit, which is +# extremely slow. Force it to be small with ulimit. +# +# We need to disable the mirrorlist both at the start *and* after +# installing centos-release-scl, which adds new things. Ugh. +RUN ulimit -n 1024 && echo precedence ::ffff:0:0/96 100 >> /etc/gai.conf && ( \ + source /etc/os-release; \ + [ "$VERSION" = "7 (Core)" -o "$VERSION" = "8" ] && echo YES && (cd /etc/yum.repos.d/ \ && sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-* \ - && sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-* \ + && sed -i 's|# \?baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-* \ && yum update -y) || true) -# rpm on centos 7 iterates over all fds up to the limit, which is -# extremely slow. Force it to be small. RUN ulimit -n 1024 \ - && yum install -y centos-release-scl epel-release \ + && yum install -y centos-release-scl epel-release \ + && ( \ + source /etc/os-release; \ + [ "$VERSION" = "7 (Core)" -o "$VERSION" = "8" ] && echo YES && (cd /etc/yum.repos.d/ \ + && sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-* \ + && sed -i 's|# \?baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-* \ + && yum update -y) || true) \ + \ && yum install -y \ devtoolset-${GCC_VERSION} make patch flex bison \ wget zlib-devel openssl-devel sqlite-devel bzip2 bzip2-devel \