Open FerrazArthur opened 10 months ago
@jprendes are you familiar with docker CLI working with the wasm container?
It looks like dockerd
isn't using the containerd snapshotter.
What do you get from docker info
?
Did you restart dockerd
after setting daemon.json
?
Having the dockerd
and containerd
logs would be useful as well.
I did a systemctl restart to docker.service, docker.socket and containerd.
I tired docker container run -i --rm --name speed-wasm --platform wasi/wasm32 --runtime io.containerd.spin.v1 ferrazarthur/spin-test:wasi-wasm up --log-dir /logs
and it works fine for me on Docker Engine (i.e., no Docker Desktop).
I see on the containerd logs the following error:
[INFO] >>> building spin application
[INFO] >>> building spin trigger Http(HttpTriggerConfiguration { base: "/" })
[INFO] >>> server shut down due to error: failed to build spin trigger
Because of that message I would think that there's some issue with spin's toml file in the image.
But then I wouldn't expect it to run on Docker Desktop either.
And given the containerd logs, I wouldn't expect the operating system is not supported
error either.
It is runing the shim after all. Is that message still acurrate?
Could you paste the full error message?
One caveat is that Docker Desktop's image store is different from Docker Engine's store, so an image with the same name (tag) might actually be a completely different image.
Would it be possible that the Docker Engine image for ferrazarthur/spin-test:wasi-wasm
is an old out of date image?
What do you get from running
$ docker inspect ferrazarthur/spin-test:wasi-wasm --format='{{ .Id }}'
sha256:3be8fe0f10ceff950ca2b1f9fc369e1e375bbad6f7d819bcd8ea23abdb76923c
The operational system's error was solved with enabling containerd's snapshotter. I was hopping the issue's edit history was ignored, because i did some new tests and research and thats reflected in the latest version of the issue.
(i've updated containerd's log in previous comment to assert the code block format is displayed correctly)
Also the output bellow is the same, either on docker-desktop engine or not.
$ docker inspect ferrazarthur/spin-test:wasi-wasm --format='{{ .Id }}'
sha256:3be8fe0f10ceff950ca2b1f9fc369e1e375bbad6f7d819bcd8ea23abdb76923c
I did get the log from docker.service now that it is running desktop engine and the container has run as expected. Interestingly, containerd isnt envolved with docker desktop engine, as it has no log info.
Could you try running the example from this repo?
docker run -i --rm --name speed-wasm -p 3000:80 --platform wasi/wasm32 --runtime io.containerd.spin.v1 ghcr.io/deislabs/containerd-wasm-shims/examples/spin-rust-hello:v0.9.1 /
What does it output?
it works as intended!
$ curl curl 127.0.0.1:3000/hello
Hello world from Spin!
So it's something with the way i am building the image or configuring the spin?
I tried to mimic the final stage in this Dockerfile, but the command
docker container run --rm -i -p 3000:80 --platform wasi/wasm --runtime io.containerd.spin.v1 ghcr.io/deislabs/containerd-wasm-shims/examples/spin-rust-hello:v0.9.1 /
works, while the command bellow doesnt work(start and exit with no log, no error msg).
docker container run --rm -i -p 3000:80 --platform wasi/wasm --runtime io.containerd.spin.v1 ferrazarthur/spin-test:wasi-wasm /
the build command was using docker desktop engine:
docker buildx build --platform wasi/wasm -t ferrazarthur/spin-test:wasi-wasm .
I installed the spin shim from this repo but it doesnt work without docker-desktop engine. how can i build a image for a spin app that can still be used with runtime spin without docker desktop?
I have 2 images, one build with
and other with
Running image
The same behaviour occurs with
While with docker-desktop everything works as it should.
Expected behaviour
To properly run a spin up and keep a server open listening on port 3000
Actual behaviour
Container exits immediately after start, without executing spin up.
Modification made in Makefile
As i only wanted the spin shim, i changed the first line of Makefile from:
to
SETUP
SYSTEM:
/etc/docker/daemon.json
usr/local/bin
DOCKER:
SPIN:
spin 1.4.1 (e0bd911 2023-07-12) also tried with spin 1.5.1 (8d4334e 2023-09-26)
RUST: