From 9fbd4e3ae66655fa2a67be1399964ba8355a934f Mon Sep 17 00:00:00 2001 From: Corey Bryant Date: Fri, 10 Jun 2022 20:14:48 +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 unit tests * sync tox.ini and requirements.txt for ruamel * use charmcraft_channel 2.0/stable Change-Id: I2cb698f719106e54b06009f24ea47259419e9cad --- .zuul.yaml | 2 +- bindep.txt | 4 + charmcraft.yaml | 73 ++++++++++++------- osci.yaml | 4 +- src/metadata.yaml | 2 +- src/tests/bundles/jammy-yoga.yaml | 11 +-- .../{focal-yoga.yaml => jammy-zed.yaml} | 23 +++--- .../{focal-xena.yaml => kinetic-zed.yaml} | 22 +++--- src/tests/tests.yaml | 11 ++- test-requirements.txt | 18 +---- tox.ini | 21 +----- 11 files changed, 92 insertions(+), 99 deletions(-) create mode 100644 bindep.txt rename src/tests/bundles/{focal-yoga.yaml => jammy-zed.yaml} (87%) rename src/tests/bundles/{focal-xena.yaml => kinetic-zed.yaml} (88%) 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 ceedebb..f14cf25 100644 --- a/charmcraft.yaml +++ b/charmcraft.yaml @@ -13,6 +13,8 @@ parts: - rustc - cargo build-environment: + - CHARM_INTERFACES_DIR: /root/project/interfaces/ + - CHARM_LAYERS_DIR: /root/project/layers/ - MAKEFLAGS: -j$(nproc) override-build: | apt-get install ca-certificates -y @@ -27,30 +29,51 @@ parts: cp -r $CRAFT_STAGE/* . # Charmcraft looks for this specific entry point. mkdir -p src - ln -sf ../hooks/start src/charm.py + touch src/charm.py + chmod +x src/charm.py bases: - - name: ubuntu - channel: "20.04" - architectures: [amd64] - - name: ubuntu - channel: "20.04" - architectures: [arm64] - - name: ubuntu - channel: "20.04" - architectures: [ppc64el] - - name: ubuntu - channel: "20.04" - architectures: [s390x] - - name: ubuntu - channel: "22.04" - architectures: [amd64] - - name: ubuntu - channel: "22.04" - architectures: [arm64] - - name: ubuntu - channel: "22.04" - architectures: [ppc64el] - - name: ubuntu - channel: "22.04" - architectures: [s390x] + - build-on: + - name: ubuntu + channel: "22.04" + architectures: [amd64] + run-on: + - name: ubuntu + channel: "22.04" + architectures: [amd64] + - name: ubuntu + channel: "22.10" + 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] + - 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] + - 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] diff --git a/osci.yaml b/osci.yaml index 0653b4e..4cb329d 100644 --- a/osci.yaml +++ b/osci.yaml @@ -1,9 +1,7 @@ - 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: octavia-diskimage-retrofit diff --git a/src/metadata.yaml b/src/metadata.yaml index 50f02b6..8dc042c 100644 --- a/src/metadata.yaml +++ b/src/metadata.yaml @@ -6,8 +6,8 @@ description: | tags: - openstack series: -- focal - jammy +- kinetic subordinate: true requires: juju-info: diff --git a/src/tests/bundles/jammy-yoga.yaml b/src/tests/bundles/jammy-yoga.yaml index 946592b..fe50ebe 100644 --- a/src/tests/bundles/jammy-yoga.yaml +++ b/src/tests/bundles/jammy-yoga.yaml @@ -46,7 +46,7 @@ applications: openstack-origin: *openstack-origin to: - '3' - channel: yoga/edge + channel: latest/edge glance: charm: ch:glance @@ -55,7 +55,7 @@ applications: openstack-origin: *openstack-origin to: - '4' - channel: yoga/edge + channel: latest/edge glance-simplestreams-sync: charm: ch:glance-simplestreams-sync @@ -68,7 +68,7 @@ applications: path: 'streams/v1/index.sjson', max: 1, item_filters: [ - 'release~(focal|jammy)', + 'release~(jammy)', 'arch~(x86_64|amd64)', 'ftype~(disk1.img|disk.img)' ] @@ -98,11 +98,12 @@ applications: # }]" to: - '5' - channel: yoga/edge + channel: latest/edge octavia-diskimage-retrofit: - charm: ../../../octavia-diskimage-retrofit_ubuntu-22.04-amd64.charm + charm: ../../../octavia-diskimage-retrofit_ubuntu-22.04-amd64_ubuntu-22.10-amd64.charm options: + retrofit-uca-pocket: yoga retrofit-series: jammy relations: diff --git a/src/tests/bundles/focal-yoga.yaml b/src/tests/bundles/jammy-zed.yaml similarity index 87% rename from src/tests/bundles/focal-yoga.yaml rename to src/tests/bundles/jammy-zed.yaml index ef3dd5a..2968c04 100644 --- a/src/tests/bundles/focal-yoga.yaml +++ b/src/tests/bundles/jammy-zed.yaml @@ -1,9 +1,9 @@ variables: - openstack-origin: &openstack-origin cloud:focal-yoga + openstack-origin: &openstack-origin cloud:jammy-zed local_overlay_enabled: False -series: focal +series: jammy comment: - 'machines section to decide order of deployment. database sooner = faster' @@ -30,14 +30,14 @@ applications: - '0' - '1' - '2' - channel: 8.0/edge + channel: latest/edge keystone-mysql-router: charm: ch:mysql-router - channel: 8.0/edge + channel: latest/edge glance-mysql-router: charm: ch:mysql-router - channel: 8.0/edge + channel: latest/edge keystone: charm: ch:keystone @@ -46,7 +46,7 @@ applications: openstack-origin: *openstack-origin to: - '3' - channel: yoga/edge + channel: latest/edge glance: charm: ch:glance @@ -55,7 +55,7 @@ applications: openstack-origin: *openstack-origin to: - '4' - channel: yoga/edge + channel: latest/edge glance-simplestreams-sync: charm: ch:glance-simplestreams-sync @@ -68,7 +68,7 @@ applications: path: 'streams/v1/index.sjson', max: 1, item_filters: [ - 'release~(focal)', + 'release~(jammy)', 'arch~(x86_64|amd64)', 'ftype~(disk1.img|disk.img)' ] @@ -98,12 +98,13 @@ applications: # }]" to: - '5' - channel: yoga/edge + channel: latest/edge octavia-diskimage-retrofit: - charm: ../../../octavia-diskimage-retrofit_ubuntu-20.04-amd64.charm + charm: ../../../octavia-diskimage-retrofit_ubuntu-22.04-amd64_ubuntu-22.10-amd64.charm options: - retrofit-series: focal + retrofit-uca-pocket: zed + retrofit-series: jammy relations: diff --git a/src/tests/bundles/focal-xena.yaml b/src/tests/bundles/kinetic-zed.yaml similarity index 88% rename from src/tests/bundles/focal-xena.yaml rename to src/tests/bundles/kinetic-zed.yaml index 5428c24..195c422 100644 --- a/src/tests/bundles/focal-xena.yaml +++ b/src/tests/bundles/kinetic-zed.yaml @@ -1,9 +1,9 @@ variables: - openstack-origin: &openstack-origin cloud:focal-xena + openstack-origin: &openstack-origin distro local_overlay_enabled: False -series: focal +series: kinetic comment: - 'machines section to decide order of deployment. database sooner = faster' @@ -30,14 +30,14 @@ applications: - '0' - '1' - '2' - channel: 8.0/edge + channel: latest/edge keystone-mysql-router: charm: ch:mysql-router - channel: 8.0/edge + channel: latest/edge glance-mysql-router: charm: ch:mysql-router - channel: 8.0/edge + channel: latest/edge keystone: charm: ch:keystone @@ -46,7 +46,7 @@ applications: openstack-origin: *openstack-origin to: - '3' - channel: yoga/edge + channel: latest/edge glance: charm: ch:glance @@ -55,7 +55,7 @@ applications: openstack-origin: *openstack-origin to: - '4' - channel: yoga/edge + channel: latest/edge glance-simplestreams-sync: charm: ch:glance-simplestreams-sync @@ -68,7 +68,7 @@ applications: path: 'streams/v1/index.sjson', max: 1, item_filters: [ - 'release~(focal)', + 'release~(kinetic)', 'arch~(x86_64|amd64)', 'ftype~(disk1.img|disk.img)' ] @@ -98,12 +98,12 @@ applications: # }]" to: - '5' - channel: yoga/edge + channel: latest/edge octavia-diskimage-retrofit: - charm: ../../../octavia-diskimage-retrofit_ubuntu-20.04-amd64.charm + charm: ../../../octavia-diskimage-retrofit_ubuntu-22.04-amd64_ubuntu-22.10-amd64.charm options: - retrofit-series: focal + retrofit-series: kinetic relations: diff --git a/src/tests/tests.yaml b/src/tests/tests.yaml index 043253d..232cab7 100644 --- a/src/tests/tests.yaml +++ b/src/tests/tests.yaml @@ -1,15 +1,15 @@ charm_name: octavia-diskimage-retrofit 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: glance-simplestreams-sync: @@ -24,5 +24,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 0293ba2..6df34e5 100644 --- a/tox.ini +++ b/tox.ini @@ -19,10 +19,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 = @@ -54,21 +52,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 @@ -77,7 +60,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]