Skip to content

feat: migrate rollingops v1 from charm-rolling-ops repo#415

Merged
patriciareinoso merged 33 commits intocanonical:DPE-9349-rolling-ops-maintenancefrom
patriciareinoso:DPE-9349-rollingops-maintenance
Apr 10, 2026
Merged

feat: migrate rollingops v1 from charm-rolling-ops repo#415
patriciareinoso merged 33 commits intocanonical:DPE-9349-rolling-ops-maintenancefrom
patriciareinoso:DPE-9349-rollingops-maintenance

Conversation

@patriciareinoso
Copy link
Copy Markdown

@patriciareinoso patriciareinoso commented Apr 10, 2026

In this PR I migrated the rollingops library v1 from https://github.com/canonical/charm-rolling-ops to https://github.com/canonical/charmlibs

This PR is mostly copy-paste and reorganization.

  • I split the single file into multiple file to identify responsibilities. I still need to group the files.
  • Migrated integration tests to jubilant
  • Added the RollingOpsManager in the _base_manager.py. This is quick draft that allowed me to get the integration tests running. This class will probably mostly change when the real single-api implementation lands.
  • There are no changes on the UTs

In next PR file organization would look like this
image

@patriciareinoso patriciareinoso marked this pull request as ready for review April 10, 2026 07:46
@patriciareinoso patriciareinoso requested a review from a team as a code owner April 10, 2026 07:46
@patriciareinoso patriciareinoso merged commit 1ad2103 into canonical:DPE-9349-rolling-ops-maintenance Apr 10, 2026
24 checks passed
patriciareinoso added a commit to patriciareinoso/charmlibs that referenced this pull request Apr 13, 2026
* patch: etcd rolling ops version

* first working version

* fix format

* fix linting

* add tenacity to integration test

* remove unnecessary logs

* add dataplatform as reviewes

* rename and add integration tests

* linting and rebase

* first part of comments

* more comments answered

* more comments answered

* fix linting job

* fix UT

* mark tests as only k8s

* fix integration tests

* use charmlibs apt

* remove sans dns

* add dependencies to .toml

* add uv lock

* add wait in itnegration tests

* increate timeout

* increase log count

* unlimited debug-log

* comments review

* fix paths

* migrate v1

* fix integration tests

* fix integration tests

* add lock and integration tests

* unify operations

* add tenacity

* draft

* fallback implementation

* add sync lock and state

* feat: advanced rolling ops using etcd (canonical#364)

## Context

All the code on this PR is new

This implementation is based on [DA241
Spec](https://docs.google.com/document/d/1ez4h6vOOyHy5mu6xDblcBt8PPAtMe7MUp75MtgG1sns/edit?tab=t.0)

- The content of
`charmlibs/advanced-rollingops/src/charmlibs/advanced_rollingops/_dp_interfaces_v1.py`
belongs to another library that is currently being migrated to charmlibs
so you can ignore it for now.

## Summary

This PR is the first part of the implementation of advanced rolling ops
at cluster level.

This PR includes:
- Management of the client certificate used to connect to etcd
- The leader unit creates a self-signed certificate with live of 50
years
  - Share the certificate with the other units using a peer relation
- Implementation of the integration with etcd
  - Share the mtls certificate
  - Observe the `resource_created` event 
  - Observe the `endpoints_changed` event
- Management of a env file needed to connecto etcd via `etcdctl`
 
This PR does not implement the locking mechanism. In here we only test
that we can connect to etcd from each unit.

## Current workflow:

1. The unit make a request
2. A new background process is spawn
3. The background process dispatches a Juju hook
4. The unit observes that hook
5. The unit writes and read a value in etcd
6. If the unit was able to connect to etcd, it executes the "restart"
function.

This is a very simplified workflow to be able to test that the units
from different apps can reach etcd.

## To do
- Implement the actual locking mechanism
- Figure out how to properly install etcdctl

* feat: migrate rollingops v1 from charm-rolling-ops repo (canonical#415)

* define syn lock backend

* fix merge

* clean up

* fix peer integration tests

* fix integration tests

* fix integration tests

* docstrings

* add update status handled and improve integration tests

* general cleanup
patriciareinoso added a commit to patriciareinoso/charmlibs that referenced this pull request Apr 13, 2026
* patch: etcd rolling ops version

* first working version

* fix format

* fix linting

* add tenacity to integration test

* remove unnecessary logs

* add dataplatform as reviewes

* rename and add integration tests

* linting and rebase

* first part of comments

* more comments answered

* more comments answered

* fix linting job

* fix UT

* mark tests as only k8s

* fix integration tests

* use charmlibs apt

* remove sans dns

* add dependencies to .toml

* add uv lock

* add wait in itnegration tests

* increate timeout

* increase log count

* unlimited debug-log

* comments review

* fix paths

* migrate v1

* fix integration tests

* fix integration tests

* add lock and integration tests

* unify operations

* add tenacity

* draft

* fallback implementation

* add sync lock and state

* feat: advanced rolling ops using etcd (canonical#364)

## Context

All the code on this PR is new

This implementation is based on [DA241
Spec](https://docs.google.com/document/d/1ez4h6vOOyHy5mu6xDblcBt8PPAtMe7MUp75MtgG1sns/edit?tab=t.0)

- The content of
`charmlibs/advanced-rollingops/src/charmlibs/advanced_rollingops/_dp_interfaces_v1.py`
belongs to another library that is currently being migrated to charmlibs
so you can ignore it for now.

## Summary

This PR is the first part of the implementation of advanced rolling ops
at cluster level.

This PR includes:
- Management of the client certificate used to connect to etcd
- The leader unit creates a self-signed certificate with live of 50
years
  - Share the certificate with the other units using a peer relation
- Implementation of the integration with etcd
  - Share the mtls certificate
  - Observe the `resource_created` event 
  - Observe the `endpoints_changed` event
- Management of a env file needed to connecto etcd via `etcdctl`
 
This PR does not implement the locking mechanism. In here we only test
that we can connect to etcd from each unit.

## Current workflow:

1. The unit make a request
2. A new background process is spawn
3. The background process dispatches a Juju hook
4. The unit observes that hook
5. The unit writes and read a value in etcd
6. If the unit was able to connect to etcd, it executes the "restart"
function.

This is a very simplified workflow to be able to test that the units
from different apps can reach etcd.

## To do
- Implement the actual locking mechanism
- Figure out how to properly install etcdctl

* feat: migrate rollingops v1 from charm-rolling-ops repo (canonical#415)

* define syn lock backend

* fix merge

* clean up

* fix peer integration tests

* fix integration tests

* fix integration tests

* docstrings

* add update status handled and improve integration tests

* general cleanup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant