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

Update data_interfaces lib to include opensearch provider #30

Merged
merged 225 commits into from
Mar 8, 2023
Merged

Conversation

WRFitch
Copy link
Contributor

@WRFitch WRFitch commented Feb 8, 2023

Proposal

Updates data_interfaces lib to include objects and events to manage the opensearch provider lib, as well as TLS.

Context

  • While the changes in the data_interfaces library aren't unique to this repo, I've chosen to add them here first so we can ensure they're fit for purpose, and then we can add the finished library to the data-integrator repo.
  • The data-integrator changes are duplicated across the opensearch and integration test application charm lib/ directories. This should be an exact duplication.
  • rollingops lib has been updated to update locks on leader_elected. If the leader is replaced during a rolling op, the new leader never receives the process_locks event, so it never runs the op. A PR has been opened for this here, but again, I'm testing my changes here before merging.
  • This PR is definitely getting a merge commit into main so I don't nuke our commit history

Changelog

  • Updated data_interfaces lib to include OpenSearchProvider and OpenSearchRequirer objects, and events associated with opensearch.
  • data_interfaces lib has been updated to the correct ops version
  • Added TLS to opensearch provider relation
  • Added data_interfaces OpenSearchProvider to provider relation
  • Updated endpoint update method to guarantee we have the correct number of endpoints in the databag when scaling
  • added data_interfaces OpenSearchRequirer to requirer application test charm
  • Deferred starting opensearch if the init script fails to connect
  • Possible fix for a bug where update-status fails if we remove the tls-operator
  • Fixed some typos and formatting
  • Updated rollingops lib to update locks on leader_elected
  • Updated integration tests

Testing

  • Added unit tests
  • Added more extensive integration tests, which test the following:
    • opensearch API access while scaling
    • Checks that index data persists across relations

WRFitch and others added 30 commits January 18, 2023 11:17
Adding fmt to default tox runs means we don't have to run it after finding lint doesn't work
moving lib tests to a dedicated folder means they're easier to find/differentiate from charm-specific tests
# PR
link: #26

Some QoL changes from pgbouncer that may be useful, copyright updates, and a library import to declutter PR #25 

 ## Commits
* updated gitignore and copyright string

* imported lib and updated CI

* imported data_interfaces lib

* update libjuju for testing

* Update ci.yaml
Copy link

@welpaolo welpaolo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, please add the function requested due to the change of the charm-relation-interfaces.

relation_id: the identifier for a particular relation.
version: database version.
"""
self._update_relation_data(relation_id, {"version": version})
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the provider side, you will need to include the index parameter: canonical/charm-relation-interfaces#42.
In this case you will need to add a new function set_index in the provider.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for letting me know, I've also opened a PR in that repo since the opensearch spec didn't get the update :(

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this has been added in ce1ded6

Copy link
Contributor

@deusebio deusebio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks all good to me!

lib/charms/opensearch/v0/opensearch_relation_provider.py Outdated Show resolved Hide resolved
@WRFitch WRFitch requested a review from delgod March 8, 2023 13:29
@delgod delgod merged commit 63b13c1 into main Mar 8, 2023
@delgod delgod deleted the dev/add-lib branch March 8, 2023 14:08
carlcsaposs-canonical added a commit that referenced this pull request Mar 18, 2024
Handler is never called

Handler was first added in #30 but a call to the handler was not added
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.

5 participants