mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-10-04 02:55:44 +00:00
ci(query-regression): derive the Rust toolchain pin from rust-toolchain.toml
Replace the hard-coded RUSTUP_TOOLCHAIN value and the hard-coded version strings in the runner Verify assertions with a pin resolved from rust-toolchain.toml: - the always-running test-tooling job exports the channel parsed from rust-toolchain.toml as a job output - query-regression sets RUSTUP_TOOLCHAIN from that output - the Verify step escapes the pin into the cargo/rustc/active-toolchain regexes at runtime; the exact commit hash and date are asserted generically since a stable version identifies the release Removing the redundant require_eq (workflow yaml vs runner env) since both now flow from the single source of truth. When rust-toolchain.toml is bumped, the run fails with a clear signal until the runner image is rebuilt with the new toolchain, keeping the existing lockstep contract. Part of #9289. Signed-off-by: Ning Sun <sunning@greptime.com>
This commit is contained in:
@@ -158,7 +158,8 @@ overridable via `QUERY_REGRESSION_RUNNER_UID`/`QUERY_REGRESSION_RUNNER_GID`)
|
||||
and exact tool versions: `libprotoc 3.21.12`, `uv 0.11.26`, `mold 2.40.4`,
|
||||
`Python 3.14.4`, `sccache 0.16.0`, `otelgen` commit
|
||||
`863a3f395d062c7322cc1de08a38774b7fdaa6c8`, root-owned `rustup 1.29.0`, and
|
||||
the image-baked `1.96.1` Rust toolchain. `mold` and `python3`
|
||||
the image-baked Rust toolchain matching the pin resolved from
|
||||
`rust-toolchain.toml` (asserted dynamically by the workflow). `mold` and `python3`
|
||||
come from apt at image-build time (not Ubuntu 24.04's default 3.12); bump
|
||||
the Verify pins together with `QUERY_REGRESSION_ECS_IMAGE_ID` when the
|
||||
image is rebuilt. Rustup, Cargo, and Rustc
|
||||
|
||||
@@ -120,12 +120,23 @@ jobs:
|
||||
# Ordinary PRs also run the same tests from checks.yml.
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 10
|
||||
outputs:
|
||||
# The Rust toolchain pin, resolved from rust-toolchain.toml so the
|
||||
# benchmark always runs the workspace toolchain without a second
|
||||
# hard-coded copy in this workflow.
|
||||
rust_toolchain: ${{ steps.rust-toolchain.outputs.pin }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Resolve Rust toolchain pin
|
||||
id: rust-toolchain
|
||||
run: |
|
||||
pin="$(grep -E '^channel' rust-toolchain.toml | cut -d'"' -f2)"
|
||||
echo "pin=${pin}" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Test query regression tooling
|
||||
run: |
|
||||
python3 tests/perf/test_query_regression_runner_compaction_toctou.py
|
||||
@@ -190,7 +201,7 @@ jobs:
|
||||
CARGO_HOME: /home/runner/.cargo
|
||||
UV_CACHE_DIR: /home/runner/.cargo/uv-cache
|
||||
RUSTUP_HOME: /opt/rustup
|
||||
RUSTUP_TOOLCHAIN: 1.96.1
|
||||
RUSTUP_TOOLCHAIN: ${{ needs.test-tooling.outputs.rust_toolchain }}
|
||||
RUSTUP_AUTO_INSTALL: "0"
|
||||
CARGO_TARGET_DIR: /home/runner/query-regression-target
|
||||
QUERY_REGRESSION_CACHE_META: /home/runner/query-regression-cache-meta
|
||||
@@ -504,14 +515,16 @@ jobs:
|
||||
require_eq cargo_path "$(command -v cargo || true)" "/opt/cargo/bin/cargo"
|
||||
require_eq rustc_path "$(command -v rustc || true)" "/opt/cargo/bin/rustc"
|
||||
require_match rustup "$(capture rustup --version)" '^rustup[[:space:]]1\.29\.0([[:space:]]|$)'
|
||||
# The toolchain pin flows from rust-toolchain.toml (resolved in the
|
||||
# test-tooling job); escape it for the regex assertions below.
|
||||
pin_regex="${RUSTUP_TOOLCHAIN//./\\.}"
|
||||
require_match cargo "$(capture cargo --version)" \
|
||||
'^cargo[[:space:]]1\.96\.1[[:space:]]\(356927216[[:space:]][0-9]{4}-[0-9]{2}-[0-9]{2}\)$'
|
||||
"^cargo[[:space:]]${pin_regex}[[:space:]]\([0-9a-f]+[[:space:]][0-9]{4}-[0-9]{2}-[0-9]{2}\)$"
|
||||
require_match rustc "$(capture rustc --version)" \
|
||||
'^rustc[[:space:]]1\.96\.1[[:space:]]\(31fca3adb[[:space:]][0-9]{4}-[0-9]{2}-[0-9]{2}\)$'
|
||||
"^rustc[[:space:]]${pin_regex}[[:space:]]\([0-9a-f]+[[:space:]][0-9]{4}-[0-9]{2}-[0-9]{2}\)$"
|
||||
require_match active_toolchain "$(capture rustup show active-toolchain)" \
|
||||
'^1\.96\.1-x86_64-unknown-linux-gnu([[:space:]]|$)'
|
||||
"^${pin_regex}-x86_64-unknown-linux-gnu([[:space:]]|$)"
|
||||
require_eq RUSTUP_HOME "${RUSTUP_HOME}" "/opt/rustup"
|
||||
require_eq RUSTUP_TOOLCHAIN "${RUSTUP_TOOLCHAIN}" "1.96.1"
|
||||
require_eq RUSTUP_AUTO_INSTALL "${RUSTUP_AUTO_INSTALL}" "0"
|
||||
require "readable /opt/rustup" test -r /opt/rustup
|
||||
require "executable /opt/rustup" test -x /opt/rustup
|
||||
|
||||
Reference in New Issue
Block a user