From e294222ae3075ffd9b1a699f619aa30017870366 Mon Sep 17 00:00:00 2001 From: Corey Bryant Date: Tue, 14 Feb 2023 21:26:00 +0000 Subject: [PATCH] Add Antelope support * sync charm-helpers to classic charms * change openstack-origin/source default to antelope * align testing with antelope * add new antelope bundles * add antelope bundles to tests.yaml * add antelope tests to osci.yaml and .zuul.yaml * update build-on and run-on bases Change-Id: I4aba961c11a7fa774f134e65ad1a7225fbc4fd46 --- .zuul.yaml | 2 +- build-requirements.txt | 7 - charmcraft.yaml | 73 +++++++- osci.yaml | 33 ++-- src/config.yaml | 2 +- src/metadata.yaml | 1 + src/tests/bundles/jammy-antelope.yaml | 150 +++++++++++++++++ src/tests/bundles/jammy-yoga-s3.yaml | 157 ------------------ src/tests/bundles/jammy-zed-s3.yaml | 6 +- src/tests/bundles/jammy-zed.yaml | 6 +- src/tests/bundles/kinetic-zed-s3.yaml | 2 +- src/tests/bundles/kinetic-zed.yaml | 2 +- .../{jammy-yoga.yaml => lunar-antelope.yaml} | 6 +- src/tests/tests.yaml | 9 +- tox.ini | 21 +-- 15 files changed, 255 insertions(+), 222 deletions(-) delete mode 100644 build-requirements.txt create mode 100644 src/tests/bundles/jammy-antelope.yaml delete mode 100644 src/tests/bundles/jammy-yoga-s3.yaml rename src/tests/bundles/{jammy-yoga.yaml => lunar-antelope.yaml} (95%) diff --git a/.zuul.yaml b/.zuul.yaml index 23bf5f6..fd20909 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -1,4 +1,4 @@ - project: templates: - - openstack-python3-charm-zed-jobs + - openstack-python3-charm-jobs - openstack-cover-jobs diff --git a/build-requirements.txt b/build-requirements.txt deleted file mode 100644 index b6d2452..0000000 --- a/build-requirements.txt +++ /dev/null @@ -1,7 +0,0 @@ -# NOTES(lourot): -# * We don't install charmcraft via pip anymore because it anyway spins up a -# container and scp the system's charmcraft snap inside it. So the charmcraft -# snap is necessary on the system anyway. -# * `tox -e build` successfully validated with charmcraft 1.2.1 - -cffi==1.14.6; python_version < '3.6' # cffi 1.15.0 drops support for py35. diff --git a/charmcraft.yaml b/charmcraft.yaml index 0604425..d06a6c7 100644 --- a/charmcraft.yaml +++ b/charmcraft.yaml @@ -2,24 +2,79 @@ type: charm parts: charm: - source: src/ plugin: reactive + reactive-charm-build-arguments: + - --binary-wheels-from-source + build-packages: + - tox + - git + - python3-dev + - libffi-dev + - libssl-dev + - libxml2-dev + - libxslt1-dev + - rustc + - cargo + source: src/ build-snaps: - - charm + - charm/latest/edge build-environment: - - CHARM_INTERFACES_DIR: /root/project/interfaces/ - - CHARM_LAYERS_DIR: /root/project/layers/ - + - CHARM_INTERFACES_DIR: $CRAFT_PROJECT_DIR/interfaces/ + - CHARM_LAYERS_DIR: $CRAFT_PROJECT_DIR/layers/ bases: - 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] - name: ubuntu channel: "22.10" - architectures: [amd64, s390x, ppc64el, arm64] + architectures: [amd64] + - name: ubuntu + channel: "23.04" + architectures: [amd64] + - build-on: + - name: ubuntu + channel: "22.04" + architectures: [arm64] + run-on: + - name: ubuntu + channel: "22.04" + architectures: [arm64] + - name: ubuntu + channel: "22.10" + architectures: [arm64] + - name: ubuntu + channel: "23.04" + architectures: [arm64] + - build-on: + - name: ubuntu + channel: "22.04" + architectures: [ppc64el] + run-on: + - name: ubuntu + channel: "22.04" + architectures: [ppc64el] + - name: ubuntu + channel: "22.10" + architectures: [ppc64el] + - name: ubuntu + channel: "23.04" + architectures: [ppc64el] + - build-on: + - name: ubuntu + channel: "22.04" + architectures: [s390x] + run-on: + - name: ubuntu + channel: "22.04" + architectures: [s390x] + - name: ubuntu + channel: "22.10" + architectures: [s390x] + - name: ubuntu + channel: "23.04" + architectures: [s390x] diff --git a/osci.yaml b/osci.yaml index d990643..7392dde 100644 --- a/osci.yaml +++ b/osci.yaml @@ -1,27 +1,22 @@ - project: templates: - charm-unit-jobs-py310 - - charm-zed-functional-jobs + - charm-functional-jobs check: jobs: - - test-s3-jammy-yoga-s3 - - test-s3-jammy-zed-s3: - voting: false + - test-s3-jammy-zed-s3 - test-s3-kinetic-zed-s3: voting: false + - test-s3-jammy-antelope-s3: + voting: false + - test-s3-lunar-antelope-s3: + voting: false vars: needs_charm_build: true charm_build_name: gnocchi build_type: charmcraft charmcraft_channel: 2.1/stable -- job: - name: test-s3-jammy-yoga-s3 - parent: func-target - dependencies: - - jammy-yoga - vars: - tox_extra_args: '-- test-s3:jammy-yoga-s3' - job: name: test-s3-jammy-zed-s3 parent: func-target @@ -33,6 +28,20 @@ name: test-s3-kinetic-zed-s3 parent: func-target dependencies: - - kinetic-zed + - jammy-zed vars: tox_extra_args: '-- test-s3:kinetic-zed-s3' +- job: + name: test-s3-jammy-antelope-s3 + parent: func-target + dependencies: + - jammy-zed + vars: + tox_extra_args: '-- test-s3:jammy-antelope-s3' +- job: + name: test-s3-lunar-antelope-s3 + parent: func-target + dependencies: + - jammy-zed + vars: + tox_extra_args: '-- test-s3:lunar-antelope-s3' diff --git a/src/config.yaml b/src/config.yaml index 6f6645b..8ec2c67 100644 --- a/src/config.yaml +++ b/src/config.yaml @@ -122,4 +122,4 @@ options: Value of bluestore compression max blob size for solid state media on pools requested by this charm. openstack-origin: - default: zed + default: antelope diff --git a/src/metadata.yaml b/src/metadata.yaml index a074f08..532beee 100644 --- a/src/metadata.yaml +++ b/src/metadata.yaml @@ -12,6 +12,7 @@ tags: series: - jammy - kinetic +- lunar provides: metric-service: interface: gnocchi diff --git a/src/tests/bundles/jammy-antelope.yaml b/src/tests/bundles/jammy-antelope.yaml new file mode 100644 index 0000000..f04b228 --- /dev/null +++ b/src/tests/bundles/jammy-antelope.yaml @@ -0,0 +1,150 @@ +variables: + openstack-origin: &openstack-origin cloud:jammy-antelope + +local_overlay_enabled: False + +series: &series jammy + +machines: + '0': + constraints: mem=3072M + '1': + constraints: mem=3072M + '2': + constraints: mem=3072M + '3': + '4': + '5': + '6': + '7': + '8': + '9': + '10': + '11': + '12': + '13': + series: focal + +# We specify machine placements for these to improve iteration +# time, given that machine "0" comes up way before machine "6" +applications: + + keystone-mysql-router: + charm: ch:mysql-router + channel: latest/edge + gnocchi-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: latest/edge + + ceilometer: + charm: ch:ceilometer + num_units: 1 + options: + openstack-origin: *openstack-origin + to: + - '5' + channel: latest/edge + + ceph-osd: + charm: ch:ceph-osd + num_units: 3 + storage: + osd-devices: 'cinder,10G' + options: + source: *openstack-origin + to: + - '6' + - '7' + - '8' + channel: latest/edge + + ceph-mon: + charm: ch:ceph-mon + num_units: 3 + options: + expected-osd-count: 3 + monitor-count: '3' + source: *openstack-origin + to: + - '9' + - '10' + - '11' + channel: latest/edge + + gnocchi: + series: *series + charm: ../../../gnocchi_ubuntu-22.04-amd64_ubuntu-22.10-amd64_ubuntu-23.04-amd64.charm + num_units: 1 + options: + openstack-origin: *openstack-origin + to: + - '12' + + memcached: + charm: ch:memcached + num_units: 1 + # Note that holding memcached at focal as it's not available at jammy yet. + series: focal + to: + - '13' + +relations: + + - - 'keystone:shared-db' + - 'keystone-mysql-router:shared-db' + - - 'keystone-mysql-router:db-router' + - 'mysql-innodb-cluster:db-router' + + - - 'ceph-osd:mon' + - 'ceph-mon:osd' + + - - 'ceilometer:amqp' + - 'rabbitmq-server:amqp' + + - - 'ceilometer:identity-credentials' + - 'keystone:identity-credentials' + + - - 'ceilometer:identity-notifications' + - 'keystone:identity-notifications' + + - - 'ceilometer:metric-service' + - 'gnocchi:metric-service' + + - - 'gnocchi:identity-service' + - 'keystone:identity-service' + + - - 'gnocchi:shared-db' + - 'gnocchi-mysql-router:shared-db' + - - 'gnocchi-mysql-router:db-router' + - 'mysql-innodb-cluster:db-router' + + - - 'gnocchi:storage-ceph' + - 'ceph-mon:client' + + - - 'gnocchi:coordinator-memcached' + - 'memcached:cache' diff --git a/src/tests/bundles/jammy-yoga-s3.yaml b/src/tests/bundles/jammy-yoga-s3.yaml deleted file mode 100644 index 73ff05f..0000000 --- a/src/tests/bundles/jammy-yoga-s3.yaml +++ /dev/null @@ -1,157 +0,0 @@ -variables: - openstack-origin: &openstack-origin distro - -local_overlay_enabled: False - -series: &series jammy - -machines: - 0: - constraints: "mem=3072M" - 1: - constraints: "mem=3072M" - 2: - constraints: "mem=3072M" - 3: {} - 4: {} - 5: {} - 6: {} - 7: {} - 8: {} - 9: {} - 10: - series: focal - -# We specify machine placements for these to improve iteration -# time, given that machine "0" comes up way before machine "6" -applications: - - keystone-mysql-router: - charm: ch:mysql-router - channel: latest/edge - gnocchi-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: *openstack-origin - to: - - '0' - - '1' - - '2' - channel: latest/edge - rabbitmq-server: - charm: ch:rabbitmq-server - num_units: 1 - options: - source: *openstack-origin - to: - - '3' - channel: latest/edge - keystone: - charm: ch:keystone - num_units: 1 - options: - openstack-origin: *openstack-origin - to: - - '4' - channel: latest/edge - ceilometer: - charm: ch:ceilometer - num_units: 1 - options: - openstack-origin: *openstack-origin - to: - - '5' - channel: latest/edge - gnocchi: - series: *series - charm: ../../../gnocchi.charm - num_units: 1 - options: - openstack-origin: *openstack-origin - storage-backend: s3 - 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: - - '10' - #swift-proxy is used to test gnocchi against an S3 storage backend - swift-proxy: - charm: ch:swift-proxy - num_units: 1 - options: - zone-assignment: manual - replicas: 1 - swift-hash: fdfef9d4-8b06-11e2-8ac0-531c923c8fae - openstack-origin: *openstack-origin - to: - - '7' - channel: latest/edge - swift-storage: - charm: ch:swift-storage - num_units: 1 - storage: - block-devices: 'cinder,10G' - options: - openstack-origin: *openstack-origin - zone: 1 - to: - - '8' - channel: latest/edge - vault: - charm: ch:vault - num_units: 1 - series: *series - to: - - '9' - channel: latest/edge -relations: - - - keystone:shared-db - - keystone-mysql-router:shared-db - - - keystone-mysql-router:db-router - - mysql-innodb-cluster:db-router - - - gnocchi:shared-db - - gnocchi-mysql-router:shared-db - - - gnocchi-mysql-router:db-router - - mysql-innodb-cluster:db-router - - - ceilometer:amqp - - rabbitmq-server:amqp - - - ceilometer:identity-credentials - - keystone:identity-credentials - - - ceilometer:identity-notifications - - keystone:identity-notifications - - - ceilometer:metric-service - - gnocchi:metric-service - - - gnocchi:identity-service - - keystone:identity-service - - - gnocchi:coordinator-memcached - - memcached:cache - - - swift-proxy:identity-service - - keystone:identity-service - - - swift-storage:swift-storage - - swift-proxy:swift-storage - - - vault:shared-db - - vault-mysql-router:shared-db - - - vault-mysql-router:db-router - - mysql-innodb-cluster:db-router - - - vault:certificates - - swift-proxy:certificates - - - vault:certificates - - gnocchi:certificates - - - vault:certificates - - ceilometer:certificates - - - vault:certificates - - keystone:certificates - - - vault:certificates - - rabbitmq-server:certificates diff --git a/src/tests/bundles/jammy-zed-s3.yaml b/src/tests/bundles/jammy-zed-s3.yaml index 1fee21f..dae4334 100644 --- a/src/tests/bundles/jammy-zed-s3.yaml +++ b/src/tests/bundles/jammy-zed-s3.yaml @@ -39,8 +39,6 @@ applications: mysql-innodb-cluster: charm: ch:mysql-innodb-cluster num_units: 3 - options: - source: *openstack-origin to: - '0' - '1' @@ -49,8 +47,6 @@ applications: rabbitmq-server: charm: ch:rabbitmq-server num_units: 1 - options: - source: *openstack-origin to: - '3' channel: latest/edge @@ -72,7 +68,7 @@ applications: channel: latest/edge gnocchi: series: *series - charm: ../../../gnocchi.charm + charm: ../../../gnocchi_ubuntu-22.04-amd64_ubuntu-22.10-amd64_ubuntu-23.04-amd64.charm num_units: 1 options: openstack-origin: *openstack-origin diff --git a/src/tests/bundles/jammy-zed.yaml b/src/tests/bundles/jammy-zed.yaml index d60a4bc..9dd815e 100644 --- a/src/tests/bundles/jammy-zed.yaml +++ b/src/tests/bundles/jammy-zed.yaml @@ -39,8 +39,6 @@ applications: mysql-innodb-cluster: charm: ch:mysql-innodb-cluster num_units: 3 - options: - source: *openstack-origin to: - '0' - '1' @@ -50,8 +48,6 @@ applications: rabbitmq-server: charm: ch:rabbitmq-server num_units: 1 - options: - source: *openstack-origin to: - '3' channel: latest/edge @@ -102,7 +98,7 @@ applications: gnocchi: series: *series - charm: ../../../gnocchi.charm + charm: ../../../gnocchi_ubuntu-22.04-amd64_ubuntu-22.10-amd64_ubuntu-23.04-amd64.charm num_units: 1 options: openstack-origin: *openstack-origin diff --git a/src/tests/bundles/kinetic-zed-s3.yaml b/src/tests/bundles/kinetic-zed-s3.yaml index c8c7c37..312c521 100644 --- a/src/tests/bundles/kinetic-zed-s3.yaml +++ b/src/tests/bundles/kinetic-zed-s3.yaml @@ -72,7 +72,7 @@ applications: channel: latest/edge gnocchi: series: *series - charm: ../../../gnocchi.charm + charm: ../../../gnocchi_ubuntu-22.04-amd64_ubuntu-22.10-amd64_ubuntu-23.04-amd64.charm num_units: 1 options: openstack-origin: *openstack-origin diff --git a/src/tests/bundles/kinetic-zed.yaml b/src/tests/bundles/kinetic-zed.yaml index 0b88969..a5928df 100644 --- a/src/tests/bundles/kinetic-zed.yaml +++ b/src/tests/bundles/kinetic-zed.yaml @@ -102,7 +102,7 @@ applications: gnocchi: series: *series - charm: ../../../gnocchi.charm + charm: ../../../gnocchi_ubuntu-22.04-amd64_ubuntu-22.10-amd64_ubuntu-23.04-amd64.charm num_units: 1 options: openstack-origin: *openstack-origin diff --git a/src/tests/bundles/jammy-yoga.yaml b/src/tests/bundles/lunar-antelope.yaml similarity index 95% rename from src/tests/bundles/jammy-yoga.yaml rename to src/tests/bundles/lunar-antelope.yaml index 8bf41b4..7620418 100644 --- a/src/tests/bundles/jammy-yoga.yaml +++ b/src/tests/bundles/lunar-antelope.yaml @@ -3,7 +3,7 @@ variables: local_overlay_enabled: False -series: &series jammy +series: &series lunar machines: '0': @@ -102,7 +102,7 @@ applications: gnocchi: series: *series - charm: ../../../gnocchi.charm + charm: ../../../gnocchi_ubuntu-22.04-amd64_ubuntu-22.10-amd64_ubuntu-23.04-amd64.charm num_units: 1 options: openstack-origin: *openstack-origin @@ -112,7 +112,7 @@ applications: memcached: charm: ch:memcached num_units: 1 - # Note that holding memcached at focal as it's not available at jammy yet. + # Note that holding memcached at focal as it's not available at lunar yet. series: focal to: - '13' diff --git a/src/tests/tests.yaml b/src/tests/tests.yaml index 4284417..fb14efe 100644 --- a/src/tests/tests.yaml +++ b/src/tests/tests.yaml @@ -1,15 +1,15 @@ charm_name: gnocchi gate_bundles: - - test-s3: jammy-yoga-s3 + - test-s3: jammy-zed-s3 smoke_bundles: - - test-s3: jammy-yoga-s3 + - test-s3: jammy-zed-s3 dev_bundles: - - test-s3: jammy-yoga-s3 - - test-s3: jammy-zed-s3 + - test-s3: jammy-antelope-s3 - test-s3: kinetic-zed-s3 + - test-s3: lunar-antelope-s3 configure: - zaza.openstack.charm_tests.ceilometer.setup.basic_setup @@ -44,3 +44,4 @@ target_deploy_status: tests_options: force_deploy: - kinetic-zed-s3 + - lunar-antelope-s3 diff --git a/tox.ini b/tox.ini index 399fef5..5dda268 100644 --- a/tox.ini +++ b/tox.ini @@ -19,23 +19,25 @@ skip_install = True setenv = VIRTUAL_ENV={envdir} PYTHONHASHSEED=0 TERM=linux + CHARM_LAYERS_DIR={toxinidir}/layers + CHARM_INTERFACES_DIR={toxinidir}/interfaces JUJU_REPOSITORY={toxinidir}/build passenv = no_proxy http_proxy https_proxy + CHARM_INTERFACES_DIR + CHARM_LAYERS_DIR JUJU_REPOSITORY allowlist_externals = charmcraft bash tox - {toxinidir}/rename.sh deps = -r{toxinidir}/requirements.txt [testenv:build] basepython = python3 -deps = -r{toxinidir}/build-requirements.txt # charmcraft clean is done to ensure that # `tox -e build` always performs a clean, repeatable build. # For faster rebuilds during development, @@ -43,13 +45,12 @@ deps = -r{toxinidir}/build-requirements.txt commands = charmcraft clean charmcraft -v pack - {toxinidir}/rename.sh charmcraft clean [testenv:build-reactive] basepython = python3 commands = - charm-build --log-level DEBUG --use-lock-file-branches -o {toxinidir}/build/builds src {posargs} + charm-build --log-level DEBUG --use-lock-file-branches --binary-wheels-from-source -o {toxinidir}/build/builds src {posargs} [testenv:add-build-lock-file] basepython = python3 @@ -72,18 +73,6 @@ deps = flake8==3.9.2 git+https://github.com/juju/charm-tools.git commands = flake8 {posargs} src unit_tests -[testenv:func-target] -# Hack to get functional tests working in the charmcraft -# world. We should fix this. -basepython = python3 -passenv = HOME TERM CS_* OS_* TEST_* -deps = -r{toxinidir}/src/test-requirements.txt -changedir = {toxinidir}/src -commands = - bash -c "if [ ! -f ../*.charm ]; then echo 'Charm does not exist. Run tox -e build'; exit 1; fi" - tox --version - tox -e func-target {posargs} - [testenv:cover] # Technique based heavily upon # https://github.com/openstack/nova/blob/master/tox.ini