Add support for operator plugins#532
Merged
jacobtomlinson merged 10 commits intodask:mainfrom Aug 22, 2022
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is the result of a chat with @bstadlbauer about extending the functionality of the operator. The specific context is what if the user wants the operator to create other resources like Istio
VirtualSerivce,GatewayandCertificateresources. Extra resources like this may end up being a common requirement, but given the endless possibilities of k8s cluster setups it's hard to make this configurable.Full Slack conversation
One option would be to allow users to create an extension to the operator that creates these resources automatically.
This PR loads in additional modules via a
dask_operator_pluginentrypoint. Any code in that module that useskopfdecorators to register event handlers also gets loaded.The core Dask operator with handle authentication and all that so if you want additional actions to happen when a
daskclusterresource is created for example then you can write a plugin this was and watch for the right event.Or more specifically you could watch for the scheduler service getting created.
So to create a plugin you just create a Python package with an entrypoint and to install it you just install that package in the operator container image.