From 79664a6261ad60201774fa4f075e647e0f04ab5c Mon Sep 17 00:00:00 2001 From: Myles Penner Date: Thu, 5 Sep 2024 18:52:48 +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 Change-Id: I98d3beee200783db9303772d6df81f46ce455c3e --- .zuul.yaml | 6 + charmcraft.yaml | 24 ++-- osci.yaml | 2 +- tests/bundles/jammy-antelope.yaml | 224 ------------------------------ tests/bundles/jammy-bobcat.yaml | 224 ------------------------------ tests/bundles/jammy-caracal.yaml | 224 ------------------------------ tests/bundles/noble-caracal.yaml | 16 +-- tests/tests.yaml | 6 +- tox.ini | 9 +- unit_tests/test_charm_utils.py | 2 +- 10 files changed, 40 insertions(+), 697 deletions(-) delete mode 100644 tests/bundles/jammy-antelope.yaml delete mode 100644 tests/bundles/jammy-bobcat.yaml delete mode 100644 tests/bundles/jammy-caracal.yaml diff --git a/.zuul.yaml b/.zuul.yaml index fd20909..85a13fc 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -2,3 +2,9 @@ templates: - openstack-python3-charm-jobs - openstack-cover-jobs + + check: + jobs: + - charmbuild + vars: + charm_build_name: nova-compute-nvidia-vgpu diff --git a/charmcraft.yaml b/charmcraft.yaml index 652ab74..7217725 100644 --- a/charmcraft.yaml +++ b/charmcraft.yaml @@ -19,13 +19,17 @@ parts: apt install -y ca-certificates update-ca-certificates -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 8a5221a..d6383ee 100644 --- a/osci.yaml +++ b/osci.yaml @@ -6,4 +6,4 @@ needs_charm_build: true charm_build_name: nova-compute-nvidia-vgpu build_type: charmcraft - charmcraft_channel: 2.x/stable + charmcraft_channel: 3.x/stable diff --git a/tests/bundles/jammy-antelope.yaml b/tests/bundles/jammy-antelope.yaml deleted file mode 100644 index 27ab7bf..0000000 --- a/tests/bundles/jammy-antelope.yaml +++ /dev/null @@ -1,224 +0,0 @@ -local_overlay_enabled: False - -variables: - openstack-origin: &openstack-origin cloud:jammy-antelope - -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': - constraints: mem=4096M - '5': - '6': - '7': - '8': - '9': - '10': - constraints: mem=4096M cores=4 - -applications: - - nova-cloud-controller-mysql-router: - charm: ch:mysql-router - channel: latest/edge - keystone-mysql-router: - charm: ch:mysql-router - channel: latest/edge - glance-mysql-router: - charm: ch:mysql-router - channel: latest/edge - neutron-api-mysql-router: - charm: ch:mysql-router - channel: latest/edge - placement-mysql-router: - charm: ch:mysql-router - channel: latest/edge - - mysql-innodb-cluster: - charm: ch:mysql-innodb-cluster - num_units: 3 - to: - - '0' - - '1' - - '2' - channel: latest/edge - - rabbitmq-server: - charm: ch:rabbitmq-server - num_units: 1 - to: - - '3' - channel: latest/edge - - nova-cloud-controller: - charm: ch:nova-cloud-controller - num_units: 1 - options: - openstack-origin: *openstack-origin - network-manager: Neutron - debug: true - to: - - '4' - channel: 2024.1/edge - - neutron-api: - charm: ch:neutron-api - num_units: 1 - options: - manage-neutron-plugin-legacy-mode: true - openstack-origin: *openstack-origin - flat-network-providers: physnet1 - neutron-security-groups: true - to: - - '5' - channel: 2024.1/edge - - keystone: - charm: ch:keystone - num_units: 1 - options: - openstack-origin: *openstack-origin - to: - - '6' - channel: 2024.1/edge - - neutron-gateway: - charm: ch:neutron-gateway - num_units: 1 - options: - openstack-origin: *openstack-origin - bridge-mappings: physnet1:br-ex - to: - - '7' - channel: 2024.1/edge - - glance: - charm: ch:glance - num_units: 1 - options: - openstack-origin: *openstack-origin - to: - - '8' - channel: 2024.1/edge - - neutron-openvswitch: - charm: ch:neutron-openvswitch - channel: 2024.1/edge - - placement: - charm: ch:placement - num_units: 1 - options: - openstack-origin: *openstack-origin - to: - - '9' - channel: 2024.1/edge - - nova-compute: - charm: ch:nova-compute - num_units: 1 - storage: - ephemeral-device: '40G' - options: - openstack-origin: *openstack-origin - config-flags: auto_assign_floating_ip=False - enable-live-migration: false - aa-profile-mode: enforce - debug: true - to: - - '10' - channel: 2024.1/edge - - nova-compute-nvidia-vgpu: - charm: ../../nova-compute-nvidia-vgpu.charm - options: - vgpu-device-mappings: "{'nvidia-108': ['0000:c1:00.0']}" - -relations: - - - 'nova-compute:image-service' - - 'glance:image-service' - - - - 'nova-compute:amqp' - - 'rabbitmq-server:amqp' - - - - 'nova-cloud-controller:shared-db' - - 'nova-cloud-controller-mysql-router:shared-db' - - - 'nova-cloud-controller-mysql-router:db-router' - - 'mysql-innodb-cluster:db-router' - - - - 'nova-cloud-controller:identity-service' - - 'keystone:identity-service' - - - - 'nova-cloud-controller:amqp' - - 'rabbitmq-server:amqp' - - - - 'nova-cloud-controller:cloud-compute' - - 'nova-compute:cloud-compute' - - - - 'nova-cloud-controller:image-service' - - 'glance:image-service' - - - - 'keystone:shared-db' - - 'keystone-mysql-router:shared-db' - - - 'keystone-mysql-router:db-router' - - 'mysql-innodb-cluster:db-router' - - - - 'glance:identity-service' - - 'keystone:identity-service' - - - - 'glance:shared-db' - - 'glance-mysql-router:shared-db' - - - 'glance-mysql-router:db-router' - - 'mysql-innodb-cluster:db-router' - - - - 'glance:amqp' - - 'rabbitmq-server:amqp' - - - - 'neutron-gateway:amqp' - - 'rabbitmq-server:amqp' - - - - 'nova-cloud-controller:quantum-network-service' - - 'neutron-gateway:quantum-network-service' - - - - 'neutron-api:shared-db' - - 'neutron-api-mysql-router:shared-db' - - - 'neutron-api-mysql-router:db-router' - - 'mysql-innodb-cluster:db-router' - - - - 'neutron-api:amqp' - - 'rabbitmq-server:amqp' - - - - 'neutron-api:neutron-api' - - 'nova-cloud-controller:neutron-api' - - - - 'neutron-api:identity-service' - - 'keystone:identity-service' - - - - 'nova-compute:neutron-plugin' - - 'neutron-openvswitch:neutron-plugin' - - - - 'rabbitmq-server:amqp' - - 'neutron-openvswitch:amqp' - - - - 'placement:shared-db' - - 'placement-mysql-router:shared-db' - - - 'placement-mysql-router:db-router' - - 'mysql-innodb-cluster:db-router' - - - - 'placement:identity-service' - - 'keystone:identity-service' - - - - 'placement:placement' - - 'nova-cloud-controller:placement' - - - - 'nova-compute:nova-vgpu' - - 'nova-compute-nvidia-vgpu:nova-vgpu' diff --git a/tests/bundles/jammy-bobcat.yaml b/tests/bundles/jammy-bobcat.yaml deleted file mode 100644 index 6b117df..0000000 --- a/tests/bundles/jammy-bobcat.yaml +++ /dev/null @@ -1,224 +0,0 @@ -local_overlay_enabled: False - -variables: - openstack-origin: &openstack-origin cloud:jammy-bobcat - -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': - constraints: mem=4096M - '5': - '6': - '7': - '8': - '9': - '10': - constraints: mem=4096M cores=4 - -applications: - - nova-cloud-controller-mysql-router: - charm: ch:mysql-router - channel: latest/edge - keystone-mysql-router: - charm: ch:mysql-router - channel: latest/edge - glance-mysql-router: - charm: ch:mysql-router - channel: latest/edge - neutron-api-mysql-router: - charm: ch:mysql-router - channel: latest/edge - placement-mysql-router: - charm: ch:mysql-router - channel: latest/edge - - mysql-innodb-cluster: - charm: ch:mysql-innodb-cluster - num_units: 3 - to: - - '0' - - '1' - - '2' - channel: latest/edge - - rabbitmq-server: - charm: ch:rabbitmq-server - num_units: 1 - to: - - '3' - channel: latest/edge - - nova-cloud-controller: - charm: ch:nova-cloud-controller - num_units: 1 - options: - openstack-origin: *openstack-origin - network-manager: Neutron - debug: true - to: - - '4' - channel: 2024.1/edge - - neutron-api: - charm: ch:neutron-api - num_units: 1 - options: - manage-neutron-plugin-legacy-mode: true - openstack-origin: *openstack-origin - flat-network-providers: physnet1 - neutron-security-groups: true - to: - - '5' - channel: 2024.1/edge - - keystone: - charm: ch:keystone - num_units: 1 - options: - openstack-origin: *openstack-origin - to: - - '6' - channel: 2024.1/edge - - neutron-gateway: - charm: ch:neutron-gateway - num_units: 1 - options: - openstack-origin: *openstack-origin - bridge-mappings: physnet1:br-ex - to: - - '7' - channel: 2024.1/edge - - glance: - charm: ch:glance - num_units: 1 - options: - openstack-origin: *openstack-origin - to: - - '8' - channel: 2024.1/edge - - neutron-openvswitch: - charm: ch:neutron-openvswitch - channel: 2024.1/edge - - placement: - charm: ch:placement - num_units: 1 - options: - openstack-origin: *openstack-origin - to: - - '9' - channel: 2024.1/edge - - nova-compute: - charm: ch:nova-compute - num_units: 1 - storage: - ephemeral-device: '40G' - options: - openstack-origin: *openstack-origin - config-flags: auto_assign_floating_ip=False - enable-live-migration: false - aa-profile-mode: enforce - debug: true - to: - - '10' - channel: 2024.1/edge - - nova-compute-nvidia-vgpu: - charm: ../../nova-compute-nvidia-vgpu.charm - options: - vgpu-device-mappings: "{'nvidia-108': ['0000:c1:00.0']}" - -relations: - - - 'nova-compute:image-service' - - 'glance:image-service' - - - - 'nova-compute:amqp' - - 'rabbitmq-server:amqp' - - - - 'nova-cloud-controller:shared-db' - - 'nova-cloud-controller-mysql-router:shared-db' - - - 'nova-cloud-controller-mysql-router:db-router' - - 'mysql-innodb-cluster:db-router' - - - - 'nova-cloud-controller:identity-service' - - 'keystone:identity-service' - - - - 'nova-cloud-controller:amqp' - - 'rabbitmq-server:amqp' - - - - 'nova-cloud-controller:cloud-compute' - - 'nova-compute:cloud-compute' - - - - 'nova-cloud-controller:image-service' - - 'glance:image-service' - - - - 'keystone:shared-db' - - 'keystone-mysql-router:shared-db' - - - 'keystone-mysql-router:db-router' - - 'mysql-innodb-cluster:db-router' - - - - 'glance:identity-service' - - 'keystone:identity-service' - - - - 'glance:shared-db' - - 'glance-mysql-router:shared-db' - - - 'glance-mysql-router:db-router' - - 'mysql-innodb-cluster:db-router' - - - - 'glance:amqp' - - 'rabbitmq-server:amqp' - - - - 'neutron-gateway:amqp' - - 'rabbitmq-server:amqp' - - - - 'nova-cloud-controller:quantum-network-service' - - 'neutron-gateway:quantum-network-service' - - - - 'neutron-api:shared-db' - - 'neutron-api-mysql-router:shared-db' - - - 'neutron-api-mysql-router:db-router' - - 'mysql-innodb-cluster:db-router' - - - - 'neutron-api:amqp' - - 'rabbitmq-server:amqp' - - - - 'neutron-api:neutron-api' - - 'nova-cloud-controller:neutron-api' - - - - 'neutron-api:identity-service' - - 'keystone:identity-service' - - - - 'nova-compute:neutron-plugin' - - 'neutron-openvswitch:neutron-plugin' - - - - 'rabbitmq-server:amqp' - - 'neutron-openvswitch:amqp' - - - - 'placement:shared-db' - - 'placement-mysql-router:shared-db' - - - 'placement-mysql-router:db-router' - - 'mysql-innodb-cluster:db-router' - - - - 'placement:identity-service' - - 'keystone:identity-service' - - - - 'placement:placement' - - 'nova-cloud-controller:placement' - - - - 'nova-compute:nova-vgpu' - - 'nova-compute-nvidia-vgpu:nova-vgpu' diff --git a/tests/bundles/jammy-caracal.yaml b/tests/bundles/jammy-caracal.yaml deleted file mode 100644 index 6f6336c..0000000 --- a/tests/bundles/jammy-caracal.yaml +++ /dev/null @@ -1,224 +0,0 @@ -local_overlay_enabled: False - -variables: - openstack-origin: &openstack-origin cloud:jammy-caracal - -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': - constraints: mem=4096M - '5': - '6': - '7': - '8': - '9': - '10': - constraints: mem=4096M cores=4 - -applications: - - nova-cloud-controller-mysql-router: - charm: ch:mysql-router - channel: latest/edge - keystone-mysql-router: - charm: ch:mysql-router - channel: latest/edge - glance-mysql-router: - charm: ch:mysql-router - channel: latest/edge - neutron-api-mysql-router: - charm: ch:mysql-router - channel: latest/edge - placement-mysql-router: - charm: ch:mysql-router - channel: latest/edge - - mysql-innodb-cluster: - charm: ch:mysql-innodb-cluster - num_units: 3 - to: - - '0' - - '1' - - '2' - channel: latest/edge - - rabbitmq-server: - charm: ch:rabbitmq-server - num_units: 1 - to: - - '3' - channel: latest/edge - - nova-cloud-controller: - charm: ch:nova-cloud-controller - num_units: 1 - options: - openstack-origin: *openstack-origin - network-manager: Neutron - debug: true - to: - - '4' - channel: 2024.1/edge - - neutron-api: - charm: ch:neutron-api - num_units: 1 - options: - manage-neutron-plugin-legacy-mode: true - openstack-origin: *openstack-origin - flat-network-providers: physnet1 - neutron-security-groups: true - to: - - '5' - channel: 2024.1/edge - - keystone: - charm: ch:keystone - num_units: 1 - options: - openstack-origin: *openstack-origin - to: - - '6' - channel: 2024.1/edge - - neutron-gateway: - charm: ch:neutron-gateway - num_units: 1 - options: - openstack-origin: *openstack-origin - bridge-mappings: physnet1:br-ex - to: - - '7' - channel: 2024.1/edge - - glance: - charm: ch:glance - num_units: 1 - options: - openstack-origin: *openstack-origin - to: - - '8' - channel: 2024.1/edge - - neutron-openvswitch: - charm: ch:neutron-openvswitch - channel: 2024.1/edge - - placement: - charm: ch:placement - num_units: 1 - options: - openstack-origin: *openstack-origin - to: - - '9' - channel: 2024.1/edge - - nova-compute: - charm: ch:nova-compute - num_units: 1 - storage: - ephemeral-device: '40G' - options: - openstack-origin: *openstack-origin - config-flags: auto_assign_floating_ip=False - enable-live-migration: false - aa-profile-mode: enforce - debug: true - to: - - '10' - channel: 2024.1/edge - - nova-compute-nvidia-vgpu: - charm: ../../nova-compute-nvidia-vgpu.charm - options: - vgpu-device-mappings: "{'nvidia-108': ['0000:c1:00.0']}" - -relations: - - - 'nova-compute:image-service' - - 'glance:image-service' - - - - 'nova-compute:amqp' - - 'rabbitmq-server:amqp' - - - - 'nova-cloud-controller:shared-db' - - 'nova-cloud-controller-mysql-router:shared-db' - - - 'nova-cloud-controller-mysql-router:db-router' - - 'mysql-innodb-cluster:db-router' - - - - 'nova-cloud-controller:identity-service' - - 'keystone:identity-service' - - - - 'nova-cloud-controller:amqp' - - 'rabbitmq-server:amqp' - - - - 'nova-cloud-controller:cloud-compute' - - 'nova-compute:cloud-compute' - - - - 'nova-cloud-controller:image-service' - - 'glance:image-service' - - - - 'keystone:shared-db' - - 'keystone-mysql-router:shared-db' - - - 'keystone-mysql-router:db-router' - - 'mysql-innodb-cluster:db-router' - - - - 'glance:identity-service' - - 'keystone:identity-service' - - - - 'glance:shared-db' - - 'glance-mysql-router:shared-db' - - - 'glance-mysql-router:db-router' - - 'mysql-innodb-cluster:db-router' - - - - 'glance:amqp' - - 'rabbitmq-server:amqp' - - - - 'neutron-gateway:amqp' - - 'rabbitmq-server:amqp' - - - - 'nova-cloud-controller:quantum-network-service' - - 'neutron-gateway:quantum-network-service' - - - - 'neutron-api:shared-db' - - 'neutron-api-mysql-router:shared-db' - - - 'neutron-api-mysql-router:db-router' - - 'mysql-innodb-cluster:db-router' - - - - 'neutron-api:amqp' - - 'rabbitmq-server:amqp' - - - - 'neutron-api:neutron-api' - - 'nova-cloud-controller:neutron-api' - - - - 'neutron-api:identity-service' - - 'keystone:identity-service' - - - - 'nova-compute:neutron-plugin' - - 'neutron-openvswitch:neutron-plugin' - - - - 'rabbitmq-server:amqp' - - 'neutron-openvswitch:amqp' - - - - 'placement:shared-db' - - 'placement-mysql-router:shared-db' - - - 'placement-mysql-router:db-router' - - 'mysql-innodb-cluster:db-router' - - - - 'placement:identity-service' - - 'keystone:identity-service' - - - - 'placement:placement' - - 'nova-cloud-controller:placement' - - - - 'nova-compute:nova-vgpu' - - 'nova-compute-nvidia-vgpu:nova-vgpu' diff --git a/tests/bundles/noble-caracal.yaml b/tests/bundles/noble-caracal.yaml index c4857c7..72e06b1 100644 --- a/tests/bundles/noble-caracal.yaml +++ b/tests/bundles/noble-caracal.yaml @@ -68,7 +68,7 @@ applications: debug: true to: - '4' - channel: 2024.1/edge + channel: latest/edge neutron-api: charm: ch:neutron-api @@ -80,7 +80,7 @@ applications: neutron-security-groups: true to: - '5' - channel: 2024.1/edge + channel: latest/edge keystone: charm: ch:keystone @@ -89,7 +89,7 @@ applications: openstack-origin: *openstack-origin to: - '6' - channel: 2024.1/edge + channel: latest/edge neutron-gateway: charm: ch:neutron-gateway @@ -99,7 +99,7 @@ applications: bridge-mappings: physnet1:br-ex to: - '7' - channel: 2024.1/edge + channel: latest/edge glance: charm: ch:glance @@ -108,11 +108,11 @@ applications: openstack-origin: *openstack-origin to: - '8' - channel: 2024.1/edge + channel: latest/edge neutron-openvswitch: charm: ch:neutron-openvswitch - channel: 2024.1/edge + channel: latest/edge placement: charm: ch:placement @@ -121,7 +121,7 @@ applications: openstack-origin: *openstack-origin to: - '9' - channel: 2024.1/edge + channel: latest/edge nova-compute: charm: ch:nova-compute @@ -136,7 +136,7 @@ applications: debug: true to: - '10' - channel: 2024.1/edge + channel: latest/edge nova-compute-nvidia-vgpu: charm: ../../nova-compute-nvidia-vgpu.charm diff --git a/tests/tests.yaml b/tests/tests.yaml index 7928228..8af13f0 100644 --- a/tests/tests.yaml +++ b/tests/tests.yaml @@ -1,11 +1,9 @@ charm_name: nova-compute-nvidia-vgpu smoke_bundles: - - jammy-caracal + - noble-caracal gate_bundles: - - jammy-antelope - - jammy-bobcat - - jammy-caracal + - noble-caracal dev_bundles: - noble-caracal configure: diff --git a/tox.ini b/tox.ini index b151eb7..f63f074 100644 --- a/tox.ini +++ b/tox.ini @@ -28,6 +28,7 @@ minversion = 3.2.0 setenv = VIRTUAL_ENV={envdir} PYTHONHASHSEED=0 CHARM_DIR={envdir} + TEST_JUJU3=1 # Note(mylesjp): Force Juju 3 install_command = pip install {opts} {packages} commands = stestr run --slowest {posargs} @@ -43,7 +44,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:py35] @@ -87,6 +88,12 @@ deps = -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt +[testenv:py312] +basepython = python3.12 +deps = + -r{toxinidir}/requirements.txt + -r{toxinidir}/test-requirements.txt + [testenv:py3] basepython = python3 deps = diff --git a/unit_tests/test_charm_utils.py b/unit_tests/test_charm_utils.py index 0cd2611..afa8f01 100644 --- a/unit_tests/test_charm_utils.py +++ b/unit_tests/test_charm_utils.py @@ -178,7 +178,7 @@ class TestCharmUtils(unittest.TestCase): } charm_utils.set_principal_unit_relation_data( relation_data_to_be_set, charm_config, charm_services) - self.assertEquals( + self.assertEqual( '{"nova": {"/etc/nova/nova.conf": {"sections": {"devices": ' '[["enabled_mdev_types", ""]]}}}}', relation_data_to_be_set['subordinate_configuration'])