Compare commits

..

2 Commits

Author SHA1 Message Date
Cursor Agent c22a4b1a99 ci: schedule RDMA nightly at midnight on the shared release
Run at 00:00 Asia/Shanghai and upload rustfs-nightly-rdma-latest.deb
onto the existing auto-testing nightly release without replacing the
GNU assets or release body.

Co-authored-by: hector <majinghe@users.noreply.github.com>
2026-12-02 13:03:35 +00:00
Cursor Agent efd7feebc2 ci: add a standalone nightly RDMA package build
Schedule a native NIXL release deb on the rdma runner, thirty minutes
after the GNU nightly, without dispatching the functional chain.

Co-authored-by: hector <majinghe@users.noreply.github.com>
2026-12-02 12:58:41 +00:00
11 changed files with 717 additions and 99 deletions
+27
View File
@@ -1239,6 +1239,33 @@
"origin": "baseline",
"alert_contract": "scheduled-validation"
},
{
"workflow": ".github/workflows/nightly-rdma.yml",
"name": "Nightly RDMA Build",
"roles": [
"periodic",
"manual",
"release"
],
"events": [
"schedule",
"workflow_dispatch"
],
"cadence": "nightly",
"timezone": "UTC",
"schedule": [
"0 0 * * *"
],
"owner": "@overtrue",
"policy": "active",
"monitor": "workflow",
"max_age_hours": 36,
"result_owner": "nightly-rdma.yml",
"disposition": "independent RDMA/NIXL nightly package; adds rustfs-nightly-rdma-latest.deb on the shared nightly release without replacing GNU assets or dispatching nightly-candidate-ready",
"failure_owner": "workflow",
"origin": "added",
"alert_contract": "scheduled-validation"
},
{
"workflow": ".github/workflows/nix-flake-update.yml",
"name": "Update Nix Flake",
+2 -1
View File
@@ -19,6 +19,7 @@ Every other label in this repository is capacity RustFS pays for. ARC pods and l
| `ubicloud-standard-16-arm` | RustFS | Ubicloud VM, alias of `ubicloud-standard-16-arm-ubuntu-2404`: Ubuntu 24.04 arm64, 16 vCPU, 48 GB, 300 GB disk. Reached through the `build.yml` matrix, so `actionlint.yaml` does not list it | native aarch64 release builds (`linux-aarch64-musl`, `linux-aarch64-gnu`) |
| `dind-sm-standard-2` | RustFS | ARC pod with Docker-in-Docker | Docker workloads with a measured resource or environment requirement beyond the hosted runner |
| `smoke-testing`, `pf-testing` | RustFS | long-lived lab machines | the packaged functional chain and performance suites |
| `rdma` | RustFS | long-lived lab machine with native NIXL/RDMA libraries | `rdma-build.yml` compile checks and the `nightly-rdma.yml` native release package |
The self-hosted pods and the hosted image are both Ubuntu 24.04, so a binary built on one runs on the other; `ci.yml` builds the debug binary on `sm-standard-4` and runs it on both pools.
@@ -45,7 +46,7 @@ A hosted runner is also the only choice for a few things the pods cannot do: `mo
- Every `shared-key` has exactly one writer. `cache-warm.yml` owns `ci-dev`, `ci-feat-proto` and `ci-uring`; every other `./.github/actions/setup` call states `cache-save-if` explicitly, and `scripts/security/check_cache_save_if.sh` fails the build when one does not.
- The `ci-dev` key ends in a digest of `warm-ci-dev`'s build commands. Changing what that job warms therefore needs a new key, or readers keep restoring the old artifacts: `scripts/ci_gate.py --check-workflow` prints the key the commands require and fails until the writer and every registered `sm-standard-4` reader (`ci.yml`, `dual-stack-nightly.yml`, `e2e-replication-nightly.yml`, `fuzz.yml`, `gateway-acceptance.yml`, `mint.yml` and `reference-parity.yml`) name it.
- All readers of a key run on the same image as its writer. Keys that live on hosted runners say so in their name (`ci-uring` is warmed on `ubuntu-latest`; `ci-e2e-distributed-hosted` is written on `ubuntu-latest` by `e2e-distributed.yml` and read without saving by hosted server/E2E lanes such as `gateway-acceptance.yml`, `on-demand-migration-interop.yml`, `oidc-keycloak.yml`, `minio-interop.yml`, `e2e-upgrade.yml` and `rdma-feature-check.yml`). `rdma-build.yml` owns `ci-nixl-rdma` on the `rdma` label and is the only job that saves it.
- All readers of a key run on the same image as its writer. Keys that live on hosted runners say so in their name (`ci-uring` is warmed on `ubuntu-latest`; `ci-e2e-distributed-hosted` is written on `ubuntu-latest` by `e2e-distributed.yml` and read without saving by hosted server/E2E lanes such as `gateway-acceptance.yml`, `on-demand-migration-interop.yml`, `oidc-keycloak.yml`, `minio-interop.yml`, `e2e-upgrade.yml` and `rdma-feature-check.yml`). `rdma-build.yml` owns `ci-nixl-rdma` on the `rdma` label and is the only job that saves it. `nightly-rdma.yml` owns `nightly-rdma-nixl` on that same label and is the only job that saves it.
- Moving a job between pools therefore means renaming its key. The new key is empty until a run from `main` (a scheduled run, or a manual dispatch of that workflow from `main`) saves it; until then that lane does a cold build. The `build.yml` aarch64 release legs append `-ubicloud-arm` for this reason. `cache-warm.yml` does not write those keys.
- `CARGO_BUILD_JOBS` and every other `CARGO*`, `CC*`, `CFLAGS*`, `CXX*`, `CMAKE*` and `RUST*` variable is hashed into the key. `ci.yml` sets `CARGO_BUILD_JOBS` at step level for that reason; promoting it to job level rotates the key for every lane that shares it.
+591
View File
@@ -0,0 +1,591 @@
# Copyright 2024 RustFS Team
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: Nightly RDMA Build
# Standalone nightly package of the rustfs binary with the nixl feature.
# It does not call nightly-gnu.yml, does not share that workflow's
# concurrency group, and does not dispatch nightly-candidate-ready.
# rustfs-functional-chain.yml listens only for "Nightly GNU Build", so a
# failure here cannot block or break the GNU nightly functional-testing chain.
#
# The schedule is midnight Asia/Shanghai.
# NIXL links the runner's native libraries, so this job uses cargo build
# rather than cargo zigbuild and the glibc 2.31 cross baseline.
on:
schedule:
- cron: "0 0 * * *"
timezone: "Asia/Shanghai"
workflow_dispatch:
inputs:
branch:
description: 'Branch/ref to build and publish as the RDMA nightly (empty = scheduled source, see NIGHTLY_BUILD_REF)'
required: false
default: ''
permissions:
contents: read
# Scheduled builds follow the NIGHTLY_BRANCH repo variable so the channel can
# be pointed at e.g. `release` for the GA cycle and back to `main` afterwards
# without touching this file. Manual runs take the `branch` input, falling
# back to the branch the run was dispatched from.
concurrency:
group: nightly-rdma-build-${{ github.event_name }}-${{ github.event_name == 'schedule' && (vars.NIGHTLY_BRANCH || 'main') || (inputs.branch || github.ref_name) }}
cancel-in-progress: ${{ github.event_name == 'workflow_dispatch' }}
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
NIGHTLY_BUILD_REF: ${{ github.event_name == 'schedule' && (vars.NIGHTLY_BRANCH || 'main') || (inputs.branch || github.ref_name) }}
jobs:
resolve-source:
if: github.repository == 'rustfs/rustfs'
name: Resolve nightly source
runs-on: ubuntu-latest
timeout-minutes: 10
outputs:
source_sha: ${{ steps.source.outputs.sha }}
source_ref: ${{ steps.source.outputs.ref }}
steps:
- name: Checkout selected source
uses: actions/checkout@f548e57e544e1ff5a4c46bf1e1b8685f8e4a348a # v7
with:
persist-credentials: false
ref: ${{ env.NIGHTLY_BUILD_REF }}
- name: Record immutable source
id: source
run: |
echo "sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"
echo "ref=${NIGHTLY_BUILD_REF}" >> "$GITHUB_OUTPUT"
build:
needs: resolve-source
name: Build x86_64 RDMA
# Hardware or environment: native NIXL/RDMA libraries on the self-hosted
# `rdma` runner. Hosted ubuntu-latest has no libnixl, and a glibc 2.31
# zigbuild cannot link those libraries. Bare label, same form as
# rdma-build.yml (not a [self-hosted, ...] list).
runs-on: rdma
timeout-minutes: 150
env:
NIGHTLY_BUILD_REF: ${{ needs.resolve-source.outputs.source_ref }}
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"
steps:
- name: Checkout repository
uses: actions/checkout@f548e57e544e1ff5a4c46bf1e1b8685f8e4a348a # v7
with:
persist-credentials: false
ref: ${{ needs.resolve-source.outputs.source_sha }}
- name: Setup Rust environment
uses: ./.github/actions/setup
with:
rust-version: stable
# Own key: rust-cache does not include the runner label.
# rdma-build.yml owns ci-nixl-rdma; this nightly must not share it.
cache-shared-key: nightly-rdma-nixl
cache-save-if: ${{ github.ref == 'refs/heads/main' }}
install-build-packaging-tools: 'false'
install-test-tools: 'false'
- name: Install only missing native build tools
shell: bash
run: |
set -euo pipefail
packages=()
command -v g++ >/dev/null || packages+=(g++)
ldconfig -p | grep -q 'libclang' || packages+=(libclang-dev)
command -v unzip >/dev/null || packages+=(unzip)
command -v fakeroot >/dev/null || packages+=(fakeroot)
if (( ${#packages[@]} )); then
sudo apt-get update
sudo apt-get install --no-install-recommends -y "${packages[@]}"
fi
- name: Download static console assets
shell: bash
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
# Packaging tools are off on this lane, so setup does not install unzip.
if ! command -v unzip >/dev/null 2>&1; then
sudo apt-get update -qq
sudo apt-get install -y -qq unzip
fi
if ! command -v unzip >/dev/null 2>&1; then
echo "unzip is required to extract console assets" >&2
exit 1
fi
mkdir -p ./rustfs/static
verify_sha256() {
local expected="$1"
local file="$2"
local actual=""
local actual_line=""
if command -v sha256sum >/dev/null 2>&1; then
actual_line=$(sha256sum -- "$file") || return 1
elif command -v shasum >/dev/null 2>&1; then
actual_line=$(shasum -a 256 -- "$file") || return 1
else
echo "No SHA-256 verification tool found" >&2
return 1
fi
actual="${actual_line%%[[:space:]]*}"
if [ "$actual" = "$expected" ]; then
echo "SHA256 verified OK: $actual"
return 0
else
echo "SHA256 mismatch: expected=$expected actual=$actual" >&2
return 1
fi
}
download_console_assets() {
local curl_bin="curl"
local python_bin="python3"
local console_api="https://api.github.com/repos/rustfs/console/releases/latest"
local console_json="console-release.json"
local console_url
local console_sha256
local curl_auth_args=()
console_tag=""
chmod +w ./rustfs/static/LICENSE || true
if ! command -v "$python_bin" >/dev/null 2>&1; then
python_bin="python"
fi
if ! command -v "$python_bin" >/dev/null 2>&1; then
echo "No Python interpreter found for release metadata parsing" >&2
return 1
fi
if [[ -n "${GITHUB_TOKEN:-}" ]]; then
curl_auth_args=(-H "Authorization: Bearer ${GITHUB_TOKEN}" -H "X-GitHub-Api-Version: 2022-11-28")
fi
"$curl_bin" "${curl_auth_args[@]}" --fail -L "$console_api" \
-o "$console_json" --retry 3 --retry-delay 5 --max-time 300 || return 1
read -r console_tag console_url console_sha256 < <("$python_bin" - "$console_json" <<'PY'
import json
import re
import sys
with open(sys.argv[1], encoding="utf-8") as handle:
release = json.load(handle)
tag = release.get("tag_name", "") or "unknown"
for asset in release.get("assets", []):
name = asset.get("name", "")
digest = asset.get("digest", "")
url = asset.get("browser_download_url", "")
if name.startswith("rustfs-console-") and name.endswith(".zip") and digest.startswith("sha256:") and url:
sha256 = digest.split(":", 1)[1]
if not re.fullmatch(r"[0-9a-fA-F]{64}", sha256):
raise SystemExit(f"console zip asset has invalid sha256 digest: {sha256}")
sys.stdout.buffer.write(f"{tag} {url} {sha256}\n".encode("utf-8"))
break
else:
raise SystemExit("no console zip asset with sha256 digest found")
PY
) || return 1
if [[ -z "$console_url" || -z "$console_sha256" ]]; then
echo "Console release metadata is missing URL or SHA-256 digest" >&2
return 1
fi
echo "Console release: ${console_tag}"
echo "Downloading console asset: ${console_url}"
"$curl_bin" --fail -L "$console_url" -o console.zip --retry 3 --retry-delay 5 --max-time 300 || return 1
verify_sha256 "$console_sha256" console.zip || return 2
unzip -o console.zip -d ./rustfs/static || return 2
}
if download_console_assets; then
rm -f console.zip console-release.json
else
status=$?
rm -f console.zip console-release.json
if [[ "$status" -eq 2 ]]; then
echo "Console asset integrity verification failed" >&2
fi
echo "Failed to download verified console assets" >&2
exit 1
fi
if [[ ! -s ./rustfs/static/index.html ]]; then
echo "Console asset archive is missing static/index.html" >&2
exit 1
fi
asset_count=$(find ./rustfs/static -type f | wc -l | tr -d '[:space:]')
echo "Console assets ready: version=${console_tag:-unknown}, ${asset_count} files extracted to ./rustfs/static"
- name: Build RustFS with NIXL
shell: bash
run: |
set -euo pipefail
# Force rebuild by touching build.rs so a restored cache cannot
# reuse a rustfs artifact compiled before these console assets existed.
# Native build: NIXL links the runner's libraries, so this lane does
# not use cargo zigbuild or the glibc 2.31 baseline.
touch rustfs/build.rs
NIXL_NO_STUBS_FALLBACK=1 cargo build --release --locked -p rustfs --bin rustfs --features nixl
- name: Verify console
shell: bash
run: |
set -euo pipefail
find_free_port() {
python3 - <<'PY'
import socket
with socket.socket() as sock:
sock.bind(("127.0.0.1", 0))
print(sock.getsockname()[1])
PY
}
binary="target/release/rustfs"
data_dir="$(mktemp -d)"
log_file="${RUNNER_TEMP}/rustfs-console-smoke.log"
server_pid=""
trap '
if [[ -n "${server_pid:-}" ]]; then
kill "$server_pid" 2>/dev/null || true
wait "$server_pid" 2>/dev/null || true
fi
rm -rf "$data_dir"
' EXIT
if [[ ! -x "$binary" ]]; then
echo "rustfs binary not found: ${binary}" >&2
exit 1
fi
api_port="$(find_free_port)"
console_port="$(find_free_port)"
console_url="http://127.0.0.1:${console_port}/rustfs/console/"
"$binary" server \
--address "127.0.0.1:${api_port}" \
--console-enable \
--console-address "127.0.0.1:${console_port}" \
--access-key console-smoke \
--secret-key console-smoke-secret \
"$data_dir" >"$log_file" 2>&1 &
server_pid=$!
response=""
for _ in {1..40}; do
response="$(curl --silent --output /dev/null --write-out '%{http_code} %{content_type}' "$console_url" || true)"
if [[ "$response" == 200\ text/html* ]]; then
exit 0
fi
sleep 0.25
done
echo "Console endpoint did not return 200 text/html: $response" >&2
cat "$log_file"
exit 1
- name: Build DEB package
id: deb
shell: bash
run: |
set -euo pipefail
# Nightly snapshot name: rustfs-nightly-rdma-<YYYY-MM-DD>
# (Asia/Shanghai, matching the schedule timezone so the file date
# always matches the cron's intended day).
DEB_DATE="$(TZ=Asia/Shanghai date +%Y-%m-%d)"
DEB_FILE="rustfs-nightly-rdma-${DEB_DATE}.deb"
LATEST_FILE="rustfs-nightly-rdma-latest.deb"
PKG_DIR="rustfs-nightly-rdma-${DEB_DATE}"
command -v fakeroot >/dev/null 2>&1 || sudo apt-get install -y -qq fakeroot
BIN="target/release/rustfs"
test -x "${BIN}" || { echo "rustfs binary not found: ${BIN}"; exit 1; }
# Native NIXL link: the libc floor is the highest GLIBC symbol this
# binary needs, using the same version-needs section as
# scripts/release/check_glibc.py. The zigbuild 2.31 floor does not
# apply here.
GLIBC_MIN="$(python3 - "${BIN}" <<'PY'
import os
import re
import subprocess
import sys
binary = sys.argv[1]
result = subprocess.run(
["readelf", "--version-info", "--wide", binary],
check=True,
capture_output=True,
text=True,
env={**os.environ, "LC_ALL": "C"},
)
needs = result.stdout.partition("Version needs section")[2]
symbols = re.findall(r"\bName:\s+GLIBC_([0-9]+(?:\.[0-9]+)+)", needs)
if not symbols:
raise SystemExit(f"{binary}: no GLIBC version needs found")
def version_key(value):
parts = tuple(int(part) for part in value.split("."))
return parts + (0,) * max(0, 3 - len(parts))
print(max(symbols, key=version_key))
PY
)"
mkdir -p "${PKG_DIR}/DEBIAN"
mkdir -p "${PKG_DIR}/usr/bin"
mkdir -p "${PKG_DIR}/etc/default"
mkdir -p "${PKG_DIR}/lib/systemd/system"
mkdir -p "${PKG_DIR}/usr/share/doc/rustfs"
cp "${BIN}" "${PKG_DIR}/usr/bin/rustfs"
chmod 755 "${PKG_DIR}/usr/bin/rustfs"
cp deploy/build/rustfs.service "${PKG_DIR}/lib/systemd/system/"
cat > "${PKG_DIR}/etc/default/rustfs" << 'ENVEOF'
# RustFS Environment Configuration
# See https://docs.rustfs.com for more information
# RUSTFS_ACCESS_KEY=<changeme>
# RUSTFS_SECRET_KEY=<changeme>
# RUSTFS_VOLUMES=""
# RUSTFS_ADDRESS=":9000"
# RUSTFS_CONSOLE_ADDRESS=":9001"
# RUSTFS_CONSOLE_ENABLE=true
# RUSTFS_OBS_LOGGER_LEVEL=error
# RUSTFS_OBS_LOG_DIRECTORY="/var/log/rustfs/"
ENVEOF
# dpkg versions must start with a digit and cannot contain hyphens;
# a date-based snapshot version keeps the nightly installable
# alongside release packages. The ~nightly.rdma suffix stays distinct
# from the GNU nightly's ~nightly version.
DEB_VERSION="${DEB_DATE//-/.}~nightly.rdma"
cat > "${PKG_DIR}/DEBIAN/control" << EOF
Package: rustfs
Version: ${DEB_VERSION}
Section: utils
Priority: optional
Architecture: amd64
Depends: libc6 (>= ${GLIBC_MIN})
Maintainer: RustFS Team <support@rustfs.com>
Description: High-performance distributed object storage (RDMA/NIXL nightly)
RustFS is a high-performance distributed object storage software
built using Rust with the nixl feature. It is compatible with the
MinIO and S3 API. This package is linked against the RDMA runner's
native libraries.
Homepage: https://rustfs.com
EOF
cat > "${PKG_DIR}/DEBIAN/conffiles" << 'CONFFILES'
/etc/default/rustfs
CONFFILES
./scripts/release/package_service_scripts.sh after-install > "${PKG_DIR}/DEBIAN/postinst"
chmod 755 "${PKG_DIR}/DEBIAN/postinst"
./scripts/release/package_service_scripts.sh before-remove > "${PKG_DIR}/DEBIAN/prerm"
chmod 755 "${PKG_DIR}/DEBIAN/prerm"
./scripts/release/package_service_scripts.sh after-remove > "${PKG_DIR}/DEBIAN/postrm"
chmod 755 "${PKG_DIR}/DEBIAN/postrm"
cp LICENSE "${PKG_DIR}/usr/share/doc/rustfs/"
cp README.md "${PKG_DIR}/usr/share/doc/rustfs/"
test -s "${PKG_DIR}/usr/bin/rustfs"
test -s "${PKG_DIR}/lib/systemd/system/rustfs.service"
test -s "${PKG_DIR}/etc/default/rustfs"
test -s "${PKG_DIR}/DEBIAN/postinst"
test -s "${PKG_DIR}/DEBIAN/prerm"
test -s "${PKG_DIR}/DEBIAN/postrm"
test -s "${PKG_DIR}/usr/share/doc/rustfs/LICENSE"
test -s "${PKG_DIR}/usr/share/doc/rustfs/README.md"
fakeroot dpkg-deb --build "${PKG_DIR}"
test "$(dpkg-deb -f "${DEB_FILE}" Package)" = "rustfs"
test "$(dpkg-deb -f "${DEB_FILE}" Version)" = "${DEB_VERSION}"
cp -a "${DEB_FILE}" "${LATEST_FILE}"
cmp -s "${DEB_FILE}" "${LATEST_FILE}"
ls -lh "${DEB_FILE}" "${LATEST_FILE}"
echo "deb_date=${DEB_DATE}" >> "${GITHUB_OUTPUT}"
echo "deb_file=${DEB_FILE}" >> "${GITHUB_OUTPUT}"
- name: Upload DEB artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: rustfs-nightly-rdma-latest.deb
path: rustfs-nightly-rdma-latest.deb
if-no-files-found: error
# Dated package plus the rolling alias, on the same nightly prefix as
# nightly-gnu.yml. Names are rustfs-nightly-rdma-* so this upload does
# not replace rustfs-nightly-latest.deb. Skipped when the R2 secrets
# are not configured (artifact-only mode). No immutable candidate and
# no nightly-candidate-ready dispatch.
- name: Upload DEB to Cloudflare R2
env:
DEB_FILE: ${{ steps.deb.outputs.deb_file }}
LATEST_FILE: rustfs-nightly-rdma-latest.deb
R2_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
R2_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
R2_ENDPOINT: ${{ secrets.R2_ENDPOINT }}
R2_BUCKET: ${{ secrets.R2_BUCKET }}
AWS_EC2_METADATA_DISABLED: true
shell: bash
run: |
set -euo pipefail
if [[ -z "${R2_ACCESS_KEY_ID}" || -z "${R2_SECRET_ACCESS_KEY}" || -z "${R2_ENDPOINT}" || -z "${R2_BUCKET}" ]]; then
echo "⚠️ R2 credentials missing, skipping upload"
exit 0
fi
export AWS_ACCESS_KEY_ID="${R2_ACCESS_KEY_ID}"
export AWS_SECRET_ACCESS_KEY="${R2_SECRET_ACCESS_KEY}"
export AWS_DEFAULT_REGION="auto"
if ! command -v aws >/dev/null 2>&1; then
echo "aws CLI not found on runner; installing"
aws_arch="$(uname -m)"
case "${aws_arch}" in
x86_64) aws_arch="x86_64" ;;
aarch64|arm64) aws_arch="aarch64" ;;
*)
echo "Unsupported Linux architecture for AWS CLI: ${aws_arch}" >&2
exit 1
;;
esac
aws_install_root="${RUNNER_TEMP}/aws-cli"
rm -rf "${aws_install_root}"
mkdir -p "${aws_install_root}"
curl --fail --location --retry 3 \
"https://awscli.amazonaws.com/awscli-exe-linux-${aws_arch}.zip" \
--output "${aws_install_root}/awscliv2.zip"
unzip -q "${aws_install_root}/awscliv2.zip" -d "${aws_install_root}"
"${aws_install_root}/aws/install" \
--install-dir "${aws_install_root}/aws-cli" \
--bin-dir "${aws_install_root}/bin"
export PATH="${aws_install_root}/bin:${PATH}"
fi
aws --version
R2_PREFIX="s3://${R2_BUCKET}/artifacts/rustfs/packages/nightly/"
echo "Uploading ${DEB_FILE} and ${LATEST_FILE} to ${R2_PREFIX}"
aws s3 cp "${DEB_FILE}" "${R2_PREFIX}" --endpoint-url "${R2_ENDPOINT}" --only-show-errors
aws s3 cp "${LATEST_FILE}" "${R2_PREFIX}" --endpoint-url "${R2_ENDPOINT}" --only-show-errors
echo "R2 upload complete"
# Add rustfs-nightly-rdma-latest.deb to the rolling `nightly` release
# on rustfs/auto-testing, the same tag nightly-gnu.yml publishes to.
# Only that asset is replaced. rustfs-nightly-latest.deb,
# rustfs-nightly-latest.rpm, and the release body written by
# scripts/release/publish_nightly_assets.sh are left untouched.
# The release is created only when the tag does not exist yet.
# Skipped when PF_TESTING_GH_TOKEN is not configured.
# Does not dispatch nightly-candidate-ready.
- name: Publish RDMA package to the auto-testing nightly release
env:
ASSETS_TOKEN: ${{ secrets.PF_TESTING_GH_TOKEN }}
DEB_FILE: rustfs-nightly-rdma-latest.deb
DEB_DATE: ${{ steps.deb.outputs.deb_date }}
shell: bash
run: |
set -euo pipefail
if [[ -z "${ASSETS_TOKEN}" ]]; then
echo "PF_TESTING_GH_TOKEN is missing, skipping nightly release asset publish"
exit 0
fi
: "${DEB_FILE:?DEB_FILE is required}"
: "${DEB_DATE:?DEB_DATE is required}"
[[ -f "${DEB_FILE}" ]] || { echo "missing package: ${DEB_FILE}" >&2; exit 1; }
[[ "${DEB_DATE}" =~ ^[0-9]{4}-[0-9]{2}-[0-9]{2}$ ]]
API="https://api.github.com/repos/rustfs/auto-testing"
UPLOADS="https://uploads.github.com/repos/rustfs/auto-testing/releases"
AUTH="Authorization: token ${ASSETS_TOKEN}"
RELEASE_TAG="nightly"
ASSET_NAME="rustfs-nightly-rdma-latest.deb"
release_id="$(curl -fsS --retry 3 -H "${AUTH}" "${API}/releases/tags/${RELEASE_TAG}" \
| python3 -c 'import json,sys; print(json.load(sys.stdin).get("id", ""))' 2>/dev/null || true)"
if [[ -z "${release_id}" ]]; then
echo "creating the rolling nightly release"
release_id="$(curl -fsS --retry 3 -X POST -H "${AUTH}" -H "Content-Type: application/json" \
-d '{"tag_name":"nightly","name":"Nightly builds","body":"Rolling nightly builds. Assets are replaced on every build; the release body documents the provenance of the current files."}' \
"${API}/releases" | python3 -c 'import json,sys; print(json.load(sys.stdin)["id"])')"
fi
[[ -n "${release_id}" ]] || { echo "could not resolve the nightly release id" >&2; exit 1; }
asset_id="$(curl -fsS --retry 3 -H "${AUTH}" "${API}/releases/tags/${RELEASE_TAG}" \
| ASSET_NAME="${ASSET_NAME}" python3 -c '
import json, os, sys
release = json.load(sys.stdin)
asset_name = os.environ["ASSET_NAME"]
protected = {"rustfs-nightly-latest.deb", "rustfs-nightly-latest.rpm"}
if asset_name in protected:
raise SystemExit("refusing to replace a GNU nightly asset")
print(next((asset["id"] for asset in release.get("assets", []) if asset["name"] == asset_name), ""))
')"
if [[ -n "${asset_id}" ]]; then
curl -fsS --retry 3 -X DELETE -H "${AUTH}" "${API}/releases/assets/${asset_id}" >/dev/null
fi
curl -fsS --retry 3 --max-time 900 -X POST \
-H "${AUTH}" \
-H "Content-Type: application/octet-stream" \
--data-binary "@${DEB_FILE}" \
"${UPLOADS}/${release_id}/assets?name=${ASSET_NAME}" >/dev/null
echo "published ${ASSET_NAME} to the rustfs/auto-testing nightly release without changing its body"
alert-on-failure:
name: Alert on scheduled failure
needs: [resolve-source, build]
if: >-
github.repository == 'rustfs/rustfs' && (
always() && github.event_name == 'schedule' &&
(contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled'))
)
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: read
issues: write
steps:
- uses: actions/checkout@f548e57e544e1ff5a4c46bf1e1b8685f8e4a348a # v7
with:
persist-credentials: false
- name: Open or update failure-tracking issue
uses: ./.github/actions/schedule-failure-issue
with:
github-token: ${{ secrets.BACKLOG_ISSUE_TOKEN }}
+5 -36
View File
@@ -207,16 +207,13 @@ impl ListReadBudget {
}
}
fn weight(&self, fanout: usize) -> usize {
// Admit a full walk even when its fanout exceeds the configured budget.
fanout.max(1).min(self.capacity)
}
async fn acquire(&self, fanout: usize) -> Result<Option<Arc<OwnedSemaphorePermit>>, tokio::sync::AcquireError> {
if self.capacity == 0 {
return Ok(None);
}
let weight = u32::try_from(self.weight(fanout)).unwrap_or(u32::MAX);
// A single walk must remain admissible even when the topology exceeds
// the configured budget. Tokio accepts at most u32::MAX in one grant.
let weight = u32::try_from(fanout.max(1).min(self.capacity)).unwrap_or(u32::MAX);
self.permits
.clone()
.acquire_many_owned(weight)
@@ -494,12 +491,6 @@ impl InstanceContext {
.await
}
pub(crate) fn list_read_budget_has_capacity(&self, fanout: usize) -> Option<bool> {
self.list_read_budget
.get()
.map(|budget| budget.permits.available_permits() >= budget.weight(fanout))
}
/// Build a context bound to a specific lock manager.
///
/// [`bootstrap_ctx`] uses this to alias the process-global lock manager so
@@ -1584,16 +1575,8 @@ mod tests {
#[tokio::test]
async fn list_read_budget_zero_preserves_unbounded_configuration() {
let ctx = InstanceContext::new();
assert_eq!(ctx.list_read_budget_has_capacity(1), None);
ctx.list_read_budget.set(ListReadBudget::new(0)).expect("fresh context");
assert!(
ctx.acquire_list_read_budget(usize::MAX)
.await
.expect("disabled budget")
.is_none()
);
assert_eq!(ctx.list_read_budget_has_capacity(usize::MAX), Some(true));
let budget = ListReadBudget::new(0);
assert!(budget.acquire(usize::MAX).await.expect("disabled budget").is_none());
}
#[tokio::test]
@@ -1628,8 +1611,6 @@ mod tests {
let other = InstanceContext::new();
other.list_read_budget.set(ListReadBudget::new(4)).expect("fresh context");
let held = first.acquire_list_read_budget(4).await.expect("first context");
assert_eq!(same.list_read_budget_has_capacity(4), Some(false));
assert_eq!(other.list_read_budget_has_capacity(4), Some(true));
let mut waiter = std::pin::pin!(same.acquire_list_read_budget(1));
assert!(futures::poll!(&mut waiter).is_pending());
assert!(
@@ -1641,18 +1622,6 @@ mod tests {
);
drop(held);
assert!(waiter.await.expect("shared context resumed").is_some());
assert_eq!(same.list_read_budget_has_capacity(4), Some(true));
}
#[tokio::test]
async fn list_read_budget_reports_capacity_for_the_requested_fanout() {
let ctx = InstanceContext::new();
ctx.list_read_budget.set(ListReadBudget::new(64)).expect("fresh context");
let held = ctx.acquire_list_read_budget(48).await.expect("first walk");
assert_eq!(ctx.list_read_budget_has_capacity(16), Some(true));
assert_eq!(ctx.list_read_budget_has_capacity(48), Some(false));
drop(held);
assert_eq!(ctx.list_read_budget_has_capacity(48), Some(true));
}
#[test]
+4 -17
View File
@@ -1572,18 +1572,6 @@ impl ECStore {
})
}
fn list_read_fanout(&self) -> usize {
self.pools.iter().fold(0usize, |total, pool| {
total.saturating_add(pool.disk_set.len().saturating_mul(pool.set_drive_count))
})
}
/// Whether the local budget can fit one full listing walk at the time of sampling.
/// Returns `None` until a listing walk initializes the budget.
pub fn list_read_budget_has_capacity(&self) -> Option<bool> {
self.ctx.list_read_budget_has_capacity(self.list_read_fanout())
}
pub async fn list_path(self: Arc<Self>, o: &ListPathOptions) -> Result<ListPage> {
// tracing::warn!("list_path opt {:?}", &o);
@@ -1637,11 +1625,10 @@ impl ECStore {
if o.transient {
o.create = false;
}
o.read_budget = self
.ctx
.acquire_list_read_budget(self.list_read_fanout())
.await
.map_err(Error::other)?;
let fanout = self.pools.iter().fold(0usize, |total, pool| {
total.saturating_add(pool.disk_set.len().saturating_mul(pool.set_drive_count))
});
o.read_budget = self.ctx.acquire_list_read_budget(fanout).await.map_err(Error::other)?;
let log_context = ListPathLogContext::from_options(&o);
+1
View File
@@ -97,6 +97,7 @@ Scheduled lanes never block a PR. Their workflow-local gate fails the run. The v
| `minio-interop.yml` (nightly) | `minio-interop` | EC + SSE read-parity gate | yes, with `never_ran_grace_until` | pinned Docker fixture steps in the workflow |
| `on-demand-migration-interop.yml` (nightly) | `minio-source`, `cloud-source` (`aws`, `r2`, `gcs`) | report-only provider interop; one JSON report per provider naming cases, timings and source request counts, plus JUnit and MinIO logs. A cloud provider whose `ODM_INTEROP_*` secrets are absent is skipped with a summary note, not failed | yes | start the pinned MinIO container as in the job, export the `RUSTFS_ODM_INTEROP_*` variables, run `python3 scripts/e2e_binary.py build --bins`, then `python3 scripts/e2e_binary.py run -- cargo nextest run --profile e2e-odm-interop -p e2e_test` |
| `nightly-gnu.yml` (nightly) | `build`, `kms-vault-lane`, `kms-vault-ha-failover` | build, live Vault, and HA failover gates | yes | commands and pinned Vault images in the workflow |
| `nightly-rdma.yml` (nightly) | `resolve-source`, `build` | native NIXL release package `rustfs-nightly-rdma-latest.deb` on the `rdma` runner; does not dispatch the functional chain | yes | commands in the workflow; requires the `rdma` runner and native NIXL libraries |
| `audit.yml` (nightly) | `cargo-deny`, `workflow-pin-report` | dependency and workflow-pin gates | yes | `cargo deny check`; `scripts/security/check_workflow_pins.sh` |
| `mint.yml` (nightly) | `image`, `mint` (`legacy` pinned reference and `gateway` candidate), `compare` | fail-closed dual-stack diff-table gate (`scripts/mint_stack_diff.py`): requires verified distinct binary provenance and an empty `(sdk, test, legacy, gateway)` diff table across both Mint `log.json` reports; uploads per-leg logs and `diff.md`/`diff.json` | yes | pinned Docker sequence per leg in the workflow, then `python3 scripts/mint_stack_diff.py <legacy-dir> <gateway-dir> --require-meta` |
| `coverage.yml` (weekly) | `coverage` | report-only trend; lcov and JSON artifact | yes (disabled) | `make coverage` |
+43 -22
View File
@@ -714,21 +714,44 @@ fn summarize_storage_readiness(snapshot: &ClusterReadOnlySnapshot) -> Capability
}
}
fn summarize_listing_readiness(snapshot: &ClusterReadOnlySnapshot) -> CapabilityStatus {
match snapshot
.workload_admission
.entries()
.iter()
.find(|entry| entry.class == WorkloadClass::ForegroundRead)
{
Some(entry) if entry.state == AdmissionState::Open => {
CapabilityStatus::supported().with_reason("foreground read admission is open")
}
Some(entry) => {
let mut reason = format!("foreground read admission is {}", admission_state_label(entry.state));
if let Some(detail) = entry.reason.as_deref() {
reason.push_str(": ");
reason.push_str(detail);
}
CapabilityStatus::unknown().with_reason(reason)
}
None => CapabilityStatus::unknown().with_reason("foreground read admission is not reported"),
}
}
fn summarize_listing_metacache(snapshot: &ClusterReadOnlySnapshot) -> ClusterListingMetacacheStatus {
const HINT: &str = "bucket and prefix attribution is emitted through metacache quorum logs; inspect operation-labelled walk_dir metrics for internode traffic";
let diagnostics = snapshot.listing_diagnostics;
let status = match diagnostics.local_budget_has_capacity {
Some(true) => CapabilityStatus::supported().with_reason("local listing budget has capacity"),
Some(false) => CapabilityStatus::unknown().with_reason("local listing budget cannot admit a full walk"),
None => CapabilityStatus::unknown().with_reason("local listing budget is not reported"),
let admission = summarize_listing_readiness(snapshot);
let stalls = snapshot.listing_diagnostics.internode_stall_timeouts_total;
let (condition, status) = if admission.state == CapabilityState::Supported {
("healthy", admission)
} else {
(condition_from_capability(&admission), admission)
};
ClusterListingMetacacheStatus {
source: "local_listing_budget+internode_metrics",
condition: condition_from_capability(&status),
source: "workload_admission+internode_metrics",
condition,
status,
internode_stall_timeouts_total: diagnostics.internode_stall_timeouts_total,
internode_stall_timeouts_total: stalls,
hint: HINT,
}
}
@@ -1190,7 +1213,6 @@ mod tests {
..Default::default()
},
listing_diagnostics: ClusterListingDiagnosticsSnapshot {
local_budget_has_capacity: None,
internode_stall_timeouts_total: 2,
},
pool_meta_write_gate: ClusterPoolMetaWriteGateSnapshot {
@@ -1211,7 +1233,7 @@ mod tests {
assert_eq!(value["components"]["storage"]["source"], "runtime_readiness");
assert_eq!(value["components"]["storage"]["condition"], "degraded");
assert_eq!(value["components"]["peer_health"]["source"], "cluster_peer_health");
assert_eq!(value["components"]["listing"]["source"], "local_listing_budget+internode_metrics");
assert_eq!(value["components"]["listing"]["source"], "workload_admission+internode_metrics");
assert_eq!(value["components"]["listing"]["condition"], "unknown");
assert_eq!(value["components"]["listing"]["internode_stall_timeouts_total"], 2);
assert_eq!(value["pool_meta_write_gate"]["writesReady"], false);
@@ -1287,8 +1309,8 @@ mod tests {
assert_eq!(summary.storage.state, CapabilityState::Supported);
assert_eq!(summary.storage.reason.as_deref(), Some("storage readiness reports ready"));
assert_eq!(summary.peer_health.state, CapabilityState::Unknown);
assert_eq!(summary.listing.state, CapabilityState::Unknown);
assert_eq!(summary.listing.reason.as_deref(), Some("local listing budget is not reported"));
assert_eq!(summary.listing.state, CapabilityState::Supported);
assert_eq!(summary.listing.reason.as_deref(), Some("foreground read admission is open"));
assert_eq!(summary.usage.state, CapabilityState::Unknown);
assert_eq!(summary.usage.reason.as_deref(), Some("no usage cache save result has been reported"));
assert_eq!(summary.rpc_boundary.state, CapabilityState::Supported);
@@ -1320,10 +1342,11 @@ mod tests {
},
rpc_boundary: sample_rpc_boundary_snapshot(),
observability: ObservabilitySnapshot::default(),
workload_admission: WorkloadAdmissionRegistrySnapshot::new(vec![WorkloadAdmissionSnapshot::new(
WorkloadClass::ForegroundRead,
AdmissionState::Open,
)]),
workload_admission: WorkloadAdmissionRegistrySnapshot::new(vec![
WorkloadAdmissionSnapshot::new(WorkloadClass::ForegroundRead, AdmissionState::Throttled)
.with_counts(Some(4), Some(8), Some(4))
.with_reason("metacache listing backpressure"),
]),
runtime_status: ClusterRuntimeStatusSnapshot {
readiness: DependencyReadiness {
storage_ready: false,
@@ -1342,7 +1365,6 @@ mod tests {
..Default::default()
},
listing_diagnostics: ClusterListingDiagnosticsSnapshot {
local_budget_has_capacity: Some(false),
internode_stall_timeouts_total: 0,
},
pool_meta_write_gate: ClusterPoolMetaWriteGateSnapshot::default(),
@@ -1361,7 +1383,7 @@ mod tests {
assert_eq!(view.components.listing.status.state, CapabilityState::Unknown);
assert_eq!(
view.components.listing.status.reason.as_deref(),
Some("local listing budget cannot admit a full walk")
Some("foreground read admission is throttled: metacache listing backpressure")
);
assert_eq!(view.components.listing.condition, "unknown");
assert_eq!(view.components.usage.status.state, CapabilityState::Unknown);
@@ -1411,7 +1433,7 @@ mod tests {
}
#[test]
fn cluster_snapshot_listing_uses_its_own_budget_while_get_is_saturated() {
fn cluster_snapshot_listing_component_keeps_historical_stalls_as_evidence() {
let snapshot = ClusterReadOnlySnapshot {
topology: TopologySnapshot::default(),
membership: ClusterMembershipSnapshot::default(),
@@ -1422,7 +1444,7 @@ mod tests {
observability: ObservabilitySnapshot::default(),
workload_admission: WorkloadAdmissionRegistrySnapshot::new(vec![WorkloadAdmissionSnapshot::new(
WorkloadClass::ForegroundRead,
AdmissionState::Saturated,
AdmissionState::Open,
)]),
runtime_status: ClusterRuntimeStatusSnapshot {
readiness: DependencyReadiness::default(),
@@ -1431,7 +1453,6 @@ mod tests {
},
usage_freshness: ClusterUsageFreshnessSnapshot::default(),
listing_diagnostics: ClusterListingDiagnosticsSnapshot {
local_budget_has_capacity: Some(true),
internode_stall_timeouts_total: 2,
},
pool_meta_write_gate: ClusterPoolMetaWriteGateSnapshot::default(),
@@ -1440,7 +1461,7 @@ mod tests {
let component = super::summarize_listing_metacache(&snapshot);
assert_eq!(component.status.state, CapabilityState::Supported);
assert_eq!(component.status.reason.as_deref(), Some("local listing budget has capacity"));
assert_eq!(component.status.reason.as_deref(), Some("foreground read admission is open"));
assert_eq!(component.condition, "healthy");
assert_eq!(component.internode_stall_timeouts_total, 2);
}
+2 -2
View File
@@ -777,8 +777,8 @@ impl DefaultAdminUsecase {
}
pub async fn execute_collect_cluster_read_only_snapshot(&self) -> Option<ClusterReadOnlySnapshot> {
let context = current_app_context()?;
collect_cluster_read_only_snapshot(&context).await
let endpoint_pools = current_endpoints_handle()?;
collect_cluster_read_only_snapshot(&endpoint_pools).await
}
pub fn cluster_snapshot_route(&self) -> &'static str {
+17 -18
View File
@@ -13,7 +13,6 @@
// limitations under the License.
use crate::runtime_capabilities::runtime_observability_snapshot;
use crate::runtime_sources::AppContext;
use crate::server::snapshot_dependency_readiness_report;
use crate::shared_types::{DependencyReadiness, DependencyReadinessReport, ReadinessDegradedReason};
use crate::storage_api::cluster::EndpointServerPools;
@@ -25,7 +24,7 @@ use crate::storage_api::cluster::control_plane::{
};
use crate::workload_admission::workload_admission_registry_snapshot;
use rustfs_concurrency::{AdmissionState, WorkloadAdmissionRegistrySnapshot};
use rustfs_io_metrics::internode_metrics::InternodeMetricsSnapshot;
use rustfs_io_metrics::internode_metrics::{InternodeMetricsSnapshot, global_internode_metrics};
use rustfs_scanner_metrics::metrics::{ScannerMetricsReport, global_metrics};
#[derive(Debug, Clone, PartialEq, Eq)]
@@ -103,19 +102,9 @@ impl From<&ScannerMetricsReport> for ClusterUsageFreshnessSnapshot {
#[derive(Debug, Clone, Copy, Default, PartialEq, Eq)]
pub struct ClusterListingDiagnosticsSnapshot {
pub local_budget_has_capacity: Option<bool>,
pub internode_stall_timeouts_total: u64,
}
impl From<InternodeMetricsSnapshot> for ClusterListingDiagnosticsSnapshot {
fn from(snapshot: InternodeMetricsSnapshot) -> Self {
Self {
internode_stall_timeouts_total: snapshot.operation_stall_timeouts_total,
..Self::default()
}
}
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct ClusterPoolMetaWriteGateSnapshot {
pub writes_ready: bool,
@@ -147,6 +136,14 @@ impl Default for ClusterPoolMetaWriteGateSnapshot {
}
}
impl From<InternodeMetricsSnapshot> for ClusterListingDiagnosticsSnapshot {
fn from(snapshot: InternodeMetricsSnapshot) -> Self {
Self {
internode_stall_timeouts_total: snapshot.operation_stall_timeouts_total,
}
}
}
impl ClusterRuntimeReadinessState {
fn from_report(report: &DependencyReadinessReport) -> Self {
if report.readiness.storage_ready
@@ -203,14 +200,11 @@ pub fn cluster_read_only_snapshot_from_control_plane(
}
}
pub(crate) async fn collect_cluster_read_only_snapshot(context: &AppContext) -> Option<ClusterReadOnlySnapshot> {
let endpoint_pools = context.endpoints().handle()?;
let store = context.object_store();
pub async fn collect_cluster_read_only_snapshot(endpoint_pools: &EndpointServerPools) -> Option<ClusterReadOnlySnapshot> {
let runtime_status = ClusterRuntimeStatusSnapshot::from_readiness_report(snapshot_dependency_readiness_report().await);
let mut snapshot = cluster_read_only_snapshot_from_endpoint_pools(&endpoint_pools, runtime_status);
let mut snapshot = cluster_read_only_snapshot_from_endpoint_pools(endpoint_pools, runtime_status);
snapshot.usage_freshness = current_usage_freshness_snapshot().await;
snapshot.listing_diagnostics = context.internode_metrics().handle().snapshot().into();
snapshot.listing_diagnostics.local_budget_has_capacity = store.list_read_budget_has_capacity();
snapshot.listing_diagnostics = current_listing_diagnostics_snapshot();
snapshot.pool_meta_write_gate = current_pool_meta_write_gate_snapshot().await;
Some(snapshot)
}
@@ -223,6 +217,11 @@ async fn current_usage_freshness_snapshot() -> ClusterUsageFreshnessSnapshot {
ClusterUsageFreshnessSnapshot::from(&report)
}
fn current_listing_diagnostics_snapshot() -> ClusterListingDiagnosticsSnapshot {
let metrics = crate::runtime_sources::current_internode_metrics().unwrap_or_else(|| global_internode_metrics().clone());
ClusterListingDiagnosticsSnapshot::from(metrics.snapshot())
}
async fn current_pool_meta_write_gate_snapshot() -> ClusterPoolMetaWriteGateSnapshot {
match crate::runtime_sources::current_object_store_handle() {
Some(store) => {
+1 -1
View File
@@ -1282,7 +1282,7 @@ impl ConcurrencyManager {
match state {
AdmissionState::Disabled => admission.with_reason("disk read permits disabled"),
AdmissionState::Saturated => admission.with_reason("all primary disk-backed GET permits are in use"),
AdmissionState::Saturated => admission.with_reason("all disk read permits are in use"),
_ => admission,
}
}
+24 -2
View File
@@ -523,6 +523,7 @@ SCHEDULED_ALERT_CHECKOUT_OVERRIDES = {
".github/workflows/ci.yml": "actions/checkout@f548e57e544e1ff5a4c46bf1e1b8685f8e4a348a",
".github/workflows/fuzz.yml": "actions/checkout@f548e57e544e1ff5a4c46bf1e1b8685f8e4a348a",
".github/workflows/nightly-gnu.yml": "actions/checkout@f548e57e544e1ff5a4c46bf1e1b8685f8e4a348a",
".github/workflows/nightly-rdma.yml": "actions/checkout@f548e57e544e1ff5a4c46bf1e1b8685f8e4a348a",
".github/workflows/runner-hygiene.yml": "actions/checkout@f548e57e544e1ff5a4c46bf1e1b8685f8e4a348a",
".github/workflows/scheduled-validation-watchdog.yml": "actions/checkout@f548e57e544e1ff5a4c46bf1e1b8685f8e4a348a",
".github/workflows/scheduled-validation-freshness.yml": "actions/checkout@f548e57e544e1ff5a4c46bf1e1b8685f8e4a348a",
@@ -1408,12 +1409,19 @@ def check_scheduled_alerts(root: Path) -> list[str]:
errors.append(f"{relative}: missing simple numeric schedule")
continue
minute, hour = map(int, schedule.groups())
if minute == 0:
errors.append(f"{relative}: scheduled validation must avoid minute zero")
entry_end = cron_indices[position + 1] if position + 1 < len(cron_indices) else len(schedule_lines)
entry = "\n".join(schedule_lines[cron_index + 1 : entry_end])
timezone_match = re.search(r"^\s*timezone:\s*[\"']?([^\"'\s]+)", entry, re.MULTILINE)
timezone_name = timezone_match.group(1) if timezone_match else None
# nightly-rdma.yml is pinned to midnight Asia/Shanghai. Every
# other scheduled validation still avoids minute zero. The UTC
# slot is checked for collisions below.
midnight_shanghai = (
relative == ".github/workflows/nightly-rdma.yml"
and (minute, hour, timezone_name) == (0, 0, "Asia/Shanghai")
)
if minute == 0 and not midnight_shanghai:
errors.append(f"{relative}: scheduled validation must avoid minute zero")
try:
utc_slots = schedule_utc_slots(hour, minute, timezone_name)
except ZoneInfoNotFoundError:
@@ -6591,6 +6599,7 @@ class SelfTests(unittest.TestCase):
".github/workflows/ci.yml",
".github/workflows/fuzz.yml",
".github/workflows/nightly-gnu.yml",
".github/workflows/nightly-rdma.yml",
".github/workflows/runner-hygiene.yml",
)
with tempfile.TemporaryDirectory() as tmp:
@@ -6835,6 +6844,19 @@ class SelfTests(unittest.TestCase):
self.assertEqual(len(check_scheduled_alerts(root)), 1)
first.write_text(original)
rdma = root / ".github/workflows/nightly-rdma.yml"
rdma_original = rdma.read_text()
rdma.write_text(re.sub(
r'- cron: "\d+ \d+ \* \* \*"\n',
'- cron: "0 0 * * *"\n timezone: "Asia/Shanghai"\n',
rdma_original,
count=1,
))
self.assertEqual(check_scheduled_alerts(root), [])
rdma.write_text(re.sub(r'- cron: "\d+ \d+', '- cron: "0 0', rdma_original, count=1))
self.assertTrue(any("must avoid minute zero" in error for error in check_scheduled_alerts(root)))
rdma.write_text(rdma_original)
second = root / SCHEDULED_ALERT_WORKFLOWS[1]
second_original = second.read_text()
second.write_text(re.sub(r'- cron: "\d+ \d+', '- cron: "1 1', second_original, count=1))