SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.
Go blob-storagecloud-drivedistributed-file-systemdistributed-storageerasure-codingfusehadoop-hdfshdfskuberneteslancelancedbobject-storageposixs3s3-storageseaweedfstiered-file-systemvector-search
ci: build test binaries once, share them across shard jobs (#11981)
Chris Lu9b59bc6b0df5
diff --git a/.github/workflows/rust-volume-server-tests.yml b/.github/workflows/rust-volume-server-tests.ymlindex b88a245876..7bcdbaf112 100644--- a/.github/workflows/rust-volume-server-tests.yml+++ b/.github/workflows/rust-volume-server-tests.yml@@ -52,6 +52,63 @@ jobs:- 'seaweed-volume/**'- '.github/workflows/rust-volume-server-tests.yml'+ build-test-binaries:+ name: Build Test Binaries+ runs-on: ubuntu-22.04+ timeout-minutes: 30++ steps:+ - name: Checkout code+ uses: actions/checkout@v7++ - name: Set up Go+ uses: actions/setup-go@v7+ with:+ go-version-file: 'go.mod'++ - name: Install Rust toolchain+ uses: dtolnay/rust-toolchain@stable++ # cargo tracks its own inputs but not the runner's C toolchain, so a cached+ # target/ can carry C objects built against a different glibc than we link against.+ - name: Fingerprint build toolchain+ id: toolchain+ run: echo "fingerprint=$(getconf GNU_LIBC_VERSION | tr ' ' '-')-rustc-$(rustc -V | awk '{print $2}')" >> "$GITHUB_OUTPUT"++ - name: Cache cargo registry and target+ uses: actions/cache@v6+ with:+ path: |+ ~/.cargo/registry+ ~/.cargo/git+ seaweed-volume/target+ key: rust-${{ steps.toolchain.outputs.fingerprint }}-${{ hashFiles('seaweed-volume/Cargo.lock', 'seaweed-common/Cargo.lock') }}+ restore-keys: |+ rust-${{ steps.toolchain.outputs.fingerprint }}-++ - name: Build Go weed binary+ run: |+ cd weed+ go build -tags 5BytesOffset -o weed .+ chmod +x weed+ ./weed version++ - name: Build Rust volume binary+ run: cd seaweed-volume && cargo build --release++ - name: Package binaries+ run: tar cf rust-test-binaries.tar weed/weed seaweed-volume/target/release/weed-volume++ - name: Upload test binaries+ uses: actions/upload-artifact@v7+ with:+ # archive layout mirrors the workspace: weed/weed and+ # seaweed-volume/target/release/weed-volume+ name: rust-test-binaries+ if-no-files-found: error+ retention-days: 1+ path: rust-test-binaries.tar+rust-unit-tests:name: Rust Unit Testsruns-on: ubuntu-22.04@@ -154,6 +211,7 @@ jobs:name: Rust Integration Testsruns-on: ubuntu-22.04timeout-minutes: 30+ needs: [build-test-binaries]steps:- name: Checkout code@@ -164,35 +222,16 @@ jobs:with:go-version-file: 'go.mod'- - name: Install Rust toolchain- uses: dtolnay/rust-toolchain@stable-- # cargo tracks its own inputs but not the runner's C toolchain, so a cached- # target/ can carry C objects built against a different glibc than we link against.- - name: Fingerprint build toolchain- id: toolchain- run: echo "fingerprint=$(getconf GNU_LIBC_VERSION | tr ' ' '-')-rustc-$(rustc -V | awk '{print $2}')" >> "$GITHUB_OUTPUT"-- - name: Cache cargo registry and target- uses: actions/cache@v6+ - name: Download test binaries+ uses: actions/download-artifact@v7with:- path: |- ~/.cargo/registry- ~/.cargo/git- seaweed-volume/target- key: rust-${{ steps.toolchain.outputs.fingerprint }}-${{ hashFiles('seaweed-volume/Cargo.lock', 'seaweed-common/Cargo.lock') }}- restore-keys: |- rust-${{ steps.toolchain.outputs.fingerprint }}-+ name: rust-test-binaries- - name: Build Go weed binary+ - name: Restore binariesrun: |- cd weed- go build -tags 5BytesOffset -o weed .- chmod +x weed- ./weed version-- - name: Build Rust volume binary- run: cd seaweed-volume && cargo build --release+ tar xf rust-test-binaries.tar+ chmod +x weed/weed seaweed-volume/target/release/weed-volume+ ./weed/weed version- name: Run integration testsenv:@@ -228,6 +267,7 @@ jobs:name: Go Tests with Rust Volume (${{ matrix.test-type }} - Shard ${{ matrix.shard }})runs-on: ubuntu-22.04timeout-minutes: 45+ needs: [build-test-binaries]env:# Keep in step with the length of matrix.shard below.SHARD_COUNT: 3@@ -246,35 +286,17 @@ jobs:with:go-version-file: 'go.mod'- - name: Install Rust toolchain- uses: dtolnay/rust-toolchain@stable-- # cargo tracks its own inputs but not the runner's C toolchain, so a cached- # target/ can carry C objects built against a different glibc than we link against.- - name: Fingerprint build toolchain- id: toolchain- run: echo "fingerprint=$(getconf GNU_LIBC_VERSION | tr ' ' '-')-rustc-$(rustc -V | awk '{print $2}')" >> "$GITHUB_OUTPUT"-- - name: Cache cargo registry and target- uses: actions/cache@v6+ - name: Download test binaries+ uses: actions/download-artifact@v7with:- path: |- ~/.cargo/registry- ~/.cargo/git- seaweed-volume/target- key: rust-${{ steps.toolchain.outputs.fingerprint }}-${{ hashFiles('seaweed-volume/Cargo.lock', 'seaweed-common/Cargo.lock') }}- restore-keys: |- rust-${{ steps.toolchain.outputs.fingerprint }}-+ name: rust-test-binaries- - name: Build Go weed binary+ - name: Restore binariesrun: |- cd weed- go build -tags 5BytesOffset -o weed .- chmod +x weed- ./weed version-- - name: Build Rust volume binary- run: cd seaweed-volume && cargo build --release+ tar xf rust-test-binaries.tar+ chmod +x weed/weed seaweed-volume/target/release/weed-volume+ ./weed/weed version+ ./seaweed-volume/target/release/weed-volume --help >/dev/null || true# Dealing the listed tests out one by one keeps the shards even. Bucketing# them by first letter did not: names cluster, so ^Test[I-S] drew 50 ofdiff --git a/.github/workflows/volume-server-integration-tests.yml b/.github/workflows/volume-server-integration-tests.ymlindex 9bea478215..a1f98648e6 100644--- a/.github/workflows/volume-server-integration-tests.yml+++ b/.github/workflows/volume-server-integration-tests.yml@@ -33,10 +33,43 @@ env:SHARD_COUNT: 3jobs:+ build-weed:+ name: Build SeaweedFS Binary+ runs-on: ubuntu-22.04+ timeout-minutes: 15++ steps:+ - name: Checkout code+ uses: actions/checkout@v7++ - name: Set up Go+ uses: actions/setup-go@v7+ with:+ go-version-file: 'go.mod'++ - name: Build SeaweedFS binary+ run: |+ cd weed+ go build -o weed .+ chmod +x weed+ ./weed version++ - name: Package binary+ run: tar cf weed-binary.tar weed/weed++ - name: Upload binary+ uses: actions/upload-artifact@v7+ with:+ name: weed-binary+ if-no-files-found: error+ retention-days: 1+ path: weed-binary.tar+volume-server-integration-tests:name: Volume Server Integration Tests (${{ matrix.test-type }} - Shard ${{ matrix.shard }})runs-on: ubuntu-22.04timeout-minutes: 45+ needs: [build-weed]strategy:fail-fast: falsematrix:@@ -52,12 +85,16 @@ jobs:with:go-version-file: 'go.mod'- - name: Build SeaweedFS binary+ - name: Download binary+ uses: actions/download-artifact@v7+ with:+ name: weed-binary++ - name: Restore binaryrun: |- cd weed- go build -o weed .- chmod +x weed- ./weed version+ tar xf weed-binary.tar+ chmod +x weed/weed+ ./weed/weed version# Dealing the listed tests out one by one keeps the shards even. Bucketing# them by first letter did not: names cluster, so ^Test[I-S] drew 50 of