-
Notifications
You must be signed in to change notification settings - Fork 95
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
Link against wasmedge static library #187
Conversation
d47ecbc
to
1fa970f
Compare
f44283d
to
7e556ad
Compare
Signed-off-by: Jorge Prendes <[email protected]>
7e556ad
to
b9a2dbd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Beautiful
Great work! This greatly improves the user's installation experience, |
@@ -9,22 +9,14 @@ FROM --platform=$BUILDPLATFORM tonistiigi/xx:${XX_VERSION} AS xx | |||
|
|||
FROM --platform=$BUILDPLATFORM rust:${RUST_VERSION} AS base | |||
COPY --from=xx / / | |||
RUN apt-get update -y && apt-get install --no-install-recommends -y clang jq | |||
RUN apt-get update -y && apt-get install --no-install-recommends -y clang jq wget |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't seem like we should need wget?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wasmedge-sys
needs wget
to download the library.
We could fix that upstream for the next release of wasmedge-sdk
and remove it then.
WasmEdge/wasmedge-rust-sdk#30
cargo build $(RELEASE_FLAG) && \ | ||
cp target/$(TARGET)/containerd-shim-wasmedge-v1 $(PWD)/bin/ && \ | ||
sudo cp /var/lib/rancher/k3s/agent/etc/containerd/config.toml /var/lib/rancher/k3s/agent/etc/containerd/config.toml.tmpl && \ | ||
echo '[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.wasm]' | sudo tee -a /var/lib/rancher/k3s/agent/etc/containerd/config.toml.tmpl && \ | ||
echo ' runtime_type = "$(PWD)/bin/containerd-shim-wasmedge-v1"' | sudo tee -a /var/lib/rancher/k3s/agent/etc/containerd/config.toml.tmpl && \ | ||
echo ' [plugins."io.containerd.grpc.v1.cri".containerd.runtimes.wasm.options]' | sudo tee -a /var/lib/rancher/k3s/agent/etc/containerd/config.toml.tmpl && \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've removed these two lines from here.
I don't know what was the original motivation, but the CI check succeeded.
@defims : what was the motivation for these lines? am I missing something?
@@ -9,22 +9,14 @@ FROM --platform=$BUILDPLATFORM tonistiigi/xx:${XX_VERSION} AS xx | |||
|
|||
FROM --platform=$BUILDPLATFORM rust:${RUST_VERSION} AS base | |||
COPY --from=xx / / | |||
RUN apt-get update -y && apt-get install --no-install-recommends -y clang jq | |||
RUN apt-get update -y && apt-get install --no-install-recommends -y clang jq wget |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wasmedge-sys
needs wget
to download the library.
We could fix that upstream for the next release of wasmedge-sdk
and remove it then.
WasmEdge/wasmedge-rust-sdk#30
This looks great, if there's a change that's needed for the containerd config.toml stuff we can follow-up. |
I'm bit on the fence with this one... I really like that we now automatically have the right version of the WasmEdge library. However I think downloading things with custom methods during the build has some issues, such as the possibility of having difficult-to-debug issues when building in a proxy prison or other not-fully-networked environments. It also makes it more difficult to have SBOMs and reproducible builds, because we have no way of knowing what exactly has been downloaded (for example -- is a WasmEdge library security fix part of a built shim or not?). An optimal case might be to have an option to pre-download the library, or at least specify which library checksum we are expecting during the build? |
@ipuustin , would you mind creating an issue in the wasmedge-rust-stk repo to add this functionality? I was looking here at how the |
Apologies I clearly made a mistake here with regard to automatic downloading stuff. We can certainly create a script to install deps that someone who's building can choose to run or not. Also probably static compilation should be behind a crate feature. |
I agree with making static buils a crate feature. That woud allow reverting to the previous behavior. How exactly the vendoring happens, I think that would be better discussed as an issue in |
This PR links the wasmedge shims agains the wasmedge static library:
It uses the (new) combination of
standalone
andstatic
features of thewasmedge-sys
crate, which automatically downloads the static library as part of the build process:wasmedge-sdk
crate.wasmedge-sdk
until tag0.10.0
is released.