88 Commits

Author SHA1 Message Date
Guillaume Boutry
4931ad53b9
[*-k8s] Migrate charm base to ubuntu@24.04
Update charm base to ubuntu@24.04 for all k8s based charms. Deploying
k8s charm is abstracted from the underlying host base, therefore we can
already deploy next generation based charms.

Change-Id: If8e8960a58a39f9978aaeec26ed4df4a2b690396
Signed-off-by: Guillaume Boutry <guillaume.boutry@canonical.com>
2024-10-09 09:23:37 +02:00
Guillaume Boutry
e911599abe
Migrate to unified charmcraft.yaml
Charmcraft 3 moves towards a single charmcraft.yaml, this is needed for
24.04 migration.

Change-Id: I743712752aaf37bf68730b64bd6c147dfad370e2
Signed-off-by: Guillaume Boutry <guillaume.boutry@canonical.com>
2024-10-08 09:38:10 +02:00
Guillaume Boutry
59898c7530
[*] update charm entrypoints
ops.main.main has been deprecated and superseded by `ops.main`.

Add # pragma no cover to the charm entrypoints to not count them in the
test coverage.

Change-Id: I5bc05d408db77ad806edbd66e806629cd5bc85b2
Signed-off-by: Guillaume Boutry <guillaume.boutry@canonical.com>
2024-10-07 11:11:43 +02:00
Hemanth Nakkina
f1ca790881
[OVN] fix cert_host template
Fix cert_host template to remove comments.

Closes-Bug: #2064202
Change-Id: If7ee91016c78d381bfa4f33e8032e7492ce64374
2024-09-12 18:21:38 +05:30
Guillaume Boutry
8c674de50e
[ops-sunbeam] Implement mypy linter
Implement mypy in the most non-breaking way possible. There's still some
changes of behavior that crept in, merely due to incorrect edge case
handling.

Charm libraries are generally well typed, include py.typed marker for
all of the libraries, to allow mypy analyzing their usage.

Change-Id: I7bda1913fa08dd4954a606526272ac80b45197cc
Signed-off-by: Guillaume Boutry <guillaume.boutry@canonical.com>
2024-08-13 18:56:33 +02:00
Guillaume Boutry
e5fb16d6b9
Implement tracing
Implement tracing relation for all the charms.
Instrument most of ops.Object objects, including relation handlers,
pebble handlers, and relation objects.

Change-Id: I967ff858a63aa7d30094cf5a46491fce11195060
Signed-off-by: Guillaume Boutry <guillaume.boutry@canonical.com>
2024-07-31 11:57:32 +02:00
Guillaume Boutry
16a65cf4e4
Refactor monorepo build-system
Introduce a per-charm configuration file `.sunbeam-build.yaml`,
containing information about needed external libraries, internal
libraries, and configuration templates.

Introduce new management script `repository.py`, responsible for
preparing, cleaning and updating libs.

Move all internal libraries back to their original charms. Each charm is
responsible of its own libraries.

Change-Id: I9edabed1c252cae60fcd945b931952aeaef12481
Signed-off-by: Guillaume Boutry <guillaume.boutry@canonical.com>
2024-07-08 21:51:09 +02:00
Guillaume Boutry
0214e8f173
[*-k8s] implement log forwarder
Implement LogForwardHandler for every k8s charm to forward service
stdout to logging provider.

Tempest-k8s is excluded  because it implements its own logging handler.

Change-Id: Iccc9f1f911acfaaecf733fe78cc4bc3191a231d5
Signed-off-by: Guillaume Boutry <guillaume.boutry@canonical.com>
2024-07-07 21:04:11 +02:00
Guillaume Boutry
ed4ed712bb
[tls-certificates] refactor tls certificate handler
This change refactors tls-certificates relation handler.
List of changes:
- Allow management of multiple tls certificates on the same relation
- Allow easier override of certificate signing request (csr)
- Enable certificate renewal on expiration / revokation
- Upgrade tls-certificates relation from v1 to v3

Change-Id: I4f6ac6a5570635388cc10131b34fbc6b422e1bca
Signed-off-by: Guillaume Boutry <guillaume.boutry@canonical.com>
2024-06-26 23:59:37 +02:00
Hemanth Nakkina
ff91274393
Remove bundles in the charms
Bundles are not necessary per charm.
Remove the bundles and tests.yaml

Change-Id: I4a855e055beaa85154d908976db92592ebd5aae3
2024-06-12 08:26:25 +05:30
Guillaume Boutry
bf43f5cf8d [keystone-k8s] remove configurability of admin-.../server-tenant options
These options creates more issues than they are solving. Removing
`admin-user`, `admin-role`, and `service-tenant` to ensure a standard
sunbeam deployment.

Rename the `Admin` to the default [1]` admin` role.

1: https://docs.openstack.org/keystone/2024.1/admin/service-api-protection.html
Change-Id: I93f3b754e4aca2cc71b0e408555c6d937a9d4e04
2024-06-11 08:15:56 +00:00
James Page
42e8bc6e42 Update for 2024.1
Refresh 2023.2 -> 2024.1 which will impact all charms, so we
should not need to pre-seed the edge channel before this works.

Refresh 23.09 -> 24.03 for OVN charms.

Option sql_connection is removed form 2024.1 release [1]
Use below snippet for magnum-k8s conf template
[database]
connection = <>

Update horizon local_settings.py.j2 template

[1] https://docs.openstack.org/releasenotes/oslo.db/en_GB/2024.1.html

Mark tempest test as non-voting as its currently unstable.

Change-Id: I4e277a4c5e438e2f2112a167b0f3050c1526cd0a
2024-04-18 23:21:03 +00:00
Samuel Allan
365aed9a21
Remove pypi mock package for tests
'mock' is built in to python as unittest.mock since python 3.3.
The mock package on pypi is a backport, and not required here.

The test code throughout this repo used a mix of unittest.mock and
the mock package.  This makes it consistently unittest.mock now,
and makes the import styles consistent too.

Change-Id: I643247ac4061c095b327a73cba75a1fa67f1c32e
2024-02-21 09:04:17 +10:30
Guillaume Boutry
a2a60b2c65
Allow rebuild charms on modifying a rebuild file
A main rebuild file at the root will trigger every jobs.

Change-Id: I06e986d0585495946027dbbcaad4145c4fc4c592
2023-12-06 18:58:50 +01:00
Hemanth Nakkina
df70e376ff
Add zuuljobs
* Add sunbeam project template to run pep8, py3 tests
* Add zuul.d/zuul.yaml to run pep8, py3, cover tests
* Update charmcraft and requirements for each charm
* Add global tox.ini to invoke fmt, pep8, py3, cover,
  build
* Add gitreview file
* Fix py3 test failures in ciner-ceph-k8s, glance-k8s,
  openstack-exporter
* Add jobs for charm builds using files option so that
  job is invoked if files within the component are
  modified. Add charm builds to both check and gate
  pipeline.
* Make function tests as part of global. Split the function
  tests into core, ceph, caas, misc mainly to accomodate
  function tests to run on 8GB. Add function tests as
  part of check pipeline.
* Add zuul job to publish charms in promote pipeline
  Add charmhub token as secret that can be used to
  publish charms.
  Note: Charmhub token is generated with ttl of 90 days.
* Run tox formatting
* Make .gitignore, .jujuignore, .stestr.conf global and
  remove the files from all charms.
* Make libs and templates global. Split libs to internal
  and external so that internal libs can adhere to
  sunbeam formatting styles.
* Add script to copy common files necessary libs, config
  templates, stestr conf, jujuignore during py3 tests
  and charm builds.
* Tests for keystone-ldap-k8s are commented due to
  intermittent bug LP#2045206

Change-Id: I804ca64182c109d16bd820ac00f129aa6dcf4496
2023-11-30 15:32:39 +05:30
Hemanth Nakkina
56902d7206 Fix check_relation_handlers_ready
Recent changes on charm-ops-sunbeam introduces
arugments to check_relation_handlers_ready function.
Add event argument to check_relation_handlers_ready.

Change zuul project templates to
openstack-python3-charm-jobs

Change-Id: Ib2f65a8ea728bea05b20a54a6df8a047c76b24a3
2023-11-02 18:59:55 +05:30
Hemanth Nakkina
eea251d500 Add py311 in tox file
Add py311 in tox file

Change-Id: I0ee7df6cdad2bb9d7f6ea17129131c7a34d4c7ab
2023-10-20 06:10:21 +05:30
Liam Young
a6b1f1eeee Switch to 23.09
Change-Id: I61881c130f225af2632b29f30dcca9f95444228b
2023-10-11 06:31:43 +00:00
Liam Young
1a1480148e Add 'extra' test dep
python-subunit 1.4.3+ requires 'extras' otherwise an error
occures:
"'run --slowest' is not a stestr command."

Switch to using self-signed-certificates-operator as the
self signed functionality has been removed from
tls-certificates-operator charm *1

*1 2cb418cd2e

Change-Id: I630a26ad4463f2bccc8cfd11a8c8863421e642dc
2023-09-18 12:54:33 +00:00
Liam Young
fe3e696c94 Re-enable functional tests
Change-Id: I8cd992d9837fcef2afc5279ccd59dafa477ef6d1
2023-08-29 13:15:31 +00:00
Liam Young
cb9314fbb0 Permit Juju 3.1
Allow juju 3.1 as CMR fixes should have been backported and 3.1 has a longer
life than 3.2

Change-Id: I7f136c163eb763330c7ff4ef5e914321f7fe2fcf
2023-08-22 08:30:00 +00:00
Zuul
2d79ea05a2 Merge "logging: send all logs to the console" into main 2023-07-18 02:18:13 +00:00
Liam Young
1be0cabea2 Switch to usinging consolidated rock
Change-Id: Idac9bef1249596fa5beef0a889be4fdae633a08b
2023-07-11 10:17:48 +00:00
James Page
c1337a3d5b logging: send all logs to the console
Forward all logs to the console, ensuring they are consumed by
pebble and propagated up to Kubernetes.

Change-Id: I8f3c7c0abd49c9f71f2b6e4bb85ee486ed64e478
2023-07-11 11:12:37 +01:00
Guillaume Boutry
5fd3f703ce Add retry on cluster status
Sometimes status is called too fast for ovndb to be able to create
the communication socket

Change-Id: I4a5419d241979e1456a2cd9037e49bef442743b8
2023-06-15 13:24:41 +02:00
Zuul
47ab216582 Merge "Enforce min juju version and k8s substrate" into main 2023-06-14 12:50:26 +00:00
Liam Young
71970a1fef Enforce min juju version and k8s substrate
Change-Id: I1b08d80592766be9a5899b50d8364789e74aabc8
2023-06-13 16:15:05 +00:00
Zuul
255feb0942 Merge "Remove kubernetes_service_patch in favor of open-port" into main 2023-06-13 11:58:12 +00:00
Guillaume Boutry
a483352edc Remove kubernetes_service_patch in favor of open-port
Defining service port is implemented using open-port hook, remove
kubernetes_service_patch.

Change-Id: Ib037d268c9914b4313a8feabf683ffeecdf033a9
2023-06-13 11:46:05 +02:00
Guillaume Boutry
0f5a1cc339 Default logging to syslog
Change-Id: I8bbc1bf83ef57d205e87cde2ebc224e5ebda2159
2023-06-12 14:35:30 +02:00
Guillaume Boutry
2b9e9adeb2 Update metadata.yaml's base and assumes
Change-Id: Ib53340a171c57114508ccbef2a7391226fc7dff2
2023-06-01 09:30:11 +02:00
Liam Young
e2b9e1d494 Update bundle to use antelope charms
Change-Id: Ibcdf2db02078ca29d1dd3bcb9acfb98c5b78e7f6
2023-05-29 13:54:50 +00:00
Zuul
1f30df59b9 Merge "Trivial change to trigger republish" into main 2023-05-26 09:18:19 +00:00
Zuul
34aaa0c455 Merge "Fix publishing channel" into main 2023-05-26 09:18:18 +00:00
Liam Young
1ac1af1bd8 Trivial change to trigger republish
Change-Id: Iad38c7d8aa0fb672de897fea5cea66d6531bb2e1
2023-05-25 10:21:35 +00:00
Liam Young
192652a9ad Fix publishing channel
Change-Id: I9a52e36c0bbfa7565199d92f45dfd558c5ea92e5
2023-05-25 10:17:47 +00:00
Liam Young
8d1f27b672 Switch to 2023.3
Switch charm to 2023.3 rock(s).

Change-Id: Ifd0bdb07c6b35ecafcb0983733e5cae1442b3756
2023-05-24 18:28:44 +00:00
Liam Young
59566b26dd Tighten regex when looking for ovn db file
The payload containers sb, nb and northd have a shared db dir. The join
wrapper skips the join command if it detects an existing ovn db. But the regex
used by the join command is not specific enough. So the sb would skip the join
if the nb db was present. This patch tightens the regex so that the join
wrappers look for their own db.

Change-Id: I20b139244664a5218c236ec28756fefd617cc668
2023-05-17 11:33:50 +00:00
Guillaume Boutry
f68638072b Add dependencies with native components as binary packages
The build time is very long because of PIP having to fetch and build
native components of the libraries. This change show a possible way to
bypass this issue. This has implication regarding the platform it's
running on. In this case, we know the charm is going to be run on a
22.04 container.

Change-Id: Ib0d57b872364b8eba6320bb36269c2fcaf7fedb7
2023-04-21 16:22:22 +02:00
James Page
5920717657 tests: Update mysql to use stable channel
Update mysql-k8s to use 8.0/stable channel.

Change-Id: I1a156f983247c6209449256c3d3fe91adb2b35e6
2023-04-17 15:54:48 +01:00
Guillaume Boutry
168ae6c216 Update kubernetes_service_patch to v1
v1 of the kubernetes_service_patch lib will patches the service
definition on `status_update` event. This helps when Juju refreshes the
patched services to their initial state.

Depends-On: https://review.opendev.org/c/openstack/charm-ops-sunbeam/+/880270
Change-Id: I1369a3ca6cabc7c34c958671e1638ca89bb256df
Signed-off-by: Guillaume Boutry <guillaume.boutry@canonical.com>
2023-04-13 18:20:27 +02:00
Liam Young
1071c84673 Update OVNCentralOperatorCharm super class
Update OVNCentralOperatorCharm super class after update in
ops_sunbeam.

Change-Id: I206f6e48a63acd5cdab7bde98beda5eb9b31fa43
2023-03-29 08:11:52 +00:00
Hemanth Nakkina
3ba24d543e Use juju 3.1 for CI tests
Update the snaps to use in functional tests:
juju snap to 3.1 and microk8s snap to 1.26-strict.

Update zaza requirement to use libjuju-3.1 branch.

Change-Id: I6e251140c6426b9d58c6ca7302f395c275bbf99d
2023-03-08 09:21:13 +05:30
Liam Young
df696d2fce Update after ops_sunbeam configure_charm changes
* Switch to using new `configure_charm` structure
* Stop using key self._state.bootstrapped and use property self.bootstrapped()
  instead.
* Stop using deprecated use_juju_for_storage=True

Depends-On: I6b46bae1dc700f5e8b597374c660c0af9c069172
Change-Id: I7d759a7f1474a6f37c4cd597bfe733f5c0ec32ae
2023-02-27 07:38:45 +00:00
James Page
3b7f53c049 Wildcard unit status message for mysql
All we care about is whether the unit is active or not; the
message is somewhat irrelevant and has been changed in this
operator recently.

Re-enable gating for functional testing.

Change-Id: I9c3abf83421a2933f01fa99f4cc0fe29b2c57164
2023-01-19 09:48:18 +00:00
Hemanth Nakkina
833636e5f0 update allowlist_externals with full path
publish-charm failed to execute rename.sh
as it is not allowed.
Add abosulte path for rename.sh, fetch-libs.sh
in allowlist_externals.

Change-Id: I177adb1d6a5900c5433e795e98ec14f7a94d33d1
2023-01-18 16:19:49 +05:30
Hemanth Nakkina
3a89316b75 Use tls-certificates-interface library
Use tls-certificates-interface library from
https://charmhub.io/tls-certificates-interface/libraries/tls_certificates

Fix py3 failures due to cryptography package
clashes from zaza. Move zaza dependcies from
test-requirements to tox

Depends-On: https://review.opendev.org/c/openstack/charm-ops-sunbeam/+/865410
Change-Id: Ia8769bbccfd0d9b97bd2334e1f4c2e40387d2b20
2023-01-17 20:17:30 +05:30
James Page
6db620be43 clustering: guard join process for follower units
Ensure that the expected cluster size has been reached prior to
executing the join process for NB and SB ovsdb-server instances.

Ensure that OVN databases are stored on a persistent volume
to support charm upgrades.

Change-Id: I70ded229ff4c1c2f1d70bd052699bdd641489290
2022-12-13 10:50:10 +00:00
James Page
95ea3c5948 Upgrade charm to OpenStack Yoga
Update OCI image.

Refresh bundles.

Update OSCI publisher.

Make default test/bundle name release agnostic.

Change-Id: I68246ec54749b238f3a2ca21d914f4ec7c05e0ea
2022-11-22 09:49:21 +00:00
Hemanth Nakkina
476e104dd8 Update bootstrap status to Active
When the bootstrap is completed, it is
required to update bootstrap status as
well from maintenance to Active. This
patch updates the bootstrap status to active
when bootstrap is marked as True.

Change-Id: I9c547778ed211ab17732c0a9c224a3b306ffb63d
2022-11-08 10:21:36 +05:30