Skip to content

Comments

WASM plugin support#70

Draft
bastjan wants to merge 2 commits intomainfrom
plugins
Draft

WASM plugin support#70
bastjan wants to merge 2 commits intomainfrom
plugins

Conversation

@bastjan
Copy link
Member

@bastjan bastjan commented Jun 9, 2025

This PR allows registering and running WASM plugins from OCI registries like ghcr.io.

There is currently supoprt for context plugins.

The plugin lifecycle is managed separately from the ManagedResource. For each plugin a runner pool is spawned. The repository is continously monitored for new versions and runners are replaced transparently if a new version exists.

The code on this branch can be tested by:

kubectl apply -k config/crd
go run ./main.go controller --enable-dynamic-admission-webhook=false --alpha-plugins=true

TODOs

  • Better data passing interfaces. We might want to go with WASM reactor mode and pass data using protobuf or json.
    • Plugin global conf/ better conf from managed resource/ Retrospection from plugin?
  • Trigger and output variants of plugins
    • Small supervisor for the trigger plugin.
  • Better docs/how-tos
    • Rust and Go sample plugins
  • Plugin versioning interface.
    The plugin should export a fucntion espejote_plugin_version and espejote_plugin_capabilities.
    OR maybe better: Configure using a "custom section" which would not violate spec by calling a function before _initialize.
  • More metrics (compile time, run time, pool usage, ...)
  • PullPolicies? Always, IfNotPresent, Never?

Bonus TODOs

  • Implement some form of virtual file system in stealthrocket/wasi-go for passing /etc/resolv.conf and the TLS certificates.
    They are open for contributions Name resolution does not work without filesystem access dispatchrun/wasi-go#82
  • The current pool implementation rotates runners as such that all capacity is filled which is a bit wasteful. Update the implementation or dynamically scale capacity.

Checklist

  • Categorize the PR by setting a good title and adding one of the labels:
    bug, enhancement, documentation, change, breaking, dependency
    as they show up in the changelog
  • Update tests.

@bastjan bastjan added the enhancement New feature or request label Jun 9, 2025
@bastjan bastjan force-pushed the plugins branch 9 times, most recently from 741edac to ea178e7 Compare June 10, 2025 14:56
@bastjan bastjan changed the title Initial plugin draft WASM plugin support Jun 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant