From 92a6f864617971a4963042094d481667ed675e58 Mon Sep 17 00:00:00 2001 From: Tobias Urdin Date: Mon, 7 Oct 2024 08:59:23 +0200 Subject: [PATCH 1/3] Test Python 3.12 on Ubuntu 24.04 LTS --- .github/workflows/gnocchi.yml | 1 + .mergify.yml | 24 ++++++++++++++++++++++++ images/Dockerfile.ci | 6 ++---- images/entrypoint.sh.ci | 5 +++++ tox.ini | 12 ++++++------ 5 files changed, 38 insertions(+), 10 deletions(-) diff --git a/.github/workflows/gnocchi.yml b/.github/workflows/gnocchi.yml index 43406e32d..2afa8091f 100644 --- a/.github/workflows/gnocchi.yml +++ b/.github/workflows/gnocchi.yml @@ -110,6 +110,7 @@ jobs: python: - py39 - py311 + - py312 env: - mysql-ceph-upgrade-from-4.5 - postgresql-file-upgrade-from-4.5 diff --git a/.mergify.yml b/.mergify.yml index d831689a8..f1cb4bbf1 100644 --- a/.mergify.yml +++ b/.mergify.yml @@ -26,6 +26,18 @@ queue_rules: - check-success=test (py311, postgresql-file-sqlalchemy14) - check-success=test (py311, postgresql-swift) - check-success=test (py311, postgresql-s3) + - check-success=test (py312, mysql-ceph-upgrade-from-4.5) + - check-success=test (py312, postgresql-file-upgrade-from-4.5) + - check-success=test (py312, mysql-file) + - check-success=test (py312, mysql-file-sqlalchemy14) + - check-success=test (py312, mysql-swift) + - check-success=test (py312, mysql-s3) + - check-success=test (py312, mysql-ceph) + - check-success=test (py312, postgresql-file) + - check-success=test (py312, postgresql-file-sqlalchemy14) + - check-success=test (py312, postgresql-swift) + - check-success=test (py312, postgresql-s3) + - check-success=test (py312, postgresql-ceph) pull_request_rules: - name: automatic merge @@ -61,6 +73,18 @@ pull_request_rules: - check-success=test (py311, postgresql-file-sqlalchemy14) - check-success=test (py311, postgresql-swift) - check-success=test (py311, postgresql-s3) + - check-success=test (py312, mysql-ceph-upgrade-from-4.5) + - check-success=test (py312, postgresql-file-upgrade-from-4.5) + - check-success=test (py312, mysql-file) + - check-success=test (py312, mysql-file-sqlalchemy14) + - check-success=test (py312, mysql-swift) + - check-success=test (py312, mysql-s3) + - check-success=test (py312, mysql-ceph) + - check-success=test (py312, postgresql-file) + - check-success=test (py312, postgresql-file-sqlalchemy14) + - check-success=test (py312, postgresql-swift) + - check-success=test (py312, postgresql-s3) + - check-success=test (py312, postgresql-ceph) - name: automatic merge backports from Mergify actions: diff --git a/images/Dockerfile.ci b/images/Dockerfile.ci index 9abcb0061..87bf92442 100644 --- a/images/Dockerfile.ci +++ b/images/Dockerfile.ci @@ -1,4 +1,4 @@ -FROM ubuntu:22.04 +FROM ubuntu:24.04 ENV GNOCCHI_WORKSPACE /github/workspace ENV DEBIAN_FRONTEND noninteractive @@ -15,6 +15,7 @@ RUN apt-get update -y && apt-get install -qy \ python3 \ python3-dev \ python3-pip \ + python3-virtualenv \ python3.9 \ python3.9-dev \ python3.9-distutils \ @@ -55,9 +56,6 @@ ENV LANG en_US.UTF-8 RUN update-locale RUN locale-gen $LANG -#NOTE(sileht): Upgrade python dev tools -RUN python3 -m pip install -U pip tox virtualenv - RUN npm install s3rver@3.7.0 --global RUN groupadd --gid 1001 tester diff --git a/images/entrypoint.sh.ci b/images/entrypoint.sh.ci index a4a32ab8e..f5e424e49 100755 --- a/images/entrypoint.sh.ci +++ b/images/entrypoint.sh.ci @@ -1,2 +1,7 @@ #!/bin/sh + +python3 -m virtualenv /tmp/gnocchi-tox-env +. /tmp/gnocchi-tox-env/bin/activate +pip install tox + $@ diff --git a/tox.ini b/tox.ini index ccf2a7f84..b681c53e8 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] minversion = 3.1 -envlist = {py39,py311}-{postgresql,mysql}{,-file,-file-sqlalchemy14,-swift,-ceph,-s3},pep8 +envlist = {py39,py311,py312}-{postgresql,mysql}{,-file,-file-sqlalchemy14,-swift,-ceph,-s3},pep8 skipsdist = True [testenv] @@ -59,12 +59,12 @@ allowlist_externals = {toxinidir}/run-tests.sh {toxinidir}/run-func-tests.sh -[testenv:{py38,py39,py311}-{postgresql,mysql}-file-sqlalchemy14] +[testenv:{py38,py39,py311,py312}-{postgresql,mysql}-file-sqlalchemy14] deps = {[testenv]deps} sqlalchemy<2 -[testenv:{py39,py311}-postgresql-file-upgrade-from-4.5] +[testenv:{py39,py311,py312}-postgresql-file-upgrade-from-4.5] # We should always recreate since the script upgrade # Gnocchi we can't reuse the virtualenv recreate = True @@ -79,7 +79,7 @@ deps = commands = {toxinidir}/run-upgrade-tests.sh postgresql-file allowlist_externals = {toxinidir}/run-upgrade-tests.sh -[testenv:{py39,py311}-mysql-ceph-upgrade-from-4.5] +[testenv:{py39,py311,py312}-mysql-ceph-upgrade-from-4.5] # We should always recreate since the script upgrade # Gnocchi we can't reuse the virtualenv recreate = True @@ -99,12 +99,12 @@ deps = build commands = python -m build [testenv:pep8] -deps = hacking>=3.2.0,<4.0.0 +deps = hacking>=3.2.0,<8.0.0 commands = flake8 {posargs} allowlist_externals = /usr/bin/flake8 -[testenv:{py39,py311}-cover] +[testenv:{py39,py311,py312}-cover] setenv = {[testenv]setenv} PYTHON=coverage run --source gnocchi --parallel-mode From a537a58ad8d735ada17bd7c96a6cf3f2b0a24ec2 Mon Sep 17 00:00:00 2001 From: Tobias Urdin Date: Mon, 7 Oct 2024 10:46:50 +0200 Subject: [PATCH 2/3] Use custom pifpaf Revert this when Ubuntu doesn't have a mangled Ceph version. --- tox.ini | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index b681c53e8..d3c901660 100644 --- a/tox.ini +++ b/tox.ini @@ -50,6 +50,8 @@ setenv = deps = .[test,redis,prometheus,amqp1,{env:GNOCCHI_STORAGE_DEPS:},{env:GNOCCHI_INDEXER_DEPS:}] {env:GNOCCHI_TEST_TARBALLS:} + # TODO(tobias-urdin): Remove when Ubuntu doesn't have a mangled Ceph version. + git+https://github.com/tobias-urdin/pifpaf@2d0890b7efb7af50172a95e5065a51d7871e8a76 cliff!=2.9.0 gnocchiclient>=2.8.0,!=7.0.7 commands = @@ -73,8 +75,9 @@ setenv = GNOCCHI_VERSION_FROM=stable/4.5 GNOCCHI_VARIANT=test,postgresql,file deps = + # TODO(tobias-urdin): Remove when Ubuntu doesn't have a mangled Ceph version. + git+https://github.com/tobias-urdin/pifpaf@2d0890b7efb7af50172a95e5065a51d7871e8a76 gnocchiclient>=2.8.0,!=7.0.7 - pifpaf xattr!=0.9.4 commands = {toxinidir}/run-upgrade-tests.sh postgresql-file allowlist_externals = {toxinidir}/run-upgrade-tests.sh @@ -88,8 +91,9 @@ setenv = GNOCCHI_VERSION_FROM=stable/4.5 GNOCCHI_VARIANT=test,mysql,ceph,ceph_recommended_lib deps = + # TODO(tobias-urdin): Remove when Ubuntu doesn't have a mangled Ceph version. + git+https://github.com/tobias-urdin/pifpaf@2d0890b7efb7af50172a95e5065a51d7871e8a76 gnocchiclient>=2.8.0,!=7.0.7 - pifpaf[ceph] xattr!=0.9.4 commands = {toxinidir}/run-upgrade-tests.sh mysql-ceph allowlist_externals = {toxinidir}/run-upgrade-tests.sh From 17f3cde81f9375bb96eae8e073f0705fce879ef2 Mon Sep 17 00:00:00 2001 From: Tobias Urdin Date: Tue, 8 Oct 2024 09:59:39 +0200 Subject: [PATCH 3/3] Disable Ceph jobs on Python 3.12 These jobs has timed out for a while on all Python versions and has thus been disabled so these are now also disabled on Python 3.12 We need to fix these in the future to get full Ceph coverage. --- .github/workflows/gnocchi.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/gnocchi.yml b/.github/workflows/gnocchi.yml index 2afa8091f..1542e671d 100644 --- a/.github/workflows/gnocchi.yml +++ b/.github/workflows/gnocchi.yml @@ -137,6 +137,11 @@ jobs: python: py311 - env: postgresql-ceph python: py311 + # TODO(tobias-urdin): We need to fix below Ceph jobs + - env: mysql-ceph + python: py312 + - env: postgresql-ceph + python: py312 steps: - uses: actions/checkout@v4 - run: sudo chown -R 1001:1001 $GITHUB_WORKSPACE