225 Commits

Author SHA1 Message Date
Zuul
b45eb8aac4 Merge "update container status once service is ready" into main 2022-11-17 10:02:02 +00:00
Hemanth Nakkina
8f422fa5a2 update container status once service is ready
Currently the container handler status is updated
only when update_status hook is triggered.
Update the status once the service is ready instead
of waiting for update_status hook.

Change-Id: I52cf06af03dd1807ee0097d7dd7fb8bc85e13781
2022-11-17 11:40:36 +05:30
Hemanth Nakkina
27ed6b3143 Check for KeyError when looking for remote data
Accessing relation data during departed or broken
events results in KeyError from ops framework.

KeyError: 'Cannot index relation data with "None".
Are you trying to access remote app data during a
relation-broken event? This is not allowed.'

Add KeyError whenever remote data is accessed.

Change-Id: I8515ed584caee7304b091b3e57d83c660ac5b296
2022-11-17 09:08:25 +05:30
Hemanth Nakkina
b89c573277 Change start_all() as a notion of public function
Some cases require restart of services after the
bootstrap is completed. The restart function _start_all()
is in notion of private function and so need to be
changed to notion of public.

Change-Id: I739fc762d30c1810bafd2261d62041d4678fa6fc
2022-11-04 10:44:27 +05:30
Liam Young
200957d633 Unused openstack_release option
Change-Id: I8a0b89dc227f9cbd1034e37b257e8c5ef905db3f
2022-11-03 13:13:17 +00:00
Liam Young
b222d31a61 Remove dependancy on charmhelpers
Change-Id: I24249121e53752f714f577eb954c3da1a4dd4923
2022-11-03 12:55:35 +00:00
Liam Young
004e885760 Add linters and formatting
Change-Id: Ib16bd1fac4b9dfc21b98c9ba1201305733d2598b
2022-11-03 12:26:01 +00:00
Zuul
bc200fc470 Merge "Display bootstrap status" into main 2022-11-02 14:18:42 +00:00
Liam Young
07230e3da5 Display bootstrap status
Add bootstrap status to compound status. Currently a charm will
advertise itself as active even if it is not bootstrapped.

Change-Id: Iec2e2ac37fbe723f3c7a457834d505ddb5146ff6
2022-11-02 13:10:43 +00:00
Peter Matulis
26a81303da Improve README
Change-Id: I932ce7b38d4065af00110e6a9a658bda719c7328
2022-11-02 07:26:39 -04:00
Liam Young
6025a5f4fd Add link to deploy howto
Change-Id: I4f87ac67996a063d5c1f5de1a77d4a2e60b216fa
2022-11-01 16:00:04 +00:00
Zuul
5bf86c354b Merge "ovn: refresh address data on every instantiation" into main 2022-10-28 09:06:41 +00:00
Liam Young
bb57142432 Switch to integration rather that relation
In line with the name change in Juju 3, switch the status message
to refer to intergration rather than relation.

Change-Id: Ia2b9bc8bdb083d041bbaa23059eef7a38127e1b8
2022-10-28 08:10:48 +00:00
Samuel Walladge
1517456e9a Add compound status for richer status msgs
Implement a pool of statuses,
define a status pool on the charm,
and set up some default opinionated statuses in the pool
for use by the main workload and the relations.

Change-Id: I1aa094138e66bffd02d1bbcce3db79c7fd4058c4
2022-10-28 08:30:34 +02:00
James Page
1d01cd2653 ovn: refresh address data on every instantiation
Ensure that any IP address changes are noticed and provided on
the ovsdb-cms relation - clients will need to update configuration
and restart services as needed.

Hostnames will not change.

Change-Id: I969f58fd40ab7f7651ce0af03ebd70def25f2ca1
2022-10-26 14:59:38 +02:00
James Page
193fe99c40 Restore use of address on OVN interfaces
Some clients can't use hostnames yet so expose both address and
hostname information on the ovsdb{-cms} interface type.

This supports backwards compatibility with the existing reactive
interfaces as well.

Change-Id: Iefe8ad601b305e3fdab7548e1d3357493491d3e9
2022-10-24 10:25:26 +01:00
James Page
9c552e6b3a Switch OVN relation handlers to use hostnames
Hostnames are resolvable under K8S and won't change when Pods
get refreshed during charm upgrades.

Rework OVN relation handlers to be hostname centric.

Note that this part of the codebase does not currently have
any test coverage.

Change-Id: Ief5c816ab5fbeb55aadf2b83697858f2ecb28807
2022-10-20 14:42:17 +01:00
Liam Young
55b3f97114 Only push config and restart files if data changed
Only push config and restart files if file contents have changed.

Change-Id: I4478ee10be06692bcc0118576c67dae29f0b9ae8
2022-10-19 10:05:44 +00:00
James Page
89ab0ba220 Fix incorrect import from sunbeam_ovn_central_operator
-> ovn_central_k8s

Change-Id: I127b978d302e78eab0c8c678a385e581ace25b26
2022-10-17 16:39:58 +01:00
James Page
985c974dda Update ovsdb interface owner
Pull ovsdb interface from ovn-central-k8s rather than sunbeam
POC charm.

Change-Id: I5acb14184caff42c802df62c56278040de05f4a1
2022-10-17 15:12:15 +01:00
Zuul
c04ff90f65 Merge "Use rehomed identity-service interface" into main 2022-10-17 10:43:05 +00:00
Zuul
70632097fd Merge "Misc fixes" into main 2022-10-17 10:31:35 +00:00
Zuul
ae1696a5f2 Merge "Use new rabbitmq-k8s operator and interfaces" into main 2022-10-17 10:15:03 +00:00
Zuul
e00120ad4d Merge "Use properly published cloud-credentials interface" into main 2022-10-17 10:13:54 +00:00
James Page
a584b82a4f Use rehomed identity-service interface
Use new rehomed identity-service interface from keystone-k8s.

Depends-On: I75dac5894f456d6b9de5aa10e43c0d1ebbcceda8
Change-Id: I5d043b0096dada205aef05e0ef903ed2f495618d
2022-10-17 10:34:40 +01:00
Samuel Walladge
0f7b0152f6 Get pebble ready status directly
This should be less error prone and more reliable
than storing the pebble status in stored state.

Also remove the PebbleHandler.ready attribute,
which appears to not be used.

Change-Id: I8028d6dff219b63472a6fb309040f79935add639
2022-10-17 09:07:38 +10:30
James Page
ffb6177be5 Use new rabbitmq-k8s operator and interfaces
Use renamed rabbitmq-k8s operator in bundles and the new rabbitmq
interface from the same operator in the codebase.

This will require an update to fetch-libs.sh for all charms
to rollout.

Change-Id: I53c8b9d1194895bdf6322cf8a256f32459aa76d7
2022-10-13 10:06:19 +01:00
James Page
6f0acf386c Use properly published cloud-credentials interface
The existing cloud-credentials interface was missing from the charmhub
and not correctly namespaced to the keystone-k8s charm.

Update to use the new published version.

Change-Id: Ibb8cfe50609173b23b408414ab8452f4d6bcd4ae
2022-10-13 10:03:12 +01:00
Liam Young
8ea8f2855a Start all services in a container
A container service layer is a dictionary of services so there
may be more than once service defintion. Account for this by
iterating of the services and starting each one in turn.

Change-Id: I4cba2e0cda156a6852e71059b0dc0cb1948ce9e6
2022-10-11 10:30:40 +00:00
James Page
e8605283e4 Misc fixes
Only run DB syncs on lead unit.

Ensure current event is passed to configure_charm method.

Change-Id: Ic706b866af365fde36cf4a665a2c26e952aedbe0
2022-10-07 16:25:20 +01:00
Liam Young
017e56809d Update test harness inline with ops.testing
Remove bespoke charm config handling as this can now be done in
ops.testing. Also update call to _TestingModelBackend to include
charm config.

Change-Id: I041ac4bfead12268c99c1773f0ca60f141e34047
2022-10-07 10:13:02 +00:00
Zuul
e1155dc9a8 Merge "Correct key name for service-user-name" into main 2022-09-29 03:40:56 +00:00
Hemanth Nakkina
303a49ba4b get pebble handlers for given list of containers
Add method to get a list of pebble handlers for
a given list of container names.

Change-Id: I209fa5a0aab33678c633283eeae3a66e6860dfec
2022-09-27 10:02:09 +05:30
Zuul
84cad21843 Merge "Add support for healthchecks" into main 2022-09-26 10:09:10 +00:00
Zuul
57468a8c9b Merge "Defer the event when bootstrap fails" into main 2022-09-26 10:08:20 +00:00
Zuul
22dd7aaa8b Merge "Update and add reference bundles for sunbeam" into main 2022-09-26 07:12:28 +00:00
Samuel Walladge
8cb40ad666 Update and add reference bundles for sunbeam
Change-Id: Ifb4c95fc30b49107322e09229d81de13ebd0650f
2022-09-26 16:27:49 +09:30
Hemanth Nakkina
cdf186793d Add support for healthchecks
Add healthchecks for WSGI, OVN services
Check healthcheck in update-status

Change-Id: I3df7026f18cdf5ad897f4dcf1d06a3c3f6fd80c4
2022-09-23 14:57:07 +05:30
Hemanth Nakkina
d36908e73b Defer the event when bootstrap fails
Currently when bootstrap fails, the exception
is caught and the event hook is considered as
successful. This patch defers the event when
bootstrap fails.

Change-Id: I03a028bb6f10ff5c180ee3be32be0b0f48a61a59
2022-09-23 07:57:08 +05:30
Samuel Walladge
c0a56f4928 Fix return types hints on get_app_data methods
Change-Id: I696ec38f2bba9963150a0450efefe24d37795e6f
2022-09-23 11:39:11 +09:30
Hemanth Nakkina
6a0d9ac42c Add mandatory flag to relation handlers
Following changes are done in this patch:
* Add mandatory flag to relations handler classes default
to False.
* Add mandatory_relations to charm base classes to list
all the mandatory relations.
* update relation_handlers_ready based on mandatory_relations

Change-Id: Ibc846461cf92a0a6501a15d03907c93ecdf90063
2022-09-22 13:27:08 +05:30
Samuel Walladge
45a7e17808 Fix import of library that may not be present
We can't silently ignore errors importing the ingress lib
_and_ refer to it in toplevel code.

So remove the top level 'optional' import,
and replace it with a non-optional inline import where it's used.
Also remove the type annotations
because these names may or may not be defined.

Change-Id: I45a285a929e70813c88ea1e11ef8085f7b96aaf9
2022-09-21 09:10:31 +09:30
James Page
9e69173ce2 Correct key name for service-user-name
username -> user-name

Change-Id: I0f5b98fae5a894343fbb21d6bea1e594dafb506f
2022-09-15 09:19:21 +01:00
Hemanth Nakkina
cd4621887a Update traefik ingress library to v1
Use traefik ingress v1 library for sunbeam
charms.

Change-Id: I74cdf90b736dccae198f680aaca74bd3fe3f4503
2022-09-13 18:14:55 +05:30
Samuel Walladge
7684a0db73 Switch to mysql-k8s for mysql db provider
Breaking changes for dependent charms:

- `self.db: str` has been removed in favour of
  `self.dbs: Mapping[str, str]` mapping relation names to dabatase names

- interface name for database has changed
  from mysql_datastore to mysql_client.

- The default database relation name has changed from `shared-db`
  to `database`.  We'll follow this convention in all dependent charms.

Change-Id: I750a8311c1e3db0b414207f712fa9061004b6920
2022-09-08 10:58:17 +09:30
Hemanth Nakkina
32caeb926b Doc update on how to deploy sunbeam charms
Document listing the steps to deploy sunbeam charms
Add sample sunbeam bundle file

Change-Id: I21021f47019fe91e85049ce302ea5fd8efa70966
2022-08-11 20:12:56 +05:30
Hemanth Nakkina
a43f830495 cleanup on migration to opendev
Remove references to old repo
Add .gitreview
Add .zuul.yaml

Change-Id: I66f0effc29d68564c01aaa0018786c9e04153552
2022-08-04 13:28:10 +05:30
Liam Young
75db3652ef Merge pull request #78 from hemanthnakkina/charm-dir
Change charm_dir path in test_utils
2022-07-27 08:17:05 +01:00
Hemanth Nakkina
3548bcb8e2 Change charm_dir path in test_utils
To restructure unit tests from <charm>/unit_tests to
<charm>/tests/unit the charm_dir variable should point
to top <charm> directory properly. This patch fixes
correct top <charm> directory path to restructure
unit tests.
2022-07-27 12:01:25 +05:30
Billy Olsen
84dfea3fc6 Merge pull request #76 from hemanthnakkina/cleanup
rename package names and code cleanup
2022-07-18 04:21:36 -07:00