ci(ubuntu22): install CMake from GitHub tarball, not apt.kitware.com#5962
Closed
ci(ubuntu22): install CMake from GitHub tarball, not apt.kitware.com#5962
Conversation
Replace the apt.kitware.com recipe in docker/ubuntu22Dockerfile with a
curl+tar install of the upstream Kitware CMake tarball published on
GitHub Releases.
Motivation: apt.kitware.com has been unreliable in ways our CI is
bound to hit. Recent evidence:
- ubuntu22-arm64 image build on feat/zlib-compress-stream-zlib-ng
(run 24800811051) failed with
Could not connect to apt.kitware.com:443 (66.194.253.25)
- connect (111: Connection refused)
...
E: Unable to locate package kitware-archive-keyring
while the identical recipe on x64 in the same run succeeded.
- Dec 2024: full-day outage documented on CMake Discourse
(https://discourse.cmake.org/t/kitware-apt-repo-down/13184),
caused by a mis-issued SSL certificate (for vtk.org, not
apt.kitware.com).
Kitware's apt repo is a single origin with no published HA strategy.
GitHub Releases, by contrast, is served through GitHub's CDN -- the
same infrastructure MeshLib CI already depends on for git clones,
actions/checkout, and every submodule fetch. Moving this dependency
off apt.kitware.com therefore removes a single point of failure
without adding any new one.
Side benefits of the tarball approach:
* Version is pinned (ENV CMAKE_VERSION=4.3.2) rather than "whatever
Kitware's apt index was advertising at image-build time", which
makes the Docker image reproducible.
* Drops the transitive apt dependencies the old recipe pulled in
just to run apt-add-repository (software-properties-common,
lsb-release) and the apt-key dance.
* Shorter per-image build time -- one curl+tar instead of three
sequential apt updates.
* Works uniformly on x86_64 and aarch64 via $(uname -m); no
architecture-specific branching.
Only docker/ubuntu22Dockerfile is affected: docker/ubuntu24Dockerfile
never upgraded CMake beyond Ubuntu's apt-supplied version (3.28 on
noble), so it has no kitware recipe to replace.
3 tasks
Contributor
Author
|
Closing as superseded. #5963 merged the smaller fix: delete the ubuntu22 CMake upgrade step entirely and gate |
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.
Summary
Replace the
apt.kitware.comCMake-upgrade recipe indocker/ubuntu22Dockerfilewith acurl + tarinstall of the upstream Kitware release tarball published on GitHub.Why we need a newer CMake than Ubuntu 22.04 ships
This isn't about MeshLib's own
cmake_minimum_required— those all sit at 3.18 and Ubuntu 22.04's 3.22 satisfies them. The real requirement comes from the combination ofsource/MRCuda/CMakeLists.txtusingCUDA_STANDARD 20and the CUDA 12.6 toolkit installed in the image. CMake's NVCC-flag table maps(CMake version × NVCC version) → "how to pass -std=c++20". CMake 3.22 (released Jan 2022) predates CUDA 12.6 and has no entry for that pair, so it fails at CUDA project detection with:Demonstrated by #5963's failure on run 24821677923 — that PR tried to drop the CMake upgrade entirely, and CUDA configure failed exactly as described. So the upgrade is functionally required; this PR just moves where it comes from.
Why not keep pulling from apt.kitware.com
apt.kitware.comhas been unreliable in ways our CI keeps hitting:ubuntu22-arm64image build on MRZlib: route compress and decompress streams through zlib-ng (native mode) #5959 (run 24800811051) died at this exact step withvtk.orginstead ofapt.kitware.com).Kitware's apt repo is a single origin with no published HA strategy. GitHub Releases, by contrast, rides GitHub's CDN — the same infrastructure MeshLib CI already depends on for
git clone,actions/checkout, and every submodule fetch on every run. Moving the dependency offapt.kitware.comremoves a single point of failure without adding any new one.The change
One file,
docker/ubuntu22Dockerfile:CMAKE_VERSION=4.3.2— latest stable from Kitware; it's the same binary Kitware publishes toapt.kitware.com. CUDA 12.6 + C++20 is well-supported here.uname -mdispatches tox86_64oraarch64; Kitware's tarballs are named with exactly those suffixes./opt/cmake/and symlink into/usr/local/bin/, which wins over/usr/bin/cmakein PATH order.Side benefits
CMAKE_VERSIONgives byte-identical images run-to-run; previously the Kitware apt index decided which CMake was installed based on whatever was newest at image-build time.apt updates and anapt-key advkeyserver lookup. On the arm64 leg this step now completes in ~3.4 s (vs. the old flow that took ~35 s on success and hit connection timeouts on failure).software-properties-common,lsb-release, and theapt-keydance that existed only to feedapt-add-repository.Scope
Only
docker/ubuntu22Dockerfileis touched.docker/ubuntu24Dockerfilehas never upgraded CMake — Ubuntu 24.04 noble's apt ships CMake 3.28, which does have an NVCC flag-table entry covering CUDA 12.6 + C++20, so no upgrade is needed there and noapt.kitware.cominvolvement either.Verified on CI
Full green matrix on run 24803389235:
prepare-image / linux-image-build-upload (ubuntu22, x64)— 12 m 40 s, new install step ran, image publishedprepare-image / linux-image-build-upload (ubuntu22, arm64)— 13 m 30 s,cmake-4.3.2-linux-aarch64.tar.gzpulled and unpacked in 3.4 s:ubuntu-arm64-build-test (ubuntu22, Release)— 24 m 46 s, full build + unit tests passed (CUDA project detection successful, CUDA20 dialect resolved)ubuntu-x64-build-test (ubuntu22, Release, GCC-12)— 43 m 26 s, sameapt.kitware.com🤖 Generated with Claude Code