Files
datastore/ci/jobs/scripts/bugfix_validation.py
Groene AIandClaude Opus 4.8 811d05ee24 CI: make bugfix-validation master build set architecture-aware
The per-arch Bugfix Validation jobs download the master-HEAD binaries from
S3 to run the regression test on master HEAD. Both the amd64 and aarch64
variants used the hardcoded amd-only BUGFIX_BUILD_TYPES, so the aarch64 job
fetched build_amd_*/clickhouse and tried to run x86 binaries on an ARM
runner. That fails to install (x86_64-binfmt-P: cannot open
/lib64/ld-linux-x86-64.so.2), so the aarch64 side could never produce a
validated / not-validated signal, defeating the per-arch split.

Select the build-type set by runner arch via bugfix_build_types(job_name):
arm_asan_ubsan/arm_tsan/arm_msan/arm_debug for aarch64, amd_* otherwise.
All four arm_* sanitizer builds are produced by the main build matrix, and
find_master_builds() already verifies artifact existence per commit so a
partial build set is skipped gracefully.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-06-14 15:57:12 +00:00

43 lines
1.7 KiB
Python

from ci.praktika.info import Info
from ci.praktika.utils import Shell
# Build types whose master-HEAD binaries the bugfix-validation runners download
# from S3. The set must match the runner architecture: an x86 binary cannot be
# executed on an ARM runner (and vice versa), so the master-HEAD side of the
# check would fail to install. `BUGFIX_BUILD_TYPES` is the x86 default; pick the
# matching set with `bugfix_build_types(job_name)`.
BUGFIX_BUILD_TYPES = ["amd_asan_ubsan", "amd_tsan", "amd_msan", "amd_debug"]
BUGFIX_BUILD_TYPES_ARM = ["arm_asan_ubsan", "arm_tsan", "arm_msan", "arm_debug"]
def bugfix_build_types(job_name):
"""Select the build-type set matching the job's runner architecture.
The per-arch jobs carry the arch in their name ("..., aarch64" /
"..., amd64"). aarch64 jobs run on ARM runners, so they must download the
ARM master-HEAD binaries; everything else defaults to x86.
"""
if "aarch64" in job_name:
return BUGFIX_BUILD_TYPES_ARM
return BUGFIX_BUILD_TYPES
def find_master_builds(build_types=None):
"""Find S3 URLs for all build types from a recent master commit.
Verifies that artifacts for every requested build type exist before
returning, so that a commit with a partial build set is skipped.
"""
build_types = build_types if build_types is not None else BUGFIX_BUILD_TYPES
commits = Info().get_kv_data("master_commits") or []
for sha in commits:
urls = {
bt: f"https://clickhouse-builds.s3.us-east-1.amazonaws.com/REFs/master/{sha}/build_{bt}/clickhouse"
for bt in build_types
}
if all(
Shell.check(f"curl -sfI {url} > /dev/null") for url in urls.values()
):
return urls
return None