From 16b009d74397983e07a77735c25ba62f5717711a Mon Sep 17 00:00:00 2001 From: Corey Bryant Date: Tue, 18 Jul 2023 16:47:18 -0400 Subject: [PATCH] Add 2023.2 Bobcat support * sync charm-helpers to classic charms * change openstack-origin/source default to bobcat * add mantic to metadata series * align testing with bobcat * add new bobcat bundles * add bobcat bundles to tests.yaml * add bobcat tests to osci.yaml * update build-on and run-on bases * drop kinetic * update charmcraft_channel to 2.x/stable Change-Id: I6893deebdd105fb794dc06907b9366354d3e4ce0 --- charmcraft.yaml | 6 +- charmhelpers/contrib/openstack/cert_utils.py | 11 +++ charmhelpers/contrib/openstack/context.py | 4 ++ .../templates/section-keystone-authtoken | 2 + .../section-keystone-authtoken-mitaka | 2 + .../openstack/templates/section-service-user | 4 +- .../templates/wsgi-openstack-api.conf | 6 ++ .../templates/wsgi-openstack-metadata.conf | 6 ++ charmhelpers/contrib/openstack/utils.py | 1 + charmhelpers/core/host_factory/ubuntu.py | 1 + charmhelpers/fetch/ubuntu.py | 10 +++ config.yaml | 2 +- metadata.yaml | 2 +- osci.yaml | 2 +- .../{jammy-zed.yaml => jammy-bobcat.yaml} | 2 +- tests/bundles/mantic-bobcat.yaml | 70 +++++++++++++++++++ tests/tests.yaml | 8 ++- 17 files changed, 127 insertions(+), 12 deletions(-) rename tests/bundles/{jammy-zed.yaml => jammy-bobcat.yaml} (95%) create mode 100644 tests/bundles/mantic-bobcat.yaml diff --git a/charmcraft.yaml b/charmcraft.yaml index de5ce246..58e7c161 100644 --- a/charmcraft.yaml +++ b/charmcraft.yaml @@ -32,9 +32,9 @@ bases: - name: ubuntu channel: "22.04" architectures: [amd64, s390x, ppc64el, arm64] - - name: ubuntu - channel: "22.10" - architectures: [amd64, s390x, ppc64el, arm64] - name: ubuntu channel: "23.04" architectures: [amd64, s390x, ppc64el, arm64] + - name: ubuntu + channel: "23.10" + architectures: [amd64, s390x, ppc64el, arm64] diff --git a/charmhelpers/contrib/openstack/cert_utils.py b/charmhelpers/contrib/openstack/cert_utils.py index 5c961c58..a25ca995 100644 --- a/charmhelpers/contrib/openstack/cert_utils.py +++ b/charmhelpers/contrib/openstack/cert_utils.py @@ -409,6 +409,9 @@ def get_requests_for_local_unit(relation_name=None): relation_name = relation_name or 'certificates' bundles = [] for rid in relation_ids(relation_name): + sent = relation_get(rid=rid, unit=local_unit()) + legacy_keys = ['certificate_name', 'common_name'] + is_legacy_request = set(sent).intersection(legacy_keys) for unit in related_units(rid): data = relation_get(rid=rid, unit=unit) if data.get(raw_certs_key): @@ -416,6 +419,14 @@ def get_requests_for_local_unit(relation_name=None): 'ca': data['ca'], 'chain': data.get('chain'), 'certs': json.loads(data[raw_certs_key])}) + elif is_legacy_request: + bundles.append({ + 'ca': data['ca'], + 'chain': data.get('chain'), + 'certs': {sent['common_name']: + {'cert': data.get(local_name + '.server.cert'), + 'key': data.get(local_name + '.server.key')}}}) + return bundles diff --git a/charmhelpers/contrib/openstack/context.py b/charmhelpers/contrib/openstack/context.py index d894b6a6..24a13d0d 100644 --- a/charmhelpers/contrib/openstack/context.py +++ b/charmhelpers/contrib/openstack/context.py @@ -1748,6 +1748,9 @@ class WSGIWorkerConfigContext(WorkerConfigContext): def __call__(self): total_processes = _calculate_workers() + enable_wsgi_rotation = config('wsgi-rotation') + if enable_wsgi_rotation is None: + enable_wsgi_rotation = True ctxt = { "service_name": self.service_name, "user": self.user, @@ -1761,6 +1764,7 @@ class WSGIWorkerConfigContext(WorkerConfigContext): "public_processes": int(math.ceil(self.public_process_weight * total_processes)), "threads": 1, + "wsgi_rotation": enable_wsgi_rotation, } return ctxt diff --git a/charmhelpers/contrib/openstack/templates/section-keystone-authtoken b/charmhelpers/contrib/openstack/templates/section-keystone-authtoken index dbad506f..aef5edd8 100644 --- a/charmhelpers/contrib/openstack/templates/section-keystone-authtoken +++ b/charmhelpers/contrib/openstack/templates/section-keystone-authtoken @@ -12,6 +12,8 @@ signing_dir = {{ signing_dir }} {% if service_type -%} service_type = {{ service_type }} {% endif -%} +{% if admin_role -%} service_token_roles = {{ admin_role }} service_token_roles_required = True {% endif -%} +{% endif -%} diff --git a/charmhelpers/contrib/openstack/templates/section-keystone-authtoken-mitaka b/charmhelpers/contrib/openstack/templates/section-keystone-authtoken-mitaka index 139a0512..31c21b4a 100644 --- a/charmhelpers/contrib/openstack/templates/section-keystone-authtoken-mitaka +++ b/charmhelpers/contrib/openstack/templates/section-keystone-authtoken-mitaka @@ -22,6 +22,8 @@ signing_dir = {{ signing_dir }} {% if use_memcache == true %} memcached_servers = {{ memcache_url }} {% endif -%} +{% if admin_role -%} service_token_roles = {{ admin_role }} service_token_roles_required = True {% endif -%} +{% endif -%} diff --git a/charmhelpers/contrib/openstack/templates/section-service-user b/charmhelpers/contrib/openstack/templates/section-service-user index c740cc28..ff454086 100644 --- a/charmhelpers/contrib/openstack/templates/section-service-user +++ b/charmhelpers/contrib/openstack/templates/section-service-user @@ -3,8 +3,8 @@ send_service_user_token = true auth_type = password auth_url = {{ auth_protocol }}://{{ auth_host }}:{{ auth_port }} -project_domain_id = default -user_domain_id = default +project_domain_name = service_domain +user_domain_name = service_domain project_name = {{ admin_tenant_name }} username = {{ admin_user }} password = {{ admin_password }} diff --git a/charmhelpers/contrib/openstack/templates/wsgi-openstack-api.conf b/charmhelpers/contrib/openstack/templates/wsgi-openstack-api.conf index 6c4e37e4..2cb735e9 100644 --- a/charmhelpers/contrib/openstack/templates/wsgi-openstack-api.conf +++ b/charmhelpers/contrib/openstack/templates/wsgi-openstack-api.conf @@ -12,6 +12,12 @@ Listen {{ admin_port }} Listen {{ public_port }} {% endif -%} +{% if wsgi_rotation -%} +WSGISocketRotation On +{% else -%} +WSGISocketRotation Off +{% endif -%} + {% if port -%} WSGIDaemonProcess {{ service_name }} processes={{ processes }} threads={{ threads }} user={{ user }} group={{ group }} \ diff --git a/charmhelpers/contrib/openstack/templates/wsgi-openstack-metadata.conf b/charmhelpers/contrib/openstack/templates/wsgi-openstack-metadata.conf index 6c4e37e4..2cb735e9 100644 --- a/charmhelpers/contrib/openstack/templates/wsgi-openstack-metadata.conf +++ b/charmhelpers/contrib/openstack/templates/wsgi-openstack-metadata.conf @@ -12,6 +12,12 @@ Listen {{ admin_port }} Listen {{ public_port }} {% endif -%} +{% if wsgi_rotation -%} +WSGISocketRotation On +{% else -%} +WSGISocketRotation Off +{% endif -%} + {% if port -%} WSGIDaemonProcess {{ service_name }} processes={{ processes }} threads={{ threads }} user={{ user }} group={{ group }} \ diff --git a/charmhelpers/contrib/openstack/utils.py b/charmhelpers/contrib/openstack/utils.py index 83b6884b..e98be2c5 100644 --- a/charmhelpers/contrib/openstack/utils.py +++ b/charmhelpers/contrib/openstack/utils.py @@ -160,6 +160,7 @@ OPENSTACK_CODENAMES = OrderedDict([ ('2022.1', 'yoga'), ('2022.2', 'zed'), ('2023.1', 'antelope'), + ('2023.2', 'bobcat'), ]) # The ugly duckling - must list releases oldest to newest diff --git a/charmhelpers/core/host_factory/ubuntu.py b/charmhelpers/core/host_factory/ubuntu.py index a279d5be..732d76c3 100644 --- a/charmhelpers/core/host_factory/ubuntu.py +++ b/charmhelpers/core/host_factory/ubuntu.py @@ -32,6 +32,7 @@ UBUNTU_RELEASES = ( 'jammy', 'kinetic', 'lunar', + 'mantic', ) diff --git a/charmhelpers/fetch/ubuntu.py b/charmhelpers/fetch/ubuntu.py index 1bad0db8..1be992c4 100644 --- a/charmhelpers/fetch/ubuntu.py +++ b/charmhelpers/fetch/ubuntu.py @@ -238,6 +238,14 @@ CLOUD_ARCHIVE_POCKETS = { 'antelope/proposed': 'jammy-proposed/antelope', 'jammy-antelope/proposed': 'jammy-proposed/antelope', 'jammy-proposed/antelope': 'jammy-proposed/antelope', + # bobcat + 'bobcat': 'jammy-updates/bobcat', + 'jammy-bobcat': 'jammy-updates/bobcat', + 'jammy-bobcat/updates': 'jammy-updates/bobcat', + 'jammy-updates/bobcat': 'jammy-updates/bobcat', + 'bobcat/proposed': 'jammy-proposed/bobcat', + 'jammy-bobcat/proposed': 'jammy-proposed/bobcat', + 'jammy-proposed/bobcat': 'jammy-proposed/bobcat', # OVN 'focal-ovn-22.03': 'focal-updates/ovn-22.03', @@ -270,6 +278,7 @@ OPENSTACK_RELEASES = ( 'yoga', 'zed', 'antelope', + 'bobcat', ) @@ -298,6 +307,7 @@ UBUNTU_OPENSTACK_RELEASE = OrderedDict([ ('jammy', 'yoga'), ('kinetic', 'zed'), ('lunar', 'antelope'), + ('mantic', 'bobcat'), ]) diff --git a/config.yaml b/config.yaml index 05c4c6c5..ea646a49 100644 --- a/config.yaml +++ b/config.yaml @@ -18,7 +18,7 @@ options: Setting this to True will allow supporting services to log to syslog. openstack-origin: type: string - default: antelope + default: bobcat description: | Repository from which to install. May be one of the following: distro (default), ppa:somecustom/ppa, a deb url sources entry, diff --git a/metadata.yaml b/metadata.yaml index d1db15ea..295f0a84 100644 --- a/metadata.yaml +++ b/metadata.yaml @@ -12,8 +12,8 @@ tags: - misc series: - jammy -- kinetic - lunar +- mantic extra-bindings: public: admin: diff --git a/osci.yaml b/osci.yaml index e90a28e2..504e3b47 100644 --- a/osci.yaml +++ b/osci.yaml @@ -6,4 +6,4 @@ needs_charm_build: true charm_build_name: keystone build_type: charmcraft - charmcraft_channel: 2.1/stable + charmcraft_channel: 2.x/stable diff --git a/tests/bundles/jammy-zed.yaml b/tests/bundles/jammy-bobcat.yaml similarity index 95% rename from tests/bundles/jammy-zed.yaml rename to tests/bundles/jammy-bobcat.yaml index e3112ef2..2fea5645 100644 --- a/tests/bundles/jammy-zed.yaml +++ b/tests/bundles/jammy-bobcat.yaml @@ -1,5 +1,5 @@ variables: - openstack-origin: &openstack-origin cloud:jammy-zed + openstack-origin: &openstack-origin cloud:jammy-bobcat series: jammy diff --git a/tests/bundles/mantic-bobcat.yaml b/tests/bundles/mantic-bobcat.yaml new file mode 100644 index 00000000..49575181 --- /dev/null +++ b/tests/bundles/mantic-bobcat.yaml @@ -0,0 +1,70 @@ +variables: + openstack-origin: &openstack-origin distro + +series: mantic + +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': + +applications: + + glance-mysql-router: + charm: ch:mysql-router + channel: latest/edge + keystone-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: ../../keystone.charm + num_units: 3 + options: + openstack-origin: *openstack-origin + token-provider: 'fernet' + token-expiration: 300 + to: + - '3' + - '4' + - '5' + + glance: + charm: ch:glance + num_units: 1 + options: + openstack-origin: *openstack-origin + to: + - '6' + channel: latest/edge + +relations: + + - - 'keystone:shared-db' + - 'keystone-mysql-router:shared-db' + - - 'glance:shared-db' + - 'glance-mysql-router:shared-db' + - - 'glance:identity-service' + - 'keystone:identity-service' + - - 'glance-mysql-router:db-router' + - 'mysql-innodb-cluster:db-router' + - - 'keystone-mysql-router:db-router' + - 'mysql-innodb-cluster:db-router' diff --git a/tests/tests.yaml b/tests/tests.yaml index 3673ea6e..43d79cdb 100644 --- a/tests/tests.yaml +++ b/tests/tests.yaml @@ -1,14 +1,15 @@ charm_name: keystone smoke_bundles: -- jammy-zed +- jammy-antelope gate_bundles: -- jammy-zed +- jammy-antelope dev_bundles: -- jammy-antelope +- jammy-bobcat - lunar-antelope +- mantic-bobcat comment: | the glance configure job validates operation of identity-service relation. @@ -40,6 +41,7 @@ tests_options: service: keystone force_deploy: - lunar-antelope + - mantic-bobcat target_deploy_status: vault: workload-status: blocked