From c96434d6d288f23a3aa462246ccd6121673b5b69 Mon Sep 17 00:00:00 2001 From: Neal Gompa Date: Sep 11 2021 11:46:44 +0000 Subject: Replace CentOS 7 with CentOS Stream 8 in CI CentOS 7 has been broken in CI for many months, and there are no deployments with the latest code on CentOS 7 anymore. This also begins the end of Python 2 support, as we are no longer testing on Python 2 at all. Signed-off-by: Neal Gompa --- diff --git a/dev/containers/centos7-rpms-py2 b/dev/containers/centos7-rpms-py2 deleted file mode 100644 index 7d8b5ed..0000000 --- a/dev/containers/centos7-rpms-py2 +++ /dev/null @@ -1,67 +0,0 @@ -FROM quay.io/centos/centos:7 - -ARG repo=https://pagure.io/pagure.git -ARG branch=master - -ENV REPO=$repo -ENV BRANCH=$branch - -RUN yum -y install \ - epel-release - -ADD ./fedora-infra-tags.repo /etc/yum.repos.d/infra-tags.repo -ADD ./fedora-infra-tags-stg.repo /etc/yum.repos.d/infra-tags-stg.repo - -RUN yum -y install \ - yum-utils \ - rpm-build \ - python-setuptools \ - python-coverage \ - python-mock \ - python-docutils \ - python-enum \ - python-flask \ - python-flake8 \ - python2-pytest-xdist \ - python2-fedora-messaging \ - python2-pip \ - redis \ - which \ - git -# git \ -# repoSpanner \ -# repoSpanner-bridge - -RUN pip install pip==20.3.4 --upgrade -RUN pip install setuptools --upgrade -RUN pip install pagure-messages - -RUN cd / \ - && GIT_TRACE=1 GIT_CURL_VERBOSE=1 git clone -b $BRANCH $REPO \ - && chmod +x /pagure/dev/containers/runtests_py2.sh - -# Install all the requirements from the spec file and replace the macro -# %{python_pkgversion} by empty string which thus installs all the py2 -# version of the dependencies. -RUN cd /pagure && \ - yum install --enablerepo=epel-testing -y \ - `rpmspec -q --requires /pagure/files/pagure.spec | \ - sed -e "s|%{python_pkgversion}||"` && \ - yum clean all && \ - localedef -i en_US -f UTF-8 en_US.UTF-8 - -# The old version of setuptools in CentOS7 does not support restrictions on -# the requirements file, so drop them -RUN \ - sed -i -e "s|;python_version<\"3.4\"||" /pagure/requirements.txt && \ - sed -i -e "s|;python_version<=\"2.7\"||" /pagure/requirements.txt && \ - sed -i -e "s|python3-openid;python_version>=\"3.0\"||" \ - /pagure/requirements.txt && \ - sed -i "/^email_validator.*/d" /pagure/requirements.txt && \ - sed -i -e 's|"alembic-3"|"alembic"|' /pagure/tests/test_alembic.py && \ - cd /pagure && python setup.py build - - -WORKDIR /pagure -ENTRYPOINT ["/pagure/dev/containers/runtests_py2.sh"] -CMD [] diff --git a/dev/containers/centos8-rpms-py3 b/dev/containers/centos8-rpms-py3 new file mode 100644 index 0000000..8124b9f --- /dev/null +++ b/dev/containers/centos8-rpms-py3 @@ -0,0 +1,48 @@ +FROM quay.io/centos/centos:8stream + +ARG repo=https://pagure.io/pagure.git +ARG branch=master + +ENV REPO=$repo +ENV BRANCH=$branch + +RUN dnf -y install \ + epel-release epel-next-release + +RUN dnf -y config-manager --enable epel-testing epel-next-testing powertools + +RUN dnf -y install \ + python3-setuptools \ + python3-coverage \ + python3-mock \ + python3-docutils \ + python3-black \ + python3-flake8 \ + python3-pytest-xdist \ + python3-cchardet \ + python3-fedora-messaging \ + python3-pip \ + redis \ + which \ + git + +RUN pip install pagure-messages + +RUN cd / \ + && GIT_TRACE=1 GIT_CURL_VERBOSE=1 git clone -b $BRANCH $REPO \ + && chmod +x /pagure/dev/containers/runtests_py3.sh + +# Install all the requirements from the spec file and replace the macro +# %{python_pkgversion} by '3' which thus installs all the py3 version of +# the dependencies. +RUN sed -i "/Requires: python%{python_pkgversion}-enum34/d" /pagure/files/pagure.spec && \ + dnf -y install `grep "Requires:" /pagure/files/pagure.spec | \ + awk '{split($0, a, " "); print a[2]}' |grep -v "%{name}" | \ + sed -e "s|%{python_pkgversion}|3|"` && \ + dnf clean all && \ + cd /pagure && \ + python3 setup.py build + +WORKDIR /pagure +ENTRYPOINT ["/pagure/dev/containers/runtests_py3.sh"] +CMD [] diff --git a/dev/containers/fedora-infra-tags-stg.repo b/dev/containers/fedora-infra-tags-stg.repo deleted file mode 100644 index cf77a2b..0000000 --- a/dev/containers/fedora-infra-tags-stg.repo +++ /dev/null @@ -1,6 +0,0 @@ -[infrastructure-tags-stg] -name=Fedora Infrastructure tag $releasever - $basearch -baseurl=https://kojipkgs.fedoraproject.org/repos-dist/epel$releasever-infra-stg/latest/$basearch/ -enabled=1 -gpgcheck=1 -gpgkey=https://infrastructure.fedoraproject.org/repo/infra/RPM-GPG-KEY-INFRA-TAGS diff --git a/dev/containers/fedora-infra-tags.repo b/dev/containers/fedora-infra-tags.repo deleted file mode 100644 index 4bd9b21..0000000 --- a/dev/containers/fedora-infra-tags.repo +++ /dev/null @@ -1,6 +0,0 @@ -[infrastructure-tags] -name=Fedora Infrastructure tag epel7-infra - x86_64 -baseurl=https://kojipkgs.fedoraproject.org/repos-dist/epel7-infra/latest/x86_64/ -enabled=1 -gpgcheck=1 -gpgkey=https://infrastructure.fedoraproject.org/repo/infra/RPM-GPG-KEY-INFRA-TAGS diff --git a/dev/containers/runtests_py2.sh b/dev/containers/runtests_py2.sh deleted file mode 100644 index 7963767..0000000 --- a/dev/containers/runtests_py2.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash - - -ls -l / - -echo "============== ENVIRONMENT =============" -/usr/bin/env -echo "============== END ENVIRONMENT =============" - -if [ -n "$REPO" -a -n "$BRANCH" ]; then -git remote rm proposed || true -git gc --auto -git remote add proposed "$REPO" -GIT_TRACE=1 GIT_CURL_VERBOSE=1 git fetch proposed -git checkout origin/master -git config --global user.email "you@example.com" -git config --global user.name "Your Name" -git merge --no-ff "proposed/$BRANCH" -m "Merge PR" - -echo "Running tests for branch $BRANCH of repo $REPO" -echo "Last commits:" -git --no-pager log -2 -fi - -sed -i -e "s|#!/usr/bin/env python|#!/usr/bin/env python2|" pagure/hooks/files/hookrunner - - -export LANG="en_US.UTF-8" -py.test -n auto ${TESTCASE:-tests/} diff --git a/dev/run-tests-container.py b/dev/run-tests-container.py index 39f0e87..6f1bea4 100755 --- a/dev/run-tests-container.py +++ b/dev/run-tests-container.py @@ -66,8 +66,8 @@ if __name__ == "__main__": args = parser.parse_args() if args.centos is True: - container_names = ["pagure-c7-rpms-py2"] - container_files = ["centos7-rpms-py2"] + container_names = ["pagure-c8s-rpms-py3"] + container_files = ["centos8-rpms-py3"] elif args.fedora is True: container_names = ["pagure-fedora-rpms-py3"] container_files = ["fedora-rpms-py3"] @@ -77,12 +77,12 @@ if __name__ == "__main__": else: container_names = [ "pagure-fedora-rpms-py3", - "pagure-c7-rpms-py2", + "pagure-c8s-rpms-py3", "pagure-fedora-pip-py3", ] container_files = [ "fedora-rpms-py3", - "centos7-rpms-py2", + "centos8-rpms-py3", "fedora-pip-py3", ]