Repository navigation
ci: wire shared build and nightly builder image into PR CI - #27077
Conversation
The standalone and compose BVT jobs each spend ~10 minutes compiling the same head commit. Add a shared build job (matrixorigin/CI build-mo.yaml) that builds the coverage-instrumented mo-service once and publishes it as a run-scoped artifact; both BVT workflows consume it and fall back to building from source when it is missing or mismatched. Dockerfile.prebuilt assembles the compose runtime image from that artifact in seconds instead of rebuilding thirdparties and the full Go graph inside docker. Its mo-service -h smoke check also guards the glibc contract between the build runner and the ubuntu:22.04 base, so any skew fails the assembly and triggers the in-docker fallback. Co-Authored-By: Claude Fable 5 <[email protected]>
All PR-invariant build inputs -- the Go module cache, the Go build cache, and the compiled C thirdparties -- are identical across PR runs, yet every run recompiled them from scratch (~10 minutes). Bake them into a builder image refreshed by the nightly image workflow: PR CI mounts its checkout into the image and runs make build, so only packages the PR changed recompile, and go build incrementally downloads any modules newer than the baked cache. A stale image only costs speed, never correctness. Measured locally: unchanged tree rebuilds in ~20s, a worst-case exported API change to pkg/container/types in ~54s, versus ~10 minutes cold. The binary now links inside the ubuntu-22.04 toolchain container, so it also matches the matrixorigin/ubuntu:22.04 runtime image glibc by construction. Consumed by matrixorigin/CI build-mo.yaml; published nightly as matrixorigin/matrixone:ci-builder by the image-build workflow. Co-Authored-By: Claude Fable 5 <[email protected]>
Extend the nightly ci-builder warm stage beyond the -cover mo-service build with the two go-test compile flavors PR CI pays for on every run: -race with -tags matrixone_test (the UT job via optools/run_ut.sh) and -covermode=set with the full coverpkg list (coverage-ut.yaml, whose package filter is replicated verbatim because the coverpkg value is part of the compile key). -exec /bin/true links every test binary without running any test, and -vet=off keeps vet findings out of the warm; both warms soft-fail since PR CI never depends on them for correctness. Store the module cache with -modcacherw: its default read-only directory layout breaks extracting the cache onto CI runners (docker cp creates a read-only parent, then cannot populate it). Verified locally against a checkout at a different path with the host toolchain: the full ./... race-flavor test compile took 3m18s (1m11s on rerun) instead of a cold full compile, and seeded thirdparties cut make cgo to ~11s. Co-Authored-By: Claude Fable 5 <[email protected]>
The builder image now publishes both CI architectures, each warming what PR CI compiles there: amd64 keeps the -cover build plus the two UT test flavors; arm64 (the SCA job's architecture) warms the plain build plus a full make static-check pass, which caches the vet facts and golangci-lint's analysis cache alongside the compiled packages. The golangci-lint version comes from make install-static-check-tools, so the cache matches what the SCA runner installs. Darwin is intentionally not covered: no PR-path job runs on macOS (the mac UT job is disabled), and the post-merge mac BVT runs on a persistent self-hosted runner whose local Go caches survive between runs without any image. Co-Authored-By: Claude Fable 5 <[email protected]>
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
XuPeng-SH
left a comment
There was a problem hiding this comment.
Requesting changes for two correctness blockers and one fallback/reliability issue. The shared artifact must be runnable by the standalone consumer, and native cache reuse must be proven compatible with the PR inputs/base branch rather than silently replacing them. I also recommend preserving a cold-build path when the shared job itself fails.
Validation performed at this head: actionlint, docker build --check for both Dockerfiles, and git diff --check all passed.
| with: | ||
| bvt_group: ${{ needs.bvt-group-plan.outputs.launch_group }} | ||
| bvt_generation: ${{ needs.bvt-group-plan.outputs.generation }} | ||
| build_artifact: ${{ needs.matrixone-shared-build.outputs.artifact_name }} |
There was a problem hiding this comment.
[P1] The shared artifact cannot currently launch the standalone BVT. In matrixorigin/CI#418, build-mo.yaml packages the third-party DSOs under lib/ but packages libmo.so under prebuilt-cgo/. The standalone workflow extracts the archive at the checkout root and launches ./mo-service without moving prebuilt-cgo/*.so into lib//cgo/ or setting LD_LIBRARY_PATH. Since the binary's runtime search path is $ORIGIN/lib, the loader exits with libmo.so: cannot open shared object file instead of running the tests. Please put libmo.so beside the other runtime libraries (or relocate it in the standalone consumer) and add a direct artifact smoke test before upload.
There was a problem hiding this comment.
Addressed in matrixorigin/CI@8b18024 + e417582 here. Every runtime DSO (thirdparties and libmo.so) now ships under lib/ — the binary's $ORIGIN/lib rpath — and the prebuilt-cgo/ contract is removed; Dockerfile.prebuilt copies only lib/*.so. The producer also smoke-tests the staged tree with env -u LD_LIBRARY_PATH GOCOVERDIR=$(mktemp -d) ./mo-service -h twice: once after the cached build (a failure there falls through to the cold build) and once at packaging, so a broken artifact fails at its owner before upload. (Noting @LeftHandCold could not reproduce a hard libmo.so dependency — statically linked today — but the consolidated layout makes the artifact robust if that ever changes.)
| COPY --from=warm /root/.cache/golangci-lint /root/.cache/golangci-lint | ||
| # Seeded into the PR tree before make build; the prerequisite-less file | ||
| # targets in thirdparties/Makefile then treat the C libraries as up to date. | ||
| COPY --from=warm /go/src/github.com/matrixorigin/matrixone/thirdparties/install /mo-prebuilt/thirdparties/install |
There was a problem hiding this comment.
[P1] This native output is not a correctness-safe cache. CI#418 unconditionally replaces the PR checkout's thirdparties/install with this directory before make build. The relevant thirdparties/Makefile file targets have no archive/config prerequisites, so existing usearch/CRoaring headers and libraries suppress rebuilding when a PR changes thirdparties/, build flags, or targets a release branch that differs from main. That can make CI compile and test yesterday's native implementation and go falsely green. Please attach a branch/architecture/native-input fingerprint and restore only on an exact match, or make these outputs an invalidatable cache that rebuilds on input changes.
There was a problem hiding this comment.
Addressed in e417582 + matrixorigin/CI@8b18024. The image now publishes /mo-prebuilt/thirdparties.fingerprint containing schema, os, arch, and git rev-parse HEAD:thirdparties. Because the archives, headers, the Makefile (with its flags), and the download script all live under thirdparties/, the tree hash covers every native input; schema= is bumped whenever the producing base-image/compiler contract changes. All four consumers (build-mo container build, UT, SCA, coverage-UT seeds) compute the same fingerprint from their checkout and restore thirdparties/install only on an exact match — any mismatch clears the seed and builds native deps from source. Validated locally: an unchanged tree seeds; a commit touching thirdparties/ produces a mismatch and a full usearch/CRoaring/onnx rebuild. Go build/module caches remain best-effort acceleration, which is always correctness-safe.
| matrixone-standalone-ci: | ||
| name: Matrixone Standlone CI | ||
| needs: [check-pr-valid, bvt-group-plan] | ||
| needs: [check-pr-valid, bvt-group-plan, matrixone-shared-build] |
There was a problem hiding this comment.
[P2] A shared-build failure skips the consumer before its fallback can run. Because matrixone-shared-build is a normal hard dependency, GitHub will skip this job (and compose) whenever the shared job fails; the consumer's missing/mismatched-artifact cold path is never reached. A pulled but stale/incompatible builder image is one example—the image has a fixed Go toolchain and CI#418 only falls back when the pull itself fails. Please contain cached-execution failures inside build-mo.yaml with a host cold build, or arrange for consumers to run with an empty artifact when the shared job fails for an infrastructure/cache reason.
There was a problem hiding this comment.
Addressed in matrixorigin/CI@8b18024. The fallback now lives inside the producer: the cached container build is continue-on-error with ownership repair and a loader smoke test; on any failure (image pull, stale/broken cache, toolchain skew, smoke failure) the job sets up the checkout's Go toolchain and runs the existing make clean && make build cold path, and packaging runs after either path succeeds. So the hard needs: here stays as-is and only propagates a genuine PR compile failure to the consumers — which is the intended fail-once behavior.
Part of the upstream-main integration: the SCA job gained a dedicated trusted actions/cache pipeline (sca-go-module-cache.yaml producer plus the consumer steps in matrixorigin/CI ci.yaml), which subsumes the arm64 builder-image leg this Dockerfile carried for it — including the toolchain-identity cache keys this branch had deferred. Drop the TARGETARCH conditionals, the static-check warm flavor, and the golangci-lint cache; the image now serves exactly the amd64 consumers: the shared BVT build and the UT/coverage-UT cache seeds. Also switch the final stage to ENV GOPROXY for consistency with the warm stage. Verified: full image build on the merged tree, warm-status records warm-race=ok and warm-coverage=ok, fingerprint matches the merged thirdparties tree. Co-Authored-By: Claude Fable 5 <[email protected]>
|
Merged latest upstream main (clean merge, head 91d33e7) in lockstep with matrixorigin/CI#418's merge of its main. Integration notes: the SCA cache seeding is ceded to the new 🤖 Generated with Claude Code |
|
Publish sequence update: matrixorigin/CI#418 is merged. Dispatched "Build and Push Images" on main (run 31826694057) — its new 🤖 Generated with Claude Code |
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
## What type of PR is this? - [x] Test and CI ## Which issue(s) this PR fixes: issue #27076 ## What this PR does / why we need it: Publish-prerequisite split from #27077, per the reviewer-required rollout order there. The nightly `ci-builder` job (already on `matrixorigin/CI@main` via matrixorigin/CI#418) checks out **main** and skips gracefully while `optools/images/Dockerfile.ci-builder` is absent — so the first builder image cannot publish until this file lands. **Zero behavior change for any existing job**: nothing on main references either file until the entrypoint wiring in #27077 merges. What this unblocks, in order: 1. Dispatch/nightly of "Build and Push Images" publishes `matrixorigin/matrixone:ci-builder` (amd64, Docker Hub + ACR mirror). 2. The UT and coverage-UT cache seeds already live in `matrixorigin/CI ci.yaml` go from no-op to active (guarded, `continue-on-error`, cold-build fallback — validated in matrixorigin/CI#418's review rounds). 3. The canary #27077's reviewers require (shared-build path incl. forced cached-build failure) becomes runnable, after which #27077 leaves draft. Both Dockerfiles passed `docker build --check`, and a full local image build on current main + fingerprint/warm-status verification is documented in matrixorigin/CI#418. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Fable 5 <[email protected]>
|
Canary evidence, part 1 (image published; seed paths live for every PR): Image publish — "Build and Push Images" run 31827878168 fully green after the ACR attestation fix (matrixorigin/CI#425): product images push again (they had been failing since at least 2026-08-13), and the first Seed canary — rerun of this PR's failed CI jobs (run 31827792011, attempt 2) came back green (prior failures were test flakes; nothing in the new machinery). Observed live:
Remaining before Ready: (a) a cold-runner seed observation (will land with normal PR traffic; I'll post it), and (b) the shared-build path itself, which only activates with this PR's entrypoint wiring — pre-merge it cannot run under 🤖 Generated with Claude Code |
What type of PR is this?
Which issue(s) this PR fixes:
issue #27076
What this PR does / why we need it:
MatrixOne side of the PR-CI speedup (workflows side: matrixorigin/CI#418).
entrypoint.yaml: add amatrixone-shared-buildjob (callsmatrixorigin/CI/build-mo.yaml@main) that builds the-covermo-service once per run; the standalone and compose BVT workflows consume the artifact instead of each spending ~10 minutes on identical builds. A compile-broken PR now fails once, in ~4 minutes.optools/images/Dockerfile.prebuilt: assembles the compose runtime image from the prebuilt artifact in seconds instead of a full in-docker rebuild; its/mo-service -hsmoke check guards the glibc contract and any failure falls back to the full docker build.optools/images/Dockerfile.ci-builder: the nightly-refreshed builder image (published by the existing nightly image workflow asmatrixorigin/matrixone:ci-builder, amd64+arm64, Docker Hub + ACR mirror). It bakes every PR-invariant build input — Go module cache, Go build caches warmed in exactly the flavors PR CI compiles (-coverbuild;-race -tags matrixone_test;-covermode=set+ coverpkg; arm64 static-check), and the compiled C thirdparties. A stale image only costs speed, never correctness:go buildrecompiles and downloads incrementally.Measured locally: incremental
-coverbuild 20s (unchanged) to ~1min (worst-case exported-API change topkg/container/types) vs ~10min cold; full race-flavor test compile ~3min warm;make cgo~11s with seeded thirdparties.build-mo.yaml@mainand passes abuild_artifactinput — merging it before the CI PR breaks every PR's CI at workflow-parse time. Draft until then. After both merge, manually dispatch the "Build and Push Images" workflow once to publish the firstci-builderimage (until then, all consumers fall back to today's cold builds).🤖 Generated with Claude Code