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

v1 cgroup feature is required, but was not enabled during compile time #288

Closed
0xE282B0 opened this issue Aug 29, 2023 · 6 comments · Fixed by deislabs/containerd-wasm-shims#149
Labels
help wanted Extra attention is needed question Further information is requested

Comments

@0xE282B0
Copy link
Contributor

Hi,
I tried the spin shim from master and when I try to run it on colima with kind I get the following error:

Error: failed to start containerd task "spin-hello": 
  Others("failed to create container: v1 error: 
    v1 cgroup feature is required, but was not enabled during compile time"): unknown

Is something blocking us from enabling V1 croup?

@thangchung
Copy link

I ran spin shim on k3d from master and used docker on Ubuntu 22.02 and had got the same problem

13s         Warning   Failed                    pod/wasm-spin-7bc59d855b-p85lq       Error: failed to start containerd task "spin-hello": Others("failed to create container: v1 error: v1 cgroup feature is required, but was not enabled during compile time"): unknown
12s         Warning   BackOff                   pod/wasm-spin-7bc59d855b-p85lq       Back-off restarting failed container

@Mossaka Mossaka added help wanted Extra attention is needed question Further information is requested labels Sep 1, 2023
@Mossaka
Copy link
Member

Mossaka commented Sep 5, 2023

@thangchung do you have a link to the repo that contains spin application / image, and a workflow yaml file?

@thangchung
Copy link

@Mossaka The code is at https://github.com/thangchung/dapr-labs/blob/feat/spin-refactor/polyglot/iac/kind-spin/product-api-deploy.yaml

But I think my problem is that wsl2 - Ubuntu 22 with cgroup v2 enabled does not work well, still figured it out by searching issues around on the wsl2 repo.

@thangchung
Copy link

@0xE282B0 @Mossaka Turned out, I can handle it work on WSL2 - Ubuntu 22.02. Steps below:

Follow the guidance at microsoft/WSL#9868 (comment) to configure WSL2 to use cgroup v2, the important config as

$ cat /etc/fstab
LABEL=cloudimg-rootfs   /        ext4   defaults        0 1
cgroup2 /sys/fs/cgroup cgroup2 rw,nosuid,nodev,noexec,relatime,nsdelegate 0 0

Now, we can start docker without any error caused to stop the docker.socket. But you cannot use docker buildx build command yet. To fix that, we need to switch back to default builder:

> docker buildx ls
NAME/NODE          DRIVER/ENDPOINT             STATUS   BUILDKIT             PLATFORMS
elated_banach      docker-container
  elated_banach0   unix:///var/run/docker.sock inactive
peaceful_carson *  docker-container
  peaceful_carson0 unix:///var/run/docker.sock stopped
default            docker
  default          default                     running  v0.11.6+0a15675913b7 linux/amd64, linux/amd64/v2, linux/amd64/v3

Now I run:

> docker buildx use default

After that, I run:

> docker buildx build -f Dockerfile --platform wasi/wasm,linux/amd64,linux/arm64 -t ghcr.io/thangchung/dapr-labs/product-api-spin:1.0.1 . --push

It worked.

About colima with kind, I'm not sure if it works like the hack above or not.

@0xE282B0
Copy link
Contributor Author

0xE282B0 commented Sep 6, 2023

Excellent, that will help windows users a lot!

@0xE282B0
Copy link
Contributor Author

I took a closer look and the shims in this repo (WasmTime,WasmEdge,Wasmer) seem to work with cgroups v1.
Since I don't think it needs to be part of containerd-shim-wasm I created a this PR deislabs/containerd-wasm-shims#149 to fix the deislabs shims (spin,slight,wws,lunatic) and close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants