Skip to content
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

[DPE-3908] Minor version upgrades #335

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
7cb4c4f
WIP(upgrades): Code for pre upgrade checks.
Gu1nness Sep 12, 2024
1b310e3
feat(DPE-5476): Partition handling
Gu1nness Sep 17, 2024
948fc2a
feat(DPE-5476): Implement upgrade resumed
Gu1nness Sep 17, 2024
d5fc5d9
WIP: ugprades
Gu1nness Sep 18, 2024
6360321
WIP: upgrades
Gu1nness Sep 20, 2024
2bbd9e6
WIP: features
Gu1nness Sep 20, 2024
a4a44e2
WIP: upgrades
Gu1nness Sep 23, 2024
56a5720
fix: attribute access
Gu1nness Sep 24, 2024
97f2891
fix: resume-upgrade error message
Gu1nness Sep 24, 2024
06e5eeb
fix: missing upgrade_in_progress
Gu1nness Sep 24, 2024
ce746d4
fix: Handle all services correctly
Gu1nness Sep 24, 2024
eac9a73
fix: missing function
Gu1nness Sep 24, 2024
14116ce
fix: missing exception
Gu1nness Sep 25, 2024
f841d31
fix: set revision
Gu1nness Sep 26, 2024
c8f904e
doc: Add a bit of documentation
Gu1nness Sep 26, 2024
b54ec1f
doc: Add module documentation
Gu1nness Sep 26, 2024
97b7031
fix: reviews
Gu1nness Sep 27, 2024
f9bb4b1
fix: upgrades + tests
Gu1nness Sep 27, 2024
4a5f9a0
fix: useless to check if db not init yet
Gu1nness Sep 30, 2024
818d78b
fix: safe status + correct usage of upgrade event + create logrotate …
Gu1nness Sep 30, 2024
18fe616
fix: enforce ops 2.15
Gu1nness Sep 30, 2024
1837bde
fix: ops version + bug in layer
Gu1nness Oct 1, 2024
f461f38
fix: layer definition in test as well
Gu1nness Oct 1, 2024
ae80bfc
fix: add more_itertools
Gu1nness Oct 1, 2024
08a836b
fix: remove commented code
Gu1nness Oct 1, 2024
46dc657
fix: statuses were overriden in some cases
Gu1nness Oct 1, 2024
4b5b135
fix: don't break CI
Gu1nness Oct 3, 2024
d98b6f1
fix: last minute fixes
Gu1nness Oct 3, 2024
9499172
fix: V3 vocabulary and rollback tests
Gu1nness Oct 7, 2024
50c12cd
test: local upgrade/rollback
Gu1nness Oct 7, 2024
cc5d56e
fix: post review
Gu1nness Oct 7, 2024
a73e444
fix: missing change
Gu1nness Oct 7, 2024
1cc3174
fix: patch test
Gu1nness Oct 7, 2024
aa1d524
fix: Integrate changes from review
Gu1nness Oct 7, 2024
93ee0dc
fix: A bit more statuses and checks
Gu1nness Oct 8, 2024
2d2a6ce
fix: never set healthy during an upgrade event in the reconcile
Gu1nness Oct 8, 2024
7e1c4be
fix: Ensure all versions are up to date
Gu1nness Oct 9, 2024
2903ece
fix: post rebase
Gu1nness Oct 9, 2024
faac17b
fix: round of reviews
Gu1nness Oct 9, 2024
126d5b3
fix: post review-bis
Gu1nness Oct 9, 2024
d90ba01
chore: add local sharding upgrade test
Gu1nness Oct 9, 2024
82b2b03
fix: last round of reviews
Gu1nness Oct 10, 2024
45e8162
chore: post review
Gu1nness Oct 11, 2024
2cee413
chore: typing
Gu1nness Oct 11, 2024
1f585e6
fix: messup with rebase
Gu1nness Oct 11, 2024
7647e54
fix: return if upgrade in progress
Gu1nness Oct 11, 2024
a5565e9
fix: add decent timeout
Gu1nness Oct 11, 2024
7d7899f
fix: new round of reviews
Gu1nness Oct 11, 2024
2a776c1
fix: remove useless process status (and regression)
Gu1nness Oct 11, 2024
e33daa1
fix: remove smaller deadline
Gu1nness Oct 14, 2024
4731735
fix: rename from __ to _
Gu1nness Oct 14, 2024
8973031
fix: remove useless try/except
Gu1nness Oct 14, 2024
0a9d61c
feat: split into smaller files
Gu1nness Oct 14, 2024
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
3 changes: 3 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
- run: |
# Workaround for https://github.com/canonical/charmcraft/issues/1389#issuecomment-1880921728
touch requirements.txt
- name: Check libs
uses: canonical/charming-actions/[email protected]
with:
Expand Down
18 changes: 18 additions & 0 deletions actions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,21 @@ set-tls-private-key:
internal-key:
type: string
description: The content of private key for internal communications with clients. Content will be auto-generated if this option is not specified.

pre-refresh-check:
description: Check if charm is ready to refresh.

resume-refresh:
description: Refresh remaining units (after you manually verified that refreshed units are healthy).
params:
force:
type: boolean
default: false
description: |
Potential of *data loss* and *downtime*

Force refresh of next unit.

Use to
- force incompatible refresh and/or
- continue refresh if 1+ refreshed units have non-active status
1 change: 1 addition & 0 deletions charm_version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1
26 changes: 16 additions & 10 deletions charmcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,19 @@
# See LICENSE file for licensing details.

type: "charm"
bases:
- build-on:
- name: "ubuntu"
channel: "22.04"
run-on:
- name: "ubuntu"
channel: "22.04"
parts:
charm:
charm-strict-dependencies: true
override-build: |
rustup default stable
craftctl default
build-snaps:
- rustup
build-packages:
Expand All @@ -17,18 +28,13 @@ parts:
echo 'ERROR: Use "tox run -e build-dev" instead of calling "charmcraft pack" directly' >&2
exit 1
fi
override-build: |
rustup default stable
craftctl default
files:
plugin: dump
source: .
prime:
- charm_internal_version
bases:
- build-on:
- name: "ubuntu"
channel: "22.04"
run-on:
- name: "ubuntu"
channel: "22.04"
- charm_version
- workload_version
override-build: |
rustup default stable
craftctl default
2 changes: 1 addition & 1 deletion lib/charms/mongodb/v1/mongodb_backups.py
Original file line number Diff line number Diff line change
Expand Up @@ -800,7 +800,7 @@ def get_backup_error_status(self, backup_id: str) -> str:
"""Get the error status for a provided backup."""
pbm_status = self.charm.run_pbm_command(["status", "--out=json"])
pbm_status = json.loads(pbm_status)
backups = pbm_status["backups"].get("snapshot", [])
backups = pbm_status["backups"].get("snapshot") or []
for backup in backups:
if backup_id == backup["name"]:
return backup.get("error", "")
Expand Down
3 changes: 3 additions & 0 deletions metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ website:
peers:
database-peers:
interface: mongodb-peers
upgrade-version-a:
interface: upgrade

provides:
database:
interface: mongodb_client
Expand Down
334 changes: 180 additions & 154 deletions poetry.lock

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ pyyaml = "^6.0.1"
jinja2 = "^3.1.3"
poetry-core = "^1.9.0"
data-platform-helpers = "^0.1.3"
overrides = "^7.7.0"
lightkube = "^0.15.3"
pyOpenSSL = "^24.2.1"
setuptools = "^72.0.0"

Expand Down
Loading
Loading