Repository navigation
CI: Route PR workflows to isolated runner fleet — zero-trust OSS CI, milestone 2 - #104870
Merged
Merged
Conversation
maxknv
marked this pull request as draft
May 13, 2026 16:12
Contributor
|
Workflow [PR], commit [9b30862] Summary: ✅ AI ReviewSummaryThis PR adds Findings❌ Blockers
Final VerdictStatus:
|
maxknv
force-pushed
the
ci-pr-runner-label-prefix
branch
from
May 13, 2026 16:43
2a16e9b to
da82ed0
Compare
maxknv
force-pushed
the
ci-pr-runner-label-prefix
branch
from
May 15, 2026 15:19
ac69ec8 to
f141d84
Compare
1 task
Member
|
This was fixed by #105146. Let's update the branch. |
maxknv
added a commit
that referenced
this pull request
May 18, 2026
Apply the same SCCACHE_S3_READ_ONLY guard to ci/jobs/fast_test.py that build_clickhouse.py already has, so PR builds cannot pollute the shared sccache bucket via the Fast test compile path. Addresses #104870 (comment) Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
maxknv
force-pushed
the
ci-pr-runner-label-prefix
branch
2 times, most recently
from
May 18, 2026 14:45
48e91f3 to
e487141
Compare
maxknv
added a commit
that referenced
this pull request
May 19, 2026
Apply the same SCCACHE_S3_READ_ONLY guard to ci/jobs/fast_test.py that build_clickhouse.py already has, so PR builds cannot pollute the shared sccache bucket via the Fast test compile path. Addresses #104870 (comment) Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
maxknv
force-pushed
the
ci-pr-runner-label-prefix
branch
from
May 19, 2026 15:32
5fb63c4 to
5bbfeae
Compare
maxknv
force-pushed
the
ci-pr-runner-label-prefix
branch
from
May 19, 2026 21:58
5bbfeae to
86d7fb6
Compare
maxknv
force-pushed
the
ci-pr-runner-label-prefix
branch
from
May 21, 2026 08:38
86d7fb6 to
ff7d42f
Compare
Walk every job in ci/workflows/pull_request.py and rewrite each runs_on label with a pr- prefix, leaving self-hosted untouched. Jobs are deep-copied via job.copy() before mutation so shared JobConfigs instances used by other workflows are not affected. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Set SCCACHE_S3_READ_ONLY=true in build_clickhouse.py when info.pr_number > 0 so PR builds do not write entries into the shared sccache bucket; master/release builds (pr_number == 0) keep write access. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Add S3.assert_read_access that probes the cache bucket via head_object and raises on anything other than 404/NoSuchKey/NotFound. Call it at the top of the Cache Lookup block in native_jobs, so an AccessDenied from a misconfigured runner fleet surfaces as an explicit failure instead of masquerading as a workflow with zero cache hits. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Apply the same SCCACHE_S3_READ_ONLY guard to ci/jobs/fast_test.py that build_clickhouse.py already has, so PR builds cannot pollute the shared sccache bucket via the Fast test compile path. Addresses #104870 (comment) Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
`EC2Instance.Config`, `AutoScalingGroup.Config`, and `LaunchTemplate.Config` now take `runner_labels: List[str]` instead of `runner_type: str`. The AWS tag key `github:runner-type` is preserved (legacy `runner-init.py` in clickhouse-private reads it and inlines its value verbatim into the GitHub Actions runner's `--labels` list), so multiple comma-joined labels register naturally as separate runner labels. Switch macOS instances to the pre-existing `runner_oss_prs` instance profile and drop the in-repo `praktika-ec2-instance-profile` definition. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
`EC2Instance.deploy()` now reconciles state on already-running instances instead of leaving it stale: - `_sync_tags`: upserts the merged tag set and deletes any other non-`aws:*` tag found on the instances, so the config is the source of truth. - `_sync_iam_instance_profile`: replaces / associates / disassociates the IAM instance profile to match the config. Skips instances that are not `running`/`pending` — `ReplaceIamInstanceProfileAssociation` fails with `IncorrectState` on stopped instances. - `start_instances` failures (e.g. `InsufficientHostCapacity` on mac dedicated hosts) no longer abort the whole deploy: they're logged as warnings so subsequent instance configs are still processed. Also defines `EC2_INSTANCE_PROFILE_NAME` in `ci/infra/cloud.py` and points both mac configs at `runner_oss_prs`. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
maxknv
force-pushed
the
ci-pr-runner-label-prefix
branch
2 times, most recently
from
May 21, 2026 20:21
608edca to
dbb635a
Compare
maxknv
marked this pull request as ready for review
May 22, 2026 07:32
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
maxknv
force-pushed
the
ci-pr-runner-label-prefix
branch
from
May 22, 2026 11:09
dbb635a to
12c0606
Compare
…he hook The `check_report_messages` post-hook now posts a GH commit status with a short summary (e.g. `2 error(s), 1 warning(s)`) when the workflow report contains errors or warnings, instead of exiting with a non-zero code. The hook itself never fails, so it does not block the post-hook step unnecessarily. A try/except guards against any unexpected errors. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
- `native_jobs.py`: gate `S3.assert_read_access` behind the same `skip_lookup` condition as actual remote cache lookup, so `Config Workflow` does not fail when cache is intentionally bypassed via `ci-force-all` label - `s3.py`: wrap `head_object` in `_retry_on_no_credentials` so a transient IMDS credential miss does not permanently fail the probe - `ec2_instance.py`: propagate `start_instances` failure instead of silently swallowing it; re-run IAM profile reconciliation on freshly started instances (previously skipped because `_sync_iam_instance_profile` ignores stopped instances) Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
… instances `InsufficientHostCapacity` means no dedicated host is available — an external capacity constraint we cannot fix programmatically. Treat it as a warning and continue; re-raise all other `ClientError`s. IAM profile re-reconciliation after start is now in the `else` branch so it only runs when `start_instances` actually succeeds. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
maxknv
enabled auto-merge
May 23, 2026 08:11
maxknv
disabled auto-merge
May 23, 2026 10:11
maxknv
enabled auto-merge
May 23, 2026 10:11
maxknv
disabled auto-merge
May 23, 2026 10:12
DavidHe-2008
pushed a commit
to DavidHe-2008/ClickHouse
that referenced
this pull request
Jun 1, 2026
Apply the same SCCACHE_S3_READ_ONLY guard to ci/jobs/fast_test.py that build_clickhouse.py already has, so PR builds cannot pollute the shared sccache bucket via the Fast test compile path. Addresses ClickHouse#104870 (comment) Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
DavidHe-2008
pushed a commit
to DavidHe-2008/ClickHouse
that referenced
this pull request
Jun 1, 2026
…el-prefix CI: Route PR workflows to isolated runner fleet — zero-trust OSS CI, milestone 2
This was referenced Jun 12, 2026
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.
This PR delivers the second milestone of the zero-trust OSS CI initiative: Praktika transparently routes all PR workflow jobs to the isolated
pr-*runner fleet, without requiring per-job changes.What's changed
Workflow.Config.runs_on_label_prefix— a new Praktika option that prepends a string to everyruns_onlabel across all jobs in a workflow (user-defined jobs, and Praktika-injected jobs:Config Workflow,Dockers Build,Finish Workflow). Theself-hostedlabel is left untouched.The PR workflow sets
runs_on_label_prefix = "pr-", so every PR job is automatically routed to the isolatedpr-*fleet without any per-job annotation.Build cache made read-only for PR jobs — untrusted PR code cannot write to the shared sccache/build cache consumed by trusted CI workflows.
Changelog category (leave one):
Note
Medium Risk
Moderate risk because it changes CI runner selection for all PR jobs and alters compiler-cache behavior, which can cause workflow scheduling or performance regressions if labels/fleet or cache expectations are misconfigured.
Overview
Routes the PR workflow to an isolated runner fleet by adding
Workflow.Config.runs_on_label_prefixand applying it inpraktika’s workflow mangling so every job’sruns_onlabels are automatically prefixed (leavingself-hostedunchanged). The PR workflow sets this prefix topr-, so generated PR jobs run onpr-*runners without per-job edits.Hardens PR builds by making the shared
sccacheS3 cache read-only whenInfo.pr_number > 0, preventing untrusted PR code from writing to the cache used by trusted branches.Reviewed by Cursor Bugbot for commit 9b30862. Bugbot is set up for automated code reviews on this repo. Configure here.
Version info
26.6.1.115