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

Implement WASI Controller #2

Closed
4 tasks
GeorgeMac opened this issue Jul 20, 2023 · 0 comments · Fixed by #23
Closed
4 tasks

Implement WASI Controller #2

GeorgeMac opened this issue Jul 20, 2023 · 0 comments · Fixed by #23
Milestone

Comments

@GeorgeMac
Copy link
Contributor

GeorgeMac commented Jul 20, 2023

Controller will handle building and invoking implementations of controllers and it will live in pkg/controller.

This issue will acts as a parent issue for implementing each of the operations supported by the Controller.

The controller is reponsible for invoking the configured wasm binary accordingly for each of these operations.

Implementation Details

The initial lifecycle of the controller will likely involve:

  1. Taking a resource definition path
  2. Opening, parsing and validation the resource definition
  3. Sourcing the associated controller binary

FS Abstractions

Each method on a controller will require access to a filesystem of sorts.
Currently, the plans for the shape of this interface is up in the air.
In the near term we can use gitfs for reads and an actual directory on disk for writes.
In the future we would like the use the (yet to be exported) Wazero abstractions.

So in the near-term, the controller package will abstract this details behind a struct with unexported fields.
Implementations of the FilesystemStore will decide what is appropriate based on either read (view) or write (update) level of requested access.

We will hide this details behind the following types and functions:

package controller

import "io/fs"

type FSConfig struct {
    fs fs.FS
    dir *string
}

func NewFSConfig(fs fs.FS) FSConfig { return FSConfig {fs: fs} }

func NewDirFSConfig(dir string) FSConfig { return FSConfig {dir: &dir} }

This will allow us to make adjustments over time without effecting the API server implementation.

Each Controller request structure will require a FSConfig as an argument.

Success Criteria

We have added support for each of the four core controller operations.

@GeorgeMac GeorgeMac changed the title Implement Executor Implement Controller Jul 20, 2023
@GeorgeMac GeorgeMac added this to the POC milestone Jul 20, 2023
@GeorgeMac GeorgeMac changed the title Implement Controller Implement WASI Controller Jul 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant