Spin 3.0 – open-source tooling for building and running WASM apps
11–20 of 44 posts
Re: Spin 3.0 – open-source tooling for building and running WASM apps
#12Earlier quoted context omitted.
Can you give an example? Say between a wasm component written in Rust and wasm component written in dart.
One of the biggest goals of the component model is that it doesn't matter what language your component is written in. Composition can happen anytime one component exports an interface and another component imports it. https://component-model.bytecodealliance.org/creating-and-co...
Re: Spin 3.0 – open-source tooling for building and running WASM apps
#13Does anyone know what the simplest possible recipe for running a Python script in a WASM sandbox using Spin is? I basically want to do something like this: my-sandbox-cli-tool 'print("hello world") And have the snippet of Python code I provide run inside a WebAssembly container that runs one of the Python compiled to WASM builds ( https://github.com/brettcannon/cpython-wasi-build for example) - with a time limit and…
wasmtime works as long as you make sure to include the lib directory % wasmtime run --dir .::/ python.wasm -c 'print("hello world")' hello world disclaimer: I run a code execution API service ( https://riza.io/playground ) that does this and more (HTTP, packages, etc.)
wget https://github.com/brettcannon/cpython-wasi-build/releases/download/v3.13.0/python-3.13.0-wasi_sdk-24.zip
unzip python-3.13.0-wasi_sdk-24.zip
wasmtime run --dir .::/ python.wasm -c 'print("hello world")'
So far so good! But... it looks like that --dir option mounts the current directory as both readable and writable: wasmtime run --dir .::/ python.wasm -c 'print(len(open("python.wasm", "rb").read()))'
# Outputs 28775526
But malicious code can break the system like this: wasmtime run --dir .::/ python.wasm -c 'open("python.wasm", "wb").write(b"blah")'
And now it fails with an error if you try to run it because we over-wrote python.wasm. Even if I move python.wasm out of the current directory I'd still be able to break things by breaking those other lib files.Although... I guess I could use unix filesystem permissions to make those read-only? That could work.
Re: Spin 3.0 – open-source tooling for building and running WASM apps
#14Does anyone know what the simplest possible recipe for running a Python script in a WASM sandbox using Spin is? I basically want to do something like this: my-sandbox-cli-tool 'print("hello world") And have the snippet of Python code I provide run inside a WebAssembly container that runs one of the Python compiled to WASM builds ( https://github.com/brettcannon/cpython-wasi-build for example) - with a time limit and…
disclaimer: i work there
Re: Spin 3.0 – open-source tooling for building and running WASM apps
#15Earlier quoted context omitted.
One of the biggest goals of the component model is that it doesn't matter what language your component is written in. Composition can happen anytime one component exports an interface and another component imports it. https://component-model.bytecodealliance.org/creating-and-co...
won’t happen. all will crumble with the startups pumping it.
Re: Spin 3.0 – open-source tooling for building and running WASM apps
#16Does anyone know what the simplest possible recipe for running a Python script in a WASM sandbox using Spin is? I basically want to do something like this: my-sandbox-cli-tool 'print("hello world") And have the snippet of Python code I provide run inside a WebAssembly container that runs one of the Python compiled to WASM builds ( https://github.com/brettcannon/cpython-wasi-build for example) - with a time limit and…
have you tried e2b.dev? it runs lightweight sandboxes using firecracker, python and third-party packages disclaimer: i work there
Re: Spin 3.0 – open-source tooling for building and running WASM apps
#17Earlier quoted context omitted.
wasmtime works as long as you make sure to include the lib directory % wasmtime run --dir .::/ python.wasm -c 'print("hello world")' hello world disclaimer: I run a code execution API service ( https://riza.io/playground ) that does this and more (HTTP, packages, etc.)
Wow that's almost what I want. wget https://github.com/brettcannon/cpython-wasi-build/releases/download/v3.13.0/python-3.13.0-wasi_sdk-24.zip unzip python-3.13.0-wasi_sdk-24.zip wasmtime run --dir .::/ python.wasm -c 'print("hello world")' So far so good! But... it looks like that --dir option mounts the current directory as both readable and writable: wasmtime run --dir .::/ python.wasm -c 'print(len(open("python.wa…
Re: Spin 3.0 – open-source tooling for building and running WASM apps
#18We finally in 2024 sort of have esm for workers, for example. But not import-maps, so the distributed esm modules aren't directly usable. This category of "making using the spec actually possible" problems tends to dwell for far too long alas.
Re: Spin 3.0 – open-source tooling for building and running WASM apps
#19Earlier quoted context omitted.
wasmtime works as long as you make sure to include the lib directory % wasmtime run --dir .::/ python.wasm -c 'print("hello world")' hello world disclaimer: I run a code execution API service ( https://riza.io/playground ) that does this and more (HTTP, packages, etc.)
Wow that's almost what I want. wget https://github.com/brettcannon/cpython-wasi-build/releases/download/v3.13.0/python-3.13.0-wasi_sdk-24.zip unzip python-3.13.0-wasi_sdk-24.zip wasmtime run --dir .::/ python.wasm -c 'print("hello world")' So far so good! But... it looks like that --dir option mounts the current directory as both readable and writable: wasmtime run --dir .::/ python.wasm -c 'print(len(open("python.wa…
Re: Spin 3.0 – open-source tooling for building and running WASM apps
#20Earlier quoted context omitted.
have you tried e2b.dev? it runs lightweight sandboxes using firecracker, python and third-party packages disclaimer: i work there
Is that something I can run on my own laptop? It says it's "open source" but the docs seem to be for client libraries that need an API key.
this way, we're able to run millions secure sandbox environments
i appreciate asking though and will be forwarding to my team to see if we can come up with a way for users to emulate the execution locally
source code: https://github.com/e2b-dev/infra