#4336 Fix test containers
Opened 2 months ago by tkopecek. Modified 2 months ago
tkopecek/koji fix-containers  into  master

file modified
+13 -1
@@ -152,7 +152,18 @@ 

  	@echo "Tagged with: $(TAG)"

  	@echo

  

- # If and only if "make build" fails, use "make force-tag" to 

+ containers:

+ 	make -C devtools/containers all

+ 

+ container-test: containers

+ 	podman run -it --rm -v `pwd`:/mnt:z koji-test-fedora:41 bash -c "cd /mnt ; tox -re py3"

+ 	podman run -it --rm -v `pwd`:/mnt:z koji-test-fedora:42 bash -c "cd /mnt ; tox -re py3"

+ 	podman run -it --rm -v `pwd`:/mnt:z koji-test-fedora:rawhide bash -c "cd /mnt ; tox -re py3"

+ 	podman run -it --rm -v `pwd`:/mnt:z koji-test-centos:7 bash -c "cd /mnt ; tox -re py2"

+ 	podman run -it --rm -v `pwd`:/mnt:z koji-test-centos:8 bash -c "cd /mnt ; tox -re py3"

+ 	podman run -it --rm -v `pwd`:/mnt:z koji-test-centos:9 bash -c "cd /mnt ; tox -re py3"

+ 

+ # If and only if "make build" fails, use "make force-tag" to

  # re-tag the version.

  #force-tag: $(SPECFILE)

  #	@$(MAKE) tag TAG_OPTS="-F $(TAG_OPTS)"
@@ -170,3 +181,4 @@ 

  

  	for d in $(SUBDIRS); do make DESTDIR=`cd $(DESTDIR); pwd` \

  		-C $$d install TYPE=$(TYPE); [ $$? = 0 ] || exit 1; done

+ 

@@ -1,6 +1,13 @@ 

  FROM quay.io/centos/centos:7

+ 

+ 

+ ADD files/centos7-eol.repo /etc/yum.repos.d/centos7-eol.repo

+ #ADD files/centos7-epel-eol.repo /etc/yum.repos.d/centos7-epel-eol.repo

+ 

+ RUN rm -f /etc/yum.repos.d/CentOS*.repo

+ 

  RUN \

-   yum -y update && \

+   yum install -y epel-release && \

    yum install -y \

      dnf \

      dnf-plugins-core \
@@ -10,12 +17,12 @@ 

      python-devel \

      python-librepo \

      python-requests \

-     rpm-build  && \

-   yum install -y epel-release && \

-   yum install -y \

+     rpm-build \

      python-defusedxml \

-     python-pip \

      python-psycopg2 && \

-   yum clean all && \

-   pip install -U 'pip==9.0.1' && \

+   yum clean all

+ 

+ RUN curl -O http://pylegacy.org/hub/get-pip-pyopenssl.py && \

+   python get-pip-pyopenssl.py && \

+   #pip install -U 'pip==9.0.1' && \

    pip install -U tox

@@ -1,5 +1,9 @@ 

  FROM quay.io/centos/centos:stream8

  

+ RUN rm -f /etc/yum.repos.d/*

+ 

+ ADD files/centos8-eol.repo /etc/yum.repos.d/centos8-eol.repo

+ 

  RUN \

    dnf -y update --nodocs --setopt=install_weak_deps=False && \

    dnf install -y --nodocs --setopt=install_weak_deps=False epel-release && \

@@ -1,14 +0,0 @@ 

- FROM registry.fedoraproject.org/fedora:36

- RUN \

-   dnf -y update --nodocs --setopt=install_weak_deps=False && \

-   dnf install -y --nodocs --setopt=install_weak_deps=False \

-   gcc \

-   glibc-langpack-en \

-   krb5-devel \

-   python3-defusedxml \

-   python3-devel \

-   python3-librepo \

-   python3-setuptools \

-   python3-tox \

-   rpm-build && \

-   dnf clean all

@@ -1,14 +0,0 @@ 

- FROM registry.fedoraproject.org/fedora:37

- RUN \

-   dnf -y update --nodocs --setopt=install_weak_deps=False && \

-   dnf install -y --nodocs --setopt=install_weak_deps=False \

-   gcc \

-   glibc-langpack-en \

-   krb5-devel \

-   python3-defusedxml \

-   python3-devel \

-   python3-librepo \

-   python3-setuptools \

-   python3-tox \

-   rpm-build && \

-   dnf clean all

@@ -1,14 +0,0 @@ 

- FROM registry.fedoraproject.org/fedora:38

- RUN \

-   dnf -y update --nodocs --setopt=install_weak_deps=False && \

-   dnf install -y --nodocs --setopt=install_weak_deps=False \

-   gcc \

-   glibc-langpack-en \

-   krb5-devel \

-   python3-defusedxml \

-   python3-devel \

-   python3-librepo \

-   python3-setuptools \

-   python3-tox \

-   rpm-build && \

-   dnf clean all

@@ -1,14 +0,0 @@ 

- FROM registry.fedoraproject.org/fedora:39

- RUN \

-   dnf -y update --nodocs --setopt=install_weak_deps=False && \

-   dnf install -y --nodocs --setopt=install_weak_deps=False \

-   gcc \

-   glibc-langpack-en \

-   krb5-devel \

-   python3-defusedxml \

-   python3-devel \

-   python3-librepo \

-   python3-setuptools \

-   python3-tox \

-   rpm-build && \

-   dnf clean all

devtools/containers/Dockerfile.f41 devtools/containers/Dockerfile.f34
file renamed
+4 -1
@@ -1,13 +1,16 @@ 

- FROM registry.fedoraproject.org/fedora:34

+ FROM registry.fedoraproject.org/fedora:41

  RUN \

    dnf -y update --nodocs --setopt=install_weak_deps=False && \

    dnf install -y --nodocs --setopt=install_weak_deps=False \

    gcc \

    glibc-langpack-en \

    krb5-devel \

+   python3-cheetah \

    python3-defusedxml \

    python3-devel \

+   python3-dnf \

    python3-librepo \

+   python3-rpm \

    python3-setuptools \

    python3-tox \

    rpm-build && \

devtools/containers/Dockerfile.f42 devtools/containers/Dockerfile.f35
file renamed
+4 -1
@@ -1,13 +1,16 @@ 

- FROM registry.fedoraproject.org/fedora:35

+ FROM registry.fedoraproject.org/fedora:42

  RUN \

    dnf -y update --nodocs --setopt=install_weak_deps=False && \

    dnf install -y --nodocs --setopt=install_weak_deps=False \

    gcc \

    glibc-langpack-en \

    krb5-devel \

+   python3-cheetah \

    python3-defusedxml \

    python3-devel \

+   python3-dnf \

    python3-librepo \

+   python3-rpm \

    python3-setuptools \

    python3-tox \

    rpm-build && \

@@ -5,9 +5,12 @@ 

    gcc \

    glibc-langpack-en \

    krb5-devel \

+   python3-cheetah \

    python3-defusedxml \

    python3-devel \

+   python3-dnf \

    python3-librepo \

+   python3-rpm \

    python3-setuptools \

    python3-tox \

    rpm-build && \

@@ -0,0 +1,8 @@ 

+ all:

+ 	podman build -f Dockerfile.f41 -t koji-test-fedora:41

+ 	podman build -f Dockerfile.f42 -t koji-test-fedora:42

+ 	podman build -f Dockerfile.rawhide -t koji-test-fedora:rawhide

+ 	podman build -f Dockerfile.centos7 -t koji-test-centos:7

+ 	podman build -f Dockerfile.centos8 -t koji-test-centos:8

+ 	podman build -f Dockerfile.centos9 -t koji-test-centos:9

+ 

file modified
+1 -1
@@ -1,6 +1,6 @@ 

  -e .

  Cheetah;python_version < '3.0'

- Cheetah3;python_version >= '3.0'

+ CT3;python_version >= '3.0'

  psycopg2-binary;python_version >= '3.0'

  python-multilib

  python-qpid-proton<0.38.0;python_version < '3.0'

file modified
+2 -2
@@ -37,13 +37,13 @@ 

  [testenv:py3]

  deps =

      -r{toxinidir}/test-requirements.txt

- setenv = 

+ setenv =

      {[testenv]setenv}

      PYTHONPATH=.:plugins/hub/.:plugins/builder/.:plugins/cli/.:cli/.:www/lib

  commands_pre =

      {[testenv]commands_pre}

      python -m coverage erase --rcfile .coveragerc3

- commands = 

+ commands =

      python -m pytest -n auto --cov --cov-config .coveragerc3 --cov-report=html

  

  [testenv:py2]

New Fedora containers are available and EOLed CentOS images
are re-enabled to be able to build again.

Furthermore, new make targets (containers, container-test) are added
to run all tests in all supported containers locally.

The centos containerfiles refer to files that are not in git. E.g. files/centos7-eol.repo

Do we trust pylegacy.org? Are there other options we should consider?

I wasn't looking much to others. This is coming from PyPi issue https://github.com/pypi/support/issues/974 resulting into https://github.com/pylegacy-org/get-pip-pyopenssl I probably can let it generate a fixed pip and make it a part of our repo (it is GPLv3+)