Repository navigation
Pre-pull Docker images before integration tests start - #100039
Conversation
Grep test suite sources for `with_X=True` flags and explicit
`docker_compose_*.yml` filename strings to derive the compose files needed
by the current batch, extract all `image:` references (resolving
`${VAR:-default}` placeholders from the environment), then pull every image
with up to 3 retries (300 s timeout per attempt) before any test runs.
If a pull fails the job exits immediately with an ERROR status rather than
surfacing the failure mid-test-run.
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
|
Workflow [PR], commit [a48cd31] Summary: ✅ AI ReviewSummaryThis PR adds an integration-test image prefetch stage that scans selected test suites for Missing context
ClickHouse Rules
Final Verdict
|
19d9497 to
f367c38
Compare
…p in git - `_pre_run` prints `git status --short` at job start; if dirty, runs `git clean -ffd` to restore a clean workspace before setup begins. - `_post_run` prints the same at the very end of the job. - Add `/ci/tmp` to `.gitignore` so the temporary directory used by CI jobs does not show up as untracked in local runs. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
f367c38 to
253900c
Compare
| except OSError: | ||
| continue | ||
| for m in re.finditer(r"^\s+image:\s+(.+)$", content, re.MULTILINE): | ||
| resolved = resolve_image(m.group(1).strip()) |
There was a problem hiding this comment.
get_images_from_compose_files captures the whole image: value and keeps inline comments. For tests/integration/compose/docker_compose_coredns.yml, the value is coredns/coredns:1.9.3 # :latest broke this test, so prefetch will execute docker pull with the trailing comment text and fail before tests start.
Please strip inline YAML comments (or parse YAML properly) before pulling. A minimal safe fix here is to remove everything after # for unquoted values before resolve_image.
Replaces the sequential `prefetch_images` loop in `ci/jobs/integration_test_job.py` with a new shell script `ci/jobs/scripts/prefetch-integration-test-images` that: - Pulls all images in parallel (background subshells + `wait`). - Treats `no matching manifest` errors as a non-fatal skip rather than a failure, so amd64-only images (e.g. `clickhouse/kerberos-kdc`) do not abort the job on arm64 runners. Also fixes `get_images_from_compose_files` to strip inline YAML comments (e.g. `coredns/coredns:1.9.3 # :latest broke this test`) before passing the value to `docker pull`. CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=100039&sha=253900cdb6028e70c4f55b6792a0f251811ad9cd&name_0=PR&name_1=Integration%20tests%20%28arm_binary%2C%20distributed%20plan%2C%201%2F4%29 Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
|
Why pre-pulling works better than pulling during the test run? Currently there is a retry for image pulling during the test run (this fix makes it obsolete), and I believe the image won't be pulled second time if needed again - so I just miss the point why this fix is needed. |
leshikus
left a comment
There was a problem hiding this comment.
We have discussed that in fact this is pre-test infrastructure check, this is quite reasonable to skip tests if infrastructure does not work reliably
Integration tests pull Docker images on demand inside individual test fixtures.
When the registry is slow or flaky this causes mid-run failures that are
hard to distinguish from real test failures, and wastes time retrying inside
the already-running session.
This change adds a pre-fetch step that runs before any test is executed:
the current batch for
with_X=Truepatterns and explicitdocker_compose_*.ymlfilename strings.tests/integration/compose/using a small override table for non-obviousnames (e.g.
with_mysql57→docker_compose_mysql.yml) and the obviousdocker_compose_{flag}.ymlconvention for everything else.image:entries from those compose files, resolving${VAR:-default}placeholders from the environment (tags forclickhouse/*images are already set fromIMAGES_ENVat this point).sleep between retries). Each pull line logs elapsed time. If any image
cannot be pulled the job fails immediately with an
ERRORstatus ratherthan letting the failure surface mid-test.
Potential drawback: many integration test jobs start simultaneously, so pre-fetching images up-front from all of them may put extra load on the registry proxy. To mitigate this, the pre-fetch step only pulls images required for the specific job batch rather than the full set. This change may still need to be reverted if the proxy turns out to be overloaded in practice.
Changelog category (leave one):
Version info
26.4.1.53