From cd1eaa4e96714ff4da1f80d5ab5f32f8fb5b31b8 Mon Sep 17 00:00:00 2001 From: Myles Penner Date: Thu, 5 Sep 2024 20:23:36 +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 TEST_JUJU3=1 env var to tox.ini to force Juju 3 - Add noble and oracular to charmhelpers - Add charmbuild .zuul.yaml Change-Id: I9c6145bedd04395a10f4bac9403bebeaaeff864e --- .zuul.yaml | 5 + charmcraft.yaml | 24 ++-- charmhelpers/core/host_factory/ubuntu.py | 2 + metadata.yaml | 2 - osci.yaml | 2 +- tests/bundles/jammy-antelope.yaml | 134 ----------------------- tests/bundles/jammy-bobcat.yaml | 134 ----------------------- tests/bundles/jammy-caracal.yaml | 134 ----------------------- tests/bundles/noble-caracal.yaml | 10 +- tests/tests.yaml | 6 +- tox.ini | 11 +- 11 files changed, 35 insertions(+), 429 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..29c04c3 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: glance-simplestreams-sync diff --git a/charmcraft.yaml b/charmcraft.yaml index 5fa6a0d..1b54fd7 100644 --- a/charmcraft.yaml +++ b/charmcraft.yaml @@ -19,13 +19,17 @@ parts: - metadata.yaml - README.md -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/charmhelpers/core/host_factory/ubuntu.py b/charmhelpers/core/host_factory/ubuntu.py index 732d76c..e87595e 100644 --- a/charmhelpers/core/host_factory/ubuntu.py +++ b/charmhelpers/core/host_factory/ubuntu.py @@ -33,6 +33,8 @@ UBUNTU_RELEASES = ( 'kinetic', 'lunar', 'mantic', + 'noble', + 'oracular', ) diff --git a/metadata.yaml b/metadata.yaml index 6e2ed5b..b1a707c 100644 --- a/metadata.yaml +++ b/metadata.yaml @@ -7,8 +7,6 @@ description: | tags: - misc - openstack -series: - - jammy subordinate: false provides: simplestreams-image-service: diff --git a/osci.yaml b/osci.yaml index 8479916..55efedc 100644 --- a/osci.yaml +++ b/osci.yaml @@ -6,4 +6,4 @@ needs_charm_build: true charm_build_name: glance-simplestreams-sync 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 408889d..0000000 --- a/tests/bundles/jammy-antelope.yaml +++ /dev/null @@ -1,134 +0,0 @@ -variables: - source: &source cloud:jammy-antelope - -series: jammy - -comment: - - 'machines section to decide order of deployment. database sooner = faster' - -machines: - '0': - '1': - '2': - '3': - '4': - '5': - '6': - '7': - '8': - constraints: "mem=2048" - '9': - constraints: "mem=2048" - '10': - constraints: "mem=2048" - '11': - '12': - '13': - - -applications: - - keystone-mysql-router: - charm: ch:mysql-router - channel: latest/edge - glance-mysql-router: - charm: ch:mysql-router - channel: latest/edge - vault-mysql-router: - charm: ch:mysql-router - channel: latest/edge - - mysql-innodb-cluster: - charm: ch:mysql-innodb-cluster - num_units: 3 - options: - source: *source - to: - - '0' - - '1' - - '2' - channel: latest/edge - - vault: - charm: ch:vault - num_units: 1 - to: - - '3' - channel: latest/edge - - keystone: - charm: ch:keystone - num_units: 1 - options: - openstack-origin: *source - to: - - '4' - channel: 2024.1/edge - - glance: - charm: ch:glance - num_units: 1 - options: - openstack-origin: *source - to: - - '5' - channel: 2024.1/edge - - glance-simplestreams-sync: - charm: ../../glance-simplestreams-sync.charm - options: - snap-channel: edge - num_units: 1 - to: - - '6' - - ceph-radosgw: - charm: ch:ceph-radosgw - num_units: 1 - options: - source: *source - to: - - '7' - channel: reef/edge - - ceph-osd: - charm: ch:ceph-osd - num_units: 3 - storage: - osd-devices: 'cinder,10G' - options: - source: *source - to: - - '8' - - '9' - - '10' - channel: reef/edge - - ceph-mon: - charm: ch:ceph-mon - num_units: 3 - options: - source: *source - to: - - '11' - - '12' - - '13' - channel: reef/edge - -relations: - - ['keystone:certificates', 'vault:certificates'] - - ['glance:certificates', 'vault:certificates'] - - ['glance-simplestreams-sync:certificates', 'vault:certificates'] - - ['glance:identity-service', 'keystone:identity-service'] - - ['glance-simplestreams-sync:identity-service', 'keystone:identity-service'] - - ['keystone:shared-db','keystone-mysql-router:shared-db'] - - ['glance:shared-db','glance-mysql-router:shared-db'] - - ['glance:ceph', 'ceph-mon:client'] - - ['vault:shared-db','vault-mysql-router:shared-db'] - - ['keystone-mysql-router:db-router','mysql-innodb-cluster:db-router'] - - ['glance-mysql-router:db-router','mysql-innodb-cluster:db-router'] - - ['vault-mysql-router:db-router','mysql-innodb-cluster:db-router'] - - ['ceph-osd:mon', 'ceph-mon:osd'] - - ['ceph-radosgw:mon', 'ceph-mon:radosgw'] - - ['ceph-radosgw:identity-service', 'keystone:identity-service'] - - ['ceph-radosgw:certificates', 'vault:certificates'] diff --git a/tests/bundles/jammy-bobcat.yaml b/tests/bundles/jammy-bobcat.yaml deleted file mode 100644 index 97fe277..0000000 --- a/tests/bundles/jammy-bobcat.yaml +++ /dev/null @@ -1,134 +0,0 @@ -variables: - source: &source cloud:jammy-bobcat - -series: jammy - -comment: - - 'machines section to decide order of deployment. database sooner = faster' - -machines: - '0': - '1': - '2': - '3': - '4': - '5': - '6': - '7': - '8': - constraints: "mem=2048" - '9': - constraints: "mem=2048" - '10': - constraints: "mem=2048" - '11': - '12': - '13': - - -applications: - - keystone-mysql-router: - charm: ch:mysql-router - channel: latest/edge - glance-mysql-router: - charm: ch:mysql-router - channel: latest/edge - vault-mysql-router: - charm: ch:mysql-router - channel: latest/edge - - mysql-innodb-cluster: - charm: ch:mysql-innodb-cluster - num_units: 3 - options: - source: *source - to: - - '0' - - '1' - - '2' - channel: latest/edge - - vault: - charm: ch:vault - num_units: 1 - to: - - '3' - channel: latest/edge - - keystone: - charm: ch:keystone - num_units: 1 - options: - openstack-origin: *source - to: - - '4' - channel: 2024.1/edge - - glance: - charm: ch:glance - num_units: 1 - options: - openstack-origin: *source - to: - - '5' - channel: 2024.1/edge - - glance-simplestreams-sync: - charm: ../../glance-simplestreams-sync.charm - options: - snap-channel: edge - num_units: 1 - to: - - '6' - - ceph-radosgw: - charm: ch:ceph-radosgw - num_units: 1 - options: - source: *source - to: - - '7' - channel: reef/edge - - ceph-osd: - charm: ch:ceph-osd - num_units: 3 - storage: - osd-devices: 'cinder,10G' - options: - source: *source - to: - - '8' - - '9' - - '10' - channel: reef/edge - - ceph-mon: - charm: ch:ceph-mon - num_units: 3 - options: - source: *source - to: - - '11' - - '12' - - '13' - channel: reef/edge - -relations: - - ['keystone:certificates', 'vault:certificates'] - - ['glance:certificates', 'vault:certificates'] - - ['glance-simplestreams-sync:certificates', 'vault:certificates'] - - ['glance:identity-service', 'keystone:identity-service'] - - ['glance-simplestreams-sync:identity-service', 'keystone:identity-service'] - - ['keystone:shared-db','keystone-mysql-router:shared-db'] - - ['glance:shared-db','glance-mysql-router:shared-db'] - - ['glance:ceph', 'ceph-mon:client'] - - ['vault:shared-db','vault-mysql-router:shared-db'] - - ['keystone-mysql-router:db-router','mysql-innodb-cluster:db-router'] - - ['glance-mysql-router:db-router','mysql-innodb-cluster:db-router'] - - ['vault-mysql-router:db-router','mysql-innodb-cluster:db-router'] - - ['ceph-osd:mon', 'ceph-mon:osd'] - - ['ceph-radosgw:mon', 'ceph-mon:radosgw'] - - ['ceph-radosgw:identity-service', 'keystone:identity-service'] - - ['ceph-radosgw:certificates', 'vault:certificates'] diff --git a/tests/bundles/jammy-caracal.yaml b/tests/bundles/jammy-caracal.yaml deleted file mode 100644 index d455ee5..0000000 --- a/tests/bundles/jammy-caracal.yaml +++ /dev/null @@ -1,134 +0,0 @@ -variables: - source: &source cloud:jammy-caracal - -series: jammy - -comment: - - 'machines section to decide order of deployment. database sooner = faster' - -machines: - '0': - '1': - '2': - '3': - '4': - '5': - '6': - '7': - '8': - constraints: "mem=2048" - '9': - constraints: "mem=2048" - '10': - constraints: "mem=2048" - '11': - '12': - '13': - - -applications: - - keystone-mysql-router: - charm: ch:mysql-router - channel: latest/edge - glance-mysql-router: - charm: ch:mysql-router - channel: latest/edge - vault-mysql-router: - charm: ch:mysql-router - channel: latest/edge - - mysql-innodb-cluster: - charm: ch:mysql-innodb-cluster - num_units: 3 - options: - source: *source - to: - - '0' - - '1' - - '2' - channel: latest/edge - - vault: - charm: ch:vault - num_units: 1 - to: - - '3' - channel: latest/edge - - keystone: - charm: ch:keystone - num_units: 1 - options: - openstack-origin: *source - to: - - '4' - channel: 2024.1/edge - - glance: - charm: ch:glance - num_units: 1 - options: - openstack-origin: *source - to: - - '5' - channel: 2024.1/edge - - glance-simplestreams-sync: - charm: ../../glance-simplestreams-sync.charm - options: - snap-channel: edge - num_units: 1 - to: - - '6' - - ceph-radosgw: - charm: ch:ceph-radosgw - num_units: 1 - options: - source: *source - to: - - '7' - channel: reef/edge - - ceph-osd: - charm: ch:ceph-osd - num_units: 3 - storage: - osd-devices: 'cinder,10G' - options: - source: *source - to: - - '8' - - '9' - - '10' - channel: reef/edge - - ceph-mon: - charm: ch:ceph-mon - num_units: 3 - options: - source: *source - to: - - '11' - - '12' - - '13' - channel: reef/edge - -relations: - - ['keystone:certificates', 'vault:certificates'] - - ['glance:certificates', 'vault:certificates'] - - ['glance-simplestreams-sync:certificates', 'vault:certificates'] - - ['glance:identity-service', 'keystone:identity-service'] - - ['glance-simplestreams-sync:identity-service', 'keystone:identity-service'] - - ['keystone:shared-db','keystone-mysql-router:shared-db'] - - ['glance:shared-db','glance-mysql-router:shared-db'] - - ['glance:ceph', 'ceph-mon:client'] - - ['vault:shared-db','vault-mysql-router:shared-db'] - - ['keystone-mysql-router:db-router','mysql-innodb-cluster:db-router'] - - ['glance-mysql-router:db-router','mysql-innodb-cluster:db-router'] - - ['vault-mysql-router:db-router','mysql-innodb-cluster:db-router'] - - ['ceph-osd:mon', 'ceph-mon:osd'] - - ['ceph-radosgw:mon', 'ceph-mon:radosgw'] - - ['ceph-radosgw:identity-service', 'keystone:identity-service'] - - ['ceph-radosgw:certificates', 'vault:certificates'] diff --git a/tests/bundles/noble-caracal.yaml b/tests/bundles/noble-caracal.yaml index 755edc1..ca8cc44 100644 --- a/tests/bundles/noble-caracal.yaml +++ b/tests/bundles/noble-caracal.yaml @@ -63,7 +63,7 @@ applications: openstack-origin: *source to: - '4' - channel: 2024.1/edge + channel: latest/edge glance: charm: ch:glance @@ -72,7 +72,7 @@ applications: openstack-origin: *source to: - '5' - channel: 2024.1/edge + channel: latest/edge glance-simplestreams-sync: charm: ../../glance-simplestreams-sync.charm @@ -89,7 +89,7 @@ applications: source: *source to: - '7' - channel: reef/edge + channel: latest/edge ceph-osd: charm: ch:ceph-osd @@ -102,7 +102,7 @@ applications: - '8' - '9' - '10' - channel: reef/edge + channel: latest/edge ceph-mon: charm: ch:ceph-mon @@ -113,7 +113,7 @@ applications: - '11' - '12' - '13' - channel: reef/edge + channel: latest/edge relations: - ['keystone:certificates', 'vault:certificates'] diff --git a/tests/tests.yaml b/tests/tests.yaml index b6d8a9b..36acf1b 100644 --- a/tests/tests.yaml +++ b/tests/tests.yaml @@ -6,16 +6,14 @@ comment: # functest-run-suite ... # functest-deploy --bundle /path/to/gate/bundle gate_bundles: - - jammy-antelope - - jammy-bobcat - - jammy-caracal + - noble-caracal dev_bundles: - noble-caracal tests_options: force_deploy: - noble-caracal smoke_bundles: - - jammy-caracal + - noble-caracal target_deploy_status: vault: # vault will be blocked with functest-deploy, this is ok to move on diff --git a/tox.ini b/tox.ini index 0b5994f..a590e08 100644 --- a/tox.ini +++ b/tox.ini @@ -22,6 +22,7 @@ skip_install = True setenv = VIRTUAL_ENV={envdir} PYTHONHASHSEED=0 CHARM_DIR={envdir} + TEST_JUJU3=1 # Note(mylesjp): Force Juju 3 commands = stestr run --slowest {posargs} allowlist_externals = charmcraft @@ -33,7 +34,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:build] @@ -52,21 +53,21 @@ commands = [testenv:py312] basepython = python3.12 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 [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}/requirements.txt -r{toxinidir}/test-requirements.txt [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}/requirements.txt -r{toxinidir}/test-requirements.txt @@ -82,7 +83,7 @@ commands = flake8 {posargs} hooks unit_tests tests actions lib files # 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 =