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

Simplify packaging and configuring controllers #33

Open
GeorgeMac opened this issue Aug 1, 2023 · 1 comment
Open

Simplify packaging and configuring controllers #33

GeorgeMac opened this issue Aug 1, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@GeorgeMac
Copy link
Contributor

GeorgeMac commented Aug 1, 2023

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:

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
@GeorgeMac GeorgeMac added the enhancement New feature or request label Aug 9, 2023
@GeorgeMac
Copy link
Contributor Author

Something like the following could also be preferable:
https://github.com/solo-io/wasm/blob/master/spec/spec-compat.md

This is the solo.io WASM format, that is compatible with docker build and push.
That would make the tooling a lot easier to get going with.
If you have Docker, it could just be a json file next to a wasm binary with a well-known name or configurable name in the well-known configuration file.

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

No branches or pull requests

1 participant