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
- Add charmbuild to .zuul.yaml
- Add py312 test to tox.ini
- Update flake8 to 7.1.1
- Fix unit test formatting

Change-Id: I7b228a8d89ac7bf61dbfd7416617d79e3f92aa39
This commit is contained in:
Myles Penner 2024-09-05 17:27:59 +00:00
parent 000e53df53
commit 3c2916c236
11 changed files with 42 additions and 548 deletions

View File

@ -1,4 +1,9 @@
- project:
templates:
- openstack-python3-charm-jobs
- openstack-cover-jobs
- openstack-cover-jobs
check:
jobs:
- charmbuild
vars:
charm_build_name: neutron-dynamic-routing

View File

@ -15,42 +15,23 @@ parts:
- rustc
- cargo
build-snaps:
- charm
- charm/latest/edge
build-environment:
- CHARM_INTERFACES_DIR: $CRAFT_PROJECT_DIR/interfaces/
- CHARM_LAYERS_DIR: $CRAFT_PROJECT_DIR/layers/
- MAKEFLAGS: -j$(nproc)
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

View File

@ -13,7 +13,7 @@
needs_charm_build: true
charm_build_name: neutron-dynamic-routing
build_type: charmcraft
charmcraft_channel: 2.x/stable
charmcraft_channel: 3.x/stable
- job:
name: jammy-caracal-ovn

View File

@ -6,8 +6,6 @@ description: |
networks to the BGP infrastructure.
tags:
- openstack
series:
- jammy
subordinate: false
extra-bindings:
# Used to specify the OpenStack provider network interface

View File

@ -1,248 +0,0 @@
local_overlay_enabled: False
variables:
openstack-origin: &openstack-origin cloud:jammy-bobcat
series: jammy
comment:
- 'machines section to decide order of deployment. database sooner = faster'
machines:
'0':
constraints: mem=3072M
'1':
constraints: mem=3072M
'2':
constraints: mem=3072M
'3':
'4':
'5':
'6':
'7':
# osci-frr has a limited set of supported series.
series: jammy
'8':
applications:
keystone-mysql-router:
charm: ch:mysql-router
channel: latest/edge
neutron-api-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
placement-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
keystone:
charm: ch:keystone
num_units: 1
options:
openstack-origin: *openstack-origin
haproxy-server-timeout: 90000
haproxy-client-timeout: 90000
haproxy-queue-timeout: 9000
haproxy-connect-timeout: 9000
to:
- '3'
channel: 2024.1/edge
neutron-api:
charm: ch:neutron-api
num_units: 1
options:
manage-neutron-plugin-legacy-mode: true
neutron-plugin: ovs
flat-network-providers: physnet1
enable-ml2-port-security: True
neutron-security-groups: True
openstack-origin: *openstack-origin
haproxy-server-timeout: 90000
haproxy-client-timeout: 90000
haproxy-queue-timeout: 9000
haproxy-connect-timeout: 9000
enable-dvr: True
to:
- '4'
channel: 2024.1/edge
neutron-dynamic-routing:
charm: ../../../neutron-dynamic-routing_ubuntu-22.04-amd64.charm
num_units: 1
options:
openstack-origin: *openstack-origin
to:
- '5'
rabbitmq-server:
charm: ch:rabbitmq-server
num_units: 1
to:
- '6'
channel: latest/edge
osci-frr:
charm: ch:osci-frr
series: jammy
num_units: 1
to:
- '7'
vault:
charm: ch:vault
num_units: 1
channel: latest/edge
to:
- '8'
nova-compute:
constraints: mem=7168M
charm: ch:nova-compute
num_units: 2
options:
openstack-origin: *openstack-origin
debug: True
channel: 2024.1/edge
nova-cloud-controller:
charm: ch:nova-cloud-controller
num_units: 1
options:
openstack-origin: *openstack-origin
debug: True
network-manager: Neutron
channel: 2024.1/edge
placement:
charm: ch:placement
num_units: 1
constraints: mem=1G
options:
openstack-origin: *openstack-origin
debug: true
channel: 2024.1/edge
glance:
charm: ch:glance
num_units: 1
options:
openstack-origin: *openstack-origin
channel: 2024.1/edge
neutron-openvswitch:
charm: ch:neutron-openvswitch
num_units: 0
options:
debug: True
enable-local-dhcp-and-metadata: True
use-dvr-snat: True
bridge-mappings: physnet1:br-ex
prevent-arp-spoofing: False
firewall-driver: openvswitch
channel: 2024.1/edge
relations:
- - 'neutron-dynamic-routing:amqp'
- 'rabbitmq-server:amqp'
- - 'neutron-dynamic-routing:bgp-speaker'
- 'osci-frr:bgpclient'
- - 'keystone:shared-db'
- 'keystone-mysql-router:shared-db'
- - 'keystone-mysql-router:db-router'
- 'mysql-innodb-cluster:db-router'
- - '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'
- - 'neutron-api:identity-service'
- 'keystone:identity-service'
- - 'nova-mysql-router:db-router'
- 'mysql-innodb-cluster:db-router'
- - 'glance-mysql-router:db-router'
- 'mysql-innodb-cluster:db-router'
- - 'placement-mysql-router:db-router'
- 'mysql-innodb-cluster:db-router'
- - keystone:identity-service
- glance:identity-service
- - nova-mysql-router:shared-db
- nova-cloud-controller:shared-db
- - glance:image-service
- nova-cloud-controller:image-service
- - glance:image-service
- nova-compute:image-service
- - glance-mysql-router:shared-db
- glance:shared-db
- - keystone:identity-service
- nova-cloud-controller:identity-service
- - nova-compute:cloud-compute
- nova-cloud-controller:cloud-compute
- - neutron-api:neutron-api
- nova-cloud-controller:neutron-api
- - rabbitmq-server:amqp
- nova-cloud-controller:amqp
- - rabbitmq-server:amqp
- nova-compute:amqp
- - placement
- placement-mysql-router
- - placement
- keystone
- - placement
- nova-cloud-controller
- - vault:certificates
- keystone:certificates
- - vault:certificates
- neutron-api:certificates
- - vault:certificates
- glance:certificates
- - vault:certificates
- nova-cloud-controller:certificates
- - vault:certificates
- placement:certificates
- - rabbitmq-server:amqp
- neutron-openvswitch:amqp
- - neutron-api:neutron-plugin-api
- neutron-openvswitch:neutron-plugin-api
- - neutron-openvswitch:neutron-plugin
- nova-compute:neutron-plugin

View File

@ -1,248 +0,0 @@
local_overlay_enabled: False
variables:
openstack-origin: &openstack-origin cloud:jammy-caracal
series: jammy
comment:
- 'machines section to decide order of deployment. database sooner = faster'
machines:
'0':
constraints: mem=3072M
'1':
constraints: mem=3072M
'2':
constraints: mem=3072M
'3':
'4':
'5':
'6':
'7':
# osci-frr has a limited set of supported series.
series: jammy
'8':
applications:
keystone-mysql-router:
charm: ch:mysql-router
channel: latest/edge
neutron-api-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
placement-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
keystone:
charm: ch:keystone
num_units: 1
options:
openstack-origin: *openstack-origin
haproxy-server-timeout: 90000
haproxy-client-timeout: 90000
haproxy-queue-timeout: 9000
haproxy-connect-timeout: 9000
to:
- '3'
channel: 2024.1/edge
neutron-api:
charm: ch:neutron-api
num_units: 1
options:
manage-neutron-plugin-legacy-mode: true
neutron-plugin: ovs
flat-network-providers: physnet1
enable-ml2-port-security: True
neutron-security-groups: True
openstack-origin: *openstack-origin
haproxy-server-timeout: 90000
haproxy-client-timeout: 90000
haproxy-queue-timeout: 9000
haproxy-connect-timeout: 9000
enable-dvr: True
to:
- '4'
channel: 2024.1/edge
neutron-dynamic-routing:
charm: ../../../neutron-dynamic-routing_ubuntu-22.04-amd64.charm
num_units: 1
options:
openstack-origin: *openstack-origin
to:
- '5'
rabbitmq-server:
charm: ch:rabbitmq-server
num_units: 1
to:
- '6'
channel: latest/edge
osci-frr:
charm: ch:osci-frr
series: jammy
num_units: 1
to:
- '7'
vault:
charm: ch:vault
num_units: 1
channel: latest/edge
to:
- '8'
nova-compute:
constraints: mem=7168M
charm: ch:nova-compute
num_units: 2
options:
openstack-origin: *openstack-origin
debug: True
channel: 2024.1/edge
nova-cloud-controller:
charm: ch:nova-cloud-controller
num_units: 1
options:
openstack-origin: *openstack-origin
debug: True
network-manager: Neutron
channel: 2024.1/edge
placement:
charm: ch:placement
num_units: 1
constraints: mem=1G
options:
openstack-origin: *openstack-origin
debug: true
channel: 2024.1/edge
glance:
charm: ch:glance
num_units: 1
options:
openstack-origin: *openstack-origin
channel: 2024.1/edge
neutron-openvswitch:
charm: ch:neutron-openvswitch
num_units: 0
options:
debug: True
enable-local-dhcp-and-metadata: True
use-dvr-snat: True
bridge-mappings: physnet1:br-ex
prevent-arp-spoofing: False
firewall-driver: openvswitch
channel: 2024.1/edge
relations:
- - 'neutron-dynamic-routing:amqp'
- 'rabbitmq-server:amqp'
- - 'neutron-dynamic-routing:bgp-speaker'
- 'osci-frr:bgpclient'
- - 'keystone:shared-db'
- 'keystone-mysql-router:shared-db'
- - 'keystone-mysql-router:db-router'
- 'mysql-innodb-cluster:db-router'
- - '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'
- - 'neutron-api:identity-service'
- 'keystone:identity-service'
- - 'nova-mysql-router:db-router'
- 'mysql-innodb-cluster:db-router'
- - 'glance-mysql-router:db-router'
- 'mysql-innodb-cluster:db-router'
- - 'placement-mysql-router:db-router'
- 'mysql-innodb-cluster:db-router'
- - keystone:identity-service
- glance:identity-service
- - nova-mysql-router:shared-db
- nova-cloud-controller:shared-db
- - glance:image-service
- nova-cloud-controller:image-service
- - glance:image-service
- nova-compute:image-service
- - glance-mysql-router:shared-db
- glance:shared-db
- - keystone:identity-service
- nova-cloud-controller:identity-service
- - nova-compute:cloud-compute
- nova-cloud-controller:cloud-compute
- - neutron-api:neutron-api
- nova-cloud-controller:neutron-api
- - rabbitmq-server:amqp
- nova-cloud-controller:amqp
- - rabbitmq-server:amqp
- nova-compute:amqp
- - placement
- placement-mysql-router
- - placement
- keystone
- - placement
- nova-cloud-controller
- - vault:certificates
- keystone:certificates
- - vault:certificates
- neutron-api:certificates
- - vault:certificates
- glance:certificates
- - vault:certificates
- nova-cloud-controller:certificates
- - vault:certificates
- placement:certificates
- - rabbitmq-server:amqp
- neutron-openvswitch:amqp
- - neutron-api:neutron-plugin-api
- neutron-openvswitch:neutron-plugin-api
- - neutron-openvswitch:neutron-plugin
- nova-compute:neutron-plugin

View File

@ -61,7 +61,7 @@ applications:
haproxy-connect-timeout: 9000
to:
- '3'
channel: 2024.1/edge
channel: latest/edge
neutron-api:
charm: ch:neutron-api
@ -80,7 +80,7 @@ applications:
enable-dvr: True
to:
- '4'
channel: 2024.1/edge
channel: latest/edge
neutron-dynamic-routing:
charm: ../../../neutron-dynamic-routing_ubuntu-22.04-amd64.charm
@ -118,7 +118,7 @@ applications:
options:
openstack-origin: *openstack-origin
debug: True
channel: 2024.1/edge
channel: latest/edge
nova-cloud-controller:
charm: ch:nova-cloud-controller
@ -127,7 +127,7 @@ applications:
openstack-origin: *openstack-origin
debug: True
network-manager: Neutron
channel: 2024.1/edge
channel: latest/edge
placement:
charm: ch:placement
@ -136,14 +136,14 @@ applications:
options:
openstack-origin: *openstack-origin
debug: true
channel: 2024.1/edge
channel: latest/edge
glance:
charm: ch:glance
num_units: 1
options:
openstack-origin: *openstack-origin
channel: 2024.1/edge
channel: latest/edge
neutron-openvswitch:
charm: ch:neutron-openvswitch
@ -155,7 +155,7 @@ applications:
bridge-mappings: physnet1:br-ex
prevent-arp-spoofing: False
firewall-driver: openvswitch
channel: 2024.1/edge
channel: latest/edge
relations:

View File

@ -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]

View File

@ -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.
setuptools<50.0.0 # https://github.com/pypa/setuptools/commit/04e3df22df840c6bb244e9b27bc56750c44b7c85
stestr>=2.2.0

15
tox.ini
View File

@ -50,20 +50,27 @@ 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: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}
[testenv:py312]
basepython = python3.12
deps =
-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:pep8]
basepython = python3
deps = flake8==3.9.2
deps = flake8==7.1.1
git+https://github.com/juju/charm-tools.git
commands = flake8 {posargs} src unit_tests
@ -72,7 +79,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 =

View File

@ -78,7 +78,7 @@ class TestDRAgentCharm(Helper):
with mock.patch('charms_openstack.charm.OpenStackCharm.'
'get_os_codename_package',
return_value=codename) as mock_get_os_codename:
self.assertEquals(dra.get_os_codename(), codename)
self.assertEqual(dra.get_os_codename(), codename)
mock_get_os_codename.assert_called_with(
dra.release_pkg, dra.package_codenames
)