Skip to content

ci: switch fast-path jobs to system OpenBLAS and split-image tags#2120

Open
wxyucs wants to merge 1 commit into
antgroup:mainfrom
wxyucs:improve/ci-switch-to-system-openblas
Open

ci: switch fast-path jobs to system OpenBLAS and split-image tags#2120
wxyucs wants to merge 1 commit into
antgroup:mainfrom
wxyucs:improve/ci-switch-to-system-openblas

Conversation

@wxyucs
Copy link
Copy Markdown
Collaborator

@wxyucs wxyucs commented May 28, 2026

Summary

  • Repoint every x86 CI job at the new ci-x86-mkl / ci-x86-openblas image tags introduced in chore(docker): split ci-x86 image into base / mkl / openblas variants #2119.
  • Turn on -DUSE_SYSTEM_OPENBLAS=ON (forwarded via the existing EXTRA_DEFINED Makefile knob, no Makefile change required) on the OpenBLAS-backed jobs so they reuse the pre-installed system OpenBLAS instead of rebuilding it from source on every run.
  • Leave the daily x86 ASan job unflagged on purpose: it now becomes the dedicated guard for the from-source OpenBLAS path (ExternalProject_Add(openblas) in extern/openblas/openblas.cmake).
  • Release artifacts and make pyvsag are unchanged and still build OpenBLAS from source.

Why

See #2118 for the full rationale. Short version: every PR CI / coverage / lint / compatibility / performance / CircleCI run currently spends 2–3 min building OpenBLAS even though libopenblas-dev is already in the image. Switching to the system package eliminates that rebuild on the fast path while the daily ASan job keeps the source-build path under daily coverage.

Image routing after this PR

Job(s) Image USE_SYSTEM_OPENBLAS
pr-ci (asan build, unittests, functests, examples, compatibility) ci-x86-openblas ON (build job only)
coverage, lint, check_compatibility, performance ci-x86-openblas ON (build steps)
generate_old_version_index ci-x86-openblas unset — builds historical release tags whose CMake doesn't necessarily understand the flag, so the source-build path is kept here on purpose
asan_build_and_test, tsan_build_and_test, asan_with_simd_option, daily SIMD / TSAN ci-x86-mkl n/a (MKL path)
Daily x86 ASan ci-x86-openblas unset — guards source build
CircleCI host VM + apt ON (build step)

Prerequisite

#2119 has merged and update-ci-image has published the new ci-x86-base / ci-x86-mkl / ci-x86-openblas tags to Docker Hub, so the workflows in this PR can now pull their new container images.

Notes on related work

USE_SYSTEM_OPENBLAS=ON is forwarded via EXTRA_DEFINED rather than a new make flag, deliberately avoiding any change to Makefile. This keeps this PR independent of #2117, which introduces a different VSAG_USE_SYSTEM_OPENBLAS CMake option with stricter semantics. The two changes can land in either order.

Test plan

  • Every PR triggers the affected jobs in this repo on push, so the CI run on this PR is itself the test.
  • After merge, watch the first PR-CI run on main to confirm the OpenBLAS build step has dropped out of the timeline.

Labels

kind/improvement, version/1.0

Refs: #2118

Copilot AI review requested due to automatic review settings May 28, 2026 10:56
@wxyucs wxyucs added kind/improvement Code improvements (variable/function renaming, refactoring, etc. ) version/1.0 labels May 28, 2026
@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented May 28, 2026

Merge Protections

Your pull request matches the following merge protections and will not be merged until they are valid.

🟢 Require kind label

Wonderful, this rule succeeded.
  • label~=^kind/

🟢 Require version label

Wonderful, this rule succeeded.
  • label~=^version/

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the Docker setup for VSAG on x86_64 by introducing a common base image (Dockerfile.x86.base) and layering specific BLAS backend variants (Dockerfile.x86.mkl and Dockerfile.x86.openblas) on top of it. Additionally, the CircleCI configuration is updated to install liblapacke-dev and opt into using the system OpenBLAS during parallel tests. The review feedback suggests optimizing the Dockerfiles by combining multiple apt commands into single RUN instructions, using apt-get with --no-install-recommends, and cleaning up package lists to minimize image sizes.

Comment thread docker/Dockerfile.x86.base
Comment thread docker/Dockerfile.x86.openblas
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR repoints x86 CI workflows to split MKL/OpenBLAS CI images and uses the existing EXTRA_DEFINED Makefile hook to prefer system OpenBLAS on fast-path OpenBLAS jobs, while preserving daily coverage for the bundled OpenBLAS source build.

Changes:

  • Adds/splits x86 Docker images into base, MKL, and OpenBLAS variants.
  • Updates CI workflows to use ci-x86-mkl or ci-x86-openblas.
  • Adds -DUSE_SYSTEM_OPENBLAS=ON to most OpenBLAS-backed build steps.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
docker/Dockerfile.x86.base Adds shared x86 CI base image.
docker/Dockerfile.x86.mkl Rebuilds MKL image on top of the shared base.
docker/Dockerfile.x86.openblas Adds OpenBLAS image with system OpenBLAS/LAPACKE packages.
.github/workflows/update-ci-image.yml Builds base and variant CI Docker images.
.github/workflows/pr-ci.yml Routes PR CI to OpenBLAS image and system OpenBLAS builds.
.github/workflows/daily_test.yml Routes daily OpenBLAS/MKL jobs to split images and keeps source OpenBLAS guard.
.github/workflows/coverage.yml Uses OpenBLAS image and system OpenBLAS for coverage builds.
.github/workflows/lint.yml Uses OpenBLAS image and system OpenBLAS for lint build setup.
.github/workflows/check_compatibility.yml Uses OpenBLAS image and system OpenBLAS for compatibility tools.
.github/workflows/performance.yml Uses OpenBLAS image and system OpenBLAS for performance builds.
.github/workflows/generate_old_version_index.yml Switches old-version index workflow to OpenBLAS image.
.github/workflows/asan_build_and_test.yml Routes ASan workflow to MKL image.
.github/workflows/asan_with_simd_option.yml Routes SIMD ASan workflow to MKL image.
.github/workflows/tsan_build_and_test.yml Routes TSan workflow to MKL image.
.circleci/continue_config.yml Installs LAPACKE and enables system OpenBLAS in CircleCI builds.

Comment thread .github/workflows/update-ci-image.yml
Comment thread .github/workflows/generate_old_version_index.yml
wxyucs added a commit to wxyucs/vsag that referenced this pull request May 28, 2026
…+variants on PRs

Per Copilot review on antgroup#2119/antgroup#2120: with the previous fan-out layout the
variant builds ran in a separate job from the base build, so on
pull_request runs (where `push: false`) the variants would try to pull
`vsaglib/vsag:ci-x86-base` from Docker Hub — either failing before the
first main publish or, worse, silently validating against the
already-published base instead of the PR's base changes.

Collapse the workflow into a single job that builds base first with
buildx's plain `docker` driver, which loads images into the host daemon
automatically, so the subsequent variant builds resolve
`FROM vsaglib/vsag:ci-x86-base` against the just-built base regardless
of whether the run pushes to the registry.

Signed-off-by: Xiangyu Wang <wxy407827@antgroup.com>
Assisted-by: OpenCode:claude-opus-4.7
@wxyucs wxyucs force-pushed the improve/ci-switch-to-system-openblas branch from ffa6bdc to 7539eae Compare May 28, 2026 11:14
Copilot AI review requested due to automatic review settings May 29, 2026 03:29
@wxyucs wxyucs force-pushed the improve/ci-switch-to-system-openblas branch from 7539eae to 369bca0 Compare May 29, 2026 03:29
@wxyucs wxyucs force-pushed the improve/ci-switch-to-system-openblas branch from 369bca0 to 3b8bbad Compare May 29, 2026 03:31
Repoint every x86 CI job at the BLAS-variant image introduced in the
previous PR and pass `-DUSE_SYSTEM_OPENBLAS=ON` (via the existing
`EXTRA_DEFINED` Makefile knob) to the OpenBLAS-backed jobs so they
reuse the pre-installed `libopenblas-dev` instead of rebuilding
OpenBLAS from source on every run.

Routing:

* `pr-ci`, `coverage`, `lint`, `check_compatibility`, `performance`,
  `generate_old_version_index` → `ci-x86-openblas`. All except
  `generate_old_version_index` also set `USE_SYSTEM_OPENBLAS=ON`;
  the latter builds historical release tags whose CMake does not
  understand the flag, so the source-build path is kept there.
* `asan_build_and_test`, `tsan_build_and_test`,
  `asan_with_simd_option`, daily SIMD / TSAN → `ci-x86-mkl`
  (these jobs already build with `VSAG_ENABLE_INTEL_MKL=ON`).
* Daily x86 ASan → `ci-x86-openblas` but deliberately leaves
  `USE_SYSTEM_OPENBLAS` unset, so `ExternalProject_Add(openblas)`
  keeps getting exercised end-to-end as the dedicated guard for
  the from-source build path.

CircleCI's `prepare_env_and_create_swap_file` step also installs
`liblapacke-dev` so CMake's `find_path(LAPACKE_INCLUDE NAMES
lapacke.h)` probe succeeds against the system OpenBLAS.

Forwarding `USE_SYSTEM_OPENBLAS` via `EXTRA_DEFINED` keeps `Makefile`
untouched and avoids colliding with the in-flight
`VSAG_USE_SYSTEM_OPENBLAS` CMake option in antgroup#2117.

Release artifacts (`scripts/release/dist.sh`,
`docker/Dockerfile.dist_*x86`) and `make pyvsag` are unchanged and
still build OpenBLAS from source.

Refs: antgroup#2118

Signed-off-by: Xiangyu Wang <wxy407827@antgroup.com>
Assisted-by: OpenCode:claude-opus-4.7
@wxyucs wxyucs force-pushed the improve/ci-switch-to-system-openblas branch from 3b8bbad to fa58f3d Compare May 29, 2026 06:40
@pull-request-size pull-request-size Bot added size/M and removed size/L labels May 29, 2026
Copy link
Copy Markdown
Collaborator

@LHT129 LHT129 left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/improvement Code improvements (variable/function renaming, refactoring, etc. ) module/docker size/M version/1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants