Repository: rucio/rucio

Issue:
Add python 3.10 tests to CI framework.
Motivation
----------
Python 3.10 is already out since October last year, with 3.10.1 being released a few days ago. This should be added to our test suite for validation.

Modification
------------
Add Python 3.10 to test matrix. 



Discussion:

Resolving patch:
diff --git a/lib/rucio/common/dumper/__init__.py b/lib/rucio/common/dumper/__init__.py
--- a/lib/rucio/common/dumper/__init__.py
+++ b/lib/rucio/common/dumper/__init__.py
@@ -131,6 +131,7 @@ def smart_open(filename):
     it is a bzip2 compressed file and returns a file-like object to
     handle it.
     '''
+    f = None
     if isplaintext(filename):
         f = open(filename, 'rt')
     else:
diff --git a/lib/rucio/common/dumper/consistency.py b/lib/rucio/common/dumper/consistency.py
--- a/lib/rucio/common/dumper/consistency.py
+++ b/lib/rucio/common/dumper/consistency.py
@@ -275,11 +275,12 @@ def parse_and_filter_file(filepath, parser=lambda s: s, filter_=lambda s: s, pre
 
     with dumper.temp_file(cache_dir, final_name=output_name) as (output, _):
         input_ = dumper.smart_open(filepath)
-        for line in input_:
-            if filter_(line):
-                output.write(parser(line) + '\n')
+        if input_ is not None:
+            for line in input_:
+                if filter_(line):
+                    output.write(parser(line) + '\n')
 
-        input_.close()
+            input_.close()
 
     return output_path
 


Test patch:
diff --git a/etc/docker/test/alma8.Dockerfile b/etc/docker/test/alma8.Dockerfile
new file mode 100644
--- /dev/null
+++ b/etc/docker/test/alma8.Dockerfile
@@ -0,0 +1,176 @@
+FROM almalinux:8.7 as base
+    WORKDIR /usr/local/src
+    ARG PYTHON
+    ENV PYTHON $PYTHON
+    ENV LANG=en_US.UTF-8
+    ENV LC_ALL=en_US.UTF-8
+    ENV CPLUS_INCLUDE_PATH="/usr/include/python${PYTHON}"
+    ENV C_INCLUDE_PATH="/usr/include/python${PYTHON}"
+    ENV PYTHON_VENV="/opt/venv"
+    ENV PATH="${PYTHON_VENV}/bin:${PATH}"
+    ENV PYTHON_37_PATCH_VERSION="9"
+    ENV PYTHON_38_PATCH_VERSION="12"
+    ENV PYTHON_39_PATCH_VERSION="13"
+    ENV PYTHON_310_PATCH_VERSION="4"
+    RUN dnf update -y && \
+        dnf install -y 'dnf-command(config-manager)'
+
+FROM base as oracle-client
+    RUN dnf install -y libnsl libaio
+    RUN rpm -i https://download.oracle.com/otn_software/linux/instantclient/1912000/oracle-instantclient19.12-basiclite-19.12.0.0.0-1.x86_64.rpm && \
+        echo "/usr/lib/oracle/19.12/client64/lib" > /etc/ld.so.conf.d/oracle-instantclient.conf;
+
+FROM base as python
+    RUN if [ "$PYTHON" == "3.6" ] ; then \
+            dnf install -y epel-release.noarch && \
+            dnf config-manager --enable powertools && \
+            dnf -y update && \
+            dnf -y install python3 boost-python3 python3-pip python3-devel && \
+            python3.6 -m pip --no-cache-dir install --upgrade pip && \
+            python3.6 -m pip --no-cache-dir install --upgrade setuptools wheel; \
+        elif [[ "$PYTHON" == "3.7" || "$PYTHON" == "3.8" || "$PYTHON" == "3.9" || "$PYTHON" == "3.10" ]] ; then \
+            if [ "$PYTHON" == "3.7" ] ; then \
+                PYTHON_VERSION="3.7.${PYTHON_37_PATCH_VERSION}"; \
+            elif [ "$PYTHON" == "3.8" ] ; then \
+                    PYTHON_VERSION="3.8.${PYTHON_38_PATCH_VERSION}"; \
+            elif [ "$PYTHON" == "3.9" ] ; then \
+                    PYTHON_VERSION="3.9.${PYTHON_39_PATCH_VERSION}"; \
+            elif [ "$PYTHON" == "3.10" ] ; then \
+                    PYTHON_VERSION="3.10.${PYTHON_310_PATCH_VERSION}"; \
+            fi &&  \
+            dnf config-manager --enable powertools && \
+            dnf -y update && \
+            dnf -y install dnf-plugins-core && \
+            dnf -y builddep python3 && \
+            dnf -y install wget yum-utils make gcc openssl-devel bzip2-devel libffi-devel zlib-devel && \
+            wget https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz && \
+            tar xzf Python-${PYTHON_VERSION}.tgz && \
+            cd Python-${PYTHON_VERSION} && \
+            ./configure --enable-optimizations --enable-shared --libdir=/usr/local/lib LDFLAGS="-Wl,-rpath /usr/local/lib" && \
+            make -j ${nproc} && \
+            make install exec_prefix=/usr && \
+            cd .. && rm -rf Python-${PYTHON_VERSION} && \
+            if [ "$PYTHON" == "3.7" ] ; then \
+                  cp -al /usr/include/python3.7m/pyconfig.h /usr/local/include/python3.7m/pyconfig.h && \
+                  rm -rf /usr/include/python3.7m/ && \
+                  ln -sf ../local/include/python3.7m /usr/include/python3.7m; \
+            fi && \
+            rm -rf Python-${PYTHON_VERSION}.tgz && \
+            echo "/usr/local/lib" > /etc/ld.so.conf.d/python${PYTHON}.conf && \
+            ldconfig && \
+            alternatives --remove-all python && \
+            alternatives --install /usr/bin/python python /usr/bin/python${PYTHON} 1 && \
+            alternatives --remove-all python3 && \
+            alternatives --install /usr/bin/python3 python3 /usr/bin/python${PYTHON} 1 && \
+            python3 -m pip --no-cache-dir install --upgrade pip && \
+            python3 -m pip --no-cache-dir install --upgrade setuptools wheel; \
+        fi
+    RUN python3 -m venv ${PYTHON_VENV}
+
+FROM python as gfal2
+    RUN dnf install -y epel-release.noarch && \
+        dnf config-manager --enable powertools && \
+        dnf -y update && \
+        dnf -y install gfal2-devel && \
+        if [ "$PYTHON" == "3.6" ] ; then \
+            dnf -y install gfal2-python3;\
+            cp /usr/lib64/python3.6/site-packages/gfal2.so /usr/lib64/gfal2.so; \
+        elif [[ "$PYTHON" == "3.7" || "$PYTHON" == "3.8" || "$PYTHON" == "3.9" || "$PYTHON" == "3.10" ]] ; then \
+            dnf install -y git && \ 
+            git clone --depth 1 --branch v1.11.0 https://github.com/cern-fts/gfal2-python.git && \
+            cd gfal2-python && \
+            ./ci/fedora-packages.sh && \
+            cd ./packaging && \
+            RPMBUILD_SRC_EXTRA_FLAGS="--without docs --without python2" make srpm && \
+            dnf -y builddep gfal2-python-1.11.0-1.el8.src.rpm && \
+            cd ../ && \
+            python3 -m pip --no-cache-dir install gfal2-python && \
+            cd .. && rm -rf gfal2-python; \
+            cp ${PYTHON_VENV}/lib/python${PYTHON}/site-packages/gfal2.so /usr/lib64/gfal2.so; \
+        fi
+    
+FROM python as mod_wsgi
+    RUN if [ "$PYTHON" == "3.6" ] ; then \
+            dnf install -y python3-mod_wsgi && \
+            cp /usr/lib64/httpd/modules/mod_wsgi_python3.so /usr/lib64/httpd/modules/mod_wsgi.so; \
+        else \
+            dnf install -y httpd-devel && \
+            curl -sSL https://github.com/GrahamDumpleton/mod_wsgi/archive/4.9.1.tar.gz | tar xzv && \
+            cd mod_wsgi-4.9.1 && \
+            ./configure --with-python=/usr/bin/python${PYTHON} --prefix=/usr --libdir=/usr/local/lib && \
+            make -j && \
+            make install; \
+        fi && \
+        echo -e '# NOTE:\n# Only one mod_wsgi can be loaded at a time.\n# Don'"'"'t attempt to load if already loaded.\n<IfModule !wsgi_module>\n    LoadModule wsgi_module modules/mod_wsgi.so\n</IfModule>\n' > /etc/httpd/conf.modules.d/05-wsgi-python.conf;
+
+
+FROM python as rucio-runtime
+    WORKDIR /usr/local/src/rucio
+    COPY tools tools
+    COPY bin bin
+    COPY lib lib
+    COPY etc etc
+    COPY .flake8 .pep8 .pycodestyle pylintrc setup.py setup_rucio.py setup_rucio_client.py setup_webui.py requirements.txt setuputil.py ./
+
+    RUN dnf install -y epel-release.noarch && \
+        dnf config-manager --enable powertools && \
+        dnf module -y enable nodejs:16 && \
+        dnf -y update && \
+        dnf install -y \
+        xmlsec1-devel xmlsec1-openssl-devel pkg-config libtool-ltdl-devel \
+        httpd-devel \
+        libnsl libaio \
+        memcached \
+        gridsite \
+        sqlite \
+        gfal2-devel \
+        nodejs npm \
+        glibc-langpack-en
+
+    RUN mkdir -p /var/log/rucio/trace && \
+        chmod -R 777 /var/log/rucio && \
+        cp etc/certs/hostcert_rucio.pem /etc/grid-security/hostcert.pem && \
+        cp etc/certs/hostcert_rucio.key.pem /etc/grid-security/hostkey.pem && chmod 0400 /etc/grid-security/hostkey.pem && \
+        cp etc/docker/test/extra/httpd.conf /etc/httpd/conf/httpd.conf && \
+        cp etc/docker/test/extra/rucio.conf /etc/httpd/conf.d/rucio.conf && \
+        cp etc/docker/test/extra/00-mpm.conf /etc/httpd/conf.modules.d/00-mpm.conf && \
+        rm /etc/httpd/conf.d/ssl.conf /etc/httpd/conf.d/autoindex.conf /etc/httpd/conf.d/userdir.conf /etc/httpd/conf.d/welcome.conf /etc/httpd/conf.d/zgridsite.conf && \
+        cp etc/certs/rucio_ca.pem etc/rucio_ca.pem && \
+        cp etc/certs/ruciouser.pem etc/ruciouser.pem && \
+        cp etc/certs/ruciouser.key.pem etc/ruciouser.key.pem && \
+        chmod 0400 etc/ruciouser.key.pem
+
+FROM rucio-runtime as requirements
+    
+    RUN dnf -y update && dnf -y install make gcc xmlsec1-devel xmlsec1-openssl-devel pkg-config libtool-ltdl-devel
+    
+    RUN python3 -m pip --no-cache-dir install --upgrade pip && \
+        python3 -m pip --no-cache-dir install --upgrade setuptools wheel && \
+        python3 -m pip --no-cache-dir install --upgrade -r requirements.txt
+    
+    COPY .flake8 .pep8 .pycodestyle pylintrc setup.py setup_rucio.py setup_rucio_client.py setup_webui.py ./
+    RUN python3 -m pip --no-cache-dir install --upgrade .[oracle,postgresql,mysql,kerberos,saml,dev] && \
+        python3 -m pip list
+
+FROM rucio-runtime as final
+
+    COPY --from=gfal2 /usr/include/gfal2 /usr/include/gfal2
+    COPY --from=gfal2 /usr/lib64/* /usr/lib64/
+    COPY --from=gfal2 /usr/lib64/gfal2.so /usr/lib64/gfal2.so
+
+    RUN mv /usr/lib64/gfal2.so ${PYTHON_VENV}/lib/python${PYTHON}/site-packages/gfal2.so;
+   
+    COPY --from=oracle-client /usr/share/oracle /usr/share/oracle
+    COPY --from=oracle-client /usr/lib/oracle /usr/lib/oracle/
+    COPY --from=oracle-client /etc/ld.so.conf.d/oracle-instantclient.conf /etc/ld.so.conf.d/oracle-instantclient.conf
+    
+    COPY --from=requirements ${PYTHON_VENV} ${PYTHON_VENV}
+    COPY --from=mod_wsgi /usr/lib64/httpd/modules /usr/lib64/httpd/modules
+    COPY --from=mod_wsgi /etc/httpd/conf.modules.d/05-wsgi-python.conf  /etc/httpd/conf.modules.d/05-wsgi-python.conf 
+
+    WORKDIR /opt/rucio
+    RUN cp -r /usr/local/src/rucio/{lib,bin,tools,etc} ./
+
+    RUN ldconfig
+   
+    CMD ["httpd","-D","FOREGROUND"]
diff --git a/etc/docker/test/alma9.Dockerfile b/etc/docker/test/alma9.Dockerfile
new file mode 100644
--- /dev/null
+++ b/etc/docker/test/alma9.Dockerfile
@@ -0,0 +1,171 @@
+FROM almalinux:9.1 as base
+    WORKDIR /usr/local/src
+    ARG PYTHON
+    ENV PYTHON $PYTHON
+    ENV LANG=en_US.UTF-8
+    ENV LC_ALL=en_US.UTF-8
+    ENV CPLUS_INCLUDE_PATH="/usr/local/include/python${PYTHON}:/usr/include/python${PYTHON}"
+    ENV C_INCLUDE_PATH="/usr/include/python${PYTHON}"
+    ENV PYTHON_VENV="/opt/venv"
+    ENV PATH="${PYTHON_VENV}/bin:${PATH}"
+    ENV PYTHON_310_PATCH_VERSION="4"
+
+FROM base as oracle-client
+    RUN dnf install -y libnsl libaio nodejs npm
+    RUN rpm -i https://download.oracle.com/otn_software/linux/instantclient/1912000/oracle-instantclient19.12-basiclite-19.12.0.0.0-1.x86_64.rpm && \
+        echo "/usr/lib/oracle/19.12/client64/lib" > /etc/ld.so.conf.d/oracle-instantclient.conf;
+
+FROM base as python
+    RUN if [ "$PYTHON" == "3.9" ] ; then \
+            dnf install -y epel-release.noarch && \
+            dnf install -y 'dnf-command(config-manager)' && \
+            dnf config-manager --set-enabled crb && \
+            dnf -y update && \
+            dnf -y install boost-python3 python3-pip python3-devel && \
+            python3 -m pip --no-cache-dir install --upgrade pip && \
+            python3 -m pip --no-cache-dir install --upgrade setuptools wheel; \
+        elif [ "$PYTHON" == "3.10" ] ; then \
+            PYTHON_VERSION="3.10.${PYTHON_310_PATCH_VERSION}" && \
+            dnf install -y 'dnf-command(config-manager)' && \
+            dnf config-manager --enable crb && \
+            dnf -y update && \
+            dnf -y install dnf-plugins-core && \
+            dnf -y builddep python3 && \
+            dnf -y install wget yum-utils make gcc openssl-devel bzip2-devel libffi-devel zlib-devel && \
+            wget https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz && \
+            tar xzf Python-${PYTHON_VERSION}.tgz && \
+            cd Python-${PYTHON_VERSION} && \
+            ./configure --enable-optimizations --enable-shared --libdir=/usr/local/lib LDFLAGS="-Wl,-rpath /usr/local/lib" && \
+            make -j ${nproc} && \
+            make altinstall exec_prefix=/usr && \
+            rm -rf Python-${PYTHON_VERSION}.tgz && \
+            echo "/usr/local/lib" > /etc/ld.so.conf.d/python${PYTHON}.conf && \
+            ldconfig && \
+            python${PYTHON} -m pip --no-cache-dir install --upgrade pip && \
+            python${PYTHON} -m pip --no-cache-dir install --upgrade setuptools wheel; \
+        fi
+    RUN python${PYTHON} -m venv ${PYTHON_VENV}
+
+FROM python as gfal2
+    RUN dnf install -y epel-release.noarch && \
+        dnf install -y 'dnf-command(config-manager)' && \
+        dnf config-manager --enable crb && \
+        dnf -y update && \
+        dnf -y install gfal2-devel && \
+        if [ "$PYTHON" == "3.9" ] ; then \
+            dnf -y install gfal2-python3 && \
+            cp /usr/lib64/python3.9/site-packages/gfal2.so /usr/lib64/gfal2.so; \
+        elif [ "$PYTHON" == "3.10" ] ; then \
+            wget https://boostorg.jfrog.io/artifactory/main/release/1.80.0/source/boost_1_80_0.tar.gz && \
+            tar -xvzf boost_1_80_0.tar.gz && \
+            cd boost_1_80_0 && \
+            ./bootstrap.sh --with-libraries=python --with-python=/usr/bin/python3.10 --prefix=/usr/ --libdir=/usr/local/lib && \
+            ./b2 --with-python --libdir=/usr/local/lib --link=shared && \
+            cp /usr/local/src/boost_1_80_0/stage/lib/lib* /usr/lib64/ && \
+            dnf install -y git dnf-plugins-core git rpm-build tree which cmake make gcc gcc-c++ && \ 
+            git clone --depth 1 --branch v1.12.0 https://github.com/cern-fts/gfal2-python.git && \
+            cd gfal2-python && \
+            cd ./packaging && \
+            RPMBUILD_SRC_EXTRA_FLAGS="--without docs --without python2" make srpm && \
+            dnf -y builddep gfal2-python-1.12.0-1.el9.src.rpm && \
+            cd ../ && \
+            CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH:/usr/local/src/boost_1_80_0  python3 -m pip --no-cache-dir install . && \
+            cd .. && rm -rf gfal2-python && \
+            dnf remove -y boost-python3 && \
+            cp ${PYTHON_VENV}/lib/python${PYTHON}/site-packages/gfal2.so /usr/lib64/gfal2.so; \
+        fi
+
+FROM python as mod_wsgi
+    RUN if [ "$PYTHON" == "3.9" ] ; then \
+            dnf install -y python3-mod_wsgi && \
+            cp /usr/lib64/httpd/modules/mod_wsgi_python3.so /usr/lib64/httpd/modules/mod_wsgi.so; \
+        elif [ "$PYTHON" == "3.10" ] ; then \
+            dnf install -y httpd-devel && \
+            curl -sSL https://github.com/GrahamDumpleton/mod_wsgi/archive/4.9.1.tar.gz | tar xzv && \
+            cd mod_wsgi-4.9.1 && \
+            ./configure --with-python=/usr/bin/python${PYTHON} --prefix=/usr --libdir=/usr/local/lib && \
+            make -j && \
+            make install; \
+        fi && \
+        echo -e '# NOTE:\n# Only one mod_wsgi can be loaded at a time.\n# Don'"'"'t attempt to load if already loaded.\n<IfModule !wsgi_module>\n    LoadModule wsgi_module modules/mod_wsgi.so\n</IfModule>\n' > /etc/httpd/conf.modules.d/05-wsgi-python.conf;
+
+
+FROM python as rucio-runtime
+    WORKDIR /usr/local/src/rucio
+    COPY tools tools
+    COPY bin bin
+    COPY lib lib
+    COPY etc etc
+    COPY .flake8 .pep8 .pycodestyle pylintrc setup.py setup_rucio.py setup_rucio_client.py setup_webui.py requirements.txt setuputil.py ./
+    
+    RUN dnf install -y epel-release.noarch && \
+        dnf install -y 'dnf-command(config-manager)' && \
+        dnf config-manager --enable crb && \
+        dnf -y update && \
+        dnf install -y \
+        xmlsec1-devel xmlsec1-openssl-devel pkg-config libtool-ltdl-devel \
+        httpd-devel \
+        libnsl libaio \
+        memcached \
+        sqlite \
+        gfal2-devel \
+        nodejs npm \
+        glibc-langpack-en
+
+    RUN printf "%s\n" \
+        "[epel8]" \
+        "name=Extra Packages for Enterprise Linux 8 - x86_64" \
+        "metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-8&arch=x86_64&infra=\$infra&content=\$contentdir" \
+        "enabled=1" \
+        "gpgcheck=0" \
+        > /etc/yum.repos.d/epel8.repo
+    RUN dnf install -y gridsite && rm -rf /etc/yum.repos.d/epel8.repo
+
+    RUN mkdir -p /var/log/rucio/trace && \
+        chmod -R 777 /var/log/rucio && \
+        mkdir -p /etc/grid-security && \
+        cp etc/certs/hostcert_rucio.pem /etc/grid-security/hostcert.pem && \
+        cp etc/certs/hostcert_rucio.key.pem /etc/grid-security/hostkey.pem && chmod 0400 /etc/grid-security/hostkey.pem && \
+        cp etc/docker/test/extra/httpd.conf /etc/httpd/conf/httpd.conf && \
+        cp etc/docker/test/extra/rucio.conf /etc/httpd/conf.d/rucio.conf && \
+        cp etc/docker/test/extra/00-mpm.conf /etc/httpd/conf.modules.d/00-mpm.conf && \
+        rm /etc/httpd/conf.d/ssl.conf /etc/httpd/conf.d/autoindex.conf /etc/httpd/conf.d/userdir.conf /etc/httpd/conf.d/welcome.conf /etc/httpd/conf.d/zgridsite.conf && \
+        cp etc/certs/rucio_ca.pem etc/rucio_ca.pem && \
+        cp etc/certs/ruciouser.pem etc/ruciouser.pem && \
+        cp etc/certs/ruciouser.key.pem etc/ruciouser.key.pem && \
+        chmod 0400 etc/ruciouser.key.pem
+
+FROM rucio-runtime as requirements
+    RUN dnf -y update --nobest && \ 
+        dnf -y --skip-broken install make gcc krb5-devel xmlsec1-devel xmlsec1-openssl-devel pkg-config libtool-ltdl-devel && \
+        python3 -m pip --no-cache-dir install --upgrade pip && \
+        python3 -m pip --no-cache-dir install --upgrade setuptools wheel && \
+        python3 -m pip --no-cache-dir install --upgrade -r requirements.txt   
+    
+    COPY .flake8 .pep8 .pycodestyle pylintrc setup.py setup_rucio.py setup_rucio_client.py setup_webui.py ./
+    RUN python3 -m pip --no-cache-dir install --upgrade .[oracle,postgresql,mysql,kerberos,saml,dev] && \
+        python3 -m pip list
+
+FROM rucio-runtime as final
+
+    COPY --from=gfal2 /usr/include/gfal2 /usr/include/gfal2
+    COPY --from=gfal2 /usr/lib64/* /usr/lib64/
+    COPY --from=gfal2 /usr/lib64/libboost_python3* /usr/lib64/
+    COPY --from=gfal2 /usr/lib64/gfal2.so /usr/lib64/gfal2.so
+
+    RUN mv /usr/lib64/gfal2.so ${PYTHON_VENV}/lib/python${PYTHON}/site-packages/gfal2.so;
+   
+    COPY --from=oracle-client /usr/share/oracle /usr/share/oracle
+    COPY --from=oracle-client /usr/lib/oracle /usr/lib/oracle/
+    COPY --from=oracle-client /etc/ld.so.conf.d/oracle-instantclient.conf /etc/ld.so.conf.d/oracle-instantclient.conf
+    
+    COPY --from=requirements ${PYTHON_VENV} ${PYTHON_VENV}
+    COPY --from=mod_wsgi /usr/lib64/httpd/modules /usr/lib64/httpd/modules
+    COPY --from=mod_wsgi /etc/httpd/conf.modules.d/05-wsgi-python.conf  /etc/httpd/conf.modules.d/05-wsgi-python.conf 
+
+    WORKDIR /opt/rucio
+    RUN cp -r /usr/local/src/rucio/{lib,bin,tools,etc} ./
+
+    RUN ldconfig
+   
+    CMD ["httpd","-D","FOREGROUND"]
diff --git a/etc/docker/test/extra/rucio.conf b/etc/docker/test/extra/rucio.conf
--- a/etc/docker/test/extra/rucio.conf
+++ b/etc/docker/test/extra/rucio.conf
@@ -4,7 +4,7 @@ Listen 443
 
 WSGIRestrictEmbedded On
 WSGIDaemonProcess rucio processes=4 threads=4
-WSGIApplicationGroup rucio
+WSGIApplicationGroup %{GLOBAL}
 WSGIProcessGroup rucio
 
 <VirtualHost *:443>
diff --git a/etc/docker/test/fedora33.Dockerfile b/etc/docker/test/fedora33.Dockerfile
deleted file mode 100644
--- a/etc/docker/test/fedora33.Dockerfile
+++ /dev/null
@@ -1,69 +0,0 @@
-# Copyright 2021 CERN
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#    http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-# Authors:
-# - Benedikt Ziemons <benedikt.ziemons@cern.ch>, 2021
-# - Martin Barisits <martin.barisits@cern.ch>, 2021
-
-FROM docker.io/fedora:33
-ARG PYTHON
-
-RUN test "x${PYTHON}" = "x3.9" && \
-    dnf update -y && \
-    dnf install -y which findutils gridsite libaio memcached httpd mod_ssl python3-pip python3-mod_wsgi python3-gfal2 sqlite gcc \
-            python3-devel python3-kerberos krb5-devel libxml2-devel xmlsec1-devel xmlsec1-openssl-devel libtool-ltdl-devel libnsl nodejs && \
-    alternatives --install /usr/bin/python python /usr/bin/python3.9 1 && \
-    alternatives --install /usr/bin/python3 python3 /usr/bin/python3.9 1 && \
-    python -m pip --no-cache-dir install --upgrade pip && \
-    python -m pip --no-cache-dir install --upgrade setuptools wheel && \
-    dnf clean all && \
-    rpm -i https://download.oracle.com/otn_software/linux/instantclient/1912000/oracle-instantclient19.12-basiclite-19.12.0.0.0-1.x86_64.rpm && \
-    echo "/usr/lib/oracle/19.12/client64/lib" > /etc/ld.so.conf.d/oracle-instantclient.conf && \
-    ldconfig
-
-WORKDIR /usr/local/src/rucio
-
-# pre-install requirements
-COPY requirements.txt requirements.txt
-RUN python -m pip --no-cache-dir install --upgrade -r requirements.txt
-
-COPY etc etc
-
-RUN mkdir -p /var/log/rucio/trace && \
-    chmod -R 777 /var/log/rucio && \
-    cp etc/certs/hostcert_rucio.pem /etc/grid-security/hostcert.pem && \
-    cp etc/certs/hostcert_rucio.key.pem /etc/grid-security/hostkey.pem && chmod 0400 /etc/grid-security/hostkey.pem && \
-    cp etc/docker/test/extra/httpd.conf /etc/httpd/conf/httpd.conf && \
-    cp etc/docker/test/extra/rucio.conf /etc/httpd/conf.d/rucio.conf && \
-    cp etc/docker/test/extra/00-mpm.conf /etc/httpd/conf.modules.d/00-mpm.conf && \
-    rm /etc/httpd/conf.d/ssl.conf /etc/httpd/conf.d/autoindex.conf /etc/httpd/conf.d/userdir.conf /etc/httpd/conf.d/welcome.conf /etc/httpd/conf.d/zgridsite.conf && \
-    cp etc/certs/rucio_ca.pem etc/rucio_ca.pem && \
-    cp etc/certs/ruciouser.pem etc/ruciouser.pem && \
-    cp etc/certs/ruciouser.key.pem etc/ruciouser.key.pem && \
-    chmod 0400 etc/ruciouser.key.pem
-
-# copy everything else except the git-dir (anything above is cache-friendly)
-COPY .flake8 .pep8 .pycodestyle pylintrc setuputil.py setup.py setup_rucio.py setup_rucio_client.py setup_webui.py ./
-COPY tools tools
-COPY bin bin
-COPY lib lib
-
-# Install Rucio server + dependencies
-RUN python -m pip --no-cache-dir install --upgrade .[oracle,postgresql,mysql,kerberos,dev,saml] && \
-    python -m pip list
-
-WORKDIR /opt/rucio
-RUN cp -r /usr/local/src/rucio/{lib,bin,tools,etc} ./
-
-CMD ["httpd","-D","FOREGROUND"]
diff --git a/etc/docker/test/fedora32.Dockerfile b/etc/docker/test/fedora35.Dockerfile
similarity index 86%
rename from etc/docker/test/fedora32.Dockerfile
rename to etc/docker/test/fedora35.Dockerfile
--- a/etc/docker/test/fedora32.Dockerfile
+++ b/etc/docker/test/fedora35.Dockerfile
@@ -1,4 +1,4 @@
-# Copyright 2021 CERN
+# Copyright 2022 CERN
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -13,20 +13,19 @@
 # limitations under the License.
 #
 # Authors:
-# - Benedikt Ziemons <benedikt.ziemons@cern.ch>, 2021
-# - Martin Barisits <martin.barisits@cern.ch>, 2021
+# - Mayank Sharma <mayank.sharma@cern.ch>, 2022
 
-FROM docker.io/fedora:32
+FROM docker.io/fedora:35
 ARG PYTHON
 
-RUN test "x${PYTHON}" = "x3.8" && \
+RUN test "x${PYTHON}" = "x3.10" && \
     dnf update -y && \
     dnf install -y which findutils gridsite libaio memcached httpd mod_ssl python3-pip python3-mod_wsgi python3-gfal2 sqlite gcc \
-            python3-devel python3-kerberos krb5-devel libxml2-devel xmlsec1-devel xmlsec1-openssl-devel libtool-ltdl-devel libnsl nodejs && \
-    alternatives --install /usr/bin/python python /usr/bin/python3.8 1 && \
-    alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 1 && \
+            python3-devel python-devel python3-wheel python3-kerberos krb5-devel libxml2-devel xmlsec1-devel xmlsec1-openssl-devel \
+            libtool-ltdl-devel libnsl nodejs redhat-rpm-config && \
+    alternatives --install /usr/bin/python python /usr/bin/python3.10 1 && \
+    alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 1 && \
     python -m pip --no-cache-dir install --upgrade pip && \
-    python -m pip --no-cache-dir install --upgrade setuptools wheel && \
     dnf clean all && \
     rpm -i https://download.oracle.com/otn_software/linux/instantclient/1912000/oracle-instantclient19.12-basiclite-19.12.0.0.0-1.x86_64.rpm && \
     echo "/usr/lib/oracle/19.12/client64/lib" > /etc/ld.so.conf.d/oracle-instantclient.conf && \
diff --git a/etc/docker/test/matrix.yml b/etc/docker/test/matrix.yml
--- a/etc/docker/test/matrix.yml
+++ b/etc/docker/test/matrix.yml
@@ -7,27 +7,49 @@ dists:
     deny:
       suites:
         - sqlite
-  - id: fedora32
+        - py37py38
+  - id: alma8
     allow:
       python:
+        - "3.7"
         - "3.8"
-  - id: fedora33
+  - id: alma9
     allow:
       python:
         - "3.9"
+        - "3.10"
 python:
-  - "3.6"
+  - id: "3.6"
   - id: "3.7"
     allow:
       suites:
         - py37py38
+        - client
+        - client_syntax
   - id: "3.8"
     allow:
       suites:
         - py37py38
         - client
-        - sqlite
-  - "3.9"
+        - client_syntax
+  - id: "3.9"
+    allow:
+      suites:
+        - remote_dbs
+        - multi_vo
+        - client
+        - client_syntax
+        - syntax
+        - docs
+  - id: "3.10"
+    allow:
+      suites:
+        - remote_dbs
+        - multi_vo
+        - client
+        - client_synxtax
+        - syntax
+
 suites:
   - id: syntax
     SYNTAX_REPORT: 1
diff --git a/etc/docker/test/matrix_nightly.yml b/etc/docker/test/matrix_nightly.yml
--- a/etc/docker/test/matrix_nightly.yml
+++ b/etc/docker/test/matrix_nightly.yml
@@ -7,11 +7,16 @@ dists:
     deny:
       suites:
         - sqlite
-  - id: fedora32
+        - py37py38
+  - id: fedora35
+    allow:
+      python:
+        - "3.10"
+  - id: alma8
     allow:
       python:
         - "3.8"
-  - id: fedora33
+  - id: alma9
     allow:
       python:
         - "3.9"
@@ -20,6 +25,7 @@ python:
   - "3.7"
   - "3.8"
   - "3.9"
+  - "3.10"
 suites:
   - id: syntax
     SYNTAX_REPORT: 1
diff --git a/tools/test/build_images.py b/tools/test/build_images.py
--- a/tools/test/build_images.py
+++ b/tools/test/build_images.py
@@ -83,6 +83,7 @@ def build_images(matrix, script_args):
                 continue
 
             args = ()
+            env = {"DOCKER_BUILDKIT": "1"}
             if buildargs.IMAGE_IDENTIFIER == 'integration-test':
                 if buildargs.PYTHON == '3.6':
                     buildfile = pathlib.Path(script_args.buildfiles_dir) / 'Dockerfile'
@@ -114,9 +115,8 @@ def build_images(matrix, script_args):
             if not args:
                 print("Error defining build arguments from", buildargs, file=sys.stderr, flush=True)
                 sys.exit(1)
-
             print("Running", " ".join(args), file=sys.stderr, flush=True)
-            subprocess.run(args, stdout=sys.stderr, check=True)
+            subprocess.run(args, stdout=sys.stderr, check=True, env=env)
             print("Finished building image", imagetag, file=sys.stderr, flush=True)
 
             if script_args.push_cache: