Skip to content

build: reuse native and Go caches in CI image builds - #26086

Merged
XuPeng-SH merged 3 commits into
matrixorigin:mainfrom
aptend:perf/docker-build-cache
Jul 23, 2026
Merged

XuPeng-SH merged 3 commits into
matrixorigin:mainfrom
aptend:perf/docker-build-cache

Conversation

@aptend

@aptend aptend commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • API-change
  • BUG
  • Improvement
  • Documentation
  • Feature
  • Test and CI
  • Code Refactoring

Which issue(s) this PR fixes:

issue #25782 (validation infrastructure only; this PR does not close the issue)

What this PR does / why we need it:

  • Adds a CI-specific multi-stage Dockerfile that separates native dependencies, Go build cache, and the final runtime image.
  • Adds a Make target that consumes prebuilt CGO and third-party libraries instead of rebuilding them after every source change.
  • Excludes local native outputs from the Docker context so stale host artifacts cannot overwrite cached image contents.

This is the MatrixOne half of the change. The mo-auto-test PR supplies the trusted registry/cache orchestration.

Validation:

  • bash syntax and Make dry-run checks passed.
  • git diff --check passed.
  • TKE validation run 29981557105 built the image in 8m23s versus 19m05s in run 29938558644 (10m42s / 56% faster). COPY go.mod/go.sum took 0.0s and COPY . . took 1.9s.

@aptend
aptend requested review from XuPeng-SH and fengttt as code owners July 23, 2026 07:09
@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deep review on exact head 533ac4f3086cd52abef98d4ce755b81b46a64e21 found one compatibility blocker: the global .git/ exclusion strips version/commit metadata from the existing Docker image paths, where empty commit IDs also defeat runtime binary-compatibility discrimination. The new native/Go cache orchestration with mo-auto-test #154 otherwise closes correctly; BuildKit checks for both Dockerfiles, the new Make target dry-run, diff checks, thread audit, and all PR CI checks are clean.

Comment thread .dockerignore Resolved

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-reviewed the exact latest head. The previous VCS-metadata blocker is closed: .git is no longer excluded repository-wide, while the trusted cache workflow scopes that exclusion to the CI path and passes explicit branch/commit/version values. The new build also fails fast on a missing commit ID and verifies the embedded commit from the built binary. Native compile/link/runtime-load closure is consistent with the Makefile contract. Both Dockerfiles pass BuildKit --check with no warnings, the new Make target dry-run is correct, diff/merge-tree checks against current main pass, and all PR CI checks are green. No blocking correctness, performance, or lifecycle issue found.

@XuPeng-SH
XuPeng-SH merged commit 8a6d215 into matrixorigin:main Jul 23, 2026
24 checks passed
VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
)

## What type of PR is this?

- [ ] API-change
- [ ] BUG
- [x] Improvement
- [ ] Documentation
- [ ] Feature
- [x] Test and CI
- [ ] Code Refactoring

## Which issue(s) this PR fixes:

issue matrixorigin#25782 (validation infrastructure only; this PR does not close the
issue)

## What this PR does / why we need it:

- Adds a CI-specific multi-stage Dockerfile that separates native
dependencies, Go build cache, and the final runtime image.
- Adds a Make target that consumes prebuilt CGO and third-party
libraries instead of rebuilding them after every source change.
- Excludes local native outputs from the Docker context so stale host
artifacts cannot overwrite cached image contents.

This is the MatrixOne half of the change. The mo-auto-test PR supplies
the trusted registry/cache orchestration.

Validation:

- bash syntax and Make dry-run checks passed.
- git diff --check passed.
- TKE validation run 29981557105 built the image in 8m23s versus 19m05s
in run 29938558644 (10m42s / 56% faster). COPY go.mod/go.sum took 0.0s
and COPY . . took 1.9s.

---------

Co-authored-by: XuPeng-SH <[email protected]>
VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
)

## What type of PR is this?

- [ ] API-change
- [ ] BUG
- [x] Improvement
- [ ] Documentation
- [ ] Feature
- [x] Test and CI
- [ ] Code Refactoring

## Which issue(s) this PR fixes:

issue matrixorigin#25782 (validation infrastructure only; this PR does not close the
issue)

## What this PR does / why we need it:

- Adds a CI-specific multi-stage Dockerfile that separates native
dependencies, Go build cache, and the final runtime image.
- Adds a Make target that consumes prebuilt CGO and third-party
libraries instead of rebuilding them after every source change.
- Excludes local native outputs from the Docker context so stale host
artifacts cannot overwrite cached image contents.

This is the MatrixOne half of the change. The mo-auto-test PR supplies
the trusted registry/cache orchestration.

Validation:

- bash syntax and Make dry-run checks passed.
- git diff --check passed.
- TKE validation run 29981557105 built the image in 8m23s versus 19m05s
in run 29938558644 (10m42s / 56% faster). COPY go.mod/go.sum took 0.0s
and COPY . . took 1.9s.

---------

Co-authored-by: XuPeng-SH <[email protected]>
VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
)

## What type of PR is this?

- [ ] API-change
- [ ] BUG
- [x] Improvement
- [ ] Documentation
- [ ] Feature
- [x] Test and CI
- [ ] Code Refactoring

## Which issue(s) this PR fixes:

issue matrixorigin#25782 (validation infrastructure only; this PR does not close the
issue)

## What this PR does / why we need it:

- Adds a CI-specific multi-stage Dockerfile that separates native
dependencies, Go build cache, and the final runtime image.
- Adds a Make target that consumes prebuilt CGO and third-party
libraries instead of rebuilding them after every source change.
- Excludes local native outputs from the Docker context so stale host
artifacts cannot overwrite cached image contents.

This is the MatrixOne half of the change. The mo-auto-test PR supplies
the trusted registry/cache orchestration.

Validation:

- bash syntax and Make dry-run checks passed.
- git diff --check passed.
- TKE validation run 29981557105 built the image in 8m23s versus 19m05s
in run 29938558644 (10m42s / 56% faster). COPY go.mod/go.sum took 0.0s
and COPY . . took 1.9s.

---------

Co-authored-by: XuPeng-SH <[email protected]>

This branch had an error being deployed

1 failed deployment
ci — 1fbc2799 Deployed Jul 23, 2026 by XuPeng-SH via merge-update-moc / Update MOC #3070
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/enhancement kind/test-ci size/S Denotes a PR that changes [10,99] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants