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

Switch from Go native plugins to external binary plugins #363

Open
autodidaddict opened this issue Aug 19, 2024 · 1 comment
Open

Switch from Go native plugins to external binary plugins #363

autodidaddict opened this issue Aug 19, 2024 · 1 comment
Assignees
Labels
feature New feature request proposal Enhancement idea or proposal

Comments

@autodidaddict
Copy link
Contributor

Proposed change

Rather than loading dynamic libraries compiled only in Go (which therefore also prevents a plugin-enabled agent from being statically compiled), we should instead adopt the "plugins over stdio" pattern (or a similar variant), loading executable binaries and communicating with them via some transport contract.

Use case

This would allow plugins to be written in other languages than Go, taking advantage of different ecosystems for different workload types. Further, by no longer dynamically loading Go-based plugins, the agent wouldn't have to be statically compiled. Even further further, the agent wouldn't have to have dependencies like V8 (which has strict requirements as well as CGO issues) or WebAssembly. This leaves the agent slim, supporting only process execution for native and plugin-based workloads.

Contribution

No response

@autodidaddict autodidaddict added the proposal Enhancement idea or proposal label Aug 19, 2024
@autodidaddict autodidaddict self-assigned this Aug 19, 2024
@autodidaddict autodidaddict added the feature New feature request label Aug 19, 2024
@autodidaddict
Copy link
Contributor Author

I think a design that might make this pretty straightforward to implement might be as follows:

  • When we launch a pluggable workload execution provider (after discovery), the agent supplies the NATS URL and the nkey for the internal NATS server to the execution command (identical to how we do today with native workloads)
  • execution provider load the appropriate temp file (the cached artifact), the temp file is produced by the agent proper
  • the execution provider subscribes (if applicable) to agentint.{vmId}.trigger on the internal connection
  • the execution provider is responsible for plugging the workload type into host services wherever appropriate
  • execution provider plugin can also listen for undeploy and stop itself

we're already pushing the plugin path down with the machine metadata, which means we can just reuse that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature request proposal Enhancement idea or proposal
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant