Repository navigation
Conversation
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
selzoc
force-pushed
the
feature/compile-time-packages
branch
from
October 26, 2026 19:00
7c86e37 to
284ff4c
Compare
Alphasite
requested changes
Oct 26, 2026
selzoc
force-pushed
the
feature/compile-time-packages
branch
2 times, most recently
from
October 27, 2026 17:50
fe4cd28 to
dd9af6f
Compare
When a compiled release omits compile-time-only packages, every shipped package whose dependency closure reaches an omitted package gets a new fingerprint and version: H(original fingerprint, original dependency key, sorted kept dependencies), where H is SHA-1 for 40-hex fingerprints and SHA-256 for 64-hex fingerprints. The dependency key matches the director's KeyGenerator, so the director stores each variant as a distinct compiled package. Table tests pin the dependency key format to the director's KeyGenerator, which has not changed since 2016. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With the flag, the compiled release ships only the packages that some job's job.MF lists. Every other package is omitted, with its blob, and recorded under compile_time_packages. Shipped packages that depend on omitted packages lose those dependency edges and get rewritten identities that keep their original_fingerprint. The version gains a +trimmed suffix (.trimmed if it already contains +), and the output filename matches. When nothing is omitted, the version and output are the same as without the flag. Compilation fails when a job archive has a duplicate or non-regular job.MF, or when the release has packages but no job lists any of them. go.mod pins bosh-cli to the feature/compile-time-packages commit that adds the compile-time package fields to the release manifest types. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
go test -tags fixtures compiles every release tarball in $FIXTURES with and without --exclude-compile-time-packages, using a fake package compiler. The trimmed output must ship exactly the packages listed by job.MF files, record the rest under compile_time_packages without their blobs, and carry the trimmed version suffix. In both outputs, every compiled package has exactly one blob matching its manifest digest. When nothing is omitted, the trimmed output must be byte-identical to the output without the flag. FIXTURES_OUT keeps the compiled tarballs for inspection. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
selzoc
force-pushed
the
feature/compile-time-packages
branch
from
October 27, 2026 18:01
dd9af6f to
9273047
Compare
Alphasite
reviewed
Oct 29, 2026
| return | ||
| } | ||
|
|
||
| for _, fixture := range fixtures { |
Contributor
There was a problem hiding this comment.
ginkgo has a native way of writing prameterised tests which may be worth using here. This isnt awful, its just a lot of code in a describe body
Contributor
There was a problem hiding this comment.
Also we may hyst want to hard code the fixture names, i get it, but i dont imagine it changes so often as to be a problem
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.
Compiled releases ship every package in the release, including toolchains like Go or Rust that are only needed to build other packages. No job uses them, and the director never installs them on a VM. They still take up space in every download, blobstore upload and export.
This adds an opt-in
--exclude-compile-time-packagesflag tobosh-agent compile. Everything is still compiled exactly as before; only the output tarball changes:release.MFdoesn't always include it.compile_time_packages, so you can see what was removed.+trimmedsuffix, or.trimmedif the version already has a+. If nothing is removed, the output is byte-for-byte the same as without the flag.Without the flag, nothing changes.
This depends on the bosh-cli
feature/compile-time-packagespr: cloudfoundry/bosh-cli#743, which adds the two new manifest fields and keeps them when releases are repacked or re-digested. go.mod points at that branch for now and should move to a bosh-cli release before this merges. Older CLIs and directors ignore the new fields.How much it saves
We trimmed the exact compiled releases that cf-deployment and bosh-deployment reference today:
About half of the releases have nothing to remove and come out unchanged.
create-envalso gets faster. Unlike the director, it installs every package a job depends on, not just the ones the job lists. For a base director that drops from 19 packages to 15, about 400 MB less to download and 1.29 GB less to unpack.Is it safe?
For normal deployments, yes: VMs only ever receive the packages their jobs list, and those are always kept.
create-envinstalls more than that, so we also checked every affected release in both deployments for files that need something from a removed package. Nothing a job uses was affected. The one thing we found was in backup-and-restore-sdk: a test helper that needs a library no job declares. It is already broken in the untrimmed release, and the backup job itself works fine.Testing
go test -tags fixtures ./releasetarball/) runs real release tarballs through the compiler with a fake package build. It checks that every kept package's blob is present and matches its checksum.To roll back, deploy the untrimmed version of the release.