Repository navigation
Conversation
Includes emulation support, support for cross-compilation (converting host dirs into other platforms) and multiplatform image push. Signed-off-by: Erik Sipsma <[email protected]>
Signed-off-by: Erik Sipsma <[email protected]>
Signed-off-by: Erik Sipsma <[email protected]>
Signed-off-by: Erik Sipsma <[email protected]>
Signed-off-by: Erik Sipsma <[email protected]>
Signed-off-by: Erik Sipsma <[email protected]>
Signed-off-by: Erik Sipsma <[email protected]>
Signed-off-by: Erik Sipsma <[email protected]>
Signed-off-by: Erik Sipsma <[email protected]>
Signed-off-by: Erik Sipsma <[email protected]>
|
This is awesome :) @sipsma Given the speed of this repo -- should we merge this even if unfinished to avoid rotting? Or are there side effects to the non-wasm codepath? |
I think I got rid of the impacts to non-wasm codepaths. The wasm code path needs a little love though; it currently statically compiles I don't want this to languish though either I agree. I'll rebase it once there's breathing room around the new SDK release and then quickly try to improve it. If the improvements don't work out, we can just merge it as is and then put a warning label on it that it's experimental or something maybe. |
|
This PR is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
|
This PR was closed because it has been stalled for 7 days with no activity. |
Just a quick pass to see if we could get support for the
wasi/wasm32platform on Dagger. Seems to be working and initial impression is that this could be cleaned up to the point of being mergeable; probably not a throwaway experiment.Based on top of the multiplatform PR.
Usage
Example usage from included test case (pulling and running a test image I built that has a wasm binary and uses platform
wasi/wasm32):https://github.com/dagger/dagger/blob/ff64e543a317d70f3d1fe889cd2a8ac46f050ec8/core/integration/platform_test.go#L346-L351
In that example the Exec defaults to the Entrypoint of the container, but in general args just need to be set to point to a
.wasmbinary.Example of building a wasm binary from rust code and then executing it:
https://github.com/dagger/dagger/blob/ff64e543a317d70f3d1fe889cd2a8ac46f050ec8/core/integration/platform_test.go#L285-L336
Implementation
Quick hackish solution implemented in this PR:
wasi/wasm32is being used, our shim invokes the wasmtime binary, which itself invokes the actual user's wasm binarySurprisingly that's it.
I started w/ a much more complicated path of using
wasmedgeand configuring buildkitd to use the containerd worker which is instrumented to use crun w/ wasmedge support (as described here), but I eventually realized all that did was result in this very light wrapper being invoked from crun's codebase.However, we already have our own shim in dagger, so that's the much easier thing to use right now. It may be the right approach in the long run too? Not sure yet, haven't thought in depth.
Current Caveats
wasi/wasm32images I tried fail to load due to incompatible modules being requiredmichaelirwin244/wasm-exampleimage fails to load w/ our wasmtime shim due to the errors listed here.