Skip to content

Speed up the cryptpilot-fde image build - #174

Merged
imlk0 merged 1 commit into
masterfrom
build-slow
Nov 12, 2026
Merged

imlk0 merged 1 commit into
masterfrom
build-slow

Conversation

@imlk0

@imlk0 imlk0 commented Nov 12, 2026

Copy link
Copy Markdown
Collaborator

The fde image build was dominated by yum downloads that repeated work the build
had already done. Three changes:

  • Merge the spec's yum-builddep into the dependency-install step. The later
    yum-builddep in the build step ran after the install had already satisfied
    every BuildRequires, so it downloaded the full repository metadata and
    resolved to "Nothing to do". This removes one metadata download per build.
  • Choose the package mirror at build time: keep the base image's in-cloud
    mirror when it is reachable, fall back to the public mirror otherwise. The
    published image is rewritten to public URLs at the end.
  • Split the release stage's dependency install from the freshly built RPM.
    The ~670 MB dependency tree now sits in a layer keyed on the base image, and
    the local RPM is installed with every repository disabled, resolving
    against the rpmdb alone. A cold build pays the same as before; a rebuild
    after a source change downloads nothing.

Cold-build behavior is unchanged; the gain is on rebuilds, which is where the
time was going.

Verification:

  • The merged yum transaction resolves the spec's BuildRequires.
  • The release dependency list resolves to the same 318 packages as the
    previous install.
  • The offline local-RPM install was tested with a package carrying the same
    rich and weak dependencies.

The fde image build spent most of its time fetching repository metadata
and RPMs it already had:

- The build step ran yum-builddep after the dependency install had
  already satisfied the spec's BuildRequires. It downloaded the full
  metadata and resolved to "Nothing to do". Fold it into the dependency
  install so a build performs a single yum transaction.
- Every stage rewrote the base image's in-cloud mirror to the public
  one. Probe the in-cloud mirror first and fall back to the public one
  only when it is unreachable. The published image still ships public
  URLs.
- The release stage installed the freshly built RPM and its ~670 MB
  dependency tree in one layer, so every source change downloaded all of
  it again. Split the dependency tree into a layer keyed on the base
  image and install the local RPM with every repository disabled.

Verified:
- yum-builddep resolves the spec in the merged transaction.
- The release dependency list resolves to the same 318 packages as before.
- The offline local-RPM install handles the host package's rich and weak
  dependencies.

Assisted-by: Claude Code:deepseek-v4.1-flash-1017
Signed-off-by: Kun Lai <laikun@linux.alibaba.com>
@codecov

codecov Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 37.23%. Comparing base (16195be) to head (373c7f3).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #174   +/-   ##
=======================================
  Coverage   37.23%   37.23%           
=======================================
  Files          93       93           
  Lines        8286     8286           
  Branches     8286     8286           
=======================================
  Hits         3085     3085           
  Misses       4900     4900           
  Partials      301      301           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@imlk0
imlk0 merged commit 373c7f3 into master Nov 12, 2026
94 of 96 checks passed
@imlk0
imlk0 deleted the build-slow branch November 12, 2026 12:25
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