WasmEdge / wasmedge_hyper_demo

Lightweight HTTP servers based on hyper / warp frameworks in the WasmEdge Runtime.
81 stars 15 forks source link

Build project in OSX #7

Open jabrena opened 1 year ago

jabrena commented 1 year ago

Hi,

I am trying to run the example this example: https://github.com/jabrena/101-rust/blob/main/hello_world_wasm_backend/README.md

But I was not able to compile in OSX, I am receiving the following error:

docker compose build
[+] Building 1.3s (14/14) FINISHED                                                                                          
 => [internal] load build definition from Dockerfile                                                                   0.0s
 => => transferring dockerfile: 32B                                                                                    0.0s
 => [internal] load .dockerignore                                                                                      0.0s
 => => transferring context: 2B                                                                                        0.0s
 => [internal] load metadata for docker.io/library/rust:1.64                                                           1.2s
 => [buildbase 1/5] FROM docker.io/library/rust:1.64@sha256:922d814994d77f8e3ab8a7db45a277e9cebe41a557046eeef91a2e34b  0.0s
 => [internal] load build context                                                                                      0.0s
 => => transferring context: 86B                                                                                       0.0s
 => CACHED [buildbase 2/5] RUN rustup target add wasm32-wasi                                                           0.0s
 => CACHED [buildbase 3/5] WORKDIR /src                                                                                0.0s
 => CACHED [buildbase 4/5] COPY src ./src                                                                              0.0s
 => CACHED [buildbase 5/5] COPY Cargo.toml .                                                                           0.0s
 => CACHED [buildserver 1/3] COPY src ./src                                                                            0.0s
 => CACHED [buildserver 2/3] RUN pwd                                                                                   0.0s
 => CACHED [buildserver 3/3] RUN --mount=type=cache,target=/usr/local/cargo/git/db     --mount=type=cache,target=/usr  0.0s
 => CACHED [server 1/1] COPY --from=buildserver /src/target/wasm32-wasi/release/wasmedge_hyper_server.wasm wasmedge_h  0.0s
 => ERROR exporting to image                                                                                           0.0s
 => => exporting layers                                                                                                0.0s
 => => writing image sha256:9811b6619248d3846ca8c70d463c359854511b6539541b40dbfcb799b80e64f2                           0.0s
------
 > exporting to image:
------
failed to solve: operating system is not supported

docker compose up          
[+] Running 0/0
 ⠋ Container hello_world_wasm_backend-server-1  Creating                                                                                                                   0.0s
Error response from daemon: Unknown runtime specified io.containerd.wasmedge.v1

How to build the example in OSX?

Many thanks in advance

Juan Antonio

juntao commented 1 year ago

Hi,

The docker compose option would require a new version of Docker, which we will announce on Monday at KubeCon. I will update here once Docker made the release.

For now, you can follow the step by step instructions in the doc to build, run, and test. However, I believe the networking sockets still have some issues on Mac OS. Linux would probably be more reliable for now ...

Cheers Michael

alabulei1 commented 1 year ago

Hi @jabrena,

You can run it on Docker for Mac OSX, as Docker has announced the technical review. https://docs.docker.com/desktop/wasm/

We are also fixing the problems on OSX. See this PR. https://github.com/WasmEdge/WasmEdge/pull/2105