Skip to content

feat(compute): add install-viceroy command to pre-install Viceroy#1833

Merged
kpfleming merged 3 commits into
fastly:mainfrom
mschfh:viceroy-install
Jul 7, 2026
Merged

feat(compute): add install-viceroy command to pre-install Viceroy#1833
kpfleming merged 3 commits into
fastly:mainfrom
mschfh:viceroy-install

Conversation

@mschfh

@mschfh mschfh commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

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 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.

@mschfh mschfh force-pushed the viceroy-install branch 4 times, most recently from beef7c1 to 84bb5c1 Compare June 25, 2026 07:34
@mschfh mschfh marked this pull request as ready for review June 25, 2026 07:45
@mschfh mschfh requested a review from a team as a code owner June 25, 2026 07:45
@mschfh mschfh requested a review from rcaril June 25, 2026 07:45
@mschfh mschfh mentioned this pull request Jun 25, 2026
2 tasks

@kpfleming kpfleming left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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.

@mschfh mschfh force-pushed the viceroy-install branch from 84bb5c1 to a77d82a Compare July 4, 2026 20:19
@mschfh mschfh requested a review from kpfleming July 4, 2026 20:20
@mschfh

mschfh commented Jul 4, 2026

Copy link
Copy Markdown
Contributor Author

Added the requested changes and rebased it

@kpfleming

Copy link
Copy Markdown
Member

This looks great! Thanks for the contribution.

@kpfleming kpfleming enabled auto-merge (squash) July 7, 2026 18:18
@kpfleming kpfleming merged commit f596ad9 into fastly:main Jul 7, 2026
10 checks passed
@mschfh mschfh deleted the viceroy-install branch July 7, 2026 23:13
@mschfh

mschfh commented Jul 7, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for reviewing/merging!
Are there plans to cut a new release soon, to enable it the Dockerfiles?

@kpfleming

Copy link
Copy Markdown
Member

Yep... our regularly scheduled release for July should happen tomorrow (see the README.md for a description of the release schedule).

rcaril added a commit that referenced this pull request Jul 8, 2026
### 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants