From 564d89ec9018124a3cedc3b6496bec07b563e078 Mon Sep 17 00:00:00 2001 From: Corey Bryant Date: Fri, 10 Jun 2022 20:14:47 +0000 Subject: [PATCH] Add Kinetic and Zed support * sync charm-helpers to classic charms * change openstack-origin/source default to zed * align testing with zed * add new zed bundles * add zed bundles to tests.yaml * add zed tests to osci.yaml and .zuul.yaml * update build-on and run-on bases * add bindep.txt for py310 * sync tox.ini and requirements.txt for ruamel * use charmcraft_channel 2.0/stable * drop reactive plugin overrides * move interface/layer env vars to charmcraft.yaml Change-Id: I3cc0af8443ecf62589c88d4e924cb633c419e87f --- .zuul.yaml | 2 +- bindep.txt | 4 + charmcraft.yaml | 30 ++-- osci.yaml | 5 +- requirements.txt | 12 +- src/metadata.yaml | 2 +- src/tests/bundles/focal-yoga.yaml | 170 ------------------ .../{focal-xena.yaml => jammy-zed.yaml} | 4 +- .../{impish-xena.yaml => kinetic-zed.yaml} | 2 +- src/tests/tests.yaml | 11 +- test-requirements.txt | 18 +- tox.ini | 23 +-- 12 files changed, 32 insertions(+), 251 deletions(-) create mode 100644 bindep.txt delete mode 100644 src/tests/bundles/focal-yoga.yaml rename src/tests/bundles/{focal-xena.yaml => jammy-zed.yaml} (98%) rename src/tests/bundles/{impish-xena.yaml => kinetic-zed.yaml} (99%) diff --git a/.zuul.yaml b/.zuul.yaml index 7ffc71c..23bf5f6 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -1,4 +1,4 @@ - project: templates: - - openstack-python3-charm-yoga-jobs + - openstack-python3-charm-zed-jobs - openstack-cover-jobs diff --git a/bindep.txt b/bindep.txt new file mode 100644 index 0000000..17575d9 --- /dev/null +++ b/bindep.txt @@ -0,0 +1,4 @@ +libffi-dev [platform:dpkg] +libpq-dev [platform:dpkg] +libxml2-dev [platform:dpkg] +libxslt1-dev [platform:dpkg] diff --git a/charmcraft.yaml b/charmcraft.yaml index c9a0ed7..0604425 100644 --- a/charmcraft.yaml +++ b/charmcraft.yaml @@ -2,32 +2,24 @@ type: charm parts: charm: - build-packages: - - tox - - git - - python3-dev - override-build: | - apt-get install ca-certificates -y - tox -e build-reactive - override-stage: | - echo "Copying charm to staging area: $CHARMCRAFT_STAGE" - NAME=$(ls $CHARMCRAFT_PART_BUILD/build/builds) - cp -r $CHARMCRAFT_PART_BUILD/build/builds/$NAME/* $CHARMCRAFT_STAGE/ - override-prime: | - # For some reason, the normal priming chokes on the fact that there's a - # hooks directory. - cp -r $CHARMCRAFT_STAGE/* . + source: src/ + plugin: reactive + build-snaps: + - charm + build-environment: + - CHARM_INTERFACES_DIR: /root/project/interfaces/ + - CHARM_LAYERS_DIR: /root/project/layers/ bases: - build-on: - name: ubuntu - channel: "20.04" + channel: "22.04" architectures: - amd64 run-on: - - name: ubuntu - channel: "20.04" - architectures: [amd64, s390x, ppc64el, arm64] - name: ubuntu channel: "22.04" architectures: [amd64, s390x, ppc64el, arm64] + - name: ubuntu + channel: "22.10" + architectures: [amd64, s390x, ppc64el, arm64] diff --git a/osci.yaml b/osci.yaml index 4d3f332..19daa4b 100644 --- a/osci.yaml +++ b/osci.yaml @@ -1,10 +1,9 @@ - project: templates: - - charm-unit-jobs-py38 - charm-unit-jobs-py310 - - charm-xena-functional-jobs - - charm-yoga-functional-jobs + - charm-zed-functional-jobs vars: needs_charm_build: true charm_build_name: neutron-api-plugin-ovn build_type: charmcraft + charmcraft_channel: 2.0/stable diff --git a/requirements.txt b/requirements.txt index 7755b95..b3dc23f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -15,16 +15,6 @@ setuptools<50.0.0 # https://github.com/pypa/setuptools/commit/04e3df22df840c6bb # cryptography<3.4 -# Build requirements -cffi==1.14.6; python_version < '3.6' # cffi 1.15.0 drops support for py35. -git+https://github.com/juju/charm-tools#egg=charm-tools +git+https://github.com/juju/charm-tools.git simplejson - -# Newer versions use keywords that didn't exist in python 3.5 yet (e.g. -# "ModuleNotFoundError") -# NOTE(lourot): This might look like a duplication of test-requirements.txt but -# some tox targets use only test-requirements.txt whereas charm-build uses only -# requirements.txt -importlib-metadata<3.0.0; python_version < '3.6' -importlib-resources<3.0.0; python_version < '3.6' diff --git a/src/metadata.yaml b/src/metadata.yaml index a5200a8..826dfbd 100644 --- a/src/metadata.yaml +++ b/src/metadata.yaml @@ -8,8 +8,8 @@ description: | tags: - networking series: -- focal - jammy +- kinetic subordinate: true requires: container: diff --git a/src/tests/bundles/focal-yoga.yaml b/src/tests/bundles/focal-yoga.yaml deleted file mode 100644 index 405d57b..0000000 --- a/src/tests/bundles/focal-yoga.yaml +++ /dev/null @@ -1,170 +0,0 @@ -variables: - openstack-origin: &openstack-origin cloud:focal-yoga - -local_overlay_enabled: False - -series: &series focal - -applications: - keystone-mysql-router: - charm: ch:mysql-router - channel: latest/edge - nova-mysql-router: - charm: ch:mysql-router - channel: latest/edge - glance-mysql-router: - charm: ch:mysql-router - channel: latest/edge - neutron-mysql-router: - charm: ch:mysql-router - channel: latest/edge - placement-mysql-router: - charm: ch:mysql-router - channel: latest/edge - vault-mysql-router: - charm: ch:mysql-router - channel: latest/edge - mysql-innodb-cluster: - constraints: mem=3072M - charm: ch:mysql-innodb-cluster - num_units: 3 - options: - source: *openstack-origin - channel: latest/edge - rabbitmq-server: - charm: ch:rabbitmq-server - num_units: 1 - options: - source: *openstack-origin - channel: latest/edge - vault: - charm: ch:vault - num_units: 1 - channel: latest/edge - ovn-central: - charm: ch:ovn-central - num_units: 3 - options: - source: *openstack-origin - channel: latest/edge - neutron-api-plugin-ovn: - charm: ../../../neutron-api-plugin-ovn.charm - hacluster-neutron-api: - charm: ch:hacluster - channel: latest/edge - neutron-api: - charm: ch:neutron-api - series: *series - num_units: 3 - options: - # NOTE(fnordahl): At current state of upstream Neutron development this - # is a requirement. Remove once fixed upstream. - enable-ml2-port-security: true - flat-network-providers: physnet1 - neutron-security-groups: true - openstack-origin: *openstack-origin - channel: latest/edge - keystone: - charm: ch:keystone - num_units: 1 - options: - openstack-origin: *openstack-origin - channel: latest/edge - glance: - charm: ch:glance - num_units: 1 - options: - openstack-origin: *openstack-origin - channel: latest/edge - nova-cloud-controller: - charm: ch:nova-cloud-controller - num_units: 1 - options: - network-manager: Neutron - openstack-origin: *openstack-origin - channel: latest/edge - ovn-chassis: - charm: ch:ovn-chassis - channel: latest/edge - nova-compute: - constraints: "root-disk=20G mem=4G" - charm: ch:nova-compute - num_units: 2 - options: - config-flags: default_ephemeral_format=ext4 - enable-live-migration: true - enable-resize: true - migration-auth-type: ssh - openstack-origin: *openstack-origin - channel: latest/edge - placement: - charm: ch:placement - num_units: 1 - options: - openstack-origin: *openstack-origin - channel: latest/edge -relations: - - - hacluster-neutron-api:ha - - neutron-api:ha - - - neutron-api:amqp - - rabbitmq-server:amqp - - - neutron-api:neutron-api - - nova-cloud-controller:neutron-api - - - neutron-api:identity-service - - keystone:identity-service - - - nova-cloud-controller:amqp - - rabbitmq-server:amqp - - - nova-compute:amqp - - rabbitmq-server:amqp - - - nova-cloud-controller:identity-service - - keystone:identity-service - - - nova-cloud-controller:cloud-compute - - nova-compute:cloud-compute - - - glance:identity-service - - keystone:identity-service - - - glance:amqp - - rabbitmq-server:amqp - - - nova-compute:image-service - - glance:image-service - - - nova-cloud-controller:image-service - - glance:image-service - - - placement:identity-service - - keystone:identity-service - - - placement:placement - - nova-cloud-controller:placement - - - neutron-api-plugin-ovn:neutron-plugin - - neutron-api:neutron-plugin-api-subordinate - - - ovn-central:certificates - - vault:certificates - - - ovn-central:ovsdb-cms - - neutron-api-plugin-ovn:ovsdb-cms - - - neutron-api:certificates - - vault:certificates - - - ovn-chassis:nova-compute - - nova-compute:neutron-plugin - - - ovn-chassis:certificates - - vault:certificates - - - ovn-chassis:ovsdb - - ovn-central:ovsdb - - - vault:certificates - - neutron-api-plugin-ovn:certificates - - - vault:certificates - - glance:certificates - - - vault:certificates - - keystone:certificates - - - vault:certificates - - nova-cloud-controller:certificates - - - vault:certificates - - placement:certificates - - ["keystone:shared-db", "keystone-mysql-router:shared-db"] - - ["glance:shared-db", "glance-mysql-router:shared-db"] - - ["nova-cloud-controller:shared-db", "nova-mysql-router:shared-db"] - - ["neutron-api:shared-db", "neutron-mysql-router:shared-db"] - - ["placement:shared-db", "placement-mysql-router:shared-db"] - - ["vault:shared-db", "vault-mysql-router:shared-db"] - - ["keystone-mysql-router:db-router", "mysql-innodb-cluster:db-router"] - - ["nova-mysql-router:db-router", "mysql-innodb-cluster:db-router"] - - ["glance-mysql-router:db-router", "mysql-innodb-cluster:db-router"] - - ["neutron-mysql-router:db-router", "mysql-innodb-cluster:db-router"] - - ["placement-mysql-router:db-router", "mysql-innodb-cluster:db-router"] - - ["vault-mysql-router:db-router", "mysql-innodb-cluster:db-router"] diff --git a/src/tests/bundles/focal-xena.yaml b/src/tests/bundles/jammy-zed.yaml similarity index 98% rename from src/tests/bundles/focal-xena.yaml rename to src/tests/bundles/jammy-zed.yaml index 0d7f433..7056c54 100644 --- a/src/tests/bundles/focal-xena.yaml +++ b/src/tests/bundles/jammy-zed.yaml @@ -1,9 +1,9 @@ variables: - openstack-origin: &openstack-origin cloud:focal-xena + openstack-origin: &openstack-origin cloud:jammy-zed local_overlay_enabled: False -series: &series focal +series: &series jammy applications: keystone-mysql-router: diff --git a/src/tests/bundles/impish-xena.yaml b/src/tests/bundles/kinetic-zed.yaml similarity index 99% rename from src/tests/bundles/impish-xena.yaml rename to src/tests/bundles/kinetic-zed.yaml index 32974bb..5d0b842 100644 --- a/src/tests/bundles/impish-xena.yaml +++ b/src/tests/bundles/kinetic-zed.yaml @@ -3,7 +3,7 @@ variables: local_overlay_enabled: False -series: &series impish +series: &series kinetic applications: keystone-mysql-router: diff --git a/src/tests/tests.yaml b/src/tests/tests.yaml index b77c4a2..b1ccae4 100644 --- a/src/tests/tests.yaml +++ b/src/tests/tests.yaml @@ -1,15 +1,15 @@ charm_name: neutron-api-plugin-ovn smoke_bundles: -- focal-xena +- jammy-yoga gate_bundles: -- focal-xena -- impish-xena +- jammy-yoga dev_bundles: -- focal-yoga - jammy-yoga +- jammy-zed +- kinetic-zed target_deploy_status: neutron-api-plugin-ovn: @@ -37,5 +37,4 @@ tests: tests_options: force_deploy: - - impish-xena - - jammy-yoga + - kinetic-zed diff --git a/test-requirements.txt b/test-requirements.txt index a11a7d0..a7936e6 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -4,7 +4,6 @@ # https://github.com/openstack-charmers/release-tools # pyparsing<3.0.0 # aodhclient is pinned in zaza and needs pyparsing < 3.0.0, but cffi also needs it, so pin here. -cffi==1.14.6; python_version < '3.6' # cffi 1.15.0 drops support for py35. setuptools<50.0.0 # https://github.com/pypa/setuptools/commit/04e3df22df840c6bb244e9b27bc56750c44b7c85 stestr>=2.2.0 @@ -13,25 +12,10 @@ stestr>=2.2.0 # https://github.com/mtreinish/stestr/issues/145 cliff<3.0.0 -# Dependencies of stestr. Newer versions use keywords that didn't exist in -# python 3.5 yet (e.g. "ModuleNotFoundError") -importlib-metadata<3.0.0; python_version < '3.6' -importlib-resources<3.0.0; python_version < '3.6' - -# Some Zuul nodes sometimes pull newer versions of these dependencies which -# dropped support for python 3.5: -osprofiler<2.7.0;python_version<'3.6' -stevedore<1.31.0;python_version<'3.6' -debtcollector<1.22.0;python_version<'3.6' -oslo.utils<=3.41.0;python_version<'3.6' - requests>=2.18.4 charms.reactive -# Newer mock seems to have some syntax which is newer than python3.5 (e.g. -# f'{something}' -mock>=1.2,<4.0.0; python_version < '3.6' -mock>=1.2; python_version >= '3.6' +mock>=1.2 nose>=1.3.7 coverage>=3.6 diff --git a/tox.ini b/tox.ini index e22fe48..bdde110 100644 --- a/tox.ini +++ b/tox.ini @@ -31,10 +31,8 @@ minversion = 3.18.0 setenv = VIRTUAL_ENV={envdir} PYTHONHASHSEED=0 TERM=linux - LAYER_PATH={toxinidir}/layers - INTERFACE_PATH={toxinidir}/interfaces JUJU_REPOSITORY={toxinidir}/build -passenv = http_proxy https_proxy INTERFACE_PATH LAYER_PATH JUJU_REPOSITORY +passenv = no_proxy http_proxy https_proxy JUJU_REPOSITORY install_command = {toxinidir}/pip.sh install {opts} {packages} allowlist_externals = @@ -50,7 +48,7 @@ basepython = python3 deps = -r{toxinidir}/build-requirements.txt commands = charmcraft clean - charmcraft -v build + charmcraft -v pack {toxinidir}/rename.sh [testenv:build-reactive] @@ -68,21 +66,6 @@ basepython = python3 deps = -r{toxinidir}/test-requirements.txt commands = stestr run --slowest {posargs} -[testenv:py36] -basepython = python3.6 -deps = -r{toxinidir}/test-requirements.txt -commands = stestr run --slowest {posargs} - -[testenv:py38] -basepython = python3.8 -deps = -r{toxinidir}/test-requirements.txt -commands = stestr run --slowest {posargs} - -[testenv:py39] -basepython = python3.9 -deps = -r{toxinidir}/test-requirements.txt -commands = stestr run --slowest {posargs} - [testenv:py310] basepython = python3.10 deps = -r{toxinidir}/test-requirements.txt @@ -91,7 +74,7 @@ commands = stestr run --slowest {posargs} [testenv:pep8] basepython = python3 deps = flake8==3.9.2 - charm-tools==2.8.3 + git+https://github.com/juju/charm-tools.git commands = flake8 {posargs} src unit_tests [testenv:func-target]