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

META - Extension mechanism enhancements #1894

Open
5 tasks
iameskild opened this issue Aug 4, 2023 · 4 comments
Open
5 tasks

META - Extension mechanism enhancements #1894

iameskild opened this issue Aug 4, 2023 · 4 comments
Labels
impact: high 🟥 This issue affects most of the nebari users or is a critical issue type: enhancement 💅🏼 New feature or request

Comments

@iameskild
Copy link
Member

iameskild commented Aug 4, 2023

"Composition over Inheritance"

  • The current structure is heavily inheritance based (NebariStage --> NebariTerraformStage --> KubernetesInfrastructureStage). This means there is a higher likelihood of changes that are made to base classes causing breaking changes for their inherited class.
  • How can we break up the stages into smaller, reusable components?
  • What are the interfaces we want to design?
    • render
    • deploy
    • destroy

Tasks

Preview Give feedback
  1. area: dependencies 📦 area: user experience 👩🏻‍💻
  2. area: integration/keycloak area:developer-experience 👩🏻‍💻 type: enhancement 💅🏼
  3. area:developer-experience 👩🏻‍💻 type:extension
  4. area: dependencies 📦 type: enhancement 💅🏼 type:extension
  5. area: k8s ⎈ type: enhancement 💅🏼 type:extension
@iameskild iameskild added type: enhancement 💅🏼 New feature or request impact: high 🟥 This issue affects most of the nebari users or is a critical issue project: JATIC Work item needed for the JATIC project labels Aug 7, 2023
@sblair-metrostar
Copy link
Contributor

sblair-metrostar commented Aug 14, 2023

Thanks for starting this discussion, @iameskild. Really excited to get this extensions rewrite out the door. Ken and I will be spending some time this week testing all this in preparation for release, at least on the AWS side. Aside from any issues that come out of that, here are some of my thoughts from having worked with the plugins so far.

Make users explicitly determine the stage plugins they want to use instead of registering all plugins that are pip installed

Completely agree with this point. Auto-installing plugins based on what's found in the environment has revealed several logical problems already.

  • Managing multiple environments with different plugin configurations gets messy and is really easy to screw up. Several times I've accidentally installed a plugin in an environment I didn't mean to.
  • Possibly a subcommand to handle installing and uninstalling plugins. Can update the nebari-config.yaml, handle cleanup and uninstallation, etc...

Create Keycloak (auth) provider object (to create new Keycloak clients, roles, etc)

While I agree a reusable component that would serve to configure Keycloak clients and whatnot for downstream plugins would be valuable, my concern with creating a provider (presumably without Terraform) would just lead to reinventing the Terraform provider. Would like to maybe discuss what the failings of the Terraform approach are and brainstorm solutions to those before reinventing any wheels.

  • Difficult to nebari destroy Keycloak stages if the cluster is unavailable or the Keycloak API is inaccessible. Should just be able to skip stages like this anyway since there's no need to deconfigure Keycloak if I'm just destroying the environment anyway.
  • Maybe have nebari render capable of generating shared Terraform modules that a Nebari Keycloak class can reference and be reused in plugin stages.

"Composition over Inheritance"

I think this one is going to be critical for breaking out of the Terraform mold, as the current inheritance based approach coupled with the limitations in managing subcomponents is naturally leading us to a single stage + Terraform lowest common denominator pattern. Being able to more easily split plugins into subcomponents would improve testability and maintainability, as well as expanding options for non-Terraform solutions where appropriate.

  • Base stage class that defines properties/methods for composition of plugins.
  • Add subcomponents to a list or something that the base class is responsible for orchestrating the render/deploy/destroy behaviors, shared configuration, output composition, whatever.

Confirm that the DNS auto-provision is working as expected

Suggest maybe moving toward something like External DNS as a more versatile solution. The Cloudflare auto-provision is helpful for my specific case but is overly specific to Cloudflare and can't realistically be expanded to cover other DNS providers without a ton of work.

Other issues/items I'd add to the conversation:

  • Can't install a plugin more than once since 1) the package is detected in the environment and can only be pip install once, and 2) the name is hard coded in the plugin so multiple instances would conflict anyway. As an example, I'd like to be able to create a generic Helm chart plugin to replace the old helm extensions but lets me fix some of its limitations (namespacing, private repos, secrets, whatever).
  • A stage plugin package should be treated as a single component by Nebari. Currently, if my plugin exports multiple subcomponents (AWS Terraform stage, Keycloak, etc...) they are treated as separate stages by Nebari and have no inherent connection to each other besides the packaging. This relates to the composition/inheritance issue, so moving away from an inheritance model would be a big step.
  • No clear way to uninstall a plugin aside from destroying the whole environment. This ties into the point about pivoting away from automagically registering plugins that are present in the environment toward a more deterministic configuration based solution. Will need a way to have the code for a plugin present in the system but not assumed to want it deployed, also probably a subcommand to manage uninstalling it. Should have something cleaner though so it can be managed with CI/CD pipelines.

I'll probably have more to add to this, just wanted to get some initial thoughts down.

@dharhas
Copy link
Member

dharhas commented Aug 17, 2023

Can we start splitting these into individual issues and linking them above. It feels like several of these coould be worked on independently and a few need to be coupled and worked on by one person. This is a good meta issue but have smaller individual tasks should help us divide and conquer and move forward.

Great discussion by the way I like where this is going.

@pavithraes
Copy link
Member

Can we start splitting these into individual issues and linking them above. It feels like several of these coould be worked on independently and a few need to be coupled and worked on by one person. This is a good meta issue but have smaller individual tasks should help us divide and conquer and move forward.

+1, I suggest using GitHub's tasklists - it's a little buggy but convenient to convert tasks into issues as required + track them.

@pavithraes pavithraes changed the title [ENH] Extension mechanism enhancements META - Extension mechanism enhancements Aug 22, 2023
@iameskild
Copy link
Member Author

Okay the open tasks have been converted to individual issues.


Originally we also included:

  • Clean up init and --guided-init
    • Add more comprehensive tests these
  • Confirm that the DNS auto-provision is working as expected
    • Add more comprehensives tests

For item one:

For item two:

@pavithraes pavithraes moved this from New 📬 to In progress 🏗 in 🪴 Nebari Project Management Aug 28, 2023
@kcpevey kcpevey removed the project: JATIC Work item needed for the JATIC project label Aug 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
impact: high 🟥 This issue affects most of the nebari users or is a critical issue type: enhancement 💅🏼 New feature or request
Projects
Status: In progress 🏗
Development

No branches or pull requests

5 participants