From a2e57445dca079e8a8424d76ee8fdacbcba79dc6 Mon Sep 17 00:00:00 2001 From: Myles Penner Date: Fri, 30 Aug 2024 17:58:01 +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 - Removed setuptools pinning in wheelhouse.txt - Add charmbuild to .zuul.yaml - Add rename.sh to build process Change-Id: Id4f27a1eea470397ddebee2db7be76bcf5f37466 --- .zuul.yaml | 5 + charmcraft.yaml | 48 +++------ osci.yaml | 2 +- rename.sh | 13 +++ src/metadata.yaml | 2 - src/tests/bundles/jammy-antelope.yaml | 148 -------------------------- src/tests/bundles/jammy-bobcat.yaml | 148 -------------------------- src/tests/bundles/jammy-caracal.yaml | 148 -------------------------- src/tests/bundles/noble-caracal.yaml | 15 +-- src/tests/tests.yaml | 6 +- src/tox.ini | 2 +- src/wheelhouse.txt | 1 - tox.ini | 10 +- 13 files changed, 51 insertions(+), 497 deletions(-) create mode 100755 rename.sh 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..05fccb5 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: designate-bind diff --git a/charmcraft.yaml b/charmcraft.yaml index 953004e..4d59dd9 100644 --- a/charmcraft.yaml +++ b/charmcraft.yaml @@ -19,36 +19,18 @@ parts: build-environment: - CHARM_INTERFACES_DIR: $CRAFT_PROJECT_DIR/interfaces/ - CHARM_LAYERS_DIR: $CRAFT_PROJECT_DIR/layers/ -bases: - - build-on: - - name: ubuntu - channel: "22.04" - architectures: [amd64] - run-on: - - name: ubuntu - channel: "22.04" - architectures: [amd64] - - build-on: - - name: ubuntu - channel: "22.04" - architectures: [s390x] - run-on: - - name: ubuntu - channel: "22.04" - architectures: [s390x] - - build-on: - - name: ubuntu - channel: "22.04" - architectures: [ppc64el] - run-on: - - name: ubuntu - channel: "22.04" - architectures: [ppc64el] - - build-on: - - name: ubuntu - channel: "22.04" - architectures: [arm64] - run-on: - - name: ubuntu - channel: "22.04" - architectures: [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 8e03906..587639a 100644 --- a/osci.yaml +++ b/osci.yaml @@ -6,4 +6,4 @@ needs_charm_build: true charm_build_name: designate-bind build_type: charmcraft - charmcraft_channel: 2.x/stable + charmcraft_channel: 3.x/stable diff --git a/rename.sh b/rename.sh new file mode 100755 index 0000000..d0c35c9 --- /dev/null +++ b/rename.sh @@ -0,0 +1,13 @@ +#!/bin/bash +charm=$(grep "charm_build_name" osci.yaml | awk '{print $2}') +echo "renaming ${charm}_*.charm to ${charm}.charm" +echo -n "pwd: " +pwd +ls -al +echo "Removing bad downloaded charm maybe?" +if [[ -e "${charm}.charm" ]]; +then + rm "${charm}.charm" +fi +echo "Renaming charm here." +mv ${charm}_*.charm ${charm}.charm diff --git a/src/metadata.yaml b/src/metadata.yaml index 56463df..75dacbc 100644 --- a/src/metadata.yaml +++ b/src/metadata.yaml @@ -11,8 +11,6 @@ description: | tags: - openstack - dns -series: - - jammy subordinate: false extra-bindings: dns-frontend: diff --git a/src/tests/bundles/jammy-antelope.yaml b/src/tests/bundles/jammy-antelope.yaml deleted file mode 100644 index 80570a1..0000000 --- a/src/tests/bundles/jammy-antelope.yaml +++ /dev/null @@ -1,148 +0,0 @@ -variables: - openstack-origin: &openstack-origin cloud:jammy-antelope - -local_overlay_enabled: False - -series: jammy - -machines: - '0': - constraints: mem=3072M - '1': - constraints: mem=3072M - '2': - constraints: mem=3072M - '3': - '4': - '5': - '6': - '7': - series: focal - '8': - -applications: - - keystone-mysql-router: - charm: ch:mysql-router - channel: latest/edge - designate-mysql-router: - charm: ch:mysql-router - channel: latest/edge - neutron-api-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 - - keystone: - charm: ch:keystone - num_units: 1 - options: - openstack-origin: *openstack-origin - 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 - to: - - '5' - channel: 2024.1/edge - - designate-bind: - charm: ../../../designate-bind_ubuntu-22.04-amd64.charm - num_units: 1 - # NOTE(ajkavanagh) apparently it has no openstack origin! - #options: - #openstack-origin: *openstack-origin - to: - - '6' - - memcached: - charm: ch:memcached - num_units: 1 - # Note that holding memcached at focal as it's not available at jammy yet. - series: focal - to: - - '7' - - designate: - charm: ch:designate - num_units: 1 - options: - nameservers: 'ns1.amuletexample.com. ns2.amuletexample.com.' - openstack-origin: *openstack-origin - to: - - '8' - channel: 2024.1/edge - - nrpe: - charm: ch:nrpe - channel: latest/edge - - designate-bind-hacluster: - charm: ch:hacluster - options: - cluster_count: 1 - channel: latest/edge - -relations: - - - 'keystone:shared-db' - - 'keystone-mysql-router:shared-db' - - - 'keystone-mysql-router:db-router' - - 'mysql-innodb-cluster:db-router' - - - - 'designate:shared-db' - - 'designate-mysql-router:shared-db' - - - 'designate-mysql-router:db-router' - - 'mysql-innodb-cluster:db-router' - - - - 'designate:amqp' - - 'rabbitmq-server:amqp' - - - - 'designate:identity-service' - - 'keystone:identity-service' - - - - 'designate:dns-backend' - - 'designate-bind:dns-backend' - - - - 'designate:coordinator-memcached' - - 'memcached:cache' - - - - 'designate:dnsaas' - - 'neutron-api:external-dns' - - - - 'neutron-api:identity-service' - - 'keystone:identity-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' - - - - 'designate:nrpe-external-master' - - 'nrpe:nrpe-external-master' - - - - 'designate-bind' - - 'designate-bind-hacluster' diff --git a/src/tests/bundles/jammy-bobcat.yaml b/src/tests/bundles/jammy-bobcat.yaml deleted file mode 100644 index 7607607..0000000 --- a/src/tests/bundles/jammy-bobcat.yaml +++ /dev/null @@ -1,148 +0,0 @@ -variables: - openstack-origin: &openstack-origin cloud:jammy-bobcat - -local_overlay_enabled: False - -series: jammy - -machines: - '0': - constraints: mem=3072M - '1': - constraints: mem=3072M - '2': - constraints: mem=3072M - '3': - '4': - '5': - '6': - '7': - series: focal - '8': - -applications: - - keystone-mysql-router: - charm: ch:mysql-router - channel: latest/edge - designate-mysql-router: - charm: ch:mysql-router - channel: latest/edge - neutron-api-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 - - keystone: - charm: ch:keystone - num_units: 1 - options: - openstack-origin: *openstack-origin - 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 - to: - - '5' - channel: 2024.1/edge - - designate-bind: - charm: ../../../designate-bind_ubuntu-22.04-amd64.charm - num_units: 1 - # NOTE(ajkavanagh) apparently it has no openstack origin! - #options: - #openstack-origin: *openstack-origin - to: - - '6' - - memcached: - charm: ch:memcached - num_units: 1 - # Note that holding memcached at focal as it's not available at jammy yet. - series: focal - to: - - '7' - - designate: - charm: ch:designate - num_units: 1 - options: - nameservers: 'ns1.amuletexample.com. ns2.amuletexample.com.' - openstack-origin: *openstack-origin - to: - - '8' - channel: 2024.1/edge - - nrpe: - charm: ch:nrpe - channel: latest/edge - - designate-bind-hacluster: - charm: ch:hacluster - options: - cluster_count: 1 - channel: latest/edge - -relations: - - - 'keystone:shared-db' - - 'keystone-mysql-router:shared-db' - - - 'keystone-mysql-router:db-router' - - 'mysql-innodb-cluster:db-router' - - - - 'designate:shared-db' - - 'designate-mysql-router:shared-db' - - - 'designate-mysql-router:db-router' - - 'mysql-innodb-cluster:db-router' - - - - 'designate:amqp' - - 'rabbitmq-server:amqp' - - - - 'designate:identity-service' - - 'keystone:identity-service' - - - - 'designate:dns-backend' - - 'designate-bind:dns-backend' - - - - 'designate:coordinator-memcached' - - 'memcached:cache' - - - - 'designate:dnsaas' - - 'neutron-api:external-dns' - - - - 'neutron-api:identity-service' - - 'keystone:identity-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' - - - - 'designate:nrpe-external-master' - - 'nrpe:nrpe-external-master' - - - - 'designate-bind' - - 'designate-bind-hacluster' diff --git a/src/tests/bundles/jammy-caracal.yaml b/src/tests/bundles/jammy-caracal.yaml deleted file mode 100644 index 7868f80..0000000 --- a/src/tests/bundles/jammy-caracal.yaml +++ /dev/null @@ -1,148 +0,0 @@ -variables: - openstack-origin: &openstack-origin cloud:jammy-caracal - -local_overlay_enabled: False - -series: jammy - -machines: - '0': - constraints: mem=3072M - '1': - constraints: mem=3072M - '2': - constraints: mem=3072M - '3': - '4': - '5': - '6': - '7': - series: focal - '8': - -applications: - - keystone-mysql-router: - charm: ch:mysql-router - channel: latest/edge - designate-mysql-router: - charm: ch:mysql-router - channel: latest/edge - neutron-api-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 - - keystone: - charm: ch:keystone - num_units: 1 - options: - openstack-origin: *openstack-origin - 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 - to: - - '5' - channel: 2024.1/edge - - designate-bind: - charm: ../../../designate-bind_ubuntu-22.04-amd64.charm - num_units: 1 - # NOTE(ajkavanagh) apparently it has no openstack origin! - #options: - #openstack-origin: *openstack-origin - to: - - '6' - - memcached: - charm: ch:memcached - num_units: 1 - # Note that holding memcached at focal as it's not available at jammy yet. - series: focal - to: - - '7' - - designate: - charm: ch:designate - num_units: 1 - options: - nameservers: 'ns1.amuletexample.com. ns2.amuletexample.com.' - openstack-origin: *openstack-origin - to: - - '8' - channel: 2024.1/edge - - nrpe: - charm: ch:nrpe - channel: latest/edge - - designate-bind-hacluster: - charm: ch:hacluster - options: - cluster_count: 1 - channel: latest/edge - -relations: - - - 'keystone:shared-db' - - 'keystone-mysql-router:shared-db' - - - 'keystone-mysql-router:db-router' - - 'mysql-innodb-cluster:db-router' - - - - 'designate:shared-db' - - 'designate-mysql-router:shared-db' - - - 'designate-mysql-router:db-router' - - 'mysql-innodb-cluster:db-router' - - - - 'designate:amqp' - - 'rabbitmq-server:amqp' - - - - 'designate:identity-service' - - 'keystone:identity-service' - - - - 'designate:dns-backend' - - 'designate-bind:dns-backend' - - - - 'designate:coordinator-memcached' - - 'memcached:cache' - - - - 'designate:dnsaas' - - 'neutron-api:external-dns' - - - - 'neutron-api:identity-service' - - 'keystone:identity-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' - - - - 'designate:nrpe-external-master' - - 'nrpe:nrpe-external-master' - - - - 'designate-bind' - - 'designate-bind-hacluster' diff --git a/src/tests/bundles/noble-caracal.yaml b/src/tests/bundles/noble-caracal.yaml index 86915e3..e5a5f51 100644 --- a/src/tests/bundles/noble-caracal.yaml +++ b/src/tests/bundles/noble-caracal.yaml @@ -17,7 +17,8 @@ machines: '5': '6': '7': - series: focal + # Note: memcached locked to jammy + series: jammy '8': applications: @@ -55,7 +56,7 @@ applications: openstack-origin: *openstack-origin to: - '4' - channel: 2024.1/edge + channel: latest/edge neutron-api: charm: ch:neutron-api @@ -65,10 +66,10 @@ applications: openstack-origin: *openstack-origin to: - '5' - channel: 2024.1/edge + channel: latest/edge designate-bind: - charm: ../../../designate-bind_ubuntu-22.04-amd64.charm + charm: ../../../designate-bind.charm num_units: 1 # NOTE(ajkavanagh) apparently it has no openstack origin! #options: @@ -79,8 +80,8 @@ applications: memcached: charm: ch:memcached num_units: 1 - # Note that holding memcached at focal as it's not available at jammy yet. - series: focal + # Note that holding memcached at jammy as it's not available at jammy yet. + series: jammy to: - '7' @@ -92,7 +93,7 @@ applications: openstack-origin: *openstack-origin to: - '8' - channel: 2024.1/edge + channel: latest/edge nrpe: charm: ch:nrpe diff --git a/src/tests/tests.yaml b/src/tests/tests.yaml index bf4551e..6208ddf 100644 --- a/src/tests/tests.yaml +++ b/src/tests/tests.yaml @@ -1,11 +1,9 @@ charm_name: designate-bind smoke_bundles: - - jammy-caracal + - noble-caracal gate_bundles: - - jammy-antelope - - jammy-bobcat - - jammy-caracal + - noble-caracal dev_bundles: - noble-caracal tests: 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/src/wheelhouse.txt b/src/wheelhouse.txt index 671a6cc..75cfab1 100644 --- a/src/wheelhouse.txt +++ b/src/wheelhouse.txt @@ -1,5 +1,4 @@ psutil -setuptools < 50.0 git+https://github.com/openstack/charms.openstack.git#egg=charms.openstack diff --git a/tox.ini b/tox.ini index 80a50ed..350dde1 100644 --- a/tox.ini +++ b/tox.ini @@ -33,6 +33,7 @@ allowlist_externals = charmcraft bash tox + {toxinidir}/rename.sh deps = -r{toxinidir}/requirements.txt @@ -45,6 +46,7 @@ basepython = python3 commands = charmcraft clean charmcraft -v pack + {toxinidir}/rename.sh charmcraft clean [testenv:build-reactive] @@ -60,21 +62,21 @@ 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: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}/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} @@ -89,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 =