-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Refactor Wasmtime CLI to support components #6836
Refactor Wasmtime CLI to support components #6836
Conversation
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.
Various conflicts with main, and I'd like to leave the flush stuff out, but otherwise the meat of this is great.
This commit refactors the `wasmtime` CLI executable to be able to support not only compiling components but additionally executing components. While I was doing this I've additionally added a new `--preview2` argument to enable using the new experimental implementation of preview1 based on preview2 type/structs. This is off-by-default but is expected to become the default in the future. Some notable features of this change are: * The preview1-implemented-with-preview2 module now sports `add_to_linker_{async,sync}` to replace the previous `add_to_linker` which always did async. * Some trait bounds in the preview1-implemented-with-preview2 module are simplified. * Some minor changes were made to `wiggle`'s macros to support a "block on" that isn't the default wiggle dummy executor (as now we actually do need Tokio) * Many options related to core wasm `Linker` configuration, such as `--default-values-unknown-imports`, are not implemented for components at this time. When used with components these options return an error. * Construction of WASI contexts has been refactored to pass around fewer arguments to avoid threading through lots of values for both preview1 and preview2. * Reading the input to the Wasmtime CLI has been updated to read the input in the `run` subcommand before handing it off to the `wasmtime` crate's API to enable the CLI to use the contents of what's loaded to determine what to do next. * Our generic `./ci/run-tests.sh` script has been updated to pass the `--features component-model` flag to ensure that this CLI support is tested during the normal test suite. * The CLI support for `wasi-nn` supports components as well as core wasm modules.
0b837c1
to
1274636
Compare
Ok I've ignored the one test that relies on output flushing and otherwise rebased this on main. I've additionally added component support for the I think this should be ready to go though if you can give it another review @pchickey |
wasi-http is hosed at the moment and should not be enabled. @elliottt will hook it back in once its in a better state. |
This commit refactors the `wasmtime` CLI executable to be able to support not only compiling components but additionally executing components. While I was doing this I've additionally added a new `--preview2` argument to enable using the new experimental implementation of preview1 based on preview2 type/structs. This is off-by-default but is expected to become the default in the future. Some notable features of this change are: * The preview1-implemented-with-preview2 module now sports `add_to_linker_{async,sync}` to replace the previous `add_to_linker` which always did async. * Some trait bounds in the preview1-implemented-with-preview2 module are simplified. * Some minor changes were made to `wiggle`'s macros to support a "block on" that isn't the default wiggle dummy executor (as now we actually do need Tokio) * Many options related to core wasm `Linker` configuration, such as `--default-values-unknown-imports`, are not implemented for components at this time. When used with components these options return an error. * Construction of WASI contexts has been refactored to pass around fewer arguments to avoid threading through lots of values for both preview1 and preview2. * Reading the input to the Wasmtime CLI has been updated to read the input in the `run` subcommand before handing it off to the `wasmtime` crate's API to enable the CLI to use the contents of what's loaded to determine what to do next. * Our generic `./ci/run-tests.sh` script has been updated to pass the `--features component-model` flag to ensure that this CLI support is tested during the normal test suite. * The CLI support for `wasi-nn` supports components as well as core wasm modules.
…eature/kserve * 'feature/kserve' of github.com:geekbeast/wasmtime: Refactor Wasmtime CLI to support components (bytecodealliance#6836) Bump the wasm-tools family of crates (bytecodealliance#6861) Wasmtime: refactor the pooling allocator for components (bytecodealliance#6835)
This commit updates the component support in the `wasmtime` CLI from bytecodealliance#6836 to use the generated bindings for the "command" style of components rather than having that custom-written in the CLI.
* Use generated bindings to run components in the CLI This commit updates the component support in the `wasmtime` CLI from #6836 to use the generated bindings for the "command" style of components rather than having that custom-written in the CLI. * Fix tests
…#6869) * Use generated bindings to run components in the CLI This commit updates the component support in the `wasmtime` CLI from bytecodealliance#6836 to use the generated bindings for the "command" style of components rather than having that custom-written in the CLI. * Fix tests
This commit refactors the
wasmtime
CLI executable to be able tosupport not only compiling components but additionally executing
components. While I was doing this I've additionally added a new
--preview2
argument to enable using the new experimentalimplementation of preview1 based on preview2 type/structs. This is
off-by-default but is expected to become the default in the future.
Some notable features of this change are:
The preview1-implemented-with-preview2 module now sports
add_to_linker_{async,sync}
to replace the previousadd_to_linker
which always did async.
Some trait bounds in the preview1-implemented-with-preview2 module are
simplified.
Some minor changes were made to
wiggle
's macros to support a "blockon" that isn't the default wiggle dummy executor (as now we actually
do need Tokio)
Many options related to core wasm
Linker
configuration, such as--default-values-unknown-imports
, are not implemented for componentsat this time. When used with components these options return an error.
Construction of WASI contexts has been refactored to pass around fewer
arguments to avoid threading through lots of values for both preview1
and preview2.
Reading the input to the Wasmtime CLI has been updated to read the
input in the
run
subcommand before handing it off to thewasmtime
crate's API to enable the CLI to use the contents of what's loaded to
determine what to do next.
Our generic
./ci/run-tests.sh
script has been updated to pass the--features component-model
flag to ensure that this CLI support istested during the normal test suite.