Skip to content

Make OCI component resolver available to SpinKube#3403

Merged
itowlson merged 1 commit intospinframework:mainfrom
itowlson:oci-make-it-more-spinkubier
Feb 17, 2026
Merged

Make OCI component resolver available to SpinKube#3403
itowlson merged 1 commit intospinframework:mainfrom
itowlson:oci-make-it-more-spinkubier

Conversation

@itowlson
Copy link
Collaborator

This addresses an issue for SpinKube. Changes to the OCI loader to support bare Wasm from registries meant that their existing entry point (load_from_cache) required information that SpinKube neither had nor needed. I discussed splitting load_from_cache but @kate-goldenring suggested that providing access to ContentRef resolution would provide for SK's needs for now.

This feels non-ideal from a long-term point of view because ContentRef resolution involves a lot of assumptions about what the lockfile looks like and what already exists in the content-addressable cache - it doesn't feel like a 'safe' entry point. However, the long term solution requires a lot more thinking about how to organise the OCI crate - separating loading, which spin up needs but SpinKube doesn't, from resolving a loaded OCI application into a triggerable application, which both hosts need. I have a rough sense of the shape of it, but the OCI crate has a long history of tricking me into thinking I know how to refactor it and then, oh no, the tarpit opens. I probably also need a better understanding of how SpinKube uses the resolver before charging in too! So in the interim, an imperfect fix but hopefully better than no fix at all.

Signed-off-by: itowlson <ivan.towlson@fermyon.com>
/// 2. All digest-addressed content is already in the cache.
///
/// If either of these is not true, the function errors.
pub async fn resolve_component_content_refs(
Copy link
Contributor

Choose a reason for hiding this comment

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

It feels a little strange to be constructing a loader just to configure the working directory for this function -- but as you've said in the PR description, this is a weird workaround

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good point - I could make it a free function and pass the working dir in as a parameter. But maybe easier to just ship it as is - it's a fairly modest piece of our Bad APIs budget, and as you say we need to rework anyway.

@itowlson itowlson merged commit 9ec77fd into spinframework:main Feb 17, 2026
17 checks passed
kate-goldenring added a commit to kate-goldenring/containerd-shim-spin that referenced this pull request Feb 18, 2026
- Bumps the dependencies to use a git reference just past Spin 3.6 to contain these two patches to Spin
that enable continued consumption of the Spin crates by the shim: spinframework/spin#3402 and spinframework/spin#3403
- Updates the shim to support packages pushed with wkg, a change introduced in Spin here spinframework/spin#3361
- Adds a wkg integration test
- Adds extensive unit tests for the Source struct (with the help of Claude). These tests point out some gaps in the implementation to better handle edge cases (most are edge cases are ignored)

Signed-off-by: Kate Goldenring <kate.goldenring@gmail.com>
kate-goldenring added a commit to kate-goldenring/containerd-shim-spin that referenced this pull request Feb 18, 2026
- Bumps the dependencies to use a git reference just past Spin 3.6 to contain these two patches to Spin
that enable continued consumption of the Spin crates by the shim: spinframework/spin#3402 and spinframework/spin#3403
- Updates the shim to support packages pushed with wkg, a change introduced in Spin here spinframework/spin#3361
- Adds a wkg integration test
- Adds extensive unit tests for the Source struct (with the help of Claude). These tests point out some gaps in the implementation to better handle edge cases (most are edge cases are ignored)

Signed-off-by: Kate Goldenring <kate.goldenring@gmail.com>
kate-goldenring added a commit to kate-goldenring/containerd-shim-spin that referenced this pull request Feb 18, 2026
- Bumps the dependencies to use a git reference just past Spin 3.6 to contain these two patches to Spin
that enable continued consumption of the Spin crates by the shim: spinframework/spin#3402 and spinframework/spin#3403
- Updates the shim to support packages pushed with wkg, a change introduced in Spin here spinframework/spin#3361
- Adds a wkg integration test
- Adds extensive unit tests for the Source struct (with the help of Claude). These tests point out some gaps in the implementation to better handle edge cases (most are edge cases are ignored)

Signed-off-by: Kate Goldenring <kate.goldenring@gmail.com>
kate-goldenring added a commit to kate-goldenring/containerd-shim-spin that referenced this pull request Feb 18, 2026
- Bumps the dependencies to use a git reference just past Spin 3.6 to contain these two patches to Spin
that enable continued consumption of the Spin crates by the shim: spinframework/spin#3402 and spinframework/spin#3403
- Updates the shim to support packages pushed with wkg, a change introduced in Spin here spinframework/spin#3361
- Adds a wkg integration test
- Adds extensive unit tests for the Source struct (with the help of Claude). These tests point out some gaps in the implementation to better handle edge cases (most are edge cases are ignored)

Signed-off-by: Kate Goldenring <kate.goldenring@gmail.com>
kate-goldenring added a commit to kate-goldenring/containerd-shim-spin that referenced this pull request Feb 19, 2026
- Bumps the dependencies to use a git reference just past Spin 3.6 to contain these two patches to Spin
that enable continued consumption of the Spin crates by the shim: spinframework/spin#3402 and spinframework/spin#3403
- Updates the shim to support packages pushed with wkg, a change introduced in Spin here spinframework/spin#3361
- Adds a wkg integration test
- Adds extensive unit tests for the Source struct (with the help of Claude). These tests point out some gaps in the implementation to better handle edge cases (most are edge cases are ignored)

Signed-off-by: Kate Goldenring <kate.goldenring@gmail.com>
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 this pull request may close these issues.

3 participants

Comments