Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

oci: Inline small content into manifest #1744

Merged
merged 1 commit into from
Sep 7, 2023
Merged

oci: Inline small content into manifest #1744

merged 1 commit into from
Sep 7, 2023

Conversation

lann
Copy link
Collaborator

@lann lann commented Sep 7, 2023

This adds support for inlining content into the spin manifest. The immediate goal is to work around a problem with OCI implementations (discussed here: distribution/distribution#4029). Additionally, inlining small content should be an overall bandwith saver as each OCI layer has to be fetched in a separate HTTP request.

This PR starts inlining small (<=128 bytes) content, but continues to also upload layers for this content unless SPIN_OCI_SKIP_INLINED_FILES is set. Once downstream infrastructure supports content inlining we can make this the default.

@lann

This comment was marked as resolved.

@lann lann force-pushed the oci-inline-content branch from 87d6e44 to f4920cf Compare September 7, 2023 15:51
@lann

This comment was marked as resolved.

@lann lann force-pushed the oci-inline-content branch from f4920cf to 70b0e17 Compare September 7, 2023 17:27
@lann lann changed the title WIP: inline small content into manifest oci: Inline small content into manifest Sep 7, 2023
@lann lann marked this pull request as ready for review September 7, 2023 17:28
@lann lann requested a review from vdice September 7, 2023 17:28
// Update the module source with the content ref of the layer.
c.source.content = Self::content_ref_for_layer(&layer);

layers.push(layer);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't bother with skipping layers here because you can't have a valid wasm file <=2 bytes and <=128 bytes is practically impossible too.

crates/oci/src/client.rs Show resolved Hide resolved
crates/oci/src/loader.rs Show resolved Hide resolved
Signed-off-by: Lann Martin <lann.martin@fermyon.com>
@lann lann force-pushed the oci-inline-content branch from 70b0e17 to 666eca7 Compare September 7, 2023 17:51
@lann lann merged commit 12b5c65 into main Sep 7, 2023
@lann lann deleted the oci-inline-content branch September 7, 2023 19:05
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants