Skip to content

PoC: embed Viceroy directly into the fastly binary#1805

Draft
jedisct1 wants to merge 1 commit into
mainfrom
fdenis/viceroy-embedded
Draft

PoC: embed Viceroy directly into the fastly binary#1805
jedisct1 wants to merge 1 commit into
mainfrom
fdenis/viceroy-embedded

Conversation

@jedisct1
Copy link
Copy Markdown
Contributor

@jedisct1 jedisct1 commented May 28, 2026

Change summary

This allows shipping Viceroy inside the fastly binary so the common path becomes pure local extraction. No more downloads.

The embedded binary lives behind a viceroy_embed build tag. Without the tag, fastly builds and behaves exactly as before.

On first run the binary is decompressed. It's embedded as zstd-compressed to avoid bloating the binary too much if Viceroy is not used — each per-platform release archive grows by 8-10 MB. We already require klauspost/compress so no new dependencies are required.

Extraction failures or version mismatches fall through to the existing download flow untouched, as do --viceroy-path and FASTLY_VICEROY_USE_PATH.

The pinned Viceroy version is the contents of pkg/embedded/viceroy/VICEROY_VERSION, currently 0.18.0. Bumping it is a one-line edit followed by a checksums refresh.

make build-embedded builds a CLI executable with Viceroy embedded.

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

End users get a self-contained fastly binary (when built with viceroy_embed) that runs fastly compute serve offline, with no network round-trip to fetch Viceroy on first use. Default builds are unaffected.

Are there any considerations that need to be addressed for release?

Per-platform release archives grow by 8-10 MB when built with the viceroy_embed tag.

No breaking changes; the download path remains the fallback and existing overrides (--viceroy-path, FASTLY_VICEROY_USE_PATH) continue to work.

This allows shipping Viceroy inside the fastly binary so the common
path becomes pure local extraction. No more downloads.

The embedded binary lives behind a `viceroy_embed` build tag.

Without the tag, fastly builds and behaves exactly as before.

On first run the binary is decompressed. It's embedded as
ztd-compressed to avoid bloating the binary too much if
viceroy is not used - Each per-platform release archive grows by
8-10 MB. We already require klauspost/compress so no new
dependencies are required.

Extraction failures or version mismatches fall through to the
existing download flow untouched, as do --viceroy-path and
FASTLY_VICEROY_USE_PATH.

The pinned Viceroy version is the contents of
pkg/embedded/viceroy/VICEROY_VERSION, currently 0.18.0.

Bumping it is a one-line edit followed by a checksums refresh.

"make build-embedded" builds a CLI executable with Viceroy embedded.
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.

1 participant