Skip to content

Remove the circular dependency between clickhouse/cctools and clickhouse/fasttest - #126309

Merged
thevar1able merged 6 commits into
masterfrom
cctools-from-ubuntu
Oct 20, 2026
Merged

thevar1able merged 6 commits into
masterfrom
cctools-from-ubuntu

Conversation

@thevar1able

@thevar1able thevar1able commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

Remove the circular dependency between clickhouse/cctools and clickhouse/fasttest, and stop pinning the cctools tag by hand.

clickhouse/fasttest and other images copy /opt/gdb and /opt/openssl-fips from clickhouse/cctools, while clickhouse/cctools itself was built from clickhouse/fasttest. Because of this cycle, the pinned cctools tag in the dependent images could never match its digest, every tag bump changed the cctools digest again, and after the gdb update the tag was not bumped at all.

  • Build clickhouse/cctools from ubuntu:24.04 with the Ubuntu clang. Nothing in it needs the fasttest toolchain. It is the same base as fasttest, so the copied binaries match its glibc. The ld.lld workaround for binutils 2.38 is dropped, as Ubuntu 24.04 ships binutils 2.42.
  • praktika: support several dependencies of a Docker image. The first one is still passed as FROM_TAG; every dependency is also passed as <NAME>_TAG, e.g. CCTOOLS_TAG.
  • Make clickhouse/cctools a dependency of the images that copy from it, and take its tag from CCTOOLS_TAG instead of a pinned one. A change in cctools now rebuilds the dependent images automatically. The server and keeper images get the tag from the workflow config.

Related: #124241
Related: #126291

Changelog category (leave one):

  • CI Fix or Improvement (changelog entry is not required)

🤖 Generated with Claude Code


Workflow [PR]
Sync PR [sync-upstream/pr/126309]

Version info

  • Merged into: 26.11.1.313-master (included in 26.11 and later)

…/fasttest`

`clickhouse/fasttest` and other images copy `/opt/gdb` and `/opt/openssl-fips`
from `clickhouse/cctools`, while `clickhouse/cctools` itself was built from
`clickhouse/fasttest`. Because of this cycle, the pinned `cctools` tag in the
dependent images never matched its digest, and bumping the tag changed the
`cctools` digest again.

Nothing in the build needs the `fasttest` toolchain: libtapi and cctools-port
build with any recent clang, gdb and OpenSSL with any C/C++ compiler. Build it
from the plain `ubuntu:24.04` (the same base as `fasttest`, so the copied
binaries match its glibc) with the Ubuntu clang. The `ld.lld` workaround for
binutils 2.38 is not needed with binutils 2.42 from Ubuntu 24.04.

Related: #124241
Related: #126291

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@clickhouse-gh

clickhouse-gh Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [a21b464]

Summary: ✅


AI Review

Summary

The PR removes the circular dependency between clickhouse/cctools and clickhouse/fasttest, adds support for multiple Docker dependencies, and replaces manually pinned tool-image tags with calculated dependency tags. No actionable correctness or reliability findings remain in head a21b464fb8ab065dd0bb530323806caf44b9bfbc.

Final Verdict

Status: ✅ Approve

@clickhouse-gh clickhouse-gh Bot added the pr-ci label Oct 16, 2026
thevar1able and others added 2 commits October 16, 2026 17:18
The first dependency is still the base image, passed as `FROM_TAG`. The tag of
every dependency is also passed as a `<NAME>_TAG` build argument (e.g.
`CCTOOLS_TAG` for `clickhouse/cctools`), so an image can copy files from
another image by its calculated digest instead of a pinned tag.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The images that copy files from `clickhouse/cctools` declared the tag in their
Dockerfiles, and it had to be updated by hand in a separate commit after the
image was built. It was forgotten after the gdb update.

Make `clickhouse/cctools` a dependency of these images and take its tag from
the `CCTOOLS_TAG` build argument. A change in `cctools` now rebuilds the
dependent images automatically. The server and keeper images get the tag from
the workflow config.

Related: #124241
Related: #126291

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@thevar1able thevar1able changed the title Build clickhouse/cctools from ubuntu:24.04 instead of clickhouse/fasttest Remove the circular dependency between clickhouse/cctools and clickhouse/fasttest Oct 16, 2026
@clickhouse-gh
clickhouse-gh Bot requested review from leshikus and maxknv October 16, 2026 15:23
An image built without the tag would silently get whatever `latest` points to.
Require the tag to be passed explicitly instead.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@thevar1able
thevar1able marked this pull request as ready for review October 16, 2026 15:26
@clickhouse-gh clickhouse-gh Bot added the comp-ci-infrastructure CI/CD pipelines (GitHub Actions, CI scripts, runners). label Oct 16, 2026
An `ARG` placed after a `FROM` is scoped to that build stage, so
`FROM_TAG` (and `REDPANDA_VERSION`) declared after the new
`FROM clickhouse/cctools:${CCTOOLS_TAG} AS cctools` line were empty in
the following `FROM` instructions:

    failed to parse stage name "clickhouse/test-base:": invalid reference format

https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=126309&sha=5af22566bb50337ec344b8111f9773a0c509effe&name_0=PR&name_1=Dockers%20Build%20%28amd%29
#126309

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@thevar1able
thevar1able requested a review from azat October 19, 2026 12:59
@azat azat self-assigned this Oct 19, 2026

@leshikus leshikus left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please double check --build-arg added at docker_server.py:513 is really needed by the build, otherwise looks good

None of the `docker/server` and `docker/keeper` Dockerfiles copy from
`clickhouse/cctools`, so the build arg was unused.

#126309 (review)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@clickhouse-gh
clickhouse-gh Bot requested a review from leshikus October 19, 2026 21:37
@clickhouse-gh

clickhouse-gh Bot commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

Build profile diff (arm_release)

Comparing a21b464fb with master edcf68499 (stripped binary size, per-symbol sizes and ThinLTO time; object sizes against the warmup build of bf66cb9c1; compile times per translation unit against the most recent warmup build that recompiled it).

✅ No significant changes.

Binary sizes

programs/clickhouse-stripped: smaller than the master baseline by the known offset between the two builds, so the difference is not shown. A delta that differs from the offset by more than 50% of it is shown, in either direction.

The official master build is compiled with -g and a pull request build is not, and XRay counts debug instructions towards its instrumentation threshold, so master instruments thousands of functions more and its binary is ~0.4% larger no matter what the pull request does.

Object file sizes

2 object files changed (+5.18 KiB total), 2 added.

Object file Master PR Δ

721 more object files are built by the master warmup baseline only (it builds every object-file target, a pull request build only clickhouse-bundle) and not compared.

Compile time of recompiled translation units

6 translation units recompiled, 4 s compile time in total, 6 of them have a recent master baseline.

Job report

@thevar1able
thevar1able added this pull request to the merge queue Oct 20, 2026
Merged via the queue into master with commit f3f733b Oct 20, 2026
178 checks passed
@thevar1able
thevar1able deleted the cctools-from-ubuntu branch October 20, 2026 14:47
@robot-clickhouse robot-clickhouse added the pr-synced-to-cloud The PR is synced to the cloud repo label Oct 20, 2026
groeneai added a commit to groeneai/ClickHouse that referenced this pull request Oct 22, 2026
…rence build

The praktika job digest does not include the Docker image digest when
`run_in_docker` contains a colon, and `BINARY_DOCKER_COMMAND` does
(`--volume=.:/ClickHouse`). A `clickhouse/binary-builder` change (compiler,
PGO or BOLT profile) therefore leaves the sources digest of the reference
build unchanged, as at ClickHouse#126309: `566499c799d454cd6e24` both at 2a95d09
(image 3480c0dc11) and at b1451e4 (image c815e89709). MasterCI schedules
the reference build after such a change, so the old lookup stopped there,
while matching by sources digest alone could take a reference built with the
previous image whenever the new one is still running or failed.

Compare `digest_dockers["clickhouse/binary-builder"]` of both MasterCI
workflow configs as well; a missing image digest keeps the official build.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp-ci-infrastructure CI/CD pipelines (GitHub Actions, CI scripts, runners). pr-ci pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants