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

add containerd-wasm-shims to enable Wasm / WASI workloads #1037

Merged
merged 1 commit into from
Dec 22, 2022

Conversation

devigned
Copy link
Contributor

What this PR does / why we need it:

This PR adds support for running Wasm workloads using both Fermyon Spin and Deislabs SpiderLightning via Deislabs Containerd Wasm Shims. The same technology is what enables Azure Kubernetes Service to run Wasm / WASI workloads in AKS WASI Node Pools.

Wasm / WASI workloads using a runtime class which informs containerd to delegate the pod workload to the specific shim as described in https://github.com/deislabs/containerd-wasm-shims#using-a-shim-in-kubernetes.

Additional context
This PR stems from this Slack discussion with @elmiko.

@k8s-ci-robot
Copy link
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Dec 16, 2022
@devigned devigned changed the title add containerd-wasm-shims to enable wasm workloads add containerd-wasm-shims to enable Wasm / WASI workloads Dec 16, 2022
@devigned devigned marked this pull request as ready for review December 16, 2022 18:34
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 16, 2022
@devigned
Copy link
Contributor Author

/test pull-azure-sigs

1 similar comment
@devigned
Copy link
Contributor Author

/test pull-azure-sigs

@mboersma
Copy link
Contributor

/retest

@devigned
Copy link
Contributor Author

/hold

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Dec 19, 2022
@devigned
Copy link
Contributor Author

/test pull-container-image-build

@devigned
Copy link
Contributor Author

/test pull-ova-all

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 22, 2022
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 22, 2022
@devigned
Copy link
Contributor Author

/hold cancel

@jsturtevant I believe this is solid.

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Dec 22, 2022
Copy link
Contributor

@mboersma mboersma left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 22, 2022
Copy link
Contributor

@jsturtevant jsturtevant left a comment

Choose a reason for hiding this comment

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

/lgtm
/assign @kkeshavamurthy @mboersma

stdout: [ ]
stderr: ["io.containerd.spin.v1: InvalidArgument(\"Shim namespace cannot be empty\")"]
timeout: 0
grep -E 'io\.containerd\.(slight|spin)\.v1' /etc/containerd/config.toml:
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: I think this wouldn't verify both are there are present only one of them (similar to comment above)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are 100% correct. I was having a hard time dealing with .Vars.containerd_wasm_shims_runtime as it's a comma delimited string ("slight, spin"). It's much easier to deal with it in Python in Ansible using a string contains.

Do you have a suggestion of how to handle it better in Goss?

@@ -10,6 +10,23 @@ command:
stdout: []
stderr: []
timeout: 0
{{if ne .Vars.containerd_wasm_shims_runtimes ""}}
Copy link
Contributor

Choose a reason for hiding this comment

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

It isn't garmented both runtime would be installed for this check so this could fail if only one is installed. I am not sure this is a big deal at this point for the test.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's unfortunate that the containerd wasm shims are packaged together into one release artifact. When you download one, you get both.

I think in the future, I'd like to change the shims to be packaged individually and change the variables / tests in image-builder to allow for individual installation and verification.

I've also opened an issue to add --version support for the shims. I didn't like the error test. The test does the job of verifying the shim is installed, on the path, and responding in a reasonable way, but I would much rather see something closer to the containerd version verification, so we can ensure we have the specific version installed that we expect.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think in the future, I'd like to change the shims to be packaged individually and change the variables / tests in image-builder to allow for individual installation and verification.

I think it's acceptable to assume both shims for now, and to fix this when their packaging changes.

Copy link
Contributor

@mboersma mboersma left a comment

Choose a reason for hiding this comment

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

/approve

There are a couple of small followup items identified here, but 👍🏻.

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: devigned, mboersma

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 22, 2022
@k8s-ci-robot k8s-ci-robot merged commit 847c18b into kubernetes-sigs:master Dec 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants