PoC: embed Viceroy directly into the fastly binary#1805
Draft
jedisct1 wants to merge 1 commit into
Draft
Conversation
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.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
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_embedbuild 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/compressso no new dependencies are required.Extraction failures or version mismatches fall through to the existing download flow untouched, as do
--viceroy-pathandFASTLY_VICEROY_USE_PATH.The pinned Viceroy version is the contents of
pkg/embedded/viceroy/VICEROY_VERSION, currently0.18.0. Bumping it is a one-line edit followed by a checksums refresh.make build-embeddedbuilds a CLI executable with Viceroy embedded.All Submissions:
New Feature Submissions:
Changes to Core Features:
User Impact
End users get a self-contained
fastlybinary (when built withviceroy_embed) that runsfastly compute serveoffline, 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_embedtag.No breaking changes; the download path remains the fallback and existing overrides (
--viceroy-path,FASTLY_VICEROY_USE_PATH) continue to work.