← Back to Pull requests

ci: retry the network steps, fix the Windows Bazel cache key, cache more (including the Windows oneAPI toolkit) and shorten the long jobs #4031

Open
unknown opened this pull request with 650 lines diff across 8 files
View on GitHub
unknown unknown commented on Nov 17, 2026 09:28 UTC
Author

Description

One PR for the CI changes that came out of a review of the last 30 days of runs (per-job timings, failure classification, coverage matrix). Bundled to spare the runners; it can be split once capacity is back.

Network retries

Failures in 30 days on GitHub: 22 truncated Miniforge downloads (SHA256 checksum verification failed), 40 Bazel repository fetches with 504 from github.com in one wave, 19 apt DNS failures in one outage, 3 anaconda.org 503s. On Azure 4 of the 12 failed builds were the libgomp download from anaconda.org in openmp_repo, 1 was an MSYS2 mirror 500 that wasted a full build.

  • .ci/env/retry.sh: retry <command> with exponential backoff, used by apt.sh (apt-get, the Intel key, llvm.sh), tbb.sh, openblas.sh, openrng.sh (apt-get, git clone).

  • Miniforge is pinned (MINIFORGE_VERSION, Renovate-managed) with its SHA256 digests; download and digest check are retried together. conda gets remote_max_retries 10 / remote_backoff_factor 2 (also in the conda recipe job).

  • common:ci --experimental_repository_downloader_retries=10; the conda-forge packages in gcc.bzl list the channel CDN (conda.anaconda.org) before anaconda.org. repos.archive accepts space-separated mirrors.

  • The Azure Windows Bazel jobs install Bazelisk through .ci/env/bazelisk.ps1 (pinned digest, 5 attempts) instead of an unpinned Invoke-WebRequest; pacman retries three times on Azure (retryCountOnTaskFailure) and GitHub; pip --retries 10.

  • bazel shutdown in the disk-cache trim step no longer fails the job when the server does not stop in time (exit 36, 14 main runs); it warns and the cache is saved without the GC pass.
  • Windows Bazel disk cache (the biggest item)

    WindowsBazel on Azure took 23 min with a cache hit and 160-238 min without, and ~60% of the runs in the sample missed although Cache@2 restored the same 7.6 GB archive each time. The exec logs show why: the Windows toolchain copied the configure-time PATH (118 entries, every tool on the hosted image) into every compile and link action, and --action_env=PATH did the same for the cmd.exe copy actions. The 2026-11-13 image update moved one JDK directory and 5149 of 5149 actions missed on every PR until main itself rebuilt 2.5 days later. The toolchain now passes only the directories under the oneAPI, Visual Studio, Windows SDK, LLVM and SystemRoot roots, and the shell actions get Bazel's fixed PATH (build:windows --incompatible_strict_action_env). The first run after merge rebuilds once; after that an image update no longer invalidates the cache. WindowsBazelReleaseAll gets its own key prefix so its MD+MDd cache cannot become WindowsBazel's fallback.

    Caches

  • Azure Bazel jobs (LinuxBazel, LinuxBazelCoverage, LinuxBazelGNU_OpenBLAS_rv64, WindowsBazel, WindowsBazelReleaseAll) get a --repository_cache behind Cache@2, keyed on .bazelversion, MODULE.bazel and dev/bazel/deps/*.bzl like the GitHub jobs; the MKL/TBB wheels and the conda gcc were downloaded every run.

  • The AArch64 jobs cache the oneTBB build the way they cache OpenBLAS (restored every run, saved from main); it was rebuilt from source on every run.
  • Shorter jobs

    | Job | Before | Change |
    |---|---|---|
    | Azure LinuxMakeLLVM_OpenBLAS_rv64 | 90 min, 67 of them running ~200 examples under qemu | test.sh --examples (new option, -DEXAMPLES_LIST) runs one dense batch example per algorithm family: 22 DAAL + 18 oneAPI |
    | Azure LinuxBazelCoverage | 37 min compiling all of core_static uncached with --spawn_strategy=local | one module (kmeans:kernel) proves the coverage flags reach the compiler |
    | GitHub ci-conda-recipe | 3 x 40-56 min on every makefile / dev/make PR | gxx only on pull requests, all three compilers on main |
    | GitHub LinuxMakeGNU_MKL_Conda | 52 min, 21 of them onedal_dpc | no DPC++ build; the conda recipe's dpcpp leg builds oneDAL with conda icpx |
    | GitHub LinuxMakeDPCPP | Miniforge + daal/oneapi MPI samples with --compiler gnu on an icx build | MPI samples stay in Azure LinuxMakeGNU_MKL and the conda job |

    AArch64 examples were not tested

    The example steps ran with || true and a "designed to always pass" warning. On the last main run the clang leg on ah-ubuntu_24_04-c6g_2x-50 had 342 of 364 examples die with SIGILL: the build targets SVE (build.sh --optimizations sve) and Graviton2 has no SVE. The leg moves to the c7g runner and || true is gone from build-and-test. The OpenRNG leg keeps its || true for now: df_reg_default_dense_extratrees_batch and df_reg_hist_dense_extratrees_batch segfault there (static and dynamic), which is a library bug to fix separately.

    oneAPI Base Toolkit cache (from #4025)

    Every Windows job installed the toolkit from scratch: on a main Azure run 9.7 min in WindowsMakeVC, 9.9 min in WindowsBazel and 6.4 min in WindowsSklearnex, and 15.9 min in the GitHub MSVC job (#4025).

  • install_basekit.bat reuses an install directory when its .basekit_source file names the same installer URL and component list, and setvars.bat and compiler\latest\bin are present. Otherwise it removes the directory and installs as before, so a stale or broken cache costs only the restore.

  • Azure: the Windows jobs install into $(ONEAPI_DIR) ($(Pipeline.Workspace)\oneapi) behind Cache@2, keyed on the OS, WINDOWS_BASEKIT_URL and WINDOWS_DPCPP_COMPONENTS; the %TEMP%\oneapi references and TBBROOT follow. The three jobs share one entry.

  • GitHub: the MSVC job restores oneapi under a key hashed from the same two ci.yml lines and saves it from main only (one entry of about 2 GB; the repository uses about 7.3 GB of its 10 GB).

  • nightly-build.yml is unchanged: scikit-learn-intelex depends on its steps and artifacts (.github/AGENTS.md).
  • To check after merge: the first run saves the entry, the next one logs "Reusing the oneAPI Base Toolkit" and the cache size stays near the 2 GB of the intel_oneapi_basekit artifact (a larger entry means the latest links were stored as copies).

    Checked locally

    bazel build --nobuild --config=ci //cpp/daal:core_static //dev/bazel/tests:all loads the changed .bazelrc and toolchain files; bash -n on the scripts; the workflows and the pipeline parse; actionlint reports the same findings as main; editorconfig-checker and check_comment_blocks.py pass. The Windows toolchain change can only be verified by the Azure WindowsBazel run: the exec-log action digests must stay identical across two image versions.

    ---

    <details>
    <summary>Checklist:</summary>

    Completeness and readability

  • I have commented my code, particularly in hard-to-understand areas.

  • I have updated the documentation to reflect the changes or created a separate PR with updates and provided its number in the description, if necessary.

  • Git commit message contains an appropriate signed-off-by string _(see CONTRIBUTING.md for details)_.

  • I have resolved any merge conflicts that might occur with the base branch.
  • Testing

  • I have run it locally and tested the changes extensively.

  • All CI jobs are green or I have provided justification why they aren't.
  • Performance

  • I have provided justification why performance and/or quality metrics have changed or why changes are not expected: CI configuration and the Bazel Windows toolchain environment only; no library code.
  • </details>

    🤖 Generated with Claude Code

    Diff: 650 lines (+487 / -163) across 8 files Reviewer: Alexandr-Solovev Review duration: 7846m
    All Vouch review confidence checks passed
    Residual risk 0.28 = Change Risk (0.52) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.52 · 650 lines diff across 8 files
    0.52
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    46%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.388
    Shallow Review Depth shallow_review_depth
    0.344
    Real PR Conversation Timeline
    1 comments
    "Review active on #4031"
    general weight: 0.35
    Assignees
    Unassigned
    Labels
    risk: low confidence: 46.7% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 52% (MEDIUM) · Higher = larger blast radius
    52%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 46.7% · Lower = rushed or shallow review
    46.7%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 27.7% · Safe to merge
    27.7%