-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Ansible Operator Plugin Extraction #6355
Comments
Would it be a good idea to dogfood v3 plugins via this?. We said in the past that that would require a major version bump of sdk and distributing multiple binaries, are we sure that is the case? Is it a worth doing even if that's true? |
@jberkhahn By v3 plugins do you mean the Phase 2 Plugins introduced by Kubebuilder? (these are the external plugins that require a binary and would therefore not be shipped as part of the SDK binary) |
Moving ansible plugin out of SDK seems a great step towards making the development and release process of the plugin and the SDK binary easier. Doing so using phase 1.5 plugin architecture does bring in some of the questions which I'm adding below. It would be helpful to know if these have already been discussed and investigated before proceeding:
I'm not against externalizing plugins and completely understand the benefits of doing so, which is the whole reason why phase 2 was introduced. If phase 2 intends to solve the issues we are facing now, and is something that we encourage other plugin authors to follow, why shouldn't we ourselves do the same? Though I understand that this would require creating separate binaries which are not a part of SDK, and we are hesitant making that change in a minor version, we could still work towards it by externalizing using the phase 2 plugins first, followed by removing them internally from SDK. The SDK users would still not face any breaking change in terms of plugin scaffoldings with phase 2 - which is the most important factor (if not, it would have been reasonable to do SDK 2.0). Is making a bunch of changes to SDK currently to externalize the plugin with phase 1.5 and carrying over the tech debt of moving to phase 2.0 really worth it? Why can't we put in the efforts for phase 2 right away and not punt the decision for later. |
er yeah, v2 plugins. I forget where we are with the numbers |
In the community meeting we discussed breaking this out into a Phase 2 Plugin. I'm going to be creating a new repository under my GitHub account to extract all the ansible specific logic and begin the process. This is likely to be a long running effort so I will post updates here as I have time and will do my best to include what I think the next steps would be in each update. Thanks! |
My stab at extracting the ansible specific logic: https://github.com/everettraven/ansible-external-poc |
Issues go stale after 90d of inactivity. Mark the issue as fresh by commenting If this issue is safe to close now please do so with /lifecycle stale |
/remove-lifecycle stale /lifecycle frozen |
Motivation
The extraction of the Ansible Operator Plugin (and other associated items) is meant to help simplify the maintenance burden of the Operator-SDK by only keeping the components that are essential to the core Operator-SDK CLI in the Operator-SDK repository.
By extracting the Ansible Operator Plugin from the Operator-SDK repository and moving it to it's own repository, we ensure that we can iterate and make changes to the Ansible Operator Plugin's master branch without causing the Operator-SDK CI and/or releases to break.
Goals
How can we accomplish this?
After some discussion in the community, there are a few open questions that this section will provide potential solutions for:
Component Extraction
At a high level, the following would need to be extracted:
At a lower level, the following sections of code would likely need to be moved:
We would also need to remove from the Operator-SDK:
operator-sdk/Makefile
Lines 98 to 101 in 9d2f672
operator-sdk/Makefile
Lines 196 to 201 in 9d2f672
Testing
An important part of extracting this plugin is ensuring that we are still able to test the plugin and the associated components. Unit testing things like the Ansible Operator binary and the controller implementations should be relatively easy as it should be a direct port.
E2E testing is where it gets a little trickier but I think can be done in a couple different ways.
Building the SDK from source, substituting the plugin dependency
One way in which we can e2e test the plugin is to clone the Operator-SDK source, substitute the plugin dependency with a local version in the go.mod, build the Operator-SDK and then continue on testing the same way the Operator-SDK currently does.
To substitute the plugin dependency we would need to inject a dependency replacement in the go.mod that looks like:
This process is a fairly complex e2e workflow, but ensures that the ansible operator plugin changes will work with the current changes in the Operator-SDK repository.
Using Kubebuilder CLI library
Since the Operator-SDK utilizes the the Kubebuilder CLI library to actually handle the scaffolding logic and plugins, we could use the same Kubebuilder CLI library to create our testdata. While this means it doesn't get built into the Operator-SDK binary for testing, it would be following a very similar (if not identical) flow. This would keep the e2e workflow much more simple and entirely contained to the ansible operator plugin repository.
This would mean implementing a testdata generation script that creates and runs the testdata CLI. This could look something like:
This way we have a minimal CLI that closely mimics the Operator-SDK used specifically for our testdata generation. Once the testdata is generated, we can follow the same process that is used by the Operator-SDK for it's current e2e testing.
Versioning and Releasing
Moving the Ansible Operator Plugin to it's own repository would mean we need to release and version this repository separately from the Operator-SDK.
The majority of the effort would be around creating the release process, which would likely require writing automation and release scripts to create a release based on a pushed tag. For a particular release version the following artifacts should be produced:
A potential versioning strategy for this separate repository would be to start the first release after extraction at v1.0.0 (the current version of the ansible plugin) and follow semver for future releases. Ideally there are no changes made to the core of the ansible operator plugin during the extraction process and a v1.0.0 release is cut immediately after the extraction is finalized.
The text was updated successfully, but these errors were encountered: