You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The container images (Dockerfile-go, Dockerfile-node, Dockerfile-rust) re-download Viceroy on each container start (raised in #1828 (review)), this PR adds an explicit fastly compute install-viceroy command that downloads and
installs the Viceroy local-testing binary.
Implementation
Rather than duplicate the download logic, the existing installer was extracted out into a shared viceroyInstaller (pkg/commands/compute/viceroy.go).
Both compute serve and the new command call it, so every version/override
mechanism (the manifest's [local_server] viceroy_version, FASTLY_VICEROY_USE_PATH)
applies identically during a pre-install. ServeCommand.GetViceroy is now a thin
wrapper, so behavior is unchanged.
This is intentionally simpler than #1805 (which embeds binaries into the CLI binary).
All Submissions:
Have you followed the guidelines in our Contributing document?
Have you checked to ensure there aren't other open Pull Requests for the same update/change?
New Feature Submissions:
Does your submission pass tests?
Changes to Core Features:
Have you written new tests for your core changes, as applicable?
Have you successfully run tests with your changes locally?
User Impact
A new fastly compute install-viceroy command lets users (and the container
images) pre-install Viceroy ahead of time, so compute serve can start without
needing to download it. No change to existing behavior - compute serve still
installs Viceroy on demand if it isn't already present.
Are there any considerations that need to be addressed for release?
None. No breaking changes - the command is purely additive and the shared
extraction keeps compute serve's install path identical.
The reason will be displayed to describe this comment to others. Learn more.
I like the approach here, although I'd rather the command be named fastly compute install-tools - then later (if not in this PR) it can be extended to install wasm-tools which is needed by fastly compute build, resulting in the same benefits for users who are using container images for building their projects.
### Change summary
This change preinstalls viceroy during the Docker image builds using the
`compute install-tools` command introduced in #1833
All Submissions:
* [X] Have you followed the guidelines in our Contributing document?
* [X] Have you checked to ensure there aren't other open [Pull
Requests](https://github.com/fastly/cli/pulls) for the same
update/change?
### Are there any considerations that need to be addressed for release?
This will require a new release which includes the changes from #1833
Co-authored-by: Richard Carillo <77027245+rcaril@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change summary
The container images (
Dockerfile-go,Dockerfile-node,Dockerfile-rust) re-download Viceroy on each container start (raised in #1828 (review)), this PR adds an explicitfastly compute install-viceroycommand that downloads andinstalls the Viceroy local-testing binary.
Implementation
Rather than duplicate the download logic, the existing installer was extracted out into a shared
viceroyInstaller(pkg/commands/compute/viceroy.go).Both
compute serveand the new command call it, so every version/overridemechanism (the manifest's
[local_server] viceroy_version,FASTLY_VICEROY_USE_PATH)applies identically during a pre-install.
ServeCommand.GetViceroyis now a thinwrapper, so behavior is unchanged.
This is intentionally simpler than #1805 (which embeds binaries into the CLI binary).
All Submissions:
New Feature Submissions:
Changes to Core Features:
User Impact
A new
fastly compute install-viceroycommand lets users (and the containerimages) pre-install Viceroy ahead of time, so
compute servecan start withoutneeding to download it. No change to existing behavior -
compute servestillinstalls Viceroy on demand if it isn't already present.
Are there any considerations that need to be addressed for release?
None. No breaking changes - the command is purely additive and the shared
extraction keeps
compute serve's install path identical.