From 248711e28727c738d81acc2970621dcb092b9716 Mon Sep 17 00:00:00 2001 From: Alex Kavanagh Date: Thu, 27 Apr 2023 17:31:42 +0100 Subject: [PATCH] Add updates for bringing this updated to antelope * Enable running under tox 4 * add jammy-antelope, and jammy-zed bundles; remove focal-ussuri * Update osci.yaml so that it runs with charmcraft 2.1/stable Change-Id: I3422b0f215137240cd6960eea62923117c0ee91c --- .zuul.yaml | 2 +- build-requirements.txt | 7 -- charmcraft.yaml | 6 +- metadata.yaml | 2 +- osci.yaml | 6 +- pip.sh | 18 ------ test-requirements.txt | 2 +- tests/bundles/jammy-antelope.yaml | 64 +++++++++++++++++++ .../{focal-ussuri.yaml => jammy-zed.yaml} | 40 ++++++++---- tests/tests.yaml | 5 +- tox.ini | 49 +++----------- 11 files changed, 112 insertions(+), 89 deletions(-) delete mode 100644 build-requirements.txt delete mode 100755 pip.sh create mode 100644 tests/bundles/jammy-antelope.yaml rename tests/bundles/{focal-ussuri.yaml => jammy-zed.yaml} (53%) diff --git a/.zuul.yaml b/.zuul.yaml index 7ffc71c..fd20909 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -1,4 +1,4 @@ - project: templates: - - openstack-python3-charm-yoga-jobs + - openstack-python3-charm-jobs - openstack-cover-jobs diff --git a/build-requirements.txt b/build-requirements.txt deleted file mode 100644 index b6d2452..0000000 --- a/build-requirements.txt +++ /dev/null @@ -1,7 +0,0 @@ -# NOTES(lourot): -# * We don't install charmcraft via pip anymore because it anyway spins up a -# container and scp the system's charmcraft snap inside it. So the charmcraft -# snap is necessary on the system anyway. -# * `tox -e build` successfully validated with charmcraft 1.2.1 - -cffi==1.14.6; python_version < '3.6' # cffi 1.15.0 drops support for py35. diff --git a/charmcraft.yaml b/charmcraft.yaml index ff59b02..fa7de3a 100644 --- a/charmcraft.yaml +++ b/charmcraft.yaml @@ -22,7 +22,7 @@ parts: bases: - build-on: - name: ubuntu - channel: "20.04" + channel: "22.04" architectures: - amd64 - s390x @@ -30,6 +30,4 @@ bases: - arm64 run-on: - name: ubuntu - channel: "20.04" - - name: ubuntu - channel: "21.10" + channel: "22.04" diff --git a/metadata.yaml b/metadata.yaml index 72f55d0..8660f89 100644 --- a/metadata.yaml +++ b/metadata.yaml @@ -12,7 +12,7 @@ tags: - file-servers - misc series: - - focal + - jammy subordinate: true provides: storage-backend: diff --git a/osci.yaml b/osci.yaml index 5dc70d6..2ba66e6 100644 --- a/osci.yaml +++ b/osci.yaml @@ -1,8 +1,8 @@ - project: templates: - - charm-unit-jobs-py38 - - charm-unit-jobs-py39 + - charm-unit-jobs-py310 vars: needs_charm_build: true - charm_build_name: infinidat2 + charm_build_name: infinidat-tools build_type: charmcraft + charmcraft_channel: 2.1/stable diff --git a/pip.sh b/pip.sh deleted file mode 100755 index 9a7e6b0..0000000 --- a/pip.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env bash -# -# This file is managed centrally by release-tools and should not be modified -# within individual charm repos. See the 'global' dir contents for available -# choices of tox.ini for OpenStack Charms: -# https://github.com/openstack-charmers/release-tools -# -# setuptools 58.0 dropped the support for use_2to3=true which is needed to -# install blessings (an indirect dependency of charm-tools). -# -# More details on the beahvior of tox and virtualenv creation can be found at -# https://github.com/tox-dev/tox/issues/448 -# -# This script is wrapper to force the use of the pinned versions early in the -# process when the virtualenv was created and upgraded before installing the -# depedencies declared in the target. -pip install 'pip<20.3' 'setuptools<50.0.0' -pip "$@" diff --git a/test-requirements.txt b/test-requirements.txt index e6f71d3..43e628f 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,7 +1,7 @@ # This file is managed centrally. If you find the need to modify this as a # one-off, please don't. Intead, consult #openstack-charms and ask about # requirements management in charms via bot-control. Thank you. -charm-tools>=2.4.4 +# charm-tools>=2.4.4 coverage>=3.6 mock>=1.2 flake8>=4.0.1; python_version >= '3.6' diff --git a/tests/bundles/jammy-antelope.yaml b/tests/bundles/jammy-antelope.yaml new file mode 100644 index 0000000..f5001b8 --- /dev/null +++ b/tests/bundles/jammy-antelope.yaml @@ -0,0 +1,64 @@ +series: jammy +comment: +- 'machines section to decide order of deployment. database sooner = faster' +machines: + '0': + constraints: mem=3072M + '1': + constraints: mem=3072M + '2': + constraints: mem=3072M + '3': + '4': + '5': +local_overlay_enabled: false + +applications: + mysql: + charm: ch:mysql-innodb-cluster + channel: 8.0/edge + num_units: 3 + to: + - '0' + - '1' + - '2' + keystone: + charm: ch:keystone + channel: latest/edge + num_units: 1 + options: + openstack-origin: cloud:jammy-antelope + to: + - '3' + keystone-mysql-router: + charm: ch:mysql-router + channel: latest/edge + cinder: + charm: ch:cinder + channel: latest/edge + num_units: 1 + options: + openstack-origin: cloud:jammy-antelope + to: + - '4' + cinder-mysql-router: + charm: ch:mysql-router + channel: latest/edge + infinidat-tools: + charm: ../../infinidat-tools.charm + # options: + rabbitmq-server: + charm: ch:rabbitmq-server + channel: latest/edge + num_units: 1 + to: + - '5' + +relations: +- [ keystone:shared-db, keystone-mysql-router:shared-db ] +- [ cinder:shared-db, cinder-mysql-router:shared-db ] +- [ cinder:identity-service, keystone:identity-service ] +- [ cinder:amqp, rabbitmq-server:amqp ] +- [ cinder:juju-info, infinidat-tools:juju-info ] +- [ mysql:db-router, keystone-mysql-router:db-router] +- [ mysql:db-router, cinder-mysql-router:db-router] diff --git a/tests/bundles/focal-ussuri.yaml b/tests/bundles/jammy-zed.yaml similarity index 53% rename from tests/bundles/focal-ussuri.yaml rename to tests/bundles/jammy-zed.yaml index 018401b..b59fbd6 100644 --- a/tests/bundles/focal-ussuri.yaml +++ b/tests/bundles/jammy-zed.yaml @@ -1,37 +1,49 @@ -series: focal +series: jammy comment: - 'machines section to decide order of deployment. database sooner = faster' machines: '0': constraints: mem=3072M '1': + constraints: mem=3072M '2': + constraints: mem=3072M '3': + '4': + '5': local_overlay_enabled: false applications: mysql: - charm: ch:percona-cluster - channel: latest/edge - num_units: 1 + charm: ch:mysql-innodb-cluster + channel: 8.0/edge + num_units: 3 to: - '0' + - '1' + - '2' keystone: charm: ch:keystone - channel: yoga/edge + channel: latest/edge num_units: 1 options: - openstack-origin: cloud:focal-ussuri + openstack-origin: cloud:jammy-zed to: - - '1' + - '3' + keystone-mysql-router: + charm: ch:mysql-router + channel: latest/edge cinder: charm: ch:cinder - channel: yoga/edge + channel: latest/edge num_units: 1 options: - openstack-origin: cloud:focal-ussuri + openstack-origin: cloud:jammy-zed to: - - '2' + - '4' + cinder-mysql-router: + charm: ch:mysql-router + channel: latest/edge infinidat-tools: charm: ../../infinidat-tools.charm # options: @@ -40,11 +52,13 @@ applications: channel: latest/edge num_units: 1 to: - - '3' + - '5' relations: -- [ keystone:shared-db, mysql:shared-db ] -- [ cinder:shared-db, mysql:shared-db ] +- [ keystone:shared-db, keystone-mysql-router:shared-db ] +- [ cinder:shared-db, cinder-mysql-router:shared-db ] - [ cinder:identity-service, keystone:identity-service ] - [ cinder:amqp, rabbitmq-server:amqp ] - [ cinder:juju-info, infinidat-tools:juju-info ] +- [ mysql:db-router, keystone-mysql-router:db-router] +- [ mysql:db-router, cinder-mysql-router:db-router] diff --git a/tests/tests.yaml b/tests/tests.yaml index cb37429..20162f5 100644 --- a/tests/tests.yaml +++ b/tests/tests.yaml @@ -4,6 +4,7 @@ tests: configure: - zaza.openstack.charm_tests.keystone.setup.add_demo_user gate_bundles: - - focal-ussuri + - jammy-antelope + - jammy-zed smoke_bundles: - - focal-ussuri + - jammy-antelope diff --git a/tox.ini b/tox.ini index a82d855..e39b48e 100644 --- a/tox.ini +++ b/tox.ini @@ -7,20 +7,6 @@ skipsdist = True sitepackages = False # NOTE: Avoid false positives by not skipping missing interpreters. skip_missing_interpreters = False -# NOTES: -# * We avoid the new dependency resolver by pinning pip < 20.3, see -# https://github.com/pypa/pip/issues/9187 -# * Pinning dependencies requires tox >= 3.2.0, see -# https://tox.readthedocs.io/en/latest/config.html#conf-requires -# * It is also necessary to pin virtualenv as a newer virtualenv would still -# lead to fetching the latest pip in the func* tox targets, see -# https://stackoverflow.com/a/38133283 -# * It is necessary to declare setuptools as a dependency otherwise tox will -# fail very early at not being able to load it. The version pinning is in -# line with `pip.sh`. -requires = pip < 20.3 - virtualenv < 20.0 - setuptools < 50.0.0 # NOTE: https://wiki.canonical.com/engineering/OpenStack/InstallLatestToxOnOsci minversion = 3.2.0 @@ -35,36 +21,21 @@ allowlist_externals = git bash charmcraft - rename.sh -passenv = HOME TERM CS_* OS_* TEST_* + {toxinidir}/rename.sh +passenv = + HOME + TERM + CS_* + OS_* + TEST_* deps = -r{toxinidir}/test-requirements.txt -[testenv:py35] -basepython = python3.5 -# python3.5 is irrelevant on a focal+ charm. -commands = /bin/true - -[testenv:py36] -basepython = python3.6 -deps = -r{toxinidir}/requirements.txt - -r{toxinidir}/test-requirements.txt - -[testenv:py37] -basepython = python3.7 -deps = -r{toxinidir}/requirements.txt - -r{toxinidir}/test-requirements.txt - [testenv:py38] basepython = python3.8 deps = -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt -[testenv:py39] -basepython = python3.9 -deps = -r{toxinidir}/requirements.txt - -r{toxinidir}/test-requirements.txt - -[testenv:py10] +[testenv:py310] basepython = python3.10 deps = -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt @@ -114,7 +85,7 @@ commands = {posargs} [testenv:build] basepython = python3 -deps = -r{toxinidir}/build-requirements.txt +deps = # NOTE(lourot): charmcraft 1.0.0 used to generate # cinder-infinidat2.charm, which is the behaviour expected # by OSCI. However charmcraft 1.2.1 now generates @@ -122,7 +93,7 @@ deps = -r{toxinidir}/build-requirements.txt # In order to keep the old behaviour we rename the file at the end. commands = charmcraft clean - charmcraft -v build + charmcraft -v pack {toxinidir}/rename.sh [testenv:func-noop]