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

support oci_uri as a remote data source for wasm #33212

Open
arkodg opened this issue Mar 29, 2024 · 14 comments
Open

support oci_uri as a remote data source for wasm #33212

arkodg opened this issue Mar 29, 2024 · 14 comments
Labels
area/wasm enhancement Feature requests. Not bugs or questions. help wanted Needs help!

Comments

@arkodg
Copy link
Contributor

arkodg commented Mar 29, 2024

Title: One line description

Description:

Envoy only supports fetching a WASM module remotely via http

Majority of the WASM Modules now live in OCI Registries, so would be great if an oci field was supported to allow users to fetch WASM modules directly instead of using a shim (an auxiliary control plane creating a temporary file server or a sidecar agent that prefetches from an OCI registry and persists it into the common filesystem) that deals with the CRUD state machine

[optional Relevant Links:]

Any extra documentation required to understand the issue.

@arkodg arkodg added enhancement Feature requests. Not bugs or questions. triage Issue requires triage labels Mar 29, 2024
@arkodg arkodg changed the title support oct_uri as a remote data source for wasm support oci_uri as a remote data source for wasm Mar 29, 2024
@yanavlasov yanavlasov added area/wasm help wanted Needs help! and removed triage Issue requires triage labels Mar 29, 2024
@yanavlasov
Copy link
Contributor

Adding @lizan and @mpwarres as area owners

@kyessenov
Copy link
Contributor

@arkodg
Copy link
Contributor Author

arkodg commented Apr 1, 2024

  1. Format - hoping an expert who's already worked with a WASM OCI Artifact related working group in the past can help with clarity here
  1. requested @zhaohuabing to look into Add support for https uri in extensions.wasm.v3.VmConfig #29824 when he has some free cycles

@kyessenov @yanavlasov can try and find a contributor from the community to help with this feature, once its been accepted

@jewertow
Copy link
Contributor

requested @zhaohuabing to look into #29824 when he has some free cycles

@zhaohuabing did you already start or are you going to start working on this issue soon? If not, I could take care of it.

@zhaohuabing
Copy link
Member

@jewertow I haven't started on this. Please feel free to move on if you have time.

@kyessenov
Copy link
Contributor

If you're going to implement it, let's settle on the two design issues:

  • Caching: we probably don't want to fetch 100MB by URL every single time a listener is loaded. That requires some caching strategy, with expiration.
  • Reliability: how do we stage xDS and not apply a Wasm config until the blob is fetched? What happens if the blob fails to be fetched?

@jewertow
Copy link
Contributor

@kyessenov are your suggestions relevant for HTTPS URI or for OCI? I was going to start with HTTPS URI and I didn't investigate the scope of OCI yet.

@kyessenov
Copy link
Contributor

Yes, they are. OCI is not that different from a regular HTTPS. It's just a tar with structured content and some authentication schemes.

@zhaohuabing
Copy link
Member

Should HTTPS be similar to the current HTTP fetching and caching mechanism?

@kyessenov
Copy link
Contributor

@zhaohuabing The current HTTP fetching in Wasm is somewhat broken, we warn people not to use it. If you use a cluster specifier, then HTTPS vs HTTP becomes a configuration in the upstream cluster, so yes, it should be similar.

@zhaohuabing
Copy link
Member

@zhaohuabing The current HTTP fetching in Wasm is somewhat broken, we warn people not to use it. If you use a cluster specifier, then HTTPS vs HTTP becomes a configuration in the upstream cluster, so yes, it should be similar.

@kyessenov Could you elaborate on what's broken in HTTP fetching? We plan to use HTTP Wasm code source in EG and want to avoid any known issues. Thanks!

@kyessenov
Copy link
Contributor

@kyessenov Could you elaborate on what's broken in HTTP fetching? We plan to use HTTP Wasm code source in EG and want to avoid any known issues. Thanks!

It crashes :) I don't have enough time to troubleshoot and fix it, but it needs to be fixed before using it in production.

@zhaohuabing
Copy link
Member

After testing, I confirmed that HTTPS schema works for the Wasm HTTP code source. It seems that TLS is solely associated with the Cluster configuration and does not require handling within the Wasm filter.

https://github.com/zhaohuabing/playground/blob/2e2d0b49c36eda2a5282cbdeba482455b1b1109a/envoy/wasm/envoy.yaml#L28-L49

@jewertow
Copy link
Contributor

jewertow commented Nov 6, 2024

@kyessenov I wanted to start working on support for OCI scheme, and since this requires to send a few consecutive requests (GET manifests -> GET blobs -> GET layers), I wonder if I should follow asynchronous pattern used in RemoteDataFetcher? I mean, should I implement fetchers extending Http::AsyncClient::Callbacks for manifests, blobs and layers and call them consecutively in onSuccess? WDYT?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/wasm enhancement Feature requests. Not bugs or questions. help wanted Needs help!
Projects
None yet
Development

No branches or pull requests

5 participants