-
Notifications
You must be signed in to change notification settings - Fork 67
pkg/compute/pack: implement pack subcommand #282
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
Conversation
2b25acd
to
0ed780d
Compare
90b56dd
to
602ad7d
Compare
"Initialized package" => "Initialized project" ? |
Would be possible to use a smaller binary? |
I had used the binary compiled using https://github.com/fastly/compute-starter-kit-rust-default as I was not familiar with generating a WASM binary myself. But I've managed to replace the |
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.
Tested "compute pack" deploying an existing service using an unsupported language, a supported language (rust) and also initialising a project using "Other".
Code looks and works as advertised ✔️
Left a few non blocking comments but looks great to me. Thank you for working on this! |
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.
Looking good - have requested some changes:
- Question regarding an important change in terminology that has wider implications than just the CLI. Therefore, I suggest we revert for the time being,
- Nitty ask to use the correct Wasm instead of WASM.
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.
LGTM
3e54575
to
84aee19
Compare
Problem: We want users to experiment with the C@E platform, which means being able to deploy their own WASM binaries compiled using languages not officially supported (yet).
Solution: Implement
fastly compute pack
, which will accept a--path
to a WASM binary and will scaffold the required structure so thatfastly compute deploy
will know what to do.Notes: I've also updated
fastly compute init
to provide a new language option of "other" as this means we can piggyback off the existing logic to build a compatible fastly.toml manifest (whichfastly compute deploy
will require).Example
Start by initialising a new project (notice the messaging has changed to reflect the third option "other" being selected):
The only thing produced by the above subcommand run, was a valid
fastly.toml
.Next, package up your pre-compiled WASM binary (in this case I reference a rust C@E starter kit I had built previously from another project):
Finally, we'll deploy this:
$ fastly compute deploy There is no Fastly service associated with this package. To connect to an existing service add the Service ID to the fastly.toml file, otherwise follow the prompts to create a service now. Press ^C at any time to quit. Domain: [gratefully-inspired-ewe.edgecompute.app] Backend (originless, hostname or IP address): [originless] ✓ Initializing... ✓ Creating service... ✓ Creating domain... ✓ Creating backend... ✓ Uploading package... ✓ Activating version... Manage this service at: https://manage.fastly.com/configure/services/2MJOTguHXRzr7OLcnRxGTU View this service at: https://gratefully-inspired-ewe.edgecompute.app SUCCESS: Deployed package (service 2MJOTguHXRzr7OLcnRxGTU, version 1)
Fixes #174