From 20581ffd4638d167662d5f2c48f404e0c384038a Mon Sep 17 00:00:00 2001 From: Alex Kavanagh Date: Wed, 21 Jun 2023 13:41:56 +0100 Subject: [PATCH] Update charmcraft to use reactive plugin/restore 20.04 base The 20.04 base got removed in a recent commit, but it's still needed to test the focal bundles as Juju has become more strict about whether a local charm will install based on charmcraft.yaml bases rather than metadata (which still indicated that the charm was okay for focal). Also update the charmcraft.yaml to use the reactive plugin, and convert the charm to a binary wheel's charm so that it can also support lunar. Fold in changes to support mantic. Func-Test-Pr: https://github.com/openstack-charmers/zaza-openstack-tests/pull/1093 Change-Id: I372d4f06e1360a7b8d6f7972a1395118abf6a96a --- charmcraft.yaml | 149 ++++++++++++++++-- osci.yaml | 2 +- src/metadata.yaml | 1 + src/tests/bundles/focal-full.yaml | 2 +- src/tests/bundles/focal.yaml | 2 +- src/tests/bundles/jammy-full.yaml | 2 +- src/tests/bundles/jammy.yaml | 2 +- .../bundles/overlays/focal-full-ha.yaml.j2 | 2 + .../bundles/overlays/jammy-full-ha.yaml.j2 | 2 + src/tests/tests.yaml | 6 +- tox.ini | 3 +- 11 files changed, 145 insertions(+), 28 deletions(-) diff --git a/charmcraft.yaml b/charmcraft.yaml index ea0a92b..d7417c6 100644 --- a/charmcraft.yaml +++ b/charmcraft.yaml @@ -2,35 +2,150 @@ type: charm parts: charm: - charm-entrypoint: "hooks/install" + plugin: reactive + reactive-charm-build-arguments: + - --binary-wheels-from-source + - --verbose build-packages: - tox - git - python3-dev - libffi-dev - - libmysqlclient-dev # for executable mysql_shell - override-build: | - apt-get install ca-certificates -y - tox -e build-reactive - override-stage: | - echo "Copying charm to staging area: $CRAFT_STAGE" - NAME=$(ls $CRAFT_PART_BUILD/build/builds) - cp -r $CRAFT_PART_BUILD/build/builds/$NAME/* $CRAFT_STAGE/ - override-prime: | - # For some reason, the normal priming chokes on the fact that there's a - # hooks directory. - cp -r $CRAFT_STAGE/* . + - libmysqlclient-dev + - pkg-config + source: src/ + build-snaps: + - charm/latest/stable + build-environment: + - CHARM_INTERFACES_DIR: $CRAFT_PROJECT_DIR/interfaces/ + - CHARM_LAYERS_DIR: $CRAFT_PROJECT_DIR/layers/ bases: + - build-on: + - name: ubuntu + channel: "20.04" + architectures: [amd64] + run-on: + - name: ubuntu + channel: "20.04" + architectures: [amd64] + - build-on: + - name: ubuntu + channel: "20.04" + architectures: [s390x] + run-on: + - name: ubuntu + channel: "20.04" + architectures: [s390x] + - build-on: + - name: ubuntu + channel: "20.04" + architectures: [ppc64el] + run-on: + - name: ubuntu + channel: "20.04" + architectures: [ppc64el] + - build-on: + - name: ubuntu + channel: "20.04" + architectures: [arm64] + run-on: + - name: ubuntu + channel: "20.04" + architectures: [arm64] - build-on: - name: ubuntu channel: "22.04" - architectures: - - amd64 + architectures: [amd64] run-on: - name: ubuntu channel: "22.04" - architectures: [amd64, s390x, ppc64el, arm64] + 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] + - build-on: - name: ubuntu channel: "23.04" - architectures: [amd64, s390x, ppc64el, arm64] + architectures: [amd64] + run-on: + - name: ubuntu + channel: "23.04" + architectures: [amd64] + - build-on: + - name: ubuntu + channel: "23.04" + architectures: [s390x] + run-on: + - name: ubuntu + channel: "23.04" + architectures: [s390x] + - build-on: + - name: ubuntu + channel: "23.04" + architectures: [ppc64el] + run-on: + - name: ubuntu + channel: "23.04" + architectures: [ppc64el] + - build-on: + - name: ubuntu + channel: "23.04" + architectures: [arm64] + run-on: + - name: ubuntu + channel: "23.04" + architectures: [arm64] + - build-on: + - name: ubuntu + channel: "23.10" + architectures: [amd64] + run-on: + - name: ubuntu + channel: "23.10" + architectures: [amd64] + - build-on: + - name: ubuntu + channel: "23.10" + architectures: [s390x] + run-on: + - name: ubuntu + channel: "23.10" + architectures: [s390x] + - build-on: + - name: ubuntu + channel: "23.10" + architectures: [ppc64el] + run-on: + - name: ubuntu + channel: "23.10" + architectures: [ppc64el] + - build-on: + - name: ubuntu + channel: "23.10" + architectures: [arm64] + run-on: + - name: ubuntu + channel: "23.10" + architectures: [arm64] diff --git a/osci.yaml b/osci.yaml index 57d9962..c354886 100644 --- a/osci.yaml +++ b/osci.yaml @@ -12,7 +12,7 @@ needs_charm_build: true charm_build_name: mysql-innodb-cluster build_type: charmcraft - charmcraft_channel: "1.7/stable" + charmcraft_channel: "2.2/stable" - job: name: full_model-focal-full-ha diff --git a/src/metadata.yaml b/src/metadata.yaml index bf2b0bb..ddf2c6d 100644 --- a/src/metadata.yaml +++ b/src/metadata.yaml @@ -11,6 +11,7 @@ series: - focal - jammy - lunar +- mantic provides: shared-db: interface: mysql-shared diff --git a/src/tests/bundles/focal-full.yaml b/src/tests/bundles/focal-full.yaml index 20aba0e..eefd7bc 100644 --- a/src/tests/bundles/focal-full.yaml +++ b/src/tests/bundles/focal-full.yaml @@ -25,7 +25,7 @@ applications: charm: ch:mysql-router channel: latest/edge mysql-innodb-cluster: - charm: ../../../mysql-innodb-cluster.charm + charm: ../../../mysql-innodb-cluster_ubuntu-20.04-amd64.charm num_units: 3 options: source: *openstack-origin diff --git a/src/tests/bundles/focal.yaml b/src/tests/bundles/focal.yaml index 6135d6b..a3b2744 100644 --- a/src/tests/bundles/focal.yaml +++ b/src/tests/bundles/focal.yaml @@ -10,7 +10,7 @@ applications: channel: latest/edge mysql-innodb-cluster: series: focal - charm: ../../../mysql-innodb-cluster.charm + charm: ../../../mysql-innodb-cluster_ubuntu-20.04-amd64.charm num_units: 3 options: prometheus-exporter-snap-channel: edge diff --git a/src/tests/bundles/jammy-full.yaml b/src/tests/bundles/jammy-full.yaml index dd91159..fcd2f8f 100644 --- a/src/tests/bundles/jammy-full.yaml +++ b/src/tests/bundles/jammy-full.yaml @@ -25,7 +25,7 @@ applications: charm: ch:mysql-router channel: latest/edge mysql-innodb-cluster: - charm: ../../../mysql-innodb-cluster.charm + charm: ../../../mysql-innodb-cluster_ubuntu-22.04-amd64.charm num_units: 3 options: source: *openstack-origin diff --git a/src/tests/bundles/jammy.yaml b/src/tests/bundles/jammy.yaml index 3e3450d..77e0747 100644 --- a/src/tests/bundles/jammy.yaml +++ b/src/tests/bundles/jammy.yaml @@ -9,7 +9,7 @@ applications: charm: ch:mysql-router channel: latest/edge mysql-innodb-cluster: - charm: ../../../mysql-innodb-cluster.charm + charm: ../../../mysql-innodb-cluster_ubuntu-22.04-amd64.charm num_units: 3 options: prometheus-exporter-snap-channel: edge diff --git a/src/tests/bundles/overlays/focal-full-ha.yaml.j2 b/src/tests/bundles/overlays/focal-full-ha.yaml.j2 index 69519f9..7260bc5 100644 --- a/src/tests/bundles/overlays/focal-full-ha.yaml.j2 +++ b/src/tests/bundles/overlays/focal-full-ha.yaml.j2 @@ -8,9 +8,11 @@ applications: options: vip: {{TEST_VIP01}} keystone-hacluster: + series: focal charm: ch:hacluster channel: 2.0.3/edge nova-hacluster: + series: focal charm: ch:hacluster channel: 2.0.3/edge relations: diff --git a/src/tests/bundles/overlays/jammy-full-ha.yaml.j2 b/src/tests/bundles/overlays/jammy-full-ha.yaml.j2 index bca709d..c34973e 100644 --- a/src/tests/bundles/overlays/jammy-full-ha.yaml.j2 +++ b/src/tests/bundles/overlays/jammy-full-ha.yaml.j2 @@ -8,9 +8,11 @@ applications: options: vip: {{TEST_VIP01}} keystone-hacluster: + series: jammy charm: ch:hacluster channel: 2.4/edge nova-hacluster: + series: jammy charm: ch:hacluster channel: 2.4/edge relations: diff --git a/src/tests/tests.yaml b/src/tests/tests.yaml index 87d9d42..23b2cde 100644 --- a/src/tests/tests.yaml +++ b/src/tests/tests.yaml @@ -43,11 +43,7 @@ dev_bundles: - full_model: jammy-full-ha tests_options: - force_deploy: - - jammy - - jammy-full-ha - - jammy - - jammy-full-ha + force_deploy: [] target_deploy_status: neutron-api-plugin-ovn: diff --git a/tox.ini b/tox.ini index ab5d020..78c65f9 100644 --- a/tox.ini +++ b/tox.ini @@ -43,11 +43,12 @@ basepython = python3 # `tox -e build` always performs a clean, repeatable build. # For faster rebuilds during development, # directly run `charmcraft -v pack && ./rename.sh`. +deps = commands = charmcraft clean charmcraft -v pack - {toxinidir}/rename.sh charmcraft clean +# {toxinidir}/rename.sh [testenv:build-reactive] basepython = python3