diff --git a/ci-conda.Dockerfile b/ci-conda.Dockerfile index 4a969e3..5bf8868 100644 --- a/ci-conda.Dockerfile +++ b/ci-conda.Dockerfile @@ -25,114 +25,115 @@ ENV SCCACHE_S3_USE_SSL=true ENV SCCACHE_S3_NO_CREDENTIALS=false # Install system packages depending on the LINUX_VER -RUN \ - case "${LINUX_VER}" in \ - "ubuntu"*) \ - echo 'APT::Update::Error-Mode "any";' > /etc/apt/apt.conf.d/warnings-as-errors \ - && apt-get update \ - && apt-get upgrade -y \ - && apt-get install -y --no-install-recommends \ - file \ - unzip \ - wget \ - && rm -rf "/var/lib/apt/lists/*"; \ - ;; \ - "centos"* | "rockylinux"*) \ - yum -y update \ - && yum -y install --setopt=install_weak_deps=False \ - file \ - unzip \ - wget \ - which \ - yum-utils \ - && yum clean all; \ - ;; \ - *) \ - echo "Unsupported LINUX_VER: ${LINUX_VER}" && exit 1; \ - ;; \ - esac +RUN < /etc/apt/apt.conf.d/warnings-as-errors + apt-get update + apt-get upgrade -y + apt-get install -y --no-install-recommends \ + file \ + unzip \ + wget + rm -rf "/var/lib/apt/lists/*" + ;; + "centos"* | "rockylinux"*) + yum -y update + yum -y install --setopt=install_weak_deps=False \ + file \ + unzip \ + wget \ + which \ + yum-utils + yum clean all + ;; + *) + echo "Unsupported LINUX_VER: ${LINUX_VER}" && exit 1 + ;; +esac +EOF # Install CUDA packages, only for CUDA 11 (CUDA 12+ should fetch from conda) -RUN \ - case "${CUDA_VER}" in \ - "11"*) \ - PKG_CUDA_VER="$(echo ${CUDA_VER} | cut -d '.' -f1,2 | tr '.' '-')"; \ - echo "Attempting to install CUDA Toolkit ${PKG_CUDA_VER}"; \ - case "${LINUX_VER}" in \ - "ubuntu"*) \ - apt-get update \ - && apt-get upgrade -y \ - && apt-get install -y --no-install-recommends \ - cuda-gdb-${PKG_CUDA_VER} \ - cuda-cudart-dev-${PKG_CUDA_VER} \ - cuda-cupti-dev-${PKG_CUDA_VER} \ - # ignore the build-essential package since it installs dependencies like gcc/g++ - # we don't need them since we use conda compilers, so this keeps our images smaller - && apt-get download cuda-nvcc-${PKG_CUDA_VER} \ - && dpkg -i --ignore-depends="build-essential" ./cuda-nvcc-*.deb \ - && rm ./cuda-nvcc-*.deb \ - # apt will not work correctly if it thinks it needs the build-essential dependency - # so we patch it out with a sed command - && sed -i 's/, build-essential//g' /var/lib/dpkg/status \ - && rm -rf "/var/lib/apt/lists/*"; \ - ;; \ - "centos"* | "rockylinux"*) \ - yum -y update \ - && yum -y install --setopt=install_weak_deps=False \ - cuda-cudart-devel-${PKG_CUDA_VER} \ - cuda-driver-devel-${PKG_CUDA_VER} \ - cuda-gdb-${PKG_CUDA_VER} \ - cuda-cupti-${PKG_CUDA_VER} \ - && rpm -Uvh --nodeps $(repoquery --location cuda-nvcc-${PKG_CUDA_VER}) \ - && yum clean all; \ - ;; \ - *) \ - echo "Unsupported LINUX_VER: ${LINUX_VER}" && exit 1; \ - ;; \ - esac \ - ;; \ - *) \ - echo "Skipping CUDA Toolkit installation for CUDA ${CUDA_VER}"; \ - ;; \ +RUN < /etc/apt/apt.conf.d/warnings-as-errors \ - && apt update -y \ - && apt install -y \ - debianutils build-essential software-properties-common \ - jq wget gcc zlib1g-dev libbz2-dev \ - libssl-dev libreadline-dev libsqlite3-dev libffi-dev curl git libncurses5-dev \ - libnuma-dev openssh-client libcudnn8-dev zip libopenblas-dev liblapack-dev \ - protobuf-compiler autoconf automake libtool cmake yasm libopenslide-dev \ - && add-apt-repository ppa:git-core/ppa \ - && add-apt-repository ppa:ubuntu-toolchain-r/test \ - && apt update -y \ - && apt install -y git gcc-9 g++-9 \ - && add-apt-repository -r ppa:git-core/ppa \ - && add-apt-repository -r ppa:ubuntu-toolchain-r/test \ - && update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 90 --slave /usr/bin/g++ g++ /usr/bin/g++-9 --slave /usr/bin/gcov gcov /usr/bin/gcov-9 \ - && rm -rf /var/lib/apt/lists/* \ - ;; \ - "centos"*) \ - yum update --exclude=libnccl* -y \ - && yum install -y epel-release\ - && yum update --exclude=libnccl* -y \ - && yum install -y \ - which wget gcc zlib-devel bzip2 bzip2-devel readline-devel sqlite \ - sqlite-devel xz xz-devel libffi-devel curl git ncurses-devel numactl \ - numactl-devel openssh-clients libcudnn8-devel zip blas-devel lapack-devel \ - protobuf-compiler autoconf automake libtool centos-release-scl scl-utils cmake \ - yasm openslide-devel \ - && yum remove -y git \ - && yum install -y https://packages.endpointdev.com/rhel/7/os/x86_64/endpoint-repo.x86_64.rpm \ - && yum install -y git jq devtoolset-11 \ - && yum remove -y endpoint-repo \ - && yum clean all \ - && echo -e ' \ - #!/bin/bash\n \ - source scl_source enable devtoolset-11\n \ - ' > /etc/profile.d/enable_devtools.sh \ - && pushd tmp \ - && wget https://ftp.openssl.org/source/openssl-1.1.1k.tar.gz \ - && tar -xzvf openssl-1.1.1k.tar.gz \ - && cd openssl-1.1.1k \ - && ./config --prefix=/usr --openssldir=/etc/ssl --libdir=lib no-shared zlib-dynamic \ - && make \ - && make install \ - && popd \ - ;; \ - "rockylinux"*) \ - dnf update -y \ - && dnf install -y epel-release \ - && dnf update -y \ - && dnf install -y \ - which wget gcc zlib-devel bzip2 bzip2-devel readline-devel sqlite \ - sqlite-devel xz xz-devel libffi-devel curl git ncurses-devel numactl \ - numactl-devel openssh-clients libcudnn8-devel zip jq openslide-devel \ - protobuf-compiler autoconf automake libtool dnf-plugins-core cmake \ - && dnf config-manager --set-enabled powertools \ - && dnf install -y blas-devel lapack-devel \ - && dnf -y install gcc-toolset-11-gcc gcc-toolset-11-gcc-c++ \ - && dnf -y install yasm \ - && dnf clean all \ - && echo -e ' \ - #!/bin/bash\n \ - source /opt/rh/gcc-toolset-11/enable \ - ' > /etc/profile.d/enable_devtools.sh \ - && pushd tmp \ - && wget https://ftp.openssl.org/source/openssl-1.1.1k.tar.gz \ - && tar -xzvf openssl-1.1.1k.tar.gz \ - && cd openssl-1.1.1k \ - && ./config --prefix=/usr --openssldir=/etc/ssl --libdir=lib no-shared zlib-dynamic \ - && make \ - && make install \ - && popd \ - ;; \ - *) \ - echo "Unsupported LINUX_VER: ${LINUX_VER}" && exit 1; \ - ;; \ - esac +RUN < /etc/apt/apt.conf.d/warnings-as-errors + apt update -y + apt install -y \ + debianutils build-essential software-properties-common \ + jq wget gcc zlib1g-dev libbz2-dev \ + libssl-dev libreadline-dev libsqlite3-dev libffi-dev curl git libncurses5-dev \ + libnuma-dev openssh-client libcudnn8-dev zip libopenblas-dev liblapack-dev \ + protobuf-compiler autoconf automake libtool cmake yasm libopenslide-dev + add-apt-repository ppa:git-core/ppa + add-apt-repository ppa:ubuntu-toolchain-r/test + apt update -y + apt install -y git gcc-9 g++-9 + add-apt-repository -r ppa:git-core/ppa + add-apt-repository -r ppa:ubuntu-toolchain-r/test + update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 90 --slave /usr/bin/g++ g++ /usr/bin/g++-9 --slave /usr/bin/gcov gcov /usr/bin/gcov-9 + rm -rf /var/lib/apt/lists/* + ;; + "centos"*) + yum update --exclude=libnccl* -y + yum install -y epel-release + yum update --exclude=libnccl* -y + yum install -y \ + which wget gcc zlib-devel bzip2 bzip2-devel readline-devel sqlite \ + sqlite-devel xz xz-devel libffi-devel curl git ncurses-devel numactl \ + numactl-devel openssh-clients libcudnn8-devel zip blas-devel lapack-devel \ + protobuf-compiler autoconf automake libtool centos-release-scl scl-utils cmake \ + yasm openslide-devel + yum remove -y git + yum install -y https://packages.endpointdev.com/rhel/7/os/x86_64/endpoint-repo.x86_64.rpm + yum install -y git jq devtoolset-11 + yum remove -y endpoint-repo + yum clean all + echo -e ' \ + #!/bin/bash\n \ + source scl_source enable devtoolset-11\n \ + ' > /etc/profile.d/enable_devtools.sh + pushd tmp + wget https://ftp.openssl.org/source/openssl-1.1.1k.tar.gz + tar -xzvf openssl-1.1.1k.tar.gz + cd openssl-1.1.1k + ./config --prefix=/usr --openssldir=/etc/ssl --libdir=lib no-shared zlib-dynamic + make + make install + popd + ;; + "rockylinux"*) + dnf update -y + dnf install -y epel-release + dnf update -y + dnf install -y \ + which wget gcc zlib-devel bzip2 bzip2-devel readline-devel sqlite \ + sqlite-devel xz xz-devel libffi-devel curl git ncurses-devel numactl \ + numactl-devel openssh-clients libcudnn8-devel zip jq openslide-devel \ + protobuf-compiler autoconf automake libtool dnf-plugins-core cmake + dnf config-manager --set-enabled powertools + dnf install -y blas-devel lapack-devel + dnf -y install gcc-toolset-11-gcc gcc-toolset-11-gcc-c++ + dnf -y install yasm + dnf clean all + echo -e ' \ + #!/bin/bash\n \ + source /opt/rh/gcc-toolset-11/enable \ + ' > /etc/profile.d/enable_devtools.sh + pushd tmp + wget https://ftp.openssl.org/source/openssl-1.1.1k.tar.gz + tar -xzvf openssl-1.1.1k.tar.gz + cd openssl-1.1.1k + ./config --prefix=/usr --openssldir=/etc/ssl --libdir=lib no-shared zlib-dynamic + make + make install + popd + ;; + *) + echo "Unsupported LINUX_VER: ${LINUX_VER}" && exit 1 + ;; +esac +EOF # Download and install GH CLI tool v2.32.0 ARG GH_VERSION=2.32.0 @@ -117,11 +119,13 @@ EOF # Install sccache ARG SCCACHE_VERSION=0.5.4 -RUN curl -o /tmp/sccache.tar.gz \ - -L "https://github.com/mozilla/sccache/releases/download/v${SCCACHE_VERSION}/sccache-v${SCCACHE_VERSION}-"${REAL_ARCH}"-unknown-linux-musl.tar.gz" && \ - tar -C /tmp -xvf /tmp/sccache.tar.gz && \ - mv "/tmp/sccache-v${SCCACHE_VERSION}-"${REAL_ARCH}"-unknown-linux-musl/sccache" /usr/bin/sccache && \ - chmod +x /usr/bin/sccache +RUN <