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

"no unpack platforms defined: invalid argument" happens when make load #579

Open
keisku opened this issue May 5, 2024 · 2 comments
Open
Labels
good first issue Good for newcomers

Comments

@keisku
Copy link
Contributor

keisku commented May 5, 2024

This error happens during the Demo.

Env

uname -a
Linux keisuke-ubuntu-desktop 6.5.0-1016-aws #16~22.04.1-Ubuntu SMP Wed Mar 13 18:54:49 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

# Self build
ctr --version
ctr github.com/containerd/containerd/v2 v2.0.0-beta.2-452-gb6ffa2794

Error

make load
[ -f /home/ubuntu/Workspace/runwasi/dist/img.tar ] || make target/wasm32-wasi/debug/img.tar
[ -f /home/ubuntu/Workspace/runwasi/dist/img.tar ] || cp target/wasm32-wasi/debug/img.tar "dist/img.tar"
sudo ctr -n default image import --all-platforms dist/img.tar
ctr: rpc error: code = InvalidArgument desc = unable to initialize unpacker: no unpack platforms defined: invalid argument
make: *** [Makefile:195: load] Error 1

Workaround: Add --local flag since v1.7+ and run ctr image import directly.

Ref:

sudo ctr -n default image import --local --all-platforms dist/img.tar
unpacking ghcr.io/containerd/runwasi/wasi-demo-app:latest (sha256:540abaea9e27f1d5f150358fffc3b4ed7dd72a732864d78917e99d6241744ad8)...done

I wanted to add --local flag to Makefile but I've noticed runwasi supports ctr 1.6.25+ that doesn't support --local flag.

runwasi/Makefile

Lines 196 to 200 in 73df350

CTR_VERSION := $(shell sudo ctr version | sed -n -e '/Version/ {s/.*: *//p;q;}')
load/oci: dist/img-oci.tar
@echo $(CTR_VERSION)\\nv1.7.7 | sort -crV || @echo $(CTR_VERSION)\\nv1.6.25 | sort -crV || (echo "containerd version must be 1.7.7+ or 1.6.25+ was $(CTR_VERSION)" && exit 1)
@echo using containerd $(CTR_VERSION)
sudo ctr -n $(CONTAINERD_NAMESPACE) image import --all-platforms $<

@Mossaka
Copy link
Member

Mossaka commented May 13, 2024

Thanks for raising this issue and I am glad that you found a workaround.

This seems like a breaking change from the ctr CLI in v2.0.0. Perhaps, we can add a condition in Makefile to check if CTR_VERSION is v2.0.0 and above, we add --local flag.

@Mossaka Mossaka added the good first issue Good for newcomers label May 13, 2024
@cpuguy83
Copy link
Member

Any change is likely unintended.
We should report in containerd/containerd.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants