Skip to content

feat: two-stage CI build with cached prereqs and TensorStore FetchCon…#46

Open
sameeul wants to merge 5 commits intoPolusAI:mainfrom
sameeul:feat/ci-tensorstore-caching
Open

feat: two-stage CI build with cached prereqs and TensorStore FetchCon…#46
sameeul wants to merge 5 commits intoPolusAI:mainfrom
sameeul:feat/ci-tensorstore-caching

Conversation

@sameeul
Copy link
Member

@sameeul sameeul commented Feb 19, 2026

Adds a prebuild job (one per OS/arch) that runs before the parallel wheel-build jobs. The prebuild populates two caches:

  • prereq_cache/: filepattern + pybind11 (keyed on install scripts)
  • ts_fc_cache/: TensorStore FetchContent source + build state (keyed on root CMakeLists.txt + tensorstore_prebuild/CMakeLists.txt)

Wheel-build jobs restore both caches and skip the heavy dependency compilation on cache hits. FETCHCONTENT_BASE_DIR is wired into CMAKE_ARGS for all platforms so cmake reuses the pre-fetched TensorStore source tree.

New files:
ci-utils/tensorstore_prebuild/ — minimal cmake project for TS-only prebuild
ci-utils/prebuild_linux.sh — runs inside manylinux container
ci-utils/install_sys_deps_linux.sh — builds zlib/jpeg/png to /usr/local
ci-utils/before_all_{linux,macos}.sh / before_all_win.bat
— replace inline CIBW_BEFORE_ALL commands

sameeul and others added 5 commits February 19, 2026 06:46
…tent

Adds a prebuild job (one per OS/arch) that runs before the parallel
wheel-build jobs. The prebuild populates two caches:
  - prereq_cache/: filepattern + pybind11 (keyed on install scripts)
  - ts_fc_cache/: TensorStore FetchContent source + build state
    (keyed on root CMakeLists.txt + tensorstore_prebuild/CMakeLists.txt)

Wheel-build jobs restore both caches and skip the heavy dependency
compilation on cache hits. FETCHCONTENT_BASE_DIR is wired into
CMAKE_ARGS for all platforms so cmake reuses the pre-fetched
TensorStore source tree.

New files:
  ci-utils/tensorstore_prebuild/  — minimal cmake project for TS-only prebuild
  ci-utils/prebuild_linux.sh      — runs inside manylinux container
  ci-utils/install_sys_deps_linux.sh — builds zlib/jpeg/png to /usr/local
  ci-utils/before_all_{linux,macos}.sh / before_all_win.bat
                                  — replace inline CIBW_BEFORE_ALL commands

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…cmake

Without CALL, invoking a .bat file from within another batch context
transfers execution permanently — the caller never resumes. This caused
the xcopy and cmake TensorStore steps to be silently skipped after
install_prereq_win.bat completed.

Also adds --parallel to cmake --build on Windows to match the -j$(nproc)
flag used on Linux/macOS, and explicitly copies DLLs to %TEMP%\argolid\bin
in before_all_win.bat's cache-miss path rather than relying on the
conditional copy inside install_prereq_win.bat.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Previously a single prebuild matrix job blocked all wheel-build jobs
until every OS finished. Now each OS has its own named prebuild job
(prebuild_linux, prebuild_macos_intel, prebuild_windows,
prebuild_macos_arm64) and its own wheel-build job that depends only
on its matching prebuild. Linux wheels start building as soon as the
Linux prebuild is done, independently of macOS/Windows.

The build_wheels matrix is also split into per-OS jobs
(build_wheels_linux, build_wheels_macos_intel, build_wheels_windows,
build_wheels_apple_arm64), each retaining its cibw_build matrix for
the 4 Python versions. Cache keys are hardcoded per job rather than
derived from matrix variables.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add ccache detection to CMakeLists.txt and tensorstore_prebuild/CMakeLists.txt
  via CMAKE_CXX/C_COMPILER_LAUNCHER so all compilation units go through ccache
- Install ccache in prebuild_linux.sh and before_all_linux.sh via dnf
- Set CCACHE_DIR=/project/ccache_dir in prebuild (env var) and wheel-build
  (CIBW_ENVIRONMENT_LINUX) so the cache is in the host-accessible workspace
- Add ccache_dir GitHub Actions cache to prebuild_linux (saves after prebuild)
  and build_wheels_linux (restores from prebuild's key, saves per Python version)
- Prebuild now also triggers Docker run on ccache miss, not just prereq/ts misses
- Add ccache_dir/ to .gitignore

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
brew's curl dynamically links against openssl. Uninstalling openssl
before before_all_macos.sh (which uses curl to download zlib/jpeg/png)
caused curl to abort with a missing libssl dylib error.

Reordered CIBW_BEFORE_ALL_MACOS so before_all_macos.sh (curl downloads)
runs first, then openssl is removed before cmake runs.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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