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

Refactor #51

Merged
merged 159 commits into from
May 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
159 commits
Select commit Hold shift + click to select a range
db6a03e
Remove Foresight
carlcsaposs-canonical Apr 25, 2023
4bf9636
Refactor
carlcsaposs-canonical Apr 13, 2023
360e2d2
update comment
carlcsaposs-canonical Apr 13, 2023
665d89f
fix
carlcsaposs-canonical Apr 14, 2023
3aac704
Move TLS container methods to workload.py
carlcsaposs-canonical Apr 14, 2023
7f96a60
remove unused imports
carlcsaposs-canonical Apr 14, 2023
761d5b1
Implement mysql connector methods
carlcsaposs-canonical Apr 17, 2023
6bbd0cf
Use --version instead of -V
carlcsaposs-canonical Apr 17, 2023
e6ef472
temporarily skip unit/lint for integration test
carlcsaposs-canonical Apr 17, 2023
4830446
Use BlockedStatus for missing relation(s)
carlcsaposs-canonical Apr 17, 2023
82d28bd
Add src/relations/__init__.py
carlcsaposs-canonical Apr 17, 2023
279228d
Fix relations imports
carlcsaposs-canonical Apr 17, 2023
81aa07f
Handle non-existent relations
carlcsaposs-canonical Apr 17, 2023
bee49af
wait until mysql router ready
carlcsaposs-canonical Apr 17, 2023
59bacc8
fixup! Handle non-existent relations
carlcsaposs-canonical Apr 17, 2023
172e541
fixup! Use BlockedStatus for missing relation(s)
carlcsaposs-canonical Apr 17, 2023
853877e
Handle non-existent service
carlcsaposs-canonical Apr 17, 2023
79b2cdf
fixup! fixup! Use BlockedStatus for missing relation(s)
carlcsaposs-canonical Apr 18, 2023
bf506d2
add sleep to integration test
carlcsaposs-canonical Apr 18, 2023
b39b0b0
increase sleep
carlcsaposs-canonical Apr 18, 2023
2d27ed8
fix integration test
carlcsaposs-canonical Apr 18, 2023
acb3cbb
format
carlcsaposs-canonical Apr 18, 2023
098a6d0
Add debug logging
carlcsaposs-canonical Apr 18, 2023
74726a2
temp collect logs in CI
carlcsaposs-canonical Apr 18, 2023
9f6437c
deploy mysql-k8s from mysqlrouter-user branch
carlcsaposs-canonical Apr 18, 2023
288a208
add series to test
carlcsaposs-canonical Apr 18, 2023
10be441
add docstring
carlcsaposs-canonical Apr 18, 2023
2cf0d1e
Remove old unit tests
carlcsaposs-canonical Apr 20, 2023
6c59feb
Fix database requested check
carlcsaposs-canonical Apr 20, 2023
56724d4
Support multiple provides relations
carlcsaposs-canonical Apr 20, 2023
5f60dfc
add TODO comment
carlcsaposs-canonical Apr 20, 2023
d4fa025
fix
carlcsaposs-canonical Apr 20, 2023
65da976
fix
carlcsaposs-canonical Apr 20, 2023
e56423a
Fix integration test
carlcsaposs-canonical Apr 21, 2023
24d4fb2
increase timeout
carlcsaposs-canonical Apr 21, 2023
57f42f3
Use shorter ops imports
carlcsaposs-canonical Apr 21, 2023
5ebf1fe
Add mysql_shell.py
carlcsaposs-canonical Apr 21, 2023
076ec59
Add AuthenticatedWorkload
carlcsaposs-canonical Apr 21, 2023
ef6276e
Remove extraneous inits
carlcsaposs-canonical Apr 21, 2023
e511bfd
Refactor TLS
carlcsaposs-canonical Apr 24, 2023
1b9673b
fixup tls
carlcsaposs-canonical Apr 24, 2023
55ac7e7
format
carlcsaposs-canonical Apr 24, 2023
6ece1f9
fix inactive layer
carlcsaposs-canonical Apr 24, 2023
096a176
Remove unused imports
carlcsaposs-canonical Apr 24, 2023
f8b4b89
Move constants to modules
carlcsaposs-canonical Apr 25, 2023
c88df2e
waitingstatus
carlcsaposs-canonical Apr 25, 2023
c6f53f3
Add newline before constants
carlcsaposs-canonical Apr 25, 2023
0e6e46d
fixup! waitingstatus
carlcsaposs-canonical Apr 25, 2023
a8024d9
Error handling
carlcsaposs-canonical Apr 25, 2023
a1ba3d6
copyright
carlcsaposs-canonical Apr 25, 2023
ed68648
lightkube imports
carlcsaposs-canonical Apr 25, 2023
48f05ed
add docstrings
carlcsaposs-canonical Apr 25, 2023
a2a5d15
kw only parameters
carlcsaposs-canonical Apr 25, 2023
048d5a5
kw only dataclasses
carlcsaposs-canonical Apr 25, 2023
a111427
fix docstrings
carlcsaposs-canonical Apr 25, 2023
779b45e
cleanup
carlcsaposs-canonical Apr 25, 2023
8bc9059
add debug logging
carlcsaposs-canonical Apr 25, 2023
4a8e759
logs
carlcsaposs-canonical Apr 25, 2023
83fcfac
update maintainers in metadata.yaml
carlcsaposs-canonical Apr 25, 2023
4d462ba
change password on rebootstrap instead of grabbing it from service
carlcsaposs-canonical Apr 25, 2023
0d2fc02
Switch to mysql user
carlcsaposs-canonical Apr 25, 2023
ff031c1
fixup restart
carlcsaposs-canonical Apr 25, 2023
4aaa7dd
add _bootstrap_router()
carlcsaposs-canonical Apr 25, 2023
80f1051
Port changes from https://github.com/canonical/mysql-router-k8s-opera…
carlcsaposs-canonical Apr 25, 2023
384e77a
Implement mysql_shell _run_commands()
carlcsaposs-canonical Apr 25, 2023
79eaa18
temp fix ci branch remove foresight
carlcsaposs-canonical Apr 25, 2023
07b1a3c
fix: add mysql-connector-python to integration test deps
carlcsaposs-canonical Apr 25, 2023
faf440b
Revert "temp fix ci branch remove foresight"
carlcsaposs-canonical Apr 25, 2023
1bcaacc
Fix log
carlcsaposs-canonical Apr 25, 2023
468778d
Check if workload is enabled before trying to disable it
carlcsaposs-canonical Apr 25, 2023
6618a6c
update todo comment
carlcsaposs-canonical Apr 25, 2023
8311125
fix log
carlcsaposs-canonical Apr 25, 2023
f5ab836
fix mysqlsh connect
carlcsaposs-canonical Apr 25, 2023
ac1b50c
clean up wait until mysql router ready
carlcsaposs-canonical Apr 25, 2023
252ab94
fix disable
carlcsaposs-canonical Apr 25, 2023
d38cbc2
Create different router users for each unit
carlcsaposs-canonical Apr 25, 2023
d5f6812
Fix lint
carlcsaposs-canonical Apr 25, 2023
8ce42e9
Fix circular import
carlcsaposs-canonical Apr 25, 2023
bc5f8cd
Fix circular import
carlcsaposs-canonical Apr 25, 2023
b7c3953
include app name in mysqlrouter username
carlcsaposs-canonical Apr 26, 2023
cc77252
don't create mysqlrouter account on bootstrap
carlcsaposs-canonical Apr 26, 2023
82cfa05
remove `/` from username
carlcsaposs-canonical Apr 26, 2023
694d051
add timeout
carlcsaposs-canonical Apr 26, 2023
7bb78b4
add stdout debug
carlcsaposs-canonical Apr 26, 2023
4d34553
2 min timeout
carlcsaposs-canonical Apr 26, 2023
a4cdc55
catch change error
carlcsaposs-canonical Apr 26, 2023
d8c1904
fix wait for mysqlrouter ready
carlcsaposs-canonical May 2, 2023
dd6f28d
use auto-created user from bootstrap
carlcsaposs-canonical May 2, 2023
8bea6af
add unmerged fix
carlcsaposs-canonical May 2, 2023
4d739f6
update timeout
carlcsaposs-canonical May 2, 2023
5585339
update rock
carlcsaposs-canonical May 2, 2023
b8dbc95
remove --force
carlcsaposs-canonical May 2, 2023
66bb111
Revert "update rock"
carlcsaposs-canonical May 2, 2023
2b1d7cd
remove mkdir
carlcsaposs-canonical May 2, 2023
d5e1cc7
fix tls
carlcsaposs-canonical May 2, 2023
000fd26
fix enabled check
carlcsaposs-canonical May 2, 2023
4a83694
test with personal image
carlcsaposs-canonical May 2, 2023
1e6741c
remove todo comment
carlcsaposs-canonical May 2, 2023
875b668
update rock
carlcsaposs-canonical May 3, 2023
e940743
don't delete user during restart
carlcsaposs-canonical May 3, 2023
41c8cb9
remove todo comment
carlcsaposs-canonical May 3, 2023
c9770b9
format
carlcsaposs-canonical May 3, 2023
662c7c4
revert ci debugging
carlcsaposs-canonical May 3, 2023
992c39c
remove delete user
carlcsaposs-canonical May 4, 2023
f5713fe
try workflow branch
carlcsaposs-canonical May 4, 2023
e0681bb
debug workflow
carlcsaposs-canonical May 5, 2023
fb0b724
Revert "debug workflow"
carlcsaposs-canonical May 5, 2023
b4ab5b4
move handler registration to __init__ in relations modules
carlcsaposs-canonical May 5, 2023
7d2cee5
move disable method from AuthenticatedWorload to Workload
carlcsaposs-canonical May 5, 2023
df827f6
add missing comma
carlcsaposs-canonical May 5, 2023
3d8c60a
Revert "try workflow branch"
carlcsaposs-canonical May 5, 2023
1c09901
debug ci
carlcsaposs-canonical May 5, 2023
547f2f7
Don't wait for all apps to be ready before relating in integration test
carlcsaposs-canonical May 5, 2023
1441be2
remove unused import
carlcsaposs-canonical May 5, 2023
84aba2c
remove todo comment
carlcsaposs-canonical May 5, 2023
d1b79d9
Revert "debug ci"
carlcsaposs-canonical May 5, 2023
f597fe7
add docstrings
carlcsaposs-canonical May 5, 2023
a3555da
Revert "Revert "debug ci""
carlcsaposs-canonical May 5, 2023
9b0c387
Revert "Revert "Revert "debug ci"""
carlcsaposs-canonical May 5, 2023
4477ed3
debug ci
carlcsaposs-canonical May 5, 2023
0e86906
only disable workload if container ready
carlcsaposs-canonical May 8, 2023
9237e7d
Remove deletion of users when mysql charm relation broken
carlcsaposs-canonical May 8, 2023
a9b7272
Use WaitingStatus while mysql relation is active but resource unavail…
carlcsaposs-canonical May 8, 2023
afd0e35
format
carlcsaposs-canonical May 8, 2023
a677943
fix status handling on relation broken
carlcsaposs-canonical May 8, 2023
2c90119
fix
carlcsaposs-canonical May 8, 2023
71993e2
fix
carlcsaposs-canonical May 8, 2023
73d3a73
alphabetize
carlcsaposs-canonical May 8, 2023
a9ff4a1
lint
carlcsaposs-canonical May 9, 2023
c4357fe
Add model name to database username
carlcsaposs-canonical May 9, 2023
80ef5ad
fix private
carlcsaposs-canonical May 9, 2023
5845c7e
Use username from mysql relation as prefix
carlcsaposs-canonical May 9, 2023
2592456
change attribute name
carlcsaposs-canonical May 9, 2023
a410463
Clean up router metadata
carlcsaposs-canonical May 10, 2023
25f1cfd
Fix type annotation
carlcsaposs-canonical May 10, 2023
b53cbd6
Fix argument
carlcsaposs-canonical May 10, 2023
ef8889f
Add comments for flake8 ignores
carlcsaposs-canonical May 10, 2023
04ad8b3
switch log to warning
carlcsaposs-canonical May 11, 2023
89dfe92
Delete router user on pod restart
carlcsaposs-canonical May 11, 2023
60d21fc
debug log
carlcsaposs-canonical May 11, 2023
e68d0e1
fix sql arguments
carlcsaposs-canonical May 11, 2023
17740a8
only report relations status on leader unit
carlcsaposs-canonical May 11, 2023
14ee110
shorten application to app in status message
carlcsaposs-canonical May 12, 2023
43dcc54
format
carlcsaposs-canonical May 12, 2023
f016e20
add unit name attribute to mysql router user
carlcsaposs-canonical May 12, 2023
7c54c3d
format
carlcsaposs-canonical May 12, 2023
44dead8
enable GR notifications
carlcsaposs-canonical May 12, 2023
12889d5
use constant
carlcsaposs-canonical May 12, 2023
118f921
remove svc.cluster.local hard-coding
carlcsaposs-canonical May 12, 2023
0f46562
Remove `--conf-use-gr-notifications`
carlcsaposs-canonical May 15, 2023
1b2d206
update comment
carlcsaposs-canonical May 15, 2023
2befc4c
patch k8s service on install
carlcsaposs-canonical May 15, 2023
f9e1ea8
Revert "Remove `--conf-use-gr-notifications`"
carlcsaposs-canonical May 15, 2023
ba1da60
Update sans
carlcsaposs-canonical May 15, 2023
2270eae
Update comment
carlcsaposs-canonical May 15, 2023
3a0da55
revert workflow debug
carlcsaposs-canonical May 15, 2023
a443d54
change database name
carlcsaposs-canonical May 15, 2023
78e9922
update sans
carlcsaposs-canonical May 15, 2023
177b580
remove router id from databag
carlcsaposs-canonical May 16, 2023
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
29 changes: 4 additions & 25 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: 'Foresight: Collect workflow telemetry'
uses: runforesight/foresight-workflow-kit-action@v1
- name: Checkout
uses: actions/checkout@v3
- name: Install tox
Expand All @@ -34,24 +32,13 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: 'Foresight: Collect workflow telemetry'
uses: runforesight/foresight-workflow-kit-action@v1
- name: Checkout
uses: actions/checkout@v3
- name: Install tox
# TODO: Consider replacing with custom image on self-hosted runner OR pinning version
run: python3 -m pip install tox
- name: Run tests
run: tox run -e unit -- --junit-xml=pytest_report.xml
- name: 'Foresight: Collect test results'
uses: runforesight/foresight-test-kit-action@v1
if: ${{ success() || failure() }}
with:
test_framework: PYTEST
test_format: JUNIT
test_path: pytest_report.xml
coverage_format: LCOV/TXT
coverage_path: coverage.lcov
run: tox run -e unit

build:
name: Build charms
Expand All @@ -66,13 +53,12 @@ jobs:
name: ${{ matrix.tox-environments }}
needs:
- lint
- unit-test
# TODO: re-enable after adding unit tests
#- unit-test
- build
runs-on: ubuntu-latest
timeout-minutes: 120
steps:
- name: 'Foresight: Collect workflow telemetry'
uses: runforesight/foresight-workflow-kit-action@v1
- name: Checkout
uses: actions/checkout@v3
- name: Setup operator environment
Expand All @@ -98,16 +84,9 @@ jobs:
fi
- name: Run integration tests
# set a predictable model name so it can be consumed by charm-logdump-action
run: sg microk8s -c "tox run -e ${{ matrix.tox-environments }} -- -m '${{ steps.select-tests.outputs.mark_expression }}' --model testing --junit-xml=pytest_report.xml"
run: sg microk8s -c "tox run -e ${{ matrix.tox-environments }} -- -m '${{ steps.select-tests.outputs.mark_expression }}' --model testing"
env:
CI_PACKED_CHARMS: ${{ needs.build.outputs.charms }}
- name: 'Foresight: Collect test results'
uses: runforesight/foresight-test-kit-action@v1
if: ${{ success() || failure() }}
with:
test_framework: PYTEST
test_format: JUNIT
test_path: pytest_report.xml
- name: Dump logs
uses: canonical/charm-logdump-action@main
if: failure()
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: 'Foresight: Collect workflow telemetry'
uses: runforesight/foresight-workflow-kit-action@v1
- name: Checkout
uses: actions/checkout@v3
with:
Expand Down
4 changes: 2 additions & 2 deletions metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
name: mysql-router-k8s
display-name: MySQL Router
maintainers:
- Carl Csaposs <carl.csaposs@canonical.com>
- Paulo Machado <paulo.machado@canonical.com>
- Shayan Patel <shayan.patel@canonical.com>
description: |
Expand Down Expand Up @@ -30,7 +31,6 @@ resources:
mysql-router-image:
type: oci-image
description: OCI image for mysql-router
# TODO: replace with canonical maintained image
upstream-source: dataplatformoci/mysql-router:8.0-22.04_edge
upstream-source: ghcr.io/canonical/charmed-mysql@sha256:017605f168fcc569d10372bb74b29ef9041256bd066013dec39e9ceee8c88539
assumes:
- k8s-api
4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ exclude = [".git", "__pycache__", ".tox", "build", "dist", "*.egg_info", "venv"]
select = ["E", "W", "F", "C", "N", "R", "D", "H"]
# Ignore W503, E501 because using black creates errors with this
# Ignore D107 Missing docstring in __init__
ignore = ["W503", "E501", "D107"]
# Ignore D415 Docstring first line punctuation (doesn't make sense for properties)
# Ignore D403 First word of the first line should be properly capitalized (false positive on "MySQL")
ignore = ["W503", "E501", "D107", "D415", "D403"]
carlcsaposs-canonical marked this conversation as resolved.
Show resolved Hide resolved
# D100, D101, D102, D103: Ignore missing docstrings in tests
per-file-ignores = ["tests/*:D100,D101,D102,D103,D104"]
docstring-convention = "google"
Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@ cryptography==39.0.1
jsonschema==4.17.3
lightkube-models==1.24.1.4
lightkube==0.11.0
mysql-connector-python
ops >= 2.0.0
tenacity==8.0.1
Loading