ci: cache BSD sdk sources separately #35722

Closed
willcl-ark wants to merge 3 commits from depends-sdk-sources into master AGit
willcl-ark commented 2026-07-14 13:38:44 +00:00 (Migrated from github.com)

Sometimes CI jobs need to (re)download *BSD SDK archives, and these downloads can delay or fail the job, as has been happening recently.

The SDKs are currently downloaded and extracted while building the CI image itself; this means that when the relevant image-build cache is missed or invalidated, the SDK archives are downloaded again, which is unnecessary.

Instead, cache the BSD SDK archives separately and mount them into the runtime container. Move the BSD SDK setup out of 01_base_install.sh and run it after the container starts, so it is no longer part of the image build and the BSD SDKs are no longer part of the image build cache/layers.

This means rebuilding the BSD images no longer relies on pulling the SDK archives, reducing reliance and load we have on archive servers in many cases.

While touching 02_run_container.py and adding new paths to it, unify path handling for all caches a bit more.

Sometimes CI jobs need to (re)download *BSD SDK archives, and these downloads can delay or fail the job, as has been happening recently. The SDKs are currently downloaded and extracted _while building the CI image itself_; this means that when the relevant image-build cache is missed or invalidated, the SDK archives are downloaded again, which is unnecessary. Instead, cache the BSD SDK archives separately and mount them into the runtime container. Move the BSD SDK setup out of `01_base_install.sh` and run it after the container starts, so it is no longer part of the image build and the BSD SDKs are no longer part of the image build cache/layers. This means rebuilding the BSD images no longer relies on pulling the SDK archives, reducing reliance and load we have on archive servers in many cases. While touching 02_run_container.py and adding new paths to it, unify path handling for all caches a bit more.
DrahtBot commented 2026-07-14 13:39:17 +00:00 (Migrated from github.com)

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

External sites

Reviews

See the guideline and AI policy for information on the review process.
A summary of reviews will appear here.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #35754 (ci: update and verify SDKs, lock lint dependencies by l0rinc)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

<!--e57a25ab6845829454e8d69fc972939a--> The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. <!--006a51241073e994b41acfe9ec718e94--> ### External sites * Code coverage & benchmarks: https://corecheck.dev/bitcoin/bitcoin/pulls/35722 * Ralph review <img src=https://review.fish.foo/assets/bitcoin/bitcoin/35722.png alt="Ralph review status"> https://git.fish.foo/bitcoin/bitcoin/pulls/35722#author-ralph <!--021abf342d371248e50ceaed478a90ca--> ### Reviews See [the guideline](https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md#code-review) and [AI policy](https://github.com/bitcoin/bitcoin/blob/master/doc/AI_POLICY.md) for information on the review process. A summary of reviews will appear here. <!--174a7506f384e20aa4161008e828411d--> ### Conflicts Reviewers, this pull request conflicts with the following ones: * [#35754](https://github.com/bitcoin/bitcoin/pull/35754) (ci: update and verify SDKs, lock lint dependencies by l0rinc) If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. <!--5faf32d7da4f0f540f40219e4f7537a3-->
DrahtBot commented 2026-08-04 09:13:19 +00:00 (Migrated from github.com)

🐙 This pull request conflicts with the target branch and needs rebase.

<!--cf906140f33d8803c4a75a2196329ecb--> 🐙 This pull request conflicts with the target branch and [needs rebase](https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md#rebasing-changes).
maflcko commented 2026-08-04 10:00:05 +00:00 (Migrated from github.com)

An alternative would be to add fallback mirrors (like in depends), but this may be fine as well (haven't looked closely)

An alternative would be to add fallback mirrors (like in depends), but this may be fine as well (haven't looked closely)
willcl-ark commented 2026-08-04 11:12:48 +00:00 (Migrated from github.com)

Yeah I'm open to either option too. The nice thing about caching them in CI is that nobody has to update the fallback mirror on each SDK update (or forget to!). But IMO it's the "cleaner" approach, and the fallbacks also work for contributors local development; could be superior depending on how flakey the original hosts are...

I think it might be @achow101 who could add fallbacks of these, if we want to go that route?

Yeah I'm open to either option too. The nice thing about caching them in CI is that nobody has to update the fallback mirror on each SDK update (or forget to!). But IMO it's the "cleaner" approach, and the fallbacks also work for contributors local development; could be superior depending on how flakey the original hosts are... I think it might be @achow101 who could add fallbacks of these, if we want to go that route?
maflcko commented 2026-08-04 11:18:22 +00:00 (Migrated from github.com)

Do you recall any CI logs where the download failed?

Do you recall any CI logs where the download failed?
willcl-ark commented 2026-08-04 11:19:13 +00:00 (Migrated from github.com)

Do you recall any CI logs where the download failed?

I do not, it was just the re-downloading them needlessly which prompted this change.

> Do you recall any CI logs where the download failed? I do not, it was just the re-downloading them needlessly which prompted this change.
sedited commented 2026-09-16 12:03:14 +00:00 (Migrated from github.com)

Ping for rebase.

Ping for rebase.
sedited commented 2026-10-31 11:09:41 +00:00 (Migrated from github.com)

@willcl-ark do you still think the changes here are worthwhile?

@willcl-ark do you still think the changes here are worthwhile?
willcl-ark commented 2026-11-02 14:54:41 +00:00 (Migrated from github.com)

Closing due to low value.

Closing due to low value.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
bitcoin/bitcoin!35722
No description provided.