1531 Commits

Author SHA1 Message Date
Guillaume Boutry
a4582d130a
Disable scale tests on clusterd
Disable scale tests on clusterd until they are more stable.

Change-Id: I02ac5a375b04f5b5589b8a44161061682ba8029c
2024-01-31 21:19:31 +01:00
Zuul
21607c9e14 Merge "Use relative path to get metadata" into main 2024-01-30 13:00:13 +00:00
Guillaume Boutry
5a81e96a80
Use relative path to get metadata
Change-Id: Ic88027945c4d4ad04a4dec83e00e44aac5c0b890
2024-01-30 13:46:42 +01:00
Zuul
e25a0842ea Merge "Handle member removal gracefully" into main 2024-01-30 11:11:16 +00:00
Guillaume Boutry
abf7310786
Handle member removal gracefully
If roles are not settled (voters is not an odd number), leaving the
cluster might break things. Waiting for roles to settle before leaving,
and afterwards on the leader.
Pass force=1 when deleting cluster member.
Cluster removal happens when a juju unit is departing.

Change-Id: Ic9a7273be36a6cbb117b74bcfd94cef116a3b603
2024-01-30 11:27:21 +01:00
Zuul
a08f25587c Merge "Read decompressed metadata with ansible tasks" into main 2024-01-30 10:06:58 +00:00
Guillaume Boutry
0a4f479eda
Read decompressed metadata with ansible tasks
Using custom ansible module within zuul is not straightforward, using
ansible tasks to simplify things.

Change-Id: I90845a148c007657d2ce4faf191b1e46264432af
2024-01-30 10:38:56 +01:00
Zuul
b3b850bd88 Merge "Allow running unit tests on a single charm" into main 2024-01-30 09:26:50 +00:00
Zuul
bd70b928e3 Merge "Migrate database interface" into main 2024-01-30 08:56:27 +00:00
Samuel Allan
e7853633fa Allow running unit tests on a single charm
This allows scoping a tox run of py3* and cover enviroments
to a single charm or ops-sunbeam, to facilitate faster testing.

Usage examples:

```
tox -e py3                   # test all
tox -e py3 -- ops-sunbeam    # just the ops sunbeam lib
tox -e py3 -- barbican-k8s   # only the barbican charm

tox -e cover
tox -e cover -- ops-sunbeam
tox -e cover -- barbican-k8s
```

Closes-Bug: #2050840

Change-Id: Ieb3cd5ad85ee7a04a320cc41fbc3ad406e034a57
2024-01-30 11:12:13 +10:30
Zuul
18d5e2fbb3 Merge "Add module to read metadata from downloaded artifact" into main 2024-01-29 10:27:19 +00:00
Guillaume Boutry
652e8b3478
Add module to read metadata from downloaded artifact
Since charmcraft 2.5, all properties are to be written in
charmcraft.yaml. But when the charm is generated, the artifact will
still contain the metadata.yaml. Adding a module to read the artifact's
metadata.

Two benefits from this:
- don't have to check whether it's a charm with charmcraft.yaml or
  metadata.yaml
- upload oci images written in the artifact's resources section

Change-Id: I971973859d0ef76840b5c1d60098a31e55a8d28b
2024-01-29 11:03:25 +01:00
Samuel Allan
58100f3dbc Ignore temporary files used for unittests
During unittests, some temporary files are copied to the charms,
then cleaned up after the tests finish.
However, these files may not be cleaned up if the tests are interrupted,
resulting temporary files sitting around until the tests are run again.

We should ignore these to avoid accidentally checking them in to git.

Change-Id: I91b9f7c2333f109e91a4ec7952d7c9a0e0631208
2024-01-29 15:33:25 +10:30
Zuul
a5e6ecd41a Merge "Rebuild sunbeam-clusterd" into main 2024-01-29 02:56:00 +00:00
Guillaume Boutry
943c9fd988
Migrate database interface
data_platform_libs.v0.database_requires was deprecated on January 4th,
2023 and has not received updates since then.
This change migrates to data_platform_libs.v0.data_interfaces which the
preferred way to interact with MySQL.

Most notable changes:
- User/password in a secret
- Keystone test 'test_on_peer_data_changed_with_fernet_keys_and_fernet_secret_different'
  is no longer mocking secrets to make sure it's using database secrets.

Change-Id: Ia1908c0828689458c6ff3fa8d9640c8debfc0a73
2024-01-27 14:29:40 +01:00
Zuul
162eba6463 Merge "Fix ansible templating" into main 2024-01-26 16:09:21 +00:00
Guillaume Boutry
37c1dcac52
pin pytest-interface-tester and pydantic
A release of pytest-interface-tester removed the pin on pydantic<2.
Traefik-k8s ingress lib is not compatible with pydantic>=2.

Change-Id: I9db938646ab8e5928d6cf0c0da020c32f4a1bd5a
2024-01-26 16:12:30 +01:00
Guillaume Boutry
6876bcc172
Fix ansible templating
Ansible templating is not complete and will error out in publish.yaml

Change-Id: Ib12cd64c3fbd94a8cee40f37ea00e1b72fed937b
2024-01-26 12:40:37 +01:00
Guillaume Boutry
b1677ae6dc
Rebuild sunbeam-clusterd
Fix in publish role has landed, rebuild clusterd

Change-Id: Ie60d86b2513d0c36d94b9bc8fbb32a2dee76ad77
2024-01-26 12:36:51 +01:00
Guillaume Boutry
86ac0fd58d
Fix error when publishing charmcraft.yaml only charm
Since charmcraft 2.5, the files: metadata.yaml, actions.yaml, and
config.yaml have been merged into charmcraft.yaml.
The publishing job fails because it expects the metadata.yaml to be
present.
This change checks for which file to use.
The keys looked up in metadata.yaml for this specific task have the same
schema in charmcraft.yaml

Change-Id: I94ea3b8230e5dbf7d2474410fba7acc5e0836a63
2024-01-26 08:51:00 +01:00
Guillaume Boutry
619976fe43
Implement sunbeam-clusterd
Sunbeam-clusterd can scale up and down.
Currently, the external address in bound to the peers relationship.
Exposes the action `get-credentials` which returns the URL. In the long
term, it will return the credentials to access securely clusterd.

Change-Id: I8b91efe6d96198f5ad3634b9747161225381ded6
2024-01-25 12:30:54 +01:00
Samuel Allan
caabd67022 Use --parallel-mode for test coverage
stestr runs in parallel, which is good, but coverage needs to run
in parallel awareness mode, so that data from all stestr processes
is collected.

Closes-Bug: #2050838

Change-Id: I6a384f07d5063dc42b63943586d499f7647b1c64
2024-01-24 09:14:29 +10:30
Samuel Allan
610443f950 Include unit test methods in coverage
It's important to include unittests in coverage,
to detect things like unused code or shadowed methods.

Closes-Bug: #2050839

Change-Id: Ibee587af7892e8db13fb9564e05b0eccf56c6425
2024-01-23 15:55:19 +10:30
Guillaume Boutry
ae3dc83a5a
Add missing requirements from ops_sunbeam
Change-Id: I34ffeb0ca79e84fd60c43c0e76c741965f641bfb
2024-01-16 19:03:23 +01:00
Zuul
945f802453 Merge "Rebuild sunbeam-machine" into main 2024-01-16 11:01:12 +00:00
Zuul
77a7d66295 Merge "Expand VLAN range" into main 2024-01-16 10:12:14 +00:00
Guillaume Boutry
dc69bcce20 Rebuild sunbeam-machine
Charm's secret has been regenerated,
rebuild sunbeam-machine

Change-Id: I36276e52fbeca657ddc2075d8d4888da79bb0e4b
2024-01-16 10:06:48 +00:00
Guillaume Boutry
baa428eede
Publish sunbeam machine 2023.2
Change-Id: I63eee9553b224738dd44c29ae9d269de391f3d68
2024-01-16 09:38:45 +01:00
Zuul
78661ce8bc Merge "Regenerate secrets to publish charms" into main 2024-01-15 12:21:48 +00:00
Mark Beierl
363af8d402
Expand VLAN range
Changes VLAN range to the full allowed range.
The values of 0 and 4095 are reserved.

Change-Id: I85ef251709b96520e9b6054e86ea3a7cb5940c55
Signed-off-by: Mark Beierl <mark.beierl@canonical.com>
2024-01-12 15:00:12 -05:00
Guillaume Boutry
81be68e168
Regenerate secrets to publish charms
Add utility for generating a new secret.

Change-Id: If1c379ba88a8ab012bee1fc70265966f59c17dea
2024-01-12 14:05:29 +01:00
Guillaume Boutry
e8bd6abe7f
Add sunbeam-machine to publish channel
Change-Id: I16af6b7d709ef76daced8d0a02532b6f9dd5d38a
2024-01-12 11:18:50 +01:00
Guillaume Boutry
cd5418a0a3
Add sunbeam-machine to monorepo
Sunbeam-machine was a miss during migration to monorepo.

Change-Id: I5ae420882258e405405a079ddb4ae3356ca776c9
2024-01-12 09:36:20 +01:00
Zuul
44b81d6f19 Merge "Revert "[horizon-k8s] comment memcache configuration"" into main 2024-01-03 02:06:41 +00:00
Guillaume Boutry
bfe6e01fca Revert "[horizon-k8s] comment memcache configuration"
This reverts commit 41345c8271972f9be375b8bbad0d6ce20bc23bfc.

Reason for revert: Original issue was caused because python3-memcache was not provided anymore inside the ROCK. Commenting configuration introduces an other regression. A new version of the ROCK was published with python3-memcache.

Change-Id: I90455ca40465fad347894cd8729bde9fa31adefa
2024-01-02 17:03:38 +00:00
Guillaume Boutry
375ec0eae4
Make functional tests voting
Jobs have been successfully passing for the rights reasons
consistently. If a functional test fails, it should be investigated in
the patch.

Change-Id: I477cad32e8f782270d473cf04869d796fca3e294
2024-01-02 10:11:55 +01:00
Zuul
ac71e9af59 Merge "fix keystone secret rotate error" into main 2024-01-02 08:49:25 +00:00
Hemanth Nakkina
41345c8271
[horizon-k8s] comment memcache configuration
Comment mecache configuration in local_settings.py.j2
template. Without this change, the db sync failed as
memcache package is not installed.

Change-Id: I452c944276b1ea6163a8e3bb2dada1fd8229edd4
2024-01-02 08:51:04 +05:30
Szymon Roczniak
1867330597 fix keystone secret rotate error
Change-Id: I726ae7f8e26ab8e827a3c116bc822e09f4ca2fa1
2023-12-27 23:48:38 +00:00
James Page
2604875936
docs: drop WIP status
Migration of all charms is now complete; drop the WIP comment in
the repository README.

Change-Id: I705358b0856b0b95f61d522af986baf7a061c827
2023-12-13 09:22:13 +00:00
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
Guillaume Boutry
ca84fb2662
Only execute promote job when corresponding charm has changed
Change-Id: Ic86eb46a159e57174ebedad4d044fa656d59407d
2023-12-06 17:27:42 +01:00
Guillaume Boutry
70dcad57d8
Split publish job for each charm
Change-Id: I7a2f58fbc146b1c2fb235a349533e4aafba1b8b6
2023-12-06 16:49:54 +01:00
Guillaume Boutry
1cf33168ff
Reference ops.Object from its definition package
ops's Object is defined in the framework package. The charm package is
only a user.

Change-Id: I3683f30fed9cda28b25efce21c40beaf447e1fca
2023-12-06 13:45:10 +01:00
Guillaume Boutry
b2ee00f44c Remove startup enabled from layer config
Only start the heat services when the charm is bootstrapped.

Change-Id: I874f7da9243e0bbbc14fd149132e8dcdc1ad09f3
2023-12-06 09:27:31 +00:00
Zuul
eb09f77115 Merge "Generate charmhub secret with read permissions" into main 2023-12-06 09:26:14 +00:00
Guillaume Boutry
985a72c331
Generate charmhub secret with read permissions
Previous secret only had write permissions on charms. Read permissions
are necessary to upload resources.

Permissions on token:
- package-manage-metadata
- package-manage-releases
- package-manage-revisions
- package-view-metadata
- package-view-releases
- package-view-revisions

Change-Id: I1d4787985a57b2f8a01f9ad6e1de4b2072bf018b
2023-12-06 09:09:19 +01:00
Liam Young
12b88b830e Increase db sync retries
The db sync retry tenacity decorator has the folloing settings:

stop_after_attempt(3),
wait_exponential(multiplier=1, min=10, max=300)

This translates to:
run dbsync
wait 10 ((2^0 * 1) < 10 -> 10)
run dbsync
wait 10 ((2^1 * 1) < 10 -> 10)
run dbsync
exit

So, the three db sync command run within ~20s. Increasing the number
of attempts keeps the exponential back-off behaviour but gives the
command more change to work.

Change-Id: I60dbaf609c8f1cbbc89bd7e4d893004cbb0e94a4
2023-12-05 15:50:43 +00:00
Guillaume Boutry
78a7914f11
Remove startup enabled from layer config
Only start the cinder-volume when the charm is bootstrapped.

Change-Id: Ic8e194ecb3d3f7eead4b88b2414db91b16e419f1
2023-12-05 15:19:55 +01:00
Guillaume Boutry
4e97a03f23
Install snapd in publish charm
Change-Id: Ibdac301b3e7311cdb588ad3fb4e346d0068e98bd
2023-12-05 14:40:43 +01:00