✨ Migrate to go-plugin system for provisioners#3166
✨ Migrate to go-plugin system for provisioners#3166s3rj1k wants to merge 1 commit intometal3-io:mainfrom
Conversation
|
Skipping CI for Draft Pull Request. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
@dtantsur This is how possible go plugin migration can look like |
|
This is not terrible, honestly. I'd like to hear from other folks, especially those more knowledgeable in Go, but this approach looks good to me. |
If that lands, anyone could implement any (Lua, JS, Starlark, ...) interpreted runtime glue as go plugin or just directly use compiled Go code as plugin. |
0d28199 to
623a641
Compare
|
/cc @Rozzii |
6fe05e8 to
031e5e1
Compare
|
|
||
| ```text | ||
| plugin was built with a different version of package <pkg> | ||
| ``` |
There was a problem hiding this comment.
This may be a big problem in practice, and per https://pkg.go.dev/plugin it's virtually impossible to have plugins that are compiled separately from BMO itself. If so, isn't it easier to adjust the build process so that a different provisioner can be compiled in? And then add a flag to chose provisioner by name (not by its .so path)?
There was a problem hiding this comment.
You need to compile with same SDK env yes.
that a different provisioner can be compiled in
I want to ensure that we have ability to have out-of-tree plugins, not fork and add code into BMO repo
And then add a flag to chose provisioner by name (not by its .so path)?
That would mean hardcoding some specific path into BMO, I don't see any major issue with that, can be done
There was a problem hiding this comment.
Presumably someone could create an out-of-tree provisioner today and vendor the desired version of BMO to provide the controller (i.e. without having to fork BMO itself and add the provisioner code to it).
It seems like plugin authors would have to vendor BMO anyway in order to get the same versions of dependencies, so I guess it's not really clear to me what this is buying them.
There was a problem hiding this comment.
Presumably someone could create an out-of-tree provisioner today and vendor the desired version of BMO to provide the controller
Have you tried to do that?
It seems like plugin authors would have to vendor BMO anyway
Vendoring go.mod is not a real vendoring
I guess it's not really clear to me what this is buying them
It gives consumer ability to use officially shipped BMO release binary with their plugin as opposed to shipping a rebuild of BMO and plugin.
There was a problem hiding this comment.
In recent rebase I've added .github/workflows/plugin-test.yml workflow and Dockerfile.plugin-test so we could verify OOT flow and how vendoring is supposed to work.
I would appreciate if someone could trigger Copilot on this PR, so we could catch other possible issues
|
I meant to drop one comment, which failed (probably some browser issues), but 'Mahnoor started a review' is now showing up on the page for me atlease 😅 |
ba0d6ba to
27d1290
Compare
Signed-off-by: s3rj1k <evasive.gyron@gmail.com>
What this PR does / why we need it:
Migrate provisioners to go-plugin system for out-of-tree runtime BYO custom provisioner registration.
Checklist: