General Fixes

* Point at consilidated rock
* Add telemetry charms to functional test bundle
* Disable aodh-wsgi in api container
This commit is contained in:
Liam Young 2023-08-10 10:43:56 +00:00
parent d160bc68d0
commit 1a2e4ea4bc
4 changed files with 54 additions and 13 deletions

View File

@ -34,23 +34,23 @@ resources:
aodh-api-image: aodh-api-image:
type: oci-image type: oci-image
description: OCI image for OpenStack aodh description: OCI image for OpenStack aodh
upstream-source: kolla/ubuntu-binary-aodh-notifier:yoga upstream-source: ghcr.io/openstack-snaps/aodh-consolidated:2023.1
aodh-evaluator-image: aodh-evaluator-image:
type: oci-image type: oci-image
description: OCI image for OpenStack aodh description: OCI image for OpenStack aodh
upstream-source: kolla/ubuntu-binary-aodh-evaluator:yoga upstream-source: ghcr.io/openstack-snaps/aodh-consolidated:2023.1
aodh-notifier-image: aodh-notifier-image:
type: oci-image type: oci-image
description: OCI image for OpenStack aodh description: OCI image for OpenStack aodh
upstream-source: kolla/ubuntu-binary-aodh-notifier:yoga upstream-source: ghcr.io/openstack-snaps/aodh-consolidated:2023.1
aodh-listener-image: aodh-listener-image:
type: oci-image type: oci-image
description: OCI image for OpenStack aodh description: OCI image for OpenStack aodh
upstream-source: kolla/ubuntu-binary-aodh-listener:yoga upstream-source: ghcr.io/openstack-snaps/aodh-consolidated:2023.1
aodh-expirer-image: aodh-expirer-image:
type: oci-image type: oci-image
description: OCI image for OpenStack aodh description: OCI image for OpenStack aodh
upstream-source: kolla/ubuntu-binary-aodh-expirer:yoga upstream-source: ghcr.io/openstack-snaps/aodh-consolidated:2023.1
requires: requires:
database: database:

View File

@ -7,6 +7,7 @@ This charm provide Aodh services as part of an OpenStack deployment
import logging import logging
from typing import List from typing import List
import ops.pebble
import ops_sunbeam.charm as sunbeam_charm import ops_sunbeam.charm as sunbeam_charm
import ops_sunbeam.container_handlers as sunbeam_chandlers import ops_sunbeam.container_handlers as sunbeam_chandlers
import ops_sunbeam.core as sunbeam_core import ops_sunbeam.core as sunbeam_core
@ -22,6 +23,19 @@ AODH_LISTENER_CONTAINER = "aodh-listener"
AODH_EXPIRER_CONTAINER = "aodh-expirer" AODH_EXPIRER_CONTAINER = "aodh-expirer"
class AODHWSGIPebbleHandler(sunbeam_chandlers.WSGIPebbleHandler):
"""Pebble handler for AODH api service."""
def init_service(self, context) -> None:
"""Initialise the container."""
try:
self.execute(["a2dissite", "aodh-api"], exception_on_error=True)
except ops.pebble.ExecError:
logger.exception("Failed to disable aodh-api site in apache")
super().init_service(context)
class AODHEvaluatorPebbleHandler(sunbeam_chandlers.ServicePebbleHandler): class AODHEvaluatorPebbleHandler(sunbeam_chandlers.ServicePebbleHandler):
"""Pebble handler for AODH Evaluator.""" """Pebble handler for AODH Evaluator."""
@ -230,7 +244,7 @@ class AodhOperatorCharm(sunbeam_charm.OSBaseOperatorAPICharm):
# else: # else:
# enable_expirer = False # enable_expirer = False
pebble_handlers = [ pebble_handlers = [
sunbeam_chandlers.WSGIPebbleHandler( AODHWSGIPebbleHandler(
self, self,
AODH_WSGI_CONTAINER, AODH_WSGI_CONTAINER,
self.service_name, self.service_name,

View File

@ -40,17 +40,26 @@ applications:
storage: storage:
fernet-keys: 5M fernet-keys: 5M
credential-keys: 5M credential-keys: 5M
gnocchi:
charm: gnocchi-k8s
channel: edge
scale: 1
trust: true
ceilometer:
charm: ceilometer-k8s
channel: edge
scale: 1
trust: true
aodh: aodh:
charm: ../../aodh-k8s.charm charm: ../../aodh-k8s.charm
scale: 1 scale: 1
trust: true trust: true
resources: resources:
aodh-api-image: kolla/ubuntu-binary-aodh-notifier:yoga aodh-api-image: ghcr.io/openstack-snaps/aodh-consolidated:2023.1
aodh-evaluator-image: kolla/ubuntu-binary-aodh-evaluator:yoga aodh-evaluator-image: ghcr.io/openstack-snaps/aodh-consolidated:2023.1
aodh-notifier-image: kolla/ubuntu-binary-aodh-notifier:yoga aodh-notifier-image: ghcr.io/openstack-snaps/aodh-consolidated:2023.1
aodh-listener-image: kolla/ubuntu-binary-aodh-listener:yoga aodh-listener-image: ghcr.io/openstack-snaps/aodh-consolidated:2023.1
aodh-expirer-image: kolla/ubuntu-binary-aodh-expirer:yoga aodh-expirer-image: ghcr.io/openstack-snaps/aodh-consolidated:2023.1
relations: relations:
- - traefik:ingress - - traefik:ingress
@ -72,3 +81,17 @@ relations:
- - traefik-public:ingress - - traefik-public:ingress
- aodh:ingress-public - aodh:ingress-public
- - mysql:database
- gnocchi:database
- - traefik:ingress
- gnocchi:ingress-internal
- - traefik-public:ingress
- gnocchi:ingress-public
- - keystone:identity-service
- gnocchi:identity-service
- - rabbitmq:amqp
- ceilometer:amqp
- - keystone:identity-credentials
- ceilometer:identity-credentials

View File

@ -89,7 +89,11 @@ class TestAodhOperatorCharm(test_utils.CharmTestCase):
self.harness.set_leader() self.harness.set_leader()
test_utils.set_all_pebbles_ready(self.harness) test_utils.set_all_pebbles_ready(self.harness)
app_setup_cmds = [["a2ensite", "wsgi-aodh-api"], ["aodh-dbsync"]] app_setup_cmds = [
["a2ensite", "wsgi-aodh-api"],
["aodh-dbsync"],
["a2dissite", "aodh-api"],
]
for cmd in app_setup_cmds: for cmd in app_setup_cmds:
self.assertIn(cmd, self.container_calls.execute["aodh-api"]) self.assertIn(cmd, self.container_calls.execute["aodh-api"])