From b162d722a69b4520770a8976fe98179138cf8fa6 Mon Sep 17 00:00:00 2001 From: Akifumi Imanishi Date: Thu, 11 Jul 2024 16:50:03 +0900 Subject: [PATCH] Merge pull request #381 from cupy/builder-centos7 Fix builder failure due to CentOS 7 EoL --- builder/Dockerfile | 13 ++++++++++--- builder/setup_devtoolset.sh | 8 -------- builder/setup_yum_centos7.sh | 5 +++++ 3 files changed, 15 insertions(+), 11 deletions(-) delete mode 100755 builder/setup_devtoolset.sh create mode 100755 builder/setup_yum_centos7.sh diff --git a/builder/Dockerfile b/builder/Dockerfile index 15650873..2e563572 100644 --- a/builder/Dockerfile +++ b/builder/Dockerfile @@ -1,10 +1,15 @@ ARG base_image FROM ${base_image} -RUN yum -y install gcc gcc-c++ make patch git curl && \ +COPY setup_yum_centos7.sh / + +# Run twice for EPEL. +RUN /setup_yum_centos7.sh && \ + yum -y install gcc gcc-c++ make patch git curl && \ yum -y install bzip2-devel openssl-devel readline-devel libffi-devel && \ yum -y install epel-release && \ yum-config-manager --disable epel && \ + /setup_yum_centos7.sh && \ yum -y install --enablerepo=epel openssl11-devel && \ yum clean all @@ -19,8 +24,10 @@ COPY setup_python.sh / RUN /setup_python.sh "${python_versions}" "${cython_version}" "${fastrlock_version}" # Install devtoolset (g++) for CuPy v8 build. -COPY setup_devtoolset.sh / -RUN /setup_devtoolset.sh +RUN yum install -y centos-release-scl && \ + /setup_yum_centos7.sh && \ + yum install -y devtoolset-7-gcc-c++ && \ + yum clean all # Install additional libraries for CUDA. COPY cuda_lib/ /cuda_lib diff --git a/builder/setup_devtoolset.sh b/builder/setup_devtoolset.sh deleted file mode 100755 index ae827867..00000000 --- a/builder/setup_devtoolset.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -uex - -yum install -y centos-release-scl - -# CentOS 7 -yum install -y devtoolset-7-gcc-c++ - -yum clean all diff --git a/builder/setup_yum_centos7.sh b/builder/setup_yum_centos7.sh new file mode 100755 index 00000000..959d11e9 --- /dev/null +++ b/builder/setup_yum_centos7.sh @@ -0,0 +1,5 @@ +#!/bin/bash -uex + +sed -i -E -e 's|^mirrorlist=|#mirrorlist=|g' /etc/yum.repos.d/*.repo +sed -i -E -e 's|^#( ?)baseurl=http://mirror.centos.org/centos/(7\|\$releasever)/|baseurl=http://ftp.jaist.ac.jp/pub/Linux/CentOS-vault/7.9.2009/|g' /etc/yum.repos.d/*.repo +sed -i -E -e 's|^#( ?)baseurl=http://download.fedoraproject.org/pub/epel/7/|baseurl=http://ftp.jaist.ac.jp/pub/Linux/Fedora/epel/7/|g' /etc/yum.repos.d/*.repo