diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index 18b590d7f7..cc252fde63 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -11,6 +11,12 @@ inputs: prefetch-cargo: description: Whether to prefetch Cargo downloads on a cache miss. default: "false" + build-deps: + description: > + Whether to build workspace dependencies (make build-deps-slim). Set to + "false" when the environment is only needed to run a prebuilt binary, + like in the case of the nightly tests. + default: "true" outputs: rust-cache-primary-key: @@ -99,5 +105,6 @@ runs: run: find . -iname Cargo.lock -execdir cargo fetch \; - name: Build dependencies + if: inputs.build-deps == 'true' shell: bash run: make build-deps-slim diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 96750dd16b..703dc2b657 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -54,7 +54,7 @@ jobs: make-target: check title: MacOS Checks - runs-on: ubuntu-latest - make-target: durable/database-long-test + make-target: durable/run-database-long-test title: Durable Storage Long Tests name: ${{ matrix.title }} diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 196a9fd43b..0e58c91e5e 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -19,38 +19,84 @@ env: # Make sure Sccache automatically uses the GitHub Actions cache SCCACHE_GHA_ENABLED: "true" + # Time budget (minutes) shared by every nightly run + MAX_MINUTES: "330" + jobs: + # Build the long-test binary once and share it with every matrix job below. + build: + name: "Build database long test binary" + runs-on: ubuntu-latest + timeout-minutes: 90 + + steps: + - name: Checkout + uses: actions/checkout@v7 + + # Save the Nix cache so the test jobs restore this job's dev shell on a + # cache miss, instead of each rebuilding the Nix store independently. + - name: Set up build environment + uses: ./.github/actions/setup + with: + save-nix-cache: true + + - name: Build database_long_test + run: make durable/build-database-long-test + + - name: Upload binary + uses: actions/upload-artifact@v7 + with: + name: database_long_test + path: target/release/database_long_test + if-no-files-found: error + retention-days: 1 + long-test: - name: ${{ matrix.title }} + name: "Database long test ops=${{ matrix.config.ops }} cases=${{ matrix.config.cases }} #${{ matrix.replica }}" + needs: build runs-on: ubuntu-latest - # Up to 6h including setup time + # Up to 6h timeout-minutes: 360 strategy: fail-fast: false matrix: - include: - - title: Durable Storage Database Long Test - make-target: durable/database-long-test-nightly - artifact-name: durable-storage-database-long-test - out-dir: database-long-test + config: + - { ops: 2000, cases: 256 } + - { ops: 4000, cases: 128 } + - { ops: 8000, cases: 64 } + - { ops: 16000, cases: 32 } + replica: [1, 2, 3, 4, 5] steps: - name: Checkout uses: actions/checkout@v7 - - name: Set up build environment uses: ./.github/actions/setup + with: + build-deps: "false" + + - name: Download binary + uses: actions/download-artifact@v7 + with: + name: database_long_test - - name: Run ${{ matrix.title }} - run: make ${{ matrix.make-target }} OUT_DIR='${{ github.workspace }}/${{ matrix.out-dir }}' + - name: Run long test + run: | + chmod +x ./database_long_test # upload-artifact strips the executable bit + ./database_long_test test \ + --ops-per-epoch ${{ matrix.config.ops }} \ + --cases-per-epoch ${{ matrix.config.cases }} \ + --keep-epochs 1 \ + --max-minutes ${{ env.MAX_MINUTES }} \ + --out-dir '${{ github.workspace }}/run-${{ matrix.config.ops }}-${{ matrix.config.cases }}-${{ matrix.replica }}' - name: Upload failure artifacts if: failure() uses: actions/upload-artifact@v7 with: - name: ${{ matrix.artifact-name }}-${{ github.run_id }} - path: ${{ github.workspace }}/${{ matrix.out-dir }}/failure + name: dursto-long-test-${{ matrix.config.ops }}-${{ matrix.config.cases }}-r${{ matrix.replica }}-${{ github.run_id }}-${{ github.run_attempt }} + path: ${{ github.workspace }}/run-${{ matrix.config.ops }}-${{ matrix.config.cases }}-${{ matrix.replica }}/failure if-no-files-found: warn retention-days: 90 diff --git a/durable-storage/Makefile b/durable-storage/Makefile index 4bb80aa654..1bc16edd3f 100644 --- a/durable-storage/Makefile +++ b/durable-storage/Makefile @@ -20,14 +20,11 @@ reset-regressions: @cargo run -p xtask -- gen-database-regression-inputs @UPDATE_GOLDENFILES=1 cargo nextest run test_database_regression -database-long-test: - @cargo run --release --features rocksdb,unstable-test-utils \ - --bin database_long_test -- test --max-minutes 10 --keep-epochs 1 +build-database-long-test: + @cargo build --release --features rocksdb,unstable-test-utils --bin database_long_test -database-long-test-nightly: +run-database-long-test: @cargo run --release --features rocksdb,unstable-test-utils \ - --bin database_long_test -- test \ - --ops-per-epoch 2000 --cases-per-epoch 256 --keep-epochs 1 \ - --max-minutes 300 $(if $(OUT_DIR),--out-dir "$(OUT_DIR)") + --bin database_long_test -- test --max-minutes 10 --keep-epochs 1 -.PHONY: all check test gen-regression-inputs database-long-test database-long-test-nightly +.PHONY: all check test gen-regression-inputs run-database-long-test build-database-long-test