-
Notifications
You must be signed in to change notification settings - Fork 1
Description
More often than not, controllers will be defined and scoped to a set of supported resource types.
For example, the Flipt controller handles Flipt and Segment resource types only.
It should therefor be possible to bundle both the Controller WASM binary and its support definitions in a single artefact. The most promising format is likely OCI.
With the https://github.com/oras-project/oras-go project we could add support for bundling WASM binaries with their associated resources type directly into cup and cupd. cupd could support sourcing controllers and definitions directly from OCI registries.
Here are some useful links for design ideas around packing:
- ORAS Artifact Concepts I think it might be best to store
- Helm Proposal for their OCI bundling support
Quick sketch of what a manifest might look like for cup:
{
"schemaVersion": 2,
"artifactType": "application/vnd.io.flipt.cup.controller+type",
"config": {
"mediaType": "application/vnd.oci.empty.v1+json",
"digest": "sha256:44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a",
"size": 2
},
"layers": [
{
"mediaType": "application/vnd.io.flipt.cup.controller.content.v1.tar+gzip",
"digest": "sha256:1b251d38cfe948dfc0a5745b7af5ca574ecb61e52aed10b19039db39af6e1617",
"size": 7364
},
{
"mediaType": "application/vnd.io.flipt.cup.resource.v1+json",
"digest": "sha256:3e207b409db364b595ba862cdc12be96dcdad8e36c59a03b7b3b61c946a5741a",
"size": 384
}
]
}cup subcommands
One of more new subcommand(s) would be useful for packing, publishing and pulling Cup controllers.
We will need to support users being able to:
- bundle together wasm controller binaries with resource definitions
- pushing named and tagged images to OCI registries
- (optional/stretch) pulling and unpacking / introspecting remote images
cupd controller definition
The Controller definition will need extending to support referencing a registry and tag.
The controller will need to:
- establish a local or inmemory oras store
- copy the target from the remote into the store (if local we could cache between starts of cup somewhere)
- configure the resource definitions found in the image
- compile and configure the controller with the wasm binary