diff --git a/.github/scheduled-validations.json b/.github/scheduled-validations.json index 0d30e7d15c..50f4d3b6a5 100644 --- a/.github/scheduled-validations.json +++ b/.github/scheduled-validations.json @@ -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": [ + "37 0 * * *" + ], + "owner": "@overtrue", + "policy": "active", + "monitor": "workflow", + "max_age_hours": 36, + "result_owner": "nightly-rdma.yml", + "disposition": "independent RDMA/NIXL nightly package; does not dispatch nightly-candidate-ready or join the functional chain", + "failure_owner": "workflow", + "origin": "added", + "alert_contract": "scheduled-validation" + }, { "workflow": ".github/workflows/nix-flake-update.yml", "name": "Update Nix Flake", diff --git a/.github/workflows/README.md b/.github/workflows/README.md index e8890ff618..59764461c3 100644 --- a/.github/workflows/README.md +++ b/.github/workflows/README.md @@ -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. diff --git a/.github/workflows/nightly-rdma.yml b/.github/workflows/nightly-rdma.yml new file mode 100644 index 0000000000..671e5d5c6b --- /dev/null +++ b/.github/workflows/nightly-rdma.yml @@ -0,0 +1,617 @@ +# 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 00:37 Asia/Shanghai, thirty minutes after nightly-gnu.yml. +# 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: "37 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- + # (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= + # RUSTFS_SECRET_KEY= + # 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 + 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" + + # Rolling release on rustfs/auto-testing tag nightly-rdma. Separate from + # the GNU nightly tag, so this step never reads or patches that release + # body. Skipped when PF_TESTING_GH_TOKEN is not configured. + - name: Publish package to auto-testing nightly-rdma release + env: + ASSETS_TOKEN: ${{ secrets.PF_TESTING_GH_TOKEN }} + DEB_FILE: rustfs-nightly-rdma-latest.deb + DEB_DATE: ${{ steps.deb.outputs.deb_date }} + BUILD_REF: ${{ env.NIGHTLY_BUILD_REF }} + shell: bash + run: | + set -euo pipefail + + if [[ -z "${ASSETS_TOKEN}" ]]; then + echo "PF_TESTING_GH_TOKEN is missing, skipping nightly-rdma release publish" + exit 0 + fi + + : "${DEB_FILE:?DEB_FILE is required}" + : "${DEB_DATE:?DEB_DATE is required}" + : "${BUILD_REF:?BUILD_REF 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-rdma" + ASSET_NAME="rustfs-nightly-rdma-latest.deb" + SOURCE_SHA="$(git rev-parse HEAD)" + + 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-rdma release" + create_body="$(python3 - <<'PY' + import json + print(json.dumps({ + "tag_name": "nightly-rdma", + "name": "Nightly RDMA builds", + "body": "Rolling RDMA/NIXL nightly builds. The asset is replaced on every build. This release is separate from the GNU nightly tag.", + })) + PY + )" + release_id="$(curl -fsS --retry 3 -X POST -H "${AUTH}" -H "Content-Type: application/json" \ + -d "${create_body}" \ + "${API}/releases" | python3 -c 'import json,sys; print(json.load(sys.stdin)["id"])')" + fi + [[ -n "${release_id}" ]] || { echo "could not resolve the nightly-rdma 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"] + 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 "uploaded ${ASSET_NAME}" + + DEB_SHA="$(sha256sum "${DEB_FILE}" | awk '{print $1}')" + RUN_URL="${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}" + export BUILD_REF SOURCE_SHA DEB_DATE DEB_FILE DEB_SHA RUN_URL + python3 - <<'PY' > "${RUNNER_TEMP}/nightly-rdma-release-body.json" + import json + import os + env = os.environ + size_mb = os.path.getsize(env["DEB_FILE"]) // 1048576 + body = ( + f"RDMA/NIXL nightly from `{env['BUILD_REF']}@{env['SOURCE_SHA'][:12]}`, built {env['DEB_DATE']}.\n\n" + f"[Build run]({env['RUN_URL']}). This rolling `nightly-rdma` release is separate from the GNU `nightly` tag. " + "The asset is replaced in place on every build.\n\n" + "| Asset | Size | SHA256 |\n|---|---|---|\n" + f"| rustfs-nightly-rdma-latest.deb | {size_mb} MB | `{env['DEB_SHA']}` |\n" + ) + print(json.dumps({"body": body})) + PY + curl -fsS --retry 3 -X PATCH -H "${AUTH}" -H "Content-Type: application/json" \ + --data-binary @"${RUNNER_TEMP}/nightly-rdma-release-body.json" \ + "${API}/releases/${release_id}" >/dev/null + echo "published ${DEB_FILE} to the rustfs/auto-testing nightly-rdma release" + + 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 }} diff --git a/docs/testing/ci-gates.md b/docs/testing/ci-gates.md index 9582718eaa..2da638bc0f 100644 --- a/docs/testing/ci-gates.md +++ b/docs/testing/ci-gates.md @@ -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 --require-meta` | | `coverage.yml` (weekly) | `coverage` | report-only trend; lcov and JSON artifact | yes (disabled) | `make coverage` | diff --git a/scripts/check_test_wiring.py b/scripts/check_test_wiring.py index 3c204e591f..44bd74897d 100755 --- a/scripts/check_test_wiring.py +++ b/scripts/check_test_wiring.py @@ -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", @@ -6591,6 +6592,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: