Skip to content

ci(docker-image): cache CUDA and cargo builds, mount caches under /var/cache - #69

Merged
ajakhotia merged 1 commit into
mainfrom
ajakhotia/ci-cache-hygiene
Aug 22, 2026
Merged

ajakhotia merged 1 commit into
mainfrom
ajakhotia/ci-cache-hygiene

Conversation

@ajakhotia

Copy link
Copy Markdown
Owner

Two compile streams escaped ccache and dominated warm lanes (~28 of ~40 minutes, measured from log timestamps): OpenCV's CUDA device code, recompiled every run because no CUDA launcher was set, and zenoh's cold cargo build.

  • CMAKE_CUDA_COMPILER_LAUNCHER=ccache: the images carry ccache 4.12.3, whose nvcc support was verified in-container. A local validation lane (24.04 clang-shared, the exact CI invocation) built and installed all 305 steps with 94.5% hits and the CUDA objects now populating the cache.
  • Cargo's home persists in a robotfarm-cargo-<os> volume (registry and crate downloads). The target directory deliberately stays in the build tree: zenoh-c's install hardcodes the library path there, which the first local validation attempt caught.
  • Caching stays a CI-only concern: every cache knob lives in the workflow's single env block, and vanilla builds of the same image see none of it. Persistent caches mount at /var/cache/<purpose> per the FHS, matching the dockerfile's apt cache mounts; the local docker compile targets mirror the same scheme.

…r/cache

Two compile streams escaped ccache and dominated warm lanes: OpenCV's CUDA device code
(no CUDA launcher, ~19 min re-done every run) and zenoh's cargo build (~9 min cold every
run). Add CMAKE_CUDA_COMPILER_LAUNCHER and persist cargo's home in a named volume per OS
base. The cargo target directory stays in the build tree: zenoh-c's install hardcodes the
library path there, so only the registry and downloads persist.

Caching is a CI concern, so every cache knob lives in the workflow's env block and vanilla
builds of the same image see none of it. The persistent caches now mount at
/var/cache/<purpose> per the FHS, matching the apt cache mounts in the dockerfile, and the
local docker compile targets mirror the same scheme.
@ajakhotia
ajakhotia merged commit 1f82ada into main Aug 22, 2026
43 checks passed
@ajakhotia
ajakhotia deleted the ajakhotia/ci-cache-hygiene branch August 22, 2026 20:16
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