-
Notifications
You must be signed in to change notification settings - Fork 8
Add refresh v3 implementation #411
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
Conversation
b4ac782 to
6a76b3f
Compare
|
You can test the refresh with these charmhub branches (built on #412):
or modify the branch locally & re-pack the charm |
|
@carlcsaposs-canonical What's the plan for integration testing the refresh? |
use existing integration tests in the future, I think we could improve the coverage of the refresh tests, but I don't think we have enough time allocated to do that now |
b8b5835 to
b8ce54f
Compare
Does not include migration for refreshing from v2 (currently on stable) This PR branch only supports refreshing to/from mysql-router-k8s charm code with refresh v3
9e607be to
199a7cc
Compare
9659740 to
251b6e2
Compare
charmcraft.yaml
Outdated
| # 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a67093b will be reverted after tests pass & before merging
refresh_versions.toml
Outdated
| charm_major = 1 | ||
| workload = "8.0.42" | ||
|
|
||
| charm = "8.0/1.0.0" # TODO remove |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a67093b will be reverted after tests pass & before merging
|
all tests passed on fc9fa1d |
…rge)" This reverts commit a67093b.
paulomach
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
| # unit(s) tear down | ||
| self.unit.status = ops.MaintenanceStatus("Tearing down") | ||
| self._reconcile_allowed = False | ||
| except charm_refresh.KubernetesJujuAppNotTrusted: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If charm already deployed, can we just assumed trust is given or can it be revoked? Does this ever gets thrown
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reneradoi
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No concerns from my side, just a few questions and hints. Upgrade integration tests look good, too.
| import pytest | ||
| import tenacity | ||
| import tomli | ||
| import tomli_w |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hint: Once you update Python to => 3.11, tomllib is available as standard lib.
| stop=tenacity.stop_after_delay(SMALL_TIMEOUT), | ||
| wait=tenacity.wait_fixed(10), | ||
| logger.info("Wait for first unit to restart") | ||
| async with ops_test.fast_forward("60s"): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why fast_forward here if you wait for the restart, not the update_status?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good point, will remove in a follow-up
|
|
||
| mysql_router_leader_unit = await get_leader_unit(ops_test, MYSQL_ROUTER_APP_NAME) | ||
| logger.info("Wait for first unit to upgrade") | ||
| async with ops_test.fast_forward("60s"): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here: Why fast_forward here if you wait for the upgrade, not the update_status?
More frequent update-status events will not help these conditions be met faster From canonical/mysql-router-k8s-operator#411 (comment)
More frequent update-status events will not help these conditions be met faster From canonical/mysql-router-k8s-operator#411 (comment)
More frequent update-status events will not help these conditions be met faster From canonical/mysql-router-k8s-operator#411 (comment)
More frequent update-status events will not help these conditions be met faster From canonical/mysql-router-k8s-operator#411 (comment)
More frequent update-status events will not help these conditions be met faster From canonical/mysql-router-k8s-operator#411 (comment)
Does not include migration for refreshing from v2 (currently on stable)
This PR branch only supports refreshing to/from mysql-router-k8s charm code with refresh v3
Uses
charm-refreshPython package: https://github.com/canonical/charm-refreshDiscussed with @paulomach—we will merge this & release to edge to enable mysql-router monorepo migration, but we will not promote to beta/candidate/stable until the v2 to v3 migration is implemented (once a decision on specification DA202 is made)
Mostly the same as canonical/mysql-router-operator#241 (plus canonical/mysql-router-operator#279)