-
Notifications
You must be signed in to change notification settings - Fork 35
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
Support adapting core wasm to components #374
Conversation
ee9e367
to
c6ef717
Compare
698ec38
to
79e86af
Compare
fa14e8e
to
f01603a
Compare
f01603a
to
ca403cf
Compare
adapt
command to produce components from core wasmThere 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.
So exciting to see this coming together!
Mostly minor comments from me on this one. I will cop to only skimming much of the adapter code, since it is so mechanical. I tried to at least make sure that we were adapting the right thing in each case.
2bbaa2d
to
7a29848
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.
🚀 Looks great! As discussed in Slack, a number of my comments were really on the upstream preview1 adapter, and we're going to hold off on making those changes here in order to avoid drift and confusion from upstream.
This PR adds a component adapter based on the wasi_snapshot_preview1 adapter that also supports the fastly host call abi. The adapter can be used in two forms: 1. using the new viceroy adapt command to adapt a core-wasm module to a component ahead-of-time, 2. using the --adapt flag to viceroy serve or viceroy run, adapting the core-wasm in-memory. This functionality opens the door to running viceroy's existing test suite with components, and also to a longer-term migration towards components in-general. This feature comes with a downside to the development experience though: any changes made to the adapter require that we also run the make adapter target, and commit the changes to the wasi_snapshot_preview1.wasm binary. It would be great to check if this was necessary in CI, but it's not clear to me what the right mechanism is to enforce that. However, changes to the adapter should be infrequent, so hopefully this isn't too much of a burden.
This PR adds a component adapter based on the wasi_snapshot_preview1 adapter that also supports the fastly host call abi. The adapter can be used in two forms:
viceroy adapt
command to adapt a core-wasm module to a component ahead-of-time,--adapt
flag toviceroy serve
orviceroy run
, adapting the core-wasm in-memory.This functionality opens the door to running viceroy's existing test suite with components, and also to a longer-term migration towards components in-general.
This feature comes with a downside to the development experience though: any changes made to the adapter require that we also run the
make adapter
target, and commit the changes to thewasi_snapshot_preview1.wasm
binary. It would be great to check if this was necessary in CI, but it's not clear to me what the right mechanism is to enforce that. However, changes to the adapter should be infrequent, so hopefully this isn't too much of a burden.