Skip to content

DO NOT MERGE test refresh v3 draft implementation #262

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 58 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
faf70a4
Add refresh v3 draft implementation
carlcsaposs-canonical Apr 2, 2025
db9b897
Simplify reconcile
carlcsaposs-canonical Apr 4, 2025
85b1a1b
Add `self._reconcile_allowed` instead of exiting
carlcsaposs-canonical Apr 7, 2025
4461680
Sync with K8s
carlcsaposs-canonical Apr 10, 2025
461d501
Remove workload version set
carlcsaposs-canonical Apr 11, 2025
26868e2
Include logger name in logs
carlcsaposs-canonical Apr 15, 2025
1ee0c39
Update charm-refresh
carlcsaposs-canonical Apr 17, 2025
20c5b45
Update charm_refresh
carlcsaposs-canonical Apr 24, 2025
4ea0037
Use JSON schema
carlcsaposs-canonical May 7, 2025
a605bd4
Use released charm-refresh
carlcsaposs-canonical May 7, 2025
858aa81
Update comment
carlcsaposs-canonical May 7, 2025
bc6c590
Check workload version
carlcsaposs-canonical May 7, 2025
4d1c20e
Update data-platform-workflows to v32.0.0
carlcsaposs-canonical May 7, 2025
197452c
Set charm refresh compatibility version from git tag
carlcsaposs-canonical May 7, 2025
d4de70b
Format
carlcsaposs-canonical May 7, 2025
18c5292
Revert (for testing) "Set charm refresh compatibility version from gi…
carlcsaposs-canonical May 7, 2025
2d5630d
Fix unit test mocks
carlcsaposs-canonical May 7, 2025
8a06355
Format
carlcsaposs-canonical May 7, 2025
ba3dc3d
Increase numprocesses to workaround memory leak
carlcsaposs-canonical May 7, 2025
8b6e123
Increase numprocesses to workaround memory leak
carlcsaposs-canonical May 7, 2025
ede703a
Set charm refresh compatibility version from git tag
carlcsaposs-canonical May 8, 2025
b8182a2
Revert (for testing) "Set charm refresh compatibility version from gi…
carlcsaposs-canonical May 8, 2025
0b5e374
Revert testing changes
sinclert-canonical Jun 5, 2025
25eb1eb
Fix unit tests
sinclert-canonical Jun 6, 2025
b3b182c
Fix unit tests [alternative]
sinclert-canonical Jun 6, 2025
68208fe
Fix integration tests
sinclert-canonical Jun 6, 2025
c9708ad
[Temp] Disable charmcraft version build
sinclert-canonical Jun 6, 2025
fbafe74
[Temp] Hard-code charm version
sinclert-canonical Jun 6, 2025
855a7bc
[Temp] Point to a refresh v3 channel
sinclert-canonical Jun 9, 2025
01eebb1
update snap.py
carlcsaposs-canonical Jul 11, 2025
8d4ee79
python min version for 22.04
carlcsaposs-canonical Jul 11, 2025
307c520
simplify mock to not use charm-refresh private api
carlcsaposs-canonical Jul 11, 2025
fe6f7c8
Revert "[Temp] Hard-code charm version"
carlcsaposs-canonical Jul 11, 2025
96b2365
Revert "[Temp] Disable charmcraft version build"
carlcsaposs-canonical Jul 11, 2025
eebc14a
Revert "Revert testing changes"
carlcsaposs-canonical Jul 11, 2025
3d0a8fb
fix integration test
carlcsaposs-canonical Jul 11, 2025
f4e09c5
re-enable arm
carlcsaposs-canonical Jul 11, 2025
5b9ea38
format
carlcsaposs-canonical Jul 11, 2025
92bc960
actions.yaml
carlcsaposs-canonical Jul 11, 2025
c684fc3
bump charm-refresh
carlcsaposs-canonical Jul 11, 2025
683c4ee
try reverting unit test and snap.py changes
carlcsaposs-canonical Jul 11, 2025
101570d
test 8.0.41 branch
carlcsaposs-canonical Jul 11, 2025
8ed68c3
temp debug
carlcsaposs-canonical Jul 14, 2025
b1a475f
Revert "temp debug"
carlcsaposs-canonical Jul 14, 2025
c41c284
Revert "try reverting unit test and snap.py changes"
carlcsaposs-canonical Jul 14, 2025
1b6185c
Add missing mock
carlcsaposs-canonical Jul 14, 2025
ff5604e
Fix test timeout
carlcsaposs-canonical Jul 14, 2025
16a3cbb
Format
carlcsaposs-canonical Jul 14, 2025
c43d77f
Revert "Revert testing changes"
carlcsaposs-canonical Jul 11, 2025
7bbd09f
8.0.40
carlcsaposs-canonical Apr 2, 2025
865e8f6
Release to Charmhub branch
carlcsaposs-canonical Apr 2, 2025
7e121d2
8.0.41
carlcsaposs-canonical Apr 2, 2025
24738b8
8.0.41-2
carlcsaposs-canonical Apr 2, 2025
da2f603
incompat
carlcsaposs-canonical Apr 2, 2025
65dff88
precheckfail
carlcsaposs-canonical Apr 2, 2025
f6ae874
uncaught
carlcsaposs-canonical Apr 4, 2025
96d3a28
uncaught-before-snap-refresh
carlcsaposs-canonical Apr 7, 2025
8e068be
uncaught-except-upgrade-charm-event
carlcsaposs-canonical Apr 7, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/approve_renovate_pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ on:
jobs:
approve-pr:
name: Approve Renovate pull request
uses: canonical/data-platform-workflows/.github/workflows/approve_renovate_pr.yaml@v31.0.1
uses: canonical/data-platform-workflows/.github/workflows/approve_renovate_pr.yaml@v32.0.0
permissions:
pull-requests: write # Needed to approve PR
33 changes: 0 additions & 33 deletions .github/workflows/check_libs.yaml

This file was deleted.

18 changes: 0 additions & 18 deletions .github/workflows/check_pr.yaml

This file was deleted.

51 changes: 8 additions & 43 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
# See LICENSE file for licensing details.
name: Tests

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

on:
pull_request:
paths-ignore:
Expand All @@ -23,49 +19,18 @@ on:
value: ${{ jobs.build.outputs.artifact-prefix }}

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install tox & poetry
run: |
pipx install tox
pipx install poetry
- name: Run linters
run: tox run -e lint

unit-test:
name: Unit test charm
runs-on: ubuntu-22.04 # TODO: use ubuntu-latest after fixing pathlib issue on python 3.12
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install tox & poetry
run: |
pipx install tox
pipx install poetry
- name: Run tests
run: tox run -e unit
- name: Upload Coverage to Codecov
uses: codecov/codecov-action@v5

build:
name: Build charm
uses: canonical/data-platform-workflows/.github/workflows/build_charm.yaml@v31.0.1
uses: canonical/data-platform-workflows/.github/workflows/build_charm.yaml@v32.0.0

integration-test:
name: Integration test charm
release:
name: Release charm
needs:
- lint
- unit-test
- build
uses: ./.github/workflows/integration_test.yaml
uses: canonical/data-platform-workflows/.github/workflows/release_charm.yaml@v31.0.1
with:
channel: dpe/edge/test-refresh-v3-uncaught-except-upgrade-charm-event
artifact-prefix: ${{ needs.build.outputs.artifact-prefix }}
secrets: inherit
permissions:
contents: write # Needed for Allure Report
create-git-tags: false
secrets:
charmhub-token: ${{ secrets.CHARMHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/promote.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ on:
jobs:
promote:
name: Promote charm
uses: canonical/data-platform-workflows/.github/workflows/_promote_charm.yaml@v31.0.1
uses: canonical/data-platform-workflows/.github/workflows/_promote_charm.yaml@v32.0.0
with:
track: 'dpe'
from-risk: ${{ inputs.from-risk }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copyright 2023 Canonical Ltd.
# See LICENSE file for licensing details.
name: Release to Charmhub
name: Release to Charmhub edge

on:
push:
Expand All @@ -24,9 +24,9 @@ jobs:
name: Release charm
needs:
- ci-tests
uses: canonical/data-platform-workflows/.github/workflows/release_charm.yaml@v31.0.1
uses: canonical/data-platform-workflows/.github/workflows/release_charm_edge.yaml@v32.0.0
with:
channel: dpe/edge
track: 'dpe'
artifact-prefix: ${{ needs.ci-tests.outputs.artifact-prefix }}
secrets:
charmhub-token: ${{ secrets.CHARMHUB_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sync_docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
jobs:
sync-docs:
name: Sync docs from Discourse
uses: canonical/data-platform-workflows/.github/workflows/sync_docs.yaml@v31.0.1
uses: canonical/data-platform-workflows/.github/workflows/sync_docs.yaml@v32.0.0
with:
reviewers: a-velasco
permissions:
Expand Down
61 changes: 52 additions & 9 deletions actions.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,61 @@
# Copyright 2023 Canonical Ltd.
# See LICENSE file for licensing details.

resume-upgrade:
description: Upgrade remaining units (after you manually verified that upgraded units are healthy).

force-upgrade:
pre-refresh-check:
description: Check if charm is ready to refresh
additionalProperties: false
force-refresh-start:
description: |
Potential of *data loss* and *downtime*
Potential of data loss and downtime

Force refresh of first unit

Must run with at least one of the parameters `=false`
params:
check-compatibility:
type: boolean
default: true
description: |
Potential of data loss and downtime

If `false`, force refresh if new version of Router and/or charm is not compatible with previous version
run-pre-refresh-checks:
type: boolean
default: true
description: |
Potential of data loss and downtime

If `false`, force refresh if app is unhealthy or not ready to refresh (and unit status shows "Pre-refresh check failed")
check-workload-container:
type: boolean
default: true
description: |
Potential of data loss and downtime during and after refresh

Force upgrade of this unit.
If `false`, allow refresh to Router container version that has not been validated to work with the charm revision
additionalProperties: false
resume-refresh:
description: |
Refresh next unit(s) (after you have manually verified that refreshed units are healthy)

If the `pause_after_unit_refresh` config is set to `all`, this action will refresh the next unit.

If `pause_after_unit_refresh` is set to `first`, this action will refresh all remaining units.
Exception: if automatic health checks fail after a unit has refreshed, the refresh will pause.

Use to
- force incompatible upgrade and/or
- continue upgrade if 1+ upgraded units have non-active status
If `pause_after_unit_refresh` is set to `none`, this action will have no effect unless it is called with `check-health-of-refreshed-units` as `false`.
params:
check-health-of-refreshed-units:
type: boolean
default: true
description: |
Potential of data loss and downtime

If `false`, force refresh (of next unit) if 1 or more refreshed units are unhealthy

Warning: if first unit to refresh is unhealthy, consider running `force-refresh-start` action on that unit instead of using this parameter.
If first unit to refresh is unhealthy because compatibility checks, pre-refresh checks, or workload container checks are failing, this parameter is more destructive than the `force-refresh-start` action.
additionalProperties: false

set-tls-private-key:
description:
Expand Down
1 change: 0 additions & 1 deletion charm_version

This file was deleted.

10 changes: 2 additions & 8 deletions charmcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,9 @@ parts:
build-packages:
- git
override-build: |
# Workaround to add unique identifier (git hash) to charm version while specification
# DA053 - Charm versioning
# (https://docs.google.com/document/d/1Jv1jhWLl8ejK3iJn7Q3VbCIM9GIhp8926bgXpdtx-Sg/edit?pli=1)
# is pending review.
python3 -c 'import pathlib; import shutil; import subprocess; git_hash=subprocess.run(["git", "describe", "--always", "--dirty"], capture_output=True, check=True, encoding="utf-8").stdout; file = pathlib.Path("charm_version"); shutil.copy(file, pathlib.Path("charm_version.backup")); version = file.read_text().strip(); file.write_text(f"{version}+{git_hash}")'

# TODO: set charm version in refresh_versions.toml
craftctl default
stage:
- LICENSE
- charm_version
- workload_version
- refresh_versions.toml
- templates
8 changes: 7 additions & 1 deletion config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,14 @@
# See LICENSE file for licensing details.

options:

vip:
description: |
Virtual IP to use to front mysql router units. Used only in case of external node connection.
type: string
pause_after_unit_refresh:
description: |
Wait for manual confirmation to resume refresh after these units refresh

Allowed values: "all", "first", "none"
type: string
default: first
7 changes: 2 additions & 5 deletions metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,8 @@ peers:
interface: tls
cos:
interface: cos
upgrade-version-a:
# Relation versioning scheme:
# DA056 - Upgrading in-place upgrade protocol
# https://docs.google.com/document/d/1H7qy5SAwLiCOKO9xMQJbbQP5_-jGV6Lhi-mJOk4gZ08/edit
interface: upgrade
refresh-v-three:
interface: refresh
# DEPRECATED shared-db: Workaround for legacy "mysql-shared" interface using unit databags instead of app databag
deprecated-shared-db-credentials:
interface: _deprecated_shared_db_peers
Loading