From 2f5c78e07d6a99c07771a9c37b9790727a800287 Mon Sep 17 00:00:00 2001 From: Myles Penner Date: Tue, 3 Sep 2024 22:54:58 +0000 Subject: [PATCH] Add charmcraft 3 support Summary of changes: - Update the charmcraft.yaml file to use base and platforms, only allowing noble support. - Update config to default to caracal. - Update osci.yaml to use the charmcraft 3.x/beta - Drop non-noble tests - Update constraints file from -2024.1.txt to -noble.txt - Add charmbuild to .zuul.yaml - Update tox.ini to support py312 Change-Id: I7a4d46e2f0c9f645c4819ede53490747da9035f1 --- .zuul.yaml | 5 ++ charmcraft.yaml | 26 +++++---- osci.yaml | 2 +- requirements.txt | 5 -- src/metadata.yaml | 2 - src/tests/bundles/jammy-antelope.yaml | 82 --------------------------- src/tests/bundles/jammy-bobcat.yaml | 82 --------------------------- src/tests/bundles/jammy-caracal.yaml | 82 --------------------------- src/tests/bundles/noble-caracal.yaml | 4 +- src/tests/tests.yaml | 6 +- src/tox.ini | 2 +- test-requirements.txt | 1 - tox.ini | 15 +++-- 13 files changed, 37 insertions(+), 277 deletions(-) delete mode 100644 src/tests/bundles/jammy-antelope.yaml delete mode 100644 src/tests/bundles/jammy-bobcat.yaml delete mode 100644 src/tests/bundles/jammy-caracal.yaml diff --git a/.zuul.yaml b/.zuul.yaml index fd20909..247f0eb 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -2,3 +2,8 @@ templates: - openstack-python3-charm-jobs - openstack-cover-jobs + check: + jobs: + - charmbuild + vars: + charm_build_name: cinder-netapp diff --git a/charmcraft.yaml b/charmcraft.yaml index c31dea1..c31545a 100644 --- a/charmcraft.yaml +++ b/charmcraft.yaml @@ -7,18 +7,22 @@ parts: build-packages: - libpython3-dev build-snaps: - - charm + - charm/latest/edge build-environment: - CHARM_INTERFACES_DIR: /root/project/interfaces/ - CHARM_LAYERS_DIR: /root/project/layers/ -bases: - - build-on: - - name: ubuntu - channel: "22.04" - architectures: - - amd64 - run-on: - - name: ubuntu - channel: "22.04" - architectures: [amd64, s390x, ppc64el, arm64] +base: ubuntu@24.04 +platforms: + amd64: + build-on: amd64 + build-for: amd64 + arm64: + build-on: arm64 + build-for: arm64 + ppc64el: + build-on: ppc64el + build-for: ppc64el + s390x: + build-on: s390x + build-for: s390x diff --git a/osci.yaml b/osci.yaml index 07a19bd..fb1d46b 100644 --- a/osci.yaml +++ b/osci.yaml @@ -6,4 +6,4 @@ needs_charm_build: true charm_build_name: cinder-netapp build_type: charmcraft - charmcraft_channel: 2.x/stable + charmcraft_channel: 3.x/stable diff --git a/requirements.txt b/requirements.txt index b3dc23f..244688f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,11 +2,6 @@ # within individual charm repos. See the 'global' dir contents for available # choices of *requirements.txt files for OpenStack Charms: # https://github.com/openstack-charmers/release-tools -# -# NOTE(lourot): This might look like a duplication of test-requirements.txt but -# some tox targets use only test-requirements.txt whereas charm-build uses only -# requirements.txt -setuptools<50.0.0 # https://github.com/pypa/setuptools/commit/04e3df22df840c6bb244e9b27bc56750c44b7c85 # NOTE: newer versions of cryptography require a Rust compiler to build, # see diff --git a/src/metadata.yaml b/src/metadata.yaml index bd78a8a..07afc33 100644 --- a/src/metadata.yaml +++ b/src/metadata.yaml @@ -10,8 +10,6 @@ tags: - storage - file-servers - misc -series: - - jammy subordinate: true provides: storage-backend: diff --git a/src/tests/bundles/jammy-antelope.yaml b/src/tests/bundles/jammy-antelope.yaml deleted file mode 100644 index c32eae5..0000000 --- a/src/tests/bundles/jammy-antelope.yaml +++ /dev/null @@ -1,82 +0,0 @@ -series: jammy -local_overlay_enabled: False - -variables: - openstack-origin: &openstack-origin cloud:jammy-antelope -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': - constraints: mem=4G root-disk=16G -relations: - - - keystone:shared-db - - keystone-mysql-router:shared-db - - - keystone-mysql-router:db-router - - mysql-innodb-cluster:db-router - - - cinder:shared-db - - cinder-mysql-router:shared-db - - - cinder-mysql-router:db-router - - mysql-innodb-cluster:db-router - - - cinder:identity-service - - keystone:identity-service - - - cinder:amqp - - rabbitmq-server:amqp - - - cinder:storage-backend - - cinder-netapp:storage-backend -applications: - mysql-innodb-cluster: - charm: ch:mysql-innodb-cluster - num_units: 3 - options: - source: *openstack-origin - to: - - '0' - - '1' - - '2' - channel: latest/edge - rabbitmq-server: - charm: ch:rabbitmq-server - num_units: 1 - to: - - '3' - channel: latest/edge - keystone: - charm: ch:keystone - options: - openstack-origin: *openstack-origin - num_units: 1 - to: - - '4' - channel: 2024.1/edge - keystone-mysql-router: - charm: ch:mysql-router - channel: latest/edge - cinder: - charm: ch:cinder - storage: - block-devices: '40G' - num_units: 1 - options: - openstack-origin: *openstack-origin - block-device: None - overwrite: "true" - to: - - '5' - channel: 2024.1/edge - cinder-netapp: - charm: ../../../cinder-netapp.charm - options: - netapp-storage-family: ontap_cluster - netapp-storage-protocol: iscsi - volume-backend-name: NETAPP - cinder-mysql-router: - charm: ch:mysql-router - channel: latest/edge diff --git a/src/tests/bundles/jammy-bobcat.yaml b/src/tests/bundles/jammy-bobcat.yaml deleted file mode 100644 index 4b3adcd..0000000 --- a/src/tests/bundles/jammy-bobcat.yaml +++ /dev/null @@ -1,82 +0,0 @@ -series: jammy -local_overlay_enabled: False - -variables: - openstack-origin: &openstack-origin cloud:jammy-bobcat -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': - constraints: mem=4G root-disk=16G -relations: - - - keystone:shared-db - - keystone-mysql-router:shared-db - - - keystone-mysql-router:db-router - - mysql-innodb-cluster:db-router - - - cinder:shared-db - - cinder-mysql-router:shared-db - - - cinder-mysql-router:db-router - - mysql-innodb-cluster:db-router - - - cinder:identity-service - - keystone:identity-service - - - cinder:amqp - - rabbitmq-server:amqp - - - cinder:storage-backend - - cinder-netapp:storage-backend -applications: - mysql-innodb-cluster: - charm: ch:mysql-innodb-cluster - num_units: 3 - options: - source: *openstack-origin - to: - - '0' - - '1' - - '2' - channel: latest/edge - rabbitmq-server: - charm: ch:rabbitmq-server - num_units: 1 - to: - - '3' - channel: latest/edge - keystone: - charm: ch:keystone - options: - openstack-origin: *openstack-origin - num_units: 1 - to: - - '4' - channel: 2024.1/edge - keystone-mysql-router: - charm: ch:mysql-router - channel: latest/edge - cinder: - charm: ch:cinder - storage: - block-devices: '40G' - num_units: 1 - options: - openstack-origin: *openstack-origin - block-device: None - overwrite: "true" - to: - - '5' - channel: 2024.1/edge - cinder-netapp: - charm: ../../../cinder-netapp.charm - options: - netapp-storage-family: ontap_cluster - netapp-storage-protocol: iscsi - volume-backend-name: NETAPP - cinder-mysql-router: - charm: ch:mysql-router - channel: latest/edge diff --git a/src/tests/bundles/jammy-caracal.yaml b/src/tests/bundles/jammy-caracal.yaml deleted file mode 100644 index 6559686..0000000 --- a/src/tests/bundles/jammy-caracal.yaml +++ /dev/null @@ -1,82 +0,0 @@ -series: jammy -local_overlay_enabled: False - -variables: - openstack-origin: &openstack-origin cloud:jammy-caracal -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': - constraints: mem=4G root-disk=16G -relations: - - - keystone:shared-db - - keystone-mysql-router:shared-db - - - keystone-mysql-router:db-router - - mysql-innodb-cluster:db-router - - - cinder:shared-db - - cinder-mysql-router:shared-db - - - cinder-mysql-router:db-router - - mysql-innodb-cluster:db-router - - - cinder:identity-service - - keystone:identity-service - - - cinder:amqp - - rabbitmq-server:amqp - - - cinder:storage-backend - - cinder-netapp:storage-backend -applications: - mysql-innodb-cluster: - charm: ch:mysql-innodb-cluster - num_units: 3 - options: - source: *openstack-origin - to: - - '0' - - '1' - - '2' - channel: latest/edge - rabbitmq-server: - charm: ch:rabbitmq-server - num_units: 1 - to: - - '3' - channel: latest/edge - keystone: - charm: ch:keystone - options: - openstack-origin: *openstack-origin - num_units: 1 - to: - - '4' - channel: 2024.1/edge - keystone-mysql-router: - charm: ch:mysql-router - channel: latest/edge - cinder: - charm: ch:cinder - storage: - block-devices: '40G' - num_units: 1 - options: - openstack-origin: *openstack-origin - block-device: None - overwrite: "true" - to: - - '5' - channel: 2024.1/edge - cinder-netapp: - charm: ../../../cinder-netapp.charm - options: - netapp-storage-family: ontap_cluster - netapp-storage-protocol: iscsi - volume-backend-name: NETAPP - cinder-mysql-router: - charm: ch:mysql-router - channel: latest/edge diff --git a/src/tests/bundles/noble-caracal.yaml b/src/tests/bundles/noble-caracal.yaml index f0b79e7..2502724 100644 --- a/src/tests/bundles/noble-caracal.yaml +++ b/src/tests/bundles/noble-caracal.yaml @@ -55,7 +55,7 @@ applications: num_units: 1 to: - '4' - channel: 2024.1/edge + channel: latest/edge keystone-mysql-router: charm: ch:mysql-router channel: latest/edge @@ -70,7 +70,7 @@ applications: overwrite: "true" to: - '5' - channel: 2024.1/edge + channel: latest/edge cinder-netapp: charm: ../../../cinder-netapp.charm options: diff --git a/src/tests/tests.yaml b/src/tests/tests.yaml index 7b0abe4..47f1bcb 100644 --- a/src/tests/tests.yaml +++ b/src/tests/tests.yaml @@ -4,11 +4,9 @@ tests: configure: - zaza.openstack.charm_tests.keystone.setup.add_demo_user gate_bundles: - - jammy-antelope - - jammy-bobcat - - jammy-caracal + - noble-caracal smoke_bundles: - - jammy-caracal + - noble-caracal dev_bundles: - noble-caracal test_options: diff --git a/src/tox.ini b/src/tox.ini index 2ddcccd..3ce5e85 100644 --- a/src/tox.ini +++ b/src/tox.ini @@ -26,7 +26,7 @@ passenv = OS_* TEST_* deps = - -c {env:TEST_CONSTRAINTS_FILE:https://raw.githubusercontent.com/openstack-charmers/zaza-openstack-tests/master/constraints/constraints-2024.1.txt} + -c {env:TEST_CONSTRAINTS_FILE:https://raw.githubusercontent.com/openstack-charmers/zaza-openstack-tests/master/constraints/constraints-noble.txt} -r{toxinidir}/test-requirements.txt [testenv:pep8] diff --git a/test-requirements.txt b/test-requirements.txt index a7936e6..3fd5feb 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -4,7 +4,6 @@ # https://github.com/openstack-charmers/release-tools # pyparsing<3.0.0 # aodhclient is pinned in zaza and needs pyparsing < 3.0.0, but cffi also needs it, so pin here. -setuptools<50.0.0 # https://github.com/pypa/setuptools/commit/04e3df22df840c6bb244e9b27bc56750c44b7c85 stestr>=2.2.0 diff --git a/tox.ini b/tox.ini index 3e44bd9..1727bfa 100644 --- a/tox.ini +++ b/tox.ini @@ -62,20 +62,27 @@ commands = [testenv:py3] basepython = python3 deps = - -c {env:TEST_CONSTRAINTS_FILE:https://raw.githubusercontent.com/openstack-charmers/zaza-openstack-tests/master/constraints/constraints-2024.1.txt} + -c {env:TEST_CONSTRAINTS_FILE:https://raw.githubusercontent.com/openstack-charmers/zaza-openstack-tests/master/constraints/constraints-noble.txt} -r{toxinidir}/test-requirements.txt commands = stestr run --slowest {posargs} [testenv:py310] basepython = python3.10 deps = - -c {env:TEST_CONSTRAINTS_FILE:https://raw.githubusercontent.com/openstack-charmers/zaza-openstack-tests/master/constraints/constraints-2024.1.txt} + -c {env:TEST_CONSTRAINTS_FILE:https://raw.githubusercontent.com/openstack-charmers/zaza-openstack-tests/master/constraints/constraints-noble.txt} + -r{toxinidir}/test-requirements.txt +commands = stestr run --slowest {posargs} + +[testenv:py312] +basepython = python3.12 +deps = + -c {env:TEST_CONSTRAINTS_FILE:https://raw.githubusercontent.com/openstack-charmers/zaza-openstack-tests/master/constraints/constraints-noble.txt} -r{toxinidir}/test-requirements.txt commands = stestr run --slowest {posargs} [testenv:pep8] basepython = python3 -deps = flake8==3.9.2 +deps = flake8==7.1.1 git+https://github.com/juju/charm-tools.git commands = flake8 {posargs} src unit_tests @@ -84,7 +91,7 @@ commands = flake8 {posargs} src unit_tests # https://github.com/openstack/nova/blob/master/tox.ini basepython = python3 deps = - -c {env:TEST_CONSTRAINTS_FILE:https://raw.githubusercontent.com/openstack-charmers/zaza-openstack-tests/master/constraints/constraints-2024.1.txt} + -c {env:TEST_CONSTRAINTS_FILE:https://raw.githubusercontent.com/openstack-charmers/zaza-openstack-tests/master/constraints/constraints-noble.txt} -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt setenv =