Skip to content

CI: require only one package flavour per Install packages job - #117180

Merged
alexey-milovidov merged 9 commits into
ClickHouse:masterfrom
groeneai:install-packages-require-one-flavour
Oct 12, 2026
Merged

alexey-milovidov merged 9 commits into
ClickHouse:masterfrom
groeneai:install-packages-require-one-flavour

Conversation

@groeneai

@groeneai groeneai commented Aug 30, 2026 •

Copy link
Copy Markdown
Collaborator

Changelog category (leave one):

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

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

Each Install packages job now downloads only the package flavour it installs, instead of all of them.

Description

Related: #113270
Related: #117168

Install packages declares four artifacts in requires (deb, rpm, tgz, raw binary) and praktika
downloads all four into ci/tmp before the script starts. The script installs one flavour at a time
and deletes each only after its own group, so the deb group, which runs first, holds all four on disk
while needing only the debs. Measured from the failing run's df timeline: 2.5 GiB of debs, 2.5 GiB of rpms, 3.2 GiB of tarballs and about 1 GiB of
ci/tmp/clickhouse. apt asked for 4753 MB there against 4.3 GiB free, putting the peak near
14 GiB.

Each Job.ParamSet now requires only its own flavour, via the --no-deb/--no-rpm/--no-tgz
flags that already existed unused. Peak drops to about 9 GiB, or 7 GiB for tgz. That host arrived
with 13.5 GiB free of a 58 GiB volume, so the deb job would have started with 10.0 GiB free, not
4.3. ci/defs/job_configs.py joins the jobs' digest, since these parameter sets now decide what each
job installs; otherwise a PR changing only them would skip the jobs.

#117168 covers why the host arrived that full; it does not overlap
this change. Neither closes the hole alone: the runner admission floor stays at 2.86 GiB and 5
percent (free_blocks_threshold in ci/praktika/infrastructure/runner/runner-init.py), which this host passed at
4.3 GiB and 7 percent, and raising it is a pool-wide capacity tradeoff.

The same 26 substeps still run per arch, same images and packages, matching the pre-change names,
split 5 + 3 + 18. Three stale disk-space comments are corrected.

Cost: two extra jobs per arch on the amd-tiny/arm-tiny pools; only the per-job overhead (93 s) is paid
three times, and the three run in parallel, so the check finishes sooner. The check names change, so CIDB history splits at the
rename.


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

Version info

  • Merged into: 26.10.1.2180-master (included in 26.10 and later)

groeneai and others added 2 commits August 30, 2026 15:40
`Install packages` declares four artifacts in `requires` (deb, rpm, tgz and the
raw binary) and praktika downloads all four into `ci/tmp` before the job script
starts, but `install_check.py` installs one flavour at a time. Reading the step
change across each `free_packages()` call in the failing run's own `df` timeline
(master 31f27d8): debs 2.5 GiB, rpms 2.5 GiB,
tarballs 3.2 GiB, plus `ci/tmp/clickhouse` at about 1 GiB that is never deleted.
About 9.2 GiB of package files stay resident for the whole job, of which the
substep that failed needed only the 2.5 GiB of debs. `apt` asked for 4753 MB
there against 4.3 GiB free, so the job's peak is near 14 GiB and `dpkg` ran out
of space unpacking `clickhouse.debug`.

Split each of the four ParamSets into three, one per flavour, using the
`--no-deb`, `--no-rpm` and `--no-tgz` flags that already existed in
`install_check.py` and were never set. The peak drops to about 9 GiB, or 7 GiB
for tgz. On the host that failed, which arrived with 13.5 GiB free of a 58 GiB
volume, the deb job would have started with 10.0 GiB free instead of 4.3 GiB.
This is growth proportional on the demand side: the peak now tracks one
flavour's size instead of the sum of four, where the four previous fixes in this
family each reclaimed a fixed amount of space that package growth then consumed.

Three supporting changes in `install_check.py`: pull the deb image when the deb
or tgz group runs and the rpm image when the rpm or tgz group runs, since both
tgz runs install the same tarballs in both images; guard the `strict=True`
`chmod +x ci/tmp/clickhouse` behind the deb or rpm group, without which the tgz
job aborts before running anything because it does not require the binary
artifact; and correct the two comments the split falsifies. The stale 6.8 GiB
tgz figure in `test_install_tgz` is corrected in the same pass: ClickHouse#111960 already
made it wrong when it changed the generated `doinst.sh` to rename the unpacked
tree into place instead of copying it.

Coverage is unchanged. The substep set of one pre-change job and the union of
the three new jobs match name for name, 26 substeps split 5 + 3 + 18 with no
overlap, cross-checked against the CIDB substep list of a green pre-change run.
Every substep still runs once per arch, in the same image, with the same
packages; only which artifacts are on disk while it runs changes.

This reduces exposure rather than removing it. The runner admission floor stays
at `free_blocks_threshold = 3_000_000` 1 KiB blocks (2.86 GiB) and 5 percent, so
a host admitted below about 9 GiB free can still fail; the failing host passed
both checks at 4.3 GiB and 7 percent free.

Co-Authored-By: Claude Opus 5 <[email protected]>
Pre-split, "once every package has been deleted" freed all three flavours: 2.5
GiB of debs, 2.5 GiB of rpms and 3.2 GiB of tarballs in the failing run's `df`
timeline, which is where the comment's 7 GiB came from. Each job now carries one
flavour, so the deb job frees 2.5 GiB before its binary substep and the rpm job
2.5 GiB, and no job frees 7 GiB. The headroom moved rather than shrank: the deb
job reaches that substep with about 12.5 GiB free, mostly because it never
downloads the other two flavours.

The ordering rationale still holds inside the deb and rpm jobs, so only the
figure goes.

Co-Authored-By: Claude Opus 5 <[email protected]>
@groeneai groeneai added can be tested Allows running workflows for external contributors groeneai-origin-ci-master PR origin: master/nightly CI monitoring finding labels Aug 30, 2026
@groeneai

Copy link
Copy Markdown
Collaborator Author
Internal second-model review: adjudication log (click to expand)

Pre-publication review by an independent model (engine: codex; two rounds, 1 finding each), plus an
independent cold review of the resulting tree before each gate run.

# Sev Finding Verdict Evidence / action
1 ⚠️ The binary-test comment kept "which is worth 7 GiB on its own", which this change falsifies: the deb job frees 2.5 GiB of debs before its binary substep, not 7 GiB, and the headroom now comes mainly from the flavours the job never downloads (ci/jobs/install_check.py:469-472) AGREE, fixed Rewritten to the standing invariant with no per-job reclamation figure. Step changes measured from the failing run's own df timeline: debs +2.5 GiB, rpms +2.5 GiB, tarballs +3.2 GiB
2 ⚠️ The PR body did not account for the cost of the change: 2 jobs per workflow become 6 on the style-checker pools AGREE, fixed Cost paragraph added to the description; 93 s of per-job overhead measured on the failing run, paid three times instead of once, against unchanged substeps
3 💡 The Related: relationship used the #N shorthand with trailing prose instead of a full GitHub URL on its own line AGREE, fixed Settled by measurement: across the 40 most recently merged PRs the rendered body uses the full-URL form 14 times and the shorthand 0 times
4 💡 deb_image / rpm_image became Optional while the four test_install_* helpers still declare image: DockerImage DISAGREE ci/ is not type-gated (the mypy entry is commented out at ci/jobs/check_style.py:1537-1542 and check-mypy-diff.py is invoked nowhere in the repo), every call site is guarded by the condition that made the image non-None, and the callee signatures are correct as written
5 💡 Whether install_check.py:471 "The runners hand the job as little as 4 GiB of free space" should be corrected, given that 19 of the 20 most recent master runs started with 17 to 42 GiB free DISAGREE "as little as" is a minimum claim and 4.3 GiB is the measured minimum, from this run's own first df. The sentence is true as written and never asserts typicality
6 💡 A draft of this description claimed the pre-change job fetched 5.7 GiB "it never opens". It did not: with no --no-* flag every flavour was installed AGREE, fixed Confirmed at the base revision: --deb/--rpm/--tgz default to True (install_check.py:400,408,416) and main() ran all three groups. 5.7 GiB is the per-job unused amount that only exists after the split. The description now states the actual defect, simultaneous residency

Severity: ❌ blocker / ⚠️ major / 💡 nit. DISAGREE verdicts carry recorded evidence and are
terminal per finding.

Checks I ran beyond the diff, in case they are useful to a reviewer: ci/praktika/runner.py
downloads exactly the artifacts named in requires before the job command starts, which is the
mechanism this change relies on; every quantity in the commit message reproduces from the failing
run's own job.log; the 26 substeps and the 5 + 3 + 18 split were cross-checked against the CIDB
substep list of a green pre-change run, not only against a local stub; after this change no job in
ci/defs/job_configs.py requires more than one package flavour, so there is no sibling left in the
same shape; and max_jobs is a lifecycle counter (runner-init.py:343-345), not a concurrency
limit, so the three jobs cannot land on one volume at the same time.

Session id: cron:clickhouse-review-slot-10:20260830-163600

@clickhouse-gh clickhouse-gh Bot added the manual approve Manual approve required to run CI label Aug 30, 2026
@clickhouse-gh clickhouse-gh Bot closed this Aug 30, 2026
@clickhouse-gh clickhouse-gh Bot reopened this Aug 30, 2026
@groeneai

Copy link
Copy Markdown
Collaborator Author
Pre-PR validation gate (click to expand)
# Question Answer
a Deterministic repro? Not for the ENOSPC itself, and deliberately so: the defect is a declared CI job dependency whose consequence is free-space arithmetic on a shared 58 GiB runner volume, which only CI provides. What is exercised on demand: the requires-matches-flags invariant over all 12 jobs, the argument plumbing for all 3 flag combinations, and the substep-coverage identity. The disk measurement is CI-side, on this PR.
b Root cause explained? Yes. Four artifacts are declared in requires and downloaded up front; the script installs one flavour at a time. About 9.2 GiB of package files stay resident for the whole job (debs 2.5, rpms 2.5, tarballs 3.2, unpacked binary about 1), the failing substep needed only the 2.5 GiB of debs, apt asked for 4753 MB more against 4.3 GiB free, so the peak is near 14 GiB.
c Fix matches root cause? Yes. It removes the wrong dependency instead of reclaiming a fixed amount of space, which is what the four earlier fixes in this family did. The peak now tracks one flavour rather than the sum of four. Nothing is widened, disabled, shrunk or guarded.
d Test intent preserved / new tests added? Preserved exactly, and this is the load-bearing claim: I compared the substep set of one pre-change job against the union of the three new jobs and they match name for name, 26 substeps split 5 + 3 + 18 with no overlap, cross-checked against the CIDB substep list of a green pre-change run. No test is weakened or removed. No new test file: there is no ci/tests/ and no existing unit test for job configs.
e Both directions demonstrated? For every locally testable claim, by mutation: each oracle was shown to redden on a deliberate defect (3 config mutants, the chmod guard reverted, one job dropped from the union) and to pass on the real tree. For the ENOSPC itself, no, per (a).
f Fix is general across code paths? Yes. All 4 ParamSets in both job lists and both arches, so PR, BackportPR, MasterCI and ReleaseBranchCI are covered. I scanned every requires=[...] in ci/defs/job_configs.py for the same 2-or-more-flavour pattern and these four were the only hits; compatibility_test_jobs shares the pool but already requires only DEB_*. Both unconditional artifact uses inside install_check.py (the image pulls and chmod +x) are handled.
g Fix generalizes across inputs (params/datatypes/wrappers)? The input space is 3 flag combinations x 2 arches x 2 job lists; all 12 jobs are asserted and all 3 combinations exercised. Type wrappers and boundary values do not apply, since no data path changes. The one degenerate combination, all three flavours disabled, is unreachable from any ParamSet.
h Backward compatible? No compatibility surface: no setting, no serialization, no user-visible behaviour, so no SettingsChangesHistory.cpp entry. The one visible change is the check names. Individual job names are not required statuses (READY_FOR_MERGE_CUSTOM_STATUS_NAME = "Mergeable Check"), so merges are unaffected, but CIDB history splits at the rename and a post-merge query needs check_name LIKE 'Install packages%'.
i Invariants and contracts preserved? Introduced: a job requires only the package flavours it installs (asserted for all 12). Preserved: every substep runs exactly once per arch, in the same image, with the same packages (asserted by the coverage comparison). The one contract at risk was install_check.py assuming CH_* is always present, which is why the strict=True chmod +x ci/tmp/clickhouse is now guarded; the tgz job would otherwise abort before running anything. Both hooks are idempotent, so running them per flavour job is safe.

Session id: cron:clickhouse-impl-slot-4:20260830-152000

@clickhouse-gh

clickhouse-gh Bot commented Aug 30, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [f6b6df1]

Summary: ✅


AI Review

Summary

This PR splits each Install packages check by package flavour so Praktika downloads only the artifacts that job actually consumes, and it also extends the install-job digest to cover ci/defs/job_configs.py so future changes to those Job.ParamSet definitions cannot be auto-skipped as "unaffected". I reviewed the current diff, the generated workflow wiring, the artifact-download path in ci/praktika/runner.py, and the existing discussion/thread; I do not see an unresolved correctness, caching, or coverage regression in the current code.

Final Verdict
  • Status: ✅ Approve

@clickhouse-gh clickhouse-gh Bot added the pr-ci label Aug 30, 2026
@groeneai

Copy link
Copy Markdown
Collaborator Author

cc @maxknv, could you review this? It follows #113270: each Install packages job declared all four package artifacts in requires although it installs one flavour at a time, so the deb group ran with about 9 GiB of packages on disk instead of 2.5, and this splits each ParamSet per flavour using the --no-deb/--no-rpm/--no-tgz flags that already existed unused.

@qoega

qoega commented Aug 31, 2026

Copy link
Copy Markdown
Member

@groeneai fix conflicts!

…quire-one-flavour

Conflicts: `ci/defs/job_configs.py` and the four generated workflow files.

Master renamed the runner labels in `RunnerLabels` (`STYLE_CHECK_AMD` to
`AMD_TINY`, `STYLE_CHECK_ARM` to `ARM_TINY`) on the same `Job.ParamSet` lines
this branch splits per package flavour, so the twelve parameter sets added here
now use the current names. The old names no longer exist, so keeping them would
raise `AttributeError` while loading the CI config.

The four `.github/workflows/*.yml` files are generated: they were taken from
master and regenerated with `PYTHONPATH=./ci:. python3 -m praktika yaml`.

Co-Authored-By: Claude Opus 5 <[email protected]>
@groeneai

Copy link
Copy Markdown
Collaborator Author

Resolved in dfec1a3. Master's runner-label rename (STYLE_CHECK_AMD to AMD_TINY, STYLE_CHECK_ARM to ARM_TINY) landed on the same Job.ParamSet lines this PR splits per package flavour, so the twelve new parameter sets carry the current names; the four generated workflow files were taken from master and regenerated with PYTHONPATH=./ci:. python3 -m praktika yaml.

@clickhouse-gh clickhouse-gh Bot added the comp-ci-infrastructure CI/CD pipelines (GitHub Actions, CI scripts, runners). label Sep 4, 2026
…quire-one-flavour

The `ci/` sources merged cleanly; only the generated workflows conflicted, so all
four are regenerated with `python3 -m ci.praktika yaml` rather than hand-merged.
They are the only generated workflows the regeneration changes, and this branch's
per-flavour `install_packages_*_{deb,rpm,tgz}` jobs still come out in place of
master's two combined ones.
Comment thread ci/defs/job_configs.py Resolved
groeneai and others added 2 commits October 10, 2026 18:31
Each Install packages job now selects its package flavour through the
`--no-*` flags and `requires` of its parameter set in
`ci/defs/job_configs.py`, but praktika decides whether a job is affected
only from its digest `include_paths`, which did not cover that file. A
pull request that edits only these parameter sets would therefore have
all six jobs filtered out as unaffected and land without running them.

Add `ci/defs/job_configs.py` to the digest of both job groups. Checked with
`native_jobs._filter_unaffected_jobs` on the PR and MasterCI workflows: for
a change to that file alone, 0 of 6 Install packages jobs ran before and
6 of 6 after; a change to `ci/jobs/fast_test.py` still filters all of them.
The generated workflows are unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
# Conflicts:
#	.github/workflows/backport_branches.yml
#	.github/workflows/master.yml
#	.github/workflows/pull_request.yml
#	.github/workflows/release_branches.yml
@alexey-milovidov alexey-milovidov self-assigned this Oct 12, 2026
@alexey-milovidov
alexey-milovidov added this pull request to the merge queue Oct 12, 2026
Merged via the queue into ClickHouse:master with commit 145c4ac Oct 12, 2026
177 checks passed
@robot-ch-test-poll3 robot-ch-test-poll3 added the pr-synced-to-cloud The PR is synced to the cloud repo label Oct 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

can be tested Allows running workflows for external contributors comp-ci-infrastructure CI/CD pipelines (GitHub Actions, CI scripts, runners). groeneai-origin-ci-master PR origin: master/nightly CI monitoring finding manual approve Manual approve required to run CI 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.

4 participants