From c20c072b1bb1afb2d5c47d45416ce2fad88996c9 Mon Sep 17 00:00:00 2001 From: Justice Adams <107649528+justice-adams-apple@users.noreply.github.com> Date: Fri, 11 Oct 2024 12:07:48 -0700 Subject: [PATCH] Install Python deps (#423) * add dependencies to fedora images * add dependencies to debian images * add dependencies to rhel images * use correct context folder * fix up rawhide --- ci_test.py | 2 +- swift-ci/main/debian/10/Dockerfile | 4 ++++ swift-ci/main/debian/11/Dockerfile | 4 ++++ swift-ci/main/debian/12/Dockerfile | 4 ++++ swift-ci/main/debian/9/Dockerfile | 9 +++++++++ swift-ci/main/fedora/31/Dockerfile | 4 ++++ swift-ci/main/fedora/32/Dockerfile | 4 ++++ swift-ci/main/fedora/39/Dockerfile | 4 ++++ swift-ci/main/fedora/40/Dockerfile | 4 ++++ swift-ci/main/fedora/rawhide/Dockerfile | 5 ++++- swift-ci/main/rhel-ubi/8/Dockerfile | 4 ++++ swift-ci/main/rhel-ubi/9/Dockerfile | 4 ++++ 12 files changed, 50 insertions(+), 2 deletions(-) diff --git a/ci_test.py b/ci_test.py index ee4da17f..fb412a64 100755 --- a/ci_test.py +++ b/ci_test.py @@ -70,7 +70,7 @@ def main(): # Make sure everything is relative dockerfile = os.path.relpath(os.path.realpath(dockerfile), root_dir) - docker_dir, docker_name = os.path.split(dockerfile) + docker_dir = "." print("Testing {}".format(dockerfile)) sys.stdout.flush() diff --git a/swift-ci/main/debian/10/Dockerfile b/swift-ci/main/debian/10/Dockerfile index 49c12473..7c66bf06 100644 --- a/swift-ci/main/debian/10/Dockerfile +++ b/swift-ci/main/debian/10/Dockerfile @@ -23,6 +23,7 @@ RUN apt-get -y update && apt-get -y --no-install-recommends install \ python \ python-six \ python2-dev \ + python3-pip \ python3-six \ python3-distutils \ rsync \ @@ -33,6 +34,9 @@ RUN apt-get -y update && apt-get -y --no-install-recommends install \ uuid-dev \ ca-certificates +COPY swift-ci/dependencies/requirements.txt /dependencies/ +RUN pip3 install -r /dependencies/requirements.txt + USER build-user WORKDIR /home/build-user diff --git a/swift-ci/main/debian/11/Dockerfile b/swift-ci/main/debian/11/Dockerfile index fc588697..45ef26b8 100644 --- a/swift-ci/main/debian/11/Dockerfile +++ b/swift-ci/main/debian/11/Dockerfile @@ -25,6 +25,7 @@ RUN apt-get -y update && apt-get -y install \ python2-dev \ python3-six \ python3-distutils \ + python3-pip \ rsync \ swig \ systemtap-sdt-dev \ @@ -32,6 +33,9 @@ RUN apt-get -y update && apt-get -y install \ unzip \ uuid-dev +COPY swift-ci/dependencies/requirements.txt /dependencies/ +RUN pip3 install -r /dependencies/requirements.txt + USER build-user WORKDIR /home/build-user diff --git a/swift-ci/main/debian/12/Dockerfile b/swift-ci/main/debian/12/Dockerfile index 92ccf228..e4d04760 100644 --- a/swift-ci/main/debian/12/Dockerfile +++ b/swift-ci/main/debian/12/Dockerfile @@ -22,6 +22,7 @@ RUN apt-get -y update && apt-get -y install \ ninja-build \ pkg-config \ python3-distutils \ + python3-pip \ python3-pkg-resources \ python3-psutil \ rsync \ @@ -46,6 +47,9 @@ ENV SWIFT_PLATFORM=$SWIFT_PLATFORM \ SWIFT_WEBROOT=$SWIFT_WEBROOT \ SWIFT_PREFIX=$SWIFT_PREFIX +COPY swift-ci/dependencies/requirements.txt /dependencies/ +RUN pip3 install -r /dependencies/requirements.txt --break-system-packages + RUN set -e; \ ARCH_NAME="$(dpkg --print-architecture)"; \ url=; \ diff --git a/swift-ci/main/debian/9/Dockerfile b/swift-ci/main/debian/9/Dockerfile index 6e293d8f..09022bcb 100644 --- a/swift-ci/main/debian/9/Dockerfile +++ b/swift-ci/main/debian/9/Dockerfile @@ -5,6 +5,9 @@ RUN groupadd -g 998 build-user && \ ENV DEBIAN_FRONTEND="noninteractive" +RUN sed -i s/deb.debian.org/archive.debian.org/g /etc/apt/sources.list +RUN sed -i s/security.debian.org/archive.debian.org/g /etc/apt/sources.list +RUN sed -i s/stretch-updates/stretch/g /etc/apt/sources.list RUN apt-get update RUN apt-get --no-install-recommends -y install \ @@ -22,6 +25,9 @@ RUN apt-get --no-install-recommends -y install \ ninja-build \ pkg-config \ python \ + python3-setuptools \ + python3-dev \ + python3-pip \ python-six \ rsync \ swig \ @@ -31,6 +37,9 @@ RUN apt-get --no-install-recommends -y install \ ca-certificates \ uuid-dev +COPY swift-ci/dependencies/requirements.txt /dependencies/ +RUN pip3 install -r /dependencies/requirements.txt + USER build-user WORKDIR /home/build-user diff --git a/swift-ci/main/fedora/31/Dockerfile b/swift-ci/main/fedora/31/Dockerfile index 5a7ededc..17b6068e 100644 --- a/swift-ci/main/fedora/31/Dockerfile +++ b/swift-ci/main/fedora/31/Dockerfile @@ -20,12 +20,16 @@ RUN dnf -y update && dnf install -y \ python-unversioned-command \ python27 \ python3 \ + python3-pip \ python3-devel \ python3-distro \ python3-six \ rsync \ swig +COPY swift-ci/dependencies/requirements.txt /dependencies/ +RUN pip3 install -r /dependencies/requirements.txt + USER build-user WORKDIR /home/build-user diff --git a/swift-ci/main/fedora/32/Dockerfile b/swift-ci/main/fedora/32/Dockerfile index f3218877..0fce131c 100644 --- a/swift-ci/main/fedora/32/Dockerfile +++ b/swift-ci/main/fedora/32/Dockerfile @@ -20,12 +20,16 @@ RUN dnf -y update && dnf install -y \ python-unversioned-command \ python27 \ python3 \ + python3-pip \ python3-devel \ python3-distro \ python3-six \ rsync \ swig +COPY swift-ci/dependencies/requirements.txt /dependencies/ +RUN pip3 install -r /dependencies/requirements.txt + USER build-user WORKDIR /home/build-user diff --git a/swift-ci/main/fedora/39/Dockerfile b/swift-ci/main/fedora/39/Dockerfile index 768e8fa6..e3d16d57 100644 --- a/swift-ci/main/fedora/39/Dockerfile +++ b/swift-ci/main/fedora/39/Dockerfile @@ -11,6 +11,7 @@ RUN yum install -y \ libuuid-devel \ libxml2-devel \ python3 \ + python3-pip \ python3-devel \ python3-distro \ python3-setuptools \ @@ -40,6 +41,9 @@ ENV SWIFT_PLATFORM=$SWIFT_PLATFORM \ SWIFT_WEBROOT=$SWIFT_WEBROOT \ SWIFT_PREFIX=$SWIFT_PREFIX +COPY swift-ci/dependencies/requirements.txt /dependencies/ +RUN pip3 install -r /dependencies/requirements.txt + RUN set -e; \ ARCH_NAME="$(rpm --eval '%{_arch}')"; \ url=; \ diff --git a/swift-ci/main/fedora/40/Dockerfile b/swift-ci/main/fedora/40/Dockerfile index bdedbef5..ab02e85e 100644 --- a/swift-ci/main/fedora/40/Dockerfile +++ b/swift-ci/main/fedora/40/Dockerfile @@ -11,6 +11,7 @@ RUN yum install -y \ libuuid-devel \ libxml2-devel \ python3 \ + python3-pip \ python3-devel \ python3-distro \ python3-setuptools \ @@ -26,6 +27,9 @@ RUN yum install -y \ unzip \ diffutils +COPY swift-ci/dependencies/requirements.txt /dependencies/ +RUN pip3 install -r /dependencies/requirements.txt + USER build-user WORKDIR /home/build-user diff --git a/swift-ci/main/fedora/rawhide/Dockerfile b/swift-ci/main/fedora/rawhide/Dockerfile index 43830bd0..6b0b3166 100644 --- a/swift-ci/main/fedora/rawhide/Dockerfile +++ b/swift-ci/main/fedora/rawhide/Dockerfile @@ -18,14 +18,17 @@ RUN dnf -y update && dnf install -y \ make \ ninja-build \ python-unversioned-command \ - python27 \ python3 \ + python3-pip \ python3-devel \ python3-distro \ python3-six \ rsync \ swig +COPY swift-ci/dependencies/requirements.txt /dependencies/ +RUN pip3 install -r /dependencies/requirements.txt + USER build-user WORKDIR /home/build-user diff --git a/swift-ci/main/rhel-ubi/8/Dockerfile b/swift-ci/main/rhel-ubi/8/Dockerfile index 57d0550b..b5a69ff1 100644 --- a/swift-ci/main/rhel-ubi/8/Dockerfile +++ b/swift-ci/main/rhel-ubi/8/Dockerfile @@ -15,11 +15,15 @@ RUN yum install -y \ libxml2-devel \ ncurses-devel \ python3-devel \ + python3-pip \ rsync \ sqlite-devel \ unzip \ zip +COPY swift-ci/dependencies/requirements.txt /dependencies/ +RUN pip3 install -r /dependencies/requirements.txt + USER build-user WORKDIR /home/build-user diff --git a/swift-ci/main/rhel-ubi/9/Dockerfile b/swift-ci/main/rhel-ubi/9/Dockerfile index 3489c70a..cb0aeac3 100644 --- a/swift-ci/main/rhel-ubi/9/Dockerfile +++ b/swift-ci/main/rhel-ubi/9/Dockerfile @@ -15,6 +15,7 @@ RUN yum install -y \ libxml2-devel \ ncurses-devel \ python3-devel \ + python3-pip \ rsync \ sqlite-devel \ unzip \ @@ -34,6 +35,9 @@ ENV SWIFT_PLATFORM=$SWIFT_PLATFORM \ SWIFT_WEBROOT=$SWIFT_WEBROOT \ SWIFT_PREFIX=$SWIFT_PREFIX +COPY swift-ci/dependencies/requirements.txt /dependencies/ +RUN pip3 install -r /dependencies/requirements.txt + RUN set -e; \ ARCH_NAME="$(rpm --eval '%{_arch}')"; \ url=; \