From c1e170d4071706cf662137dfab591b06d9c61fc5 Mon Sep 17 00:00:00 2001 From: Stanley Brubaker Date: Wed, 30 Sep 2026 12:16:08 -0600 Subject: [PATCH 01/13] Updating workflows and server clear for two always-on servers --- .github/scripts/run-ssh-local.sh | 6 +++++- .github/scripts/setup-ssh-local.sh | 5 +++++ .../adhoc-auto-remote-benchmarks.yml | 19 +++---------------- .../adhoc-exist-remote-benchmarks.yml | 16 +--------------- .../workflows/compare-remote-benchmarks.yml | 3 ++- .../matrix-exist-remote-benchmarks.yml | 19 +++---------------- .../workflows/nightly-remote-benchmarks.yml | 1 + .../workflows/release-remote-benchmarks.yml | 3 ++- .github/workflows/remote-benchmarks.yml | 17 +++++++++++++++-- docs/ForkSetup.md | 3 ++- 10 files changed, 39 insertions(+), 53 deletions(-) diff --git a/.github/scripts/run-ssh-local.sh b/.github/scripts/run-ssh-local.sh index 54dee93d..2c7ec3f7 100755 --- a/.github/scripts/run-ssh-local.sh +++ b/.github/scripts/run-ssh-local.sh @@ -41,4 +41,8 @@ for ((attempt=1; attempt<=MAX_RETRIES; attempt++)); do fi done -ssh -o 'ConnectTimeout 10' -o 'ServerAliveInterval 60' ${USER}@${HOST} 'bash -s' -- "${args[@]}" < ${SCRIPT_DIR}/${SCRIPT_NAME}.sh |& tee logs/${SCRIPT_NAME}.log +# Keep the server address out of the log file, which is uploaded as a public artifact. Github masks +# secrets in the live log stream but not in files, and ssh names the host in its connection errors. +HOST_PATTERN=$(printf '%s' "${HOST}" | sed 's/[^a-zA-Z0-9-]/\\&/g') + +ssh -o 'ConnectTimeout 10' -o 'ServerAliveInterval 60' ${USER}@${HOST} 'bash -s' -- "${args[@]}" < ${SCRIPT_DIR}/${SCRIPT_NAME}.sh |& sed -u "s/${HOST_PATTERN}//g" | tee logs/${SCRIPT_NAME}.log diff --git a/.github/scripts/setup-ssh-local.sh b/.github/scripts/setup-ssh-local.sh index d5abb504..06634f04 100644 --- a/.github/scripts/setup-ssh-local.sh +++ b/.github/scripts/setup-ssh-local.sh @@ -17,6 +17,11 @@ if [[ $# != 2 ]]; then exit 1 fi +if [[ "${HOST}" == "<"*">" ]]; then + echo "$0: Host '${HOST}' was not resolved. Is the matching BENCHMARK_HOST_* secret set?" + exit 1 +fi + mkdir -p logs mkdir -p results mkdir -p ~/.ssh/ diff --git a/.github/workflows/adhoc-auto-remote-benchmarks.yml b/.github/workflows/adhoc-auto-remote-benchmarks.yml index 5febda41..33717c9e 100644 --- a/.github/workflows/adhoc-auto-remote-benchmarks.yml +++ b/.github/workflows/adhoc-auto-remote-benchmarks.yml @@ -111,26 +111,12 @@ jobs: scale_row_count: ${{ needs.setup-benchmark-system.outputs.test_row_count }} distribution: ${{ inputs.distribution }} test_device_addr: ${{ needs.setup-benchmark-system.outputs.metal_ip_addr }} + clear_server: true config_options: "" secrets: inherit - clear-between-runs: - needs: [setup-benchmark-system, process-adhoc-benchmarks-1] - runs-on: ubuntu-24.04 - env: - SD: .github/scripts - HOST: ${{ needs.setup-benchmark-system.outputs.metal_ip_addr }} - USER: ${{ secrets.BENCHMARK_USER }} - steps: - - uses: actions/checkout@v4 - - name: Clear Remote Test Server - run: | - sudo chmod +x ${SD}/* - ${SD}/setup-ssh-local.sh ${HOST} "${{ secrets.BENCHMARK_KEY }}" - ${SD}/run-ssh-local.sh ${HOST} ${USER} ${SD} clear-test-server-remote - process-adhoc-benchmarks-2: - needs: [setup-benchmark-system, clear-between-runs] + needs: [setup-benchmark-system, process-adhoc-benchmarks-1] uses: ./.github/workflows/remote-benchmarks.yml with: run_type: adhoc @@ -142,6 +128,7 @@ jobs: scale_row_count: ${{ needs.setup-benchmark-system.outputs.test_row_count }} distribution: ${{ inputs.distribution }} test_device_addr: ${{ needs.setup-benchmark-system.outputs.metal_ip_addr }} + clear_server: true config_options: "" secrets: inherit diff --git a/.github/workflows/adhoc-exist-remote-benchmarks.yml b/.github/workflows/adhoc-exist-remote-benchmarks.yml index 6bd6510e..fa122711 100644 --- a/.github/workflows/adhoc-exist-remote-benchmarks.yml +++ b/.github/workflows/adhoc-exist-remote-benchmarks.yml @@ -55,22 +55,7 @@ on: - runlength jobs: - clear-benchmark-system: - runs-on: ubuntu-24.04 - env: - SD: .github/scripts - HOST: ${{ secrets.BENCHMARK_HOST }} - USER: ${{ secrets.BENCHMARK_USER }} - steps: - - uses: actions/checkout@v4 - - name: Clear Remote Test Server - run: | - sudo chmod +x ${SD}/* - ${SD}/setup-ssh-local.sh ${HOST} "${{ secrets.BENCHMARK_KEY }}" - ${SD}/run-ssh-local.sh ${HOST} ${USER} ${SD} clear-test-server-remote - setup-benchmark-system: - needs: clear-benchmark-system runs-on: ubuntu-24.04 outputs: test_row_count: ${{ steps.scale-nums.outputs.TEST_ROW_COUNT }} @@ -99,6 +84,7 @@ jobs: scale_row_count: ${{ needs.setup-benchmark-system.outputs.test_row_count }} distribution: ${{ inputs.distribution }} test_device_addr: "" + clear_server: true config_options: "${{ inputs.config_options }}" secrets: inherit diff --git a/.github/workflows/compare-remote-benchmarks.yml b/.github/workflows/compare-remote-benchmarks.yml index 0bd95d6d..8e139319 100644 --- a/.github/workflows/compare-remote-benchmarks.yml +++ b/.github/workflows/compare-remote-benchmarks.yml @@ -28,6 +28,7 @@ jobs: test_iterations: 5 scale_row_count: 70000000 distribution: random - test_device_addr: "" + test_device_addr: "" + clear_server: true config_options: "" secrets: inherit diff --git a/.github/workflows/matrix-exist-remote-benchmarks.yml b/.github/workflows/matrix-exist-remote-benchmarks.yml index 24814a00..7b4c69c7 100644 --- a/.github/workflows/matrix-exist-remote-benchmarks.yml +++ b/.github/workflows/matrix-exist-remote-benchmarks.yml @@ -33,22 +33,8 @@ jobs: run: | .github/scripts/build-matrix.sh ".github/matrix/${{ inputs.matrix_file }}" - clear-server: - runs-on: ubuntu-24.04 - env: - SD: .github/scripts - HOST: ${{ secrets.BENCHMARK_HOST }} - USER: ${{ secrets.BENCHMARK_USER }} - steps: - - uses: actions/checkout@v4 - - name: Clear Remote Server - run: | - sudo chmod +x ${SD}/* - ${SD}/setup-ssh-local.sh ${HOST} "${{ secrets.BENCHMARK_KEY }}" - ${SD}/run-ssh-local.sh ${HOST} ${USER} ${SD} clear-test-server-remote - run-benchmarks: - needs: [generate-matrix, clear-server] + needs: generate-matrix strategy: fail-fast: false max-parallel: 1 @@ -64,6 +50,7 @@ jobs: test_iterations: ${{ matrix.test_iterations }} scale_row_count: ${{ matrix.scale_row_count }} distribution: ${{ matrix.distribution }} - test_device_addr: "" + test_device_addr: "" + clear_server: ${{ strategy.job-index == 0 }} config_options: ${{ matrix.config_options }} secrets: inherit diff --git a/.github/workflows/nightly-remote-benchmarks.yml b/.github/workflows/nightly-remote-benchmarks.yml index ba59791d..b0975309 100644 --- a/.github/workflows/nightly-remote-benchmarks.yml +++ b/.github/workflows/nightly-remote-benchmarks.yml @@ -24,5 +24,6 @@ jobs: scale_row_count: 10000000 distribution: random test_device_addr: "" + clear_server: true config_options: "" secrets: inherit diff --git a/.github/workflows/release-remote-benchmarks.yml b/.github/workflows/release-remote-benchmarks.yml index abf16dd2..78a47006 100644 --- a/.github/workflows/release-remote-benchmarks.yml +++ b/.github/workflows/release-remote-benchmarks.yml @@ -38,6 +38,7 @@ jobs: test_iterations: 5 scale_row_count: 10000000 distribution: random - test_device_addr: "" + test_device_addr: "" + clear_server: true config_options: "" secrets: inherit diff --git a/.github/workflows/remote-benchmarks.yml b/.github/workflows/remote-benchmarks.yml index d6a615d2..5544496e 100644 --- a/.github/workflows/remote-benchmarks.yml +++ b/.github/workflows/remote-benchmarks.yml @@ -4,6 +4,11 @@ # - This workflow is reusable with run_type set to release or nightly # - Scripts ending in "-local" run on the github runner # - Scripts ending in "-remote" run are executed on the remote test server through ssh +# - test_device_addr picks the server: is BENCHMARK_HOST_NIGHT (adhoc-existing, nightly), +# is BENCHMARK_HOST_MATRIX (compare, release, matrix), anything else is used as an ip +# - Since the concurrency group is test_device_addr, the two always-on servers do not block each other +# - Clearing a server must happen here rather than in a calling workflow, since only this workflow holds +# the concurrency group. A caller that clears on its own can wipe a run already in progress. name: Benchmark Test on Docker Deephaven @@ -35,14 +40,22 @@ on: required: true type: string test_device_addr: + description: 'Server ip, or for the nightly host, or for the matrix host' required: true type: string + clear_server: + description: 'Wipe artifacts, containers, images, and data before setup' + required: true + type: boolean config_options: required: true type: string env: - HOST: "${{ inputs.test_device_addr == '' && secrets.BENCHMARK_HOST || inputs.test_device_addr }}" + HOST: >- + ${{ inputs.test_device_addr == '' && secrets.BENCHMARK_HOST_NIGHT + || inputs.test_device_addr == '' && secrets.BENCHMARK_HOST_MATRIX + || inputs.test_device_addr }} concurrency: group: ${{ inputs.test_device_addr }} @@ -77,7 +90,7 @@ jobs: ${SD}/setup-ssh-local.sh ${HOST} "${{secrets.BENCHMARK_KEY}}" - name: Clear Remote Test Server - if: ${{ env.RUN_TYPE != 'adhoc' }} + if: ${{ inputs.clear_server }} run: | ${SD}/run-ssh-local.sh ${HOST} ${USER} ${SD} clear-test-server-remote diff --git a/docs/ForkSetup.md b/docs/ForkSetup.md index b566b26d..e979dc3c 100644 --- a/docs/ForkSetup.md +++ b/docs/ForkSetup.md @@ -15,7 +15,8 @@ Not all secrets are required for each workflow. In the following table, each sec | Variable | Description | Shared (Ask Admin) | Optional | | -------------------------- | --------------------------------------------------------------------- | ------------------ | -------- | | BENCHMARK_GCLOUD | The GCloud Service Account Key (credentials) in JSON format | Yes | No | -| BENCHMARK_HOST | The host ip for an existing (non-auto-provisioned) server | No | No | +| BENCHMARK_HOST_NIGHT | Host ip of the always-on server used by adhoc-existing and nightly | No | No | +| BENCHMARK_HOST_MATRIX | Host ip of the always-on server used by compare, release, and matrix | No | No | | BENCHMARK_USER | The "run as" user for running benchmarks on the server | No | No | | BENCHMARK_KEY | A private key used by SSH corresponding to a public key on the server | No | No | | BENCHMARK_METAL_AUTH_TOKEN | The key/secret required to access the bare metal provider API | Yes | No | From 638cbe7900b68c8ce6e54a5761b36f9eefe298ec Mon Sep 17 00:00:00 2001 From: Stanley Brubaker Date: Thu, 1 Oct 2026 12:14:14 -0600 Subject: [PATCH 02/13] Reworked Release runs to use matrix --- .github/matrix/example-regression-matrix.sh | 5 +- .github/matrix/gc-train-1000-100.sh | 10 ++-- .github/matrix/gc-train-heap-fail.sh | 5 +- .github/matrix/release.sh | 39 +++++++++++++ .github/scripts/build-matrix.sh | 22 +++++++- .github/scripts/fetch-results-local.sh | 35 +++++++----- .github/scripts/run-ssh-local.sh | 3 +- .../matrix-exist-remote-benchmarks.yml | 2 +- .../workflows/release-remote-benchmarks.yml | 56 +++++++++++++------ .github/workflows/remote-benchmarks.yml | 9 +-- 10 files changed, 136 insertions(+), 50 deletions(-) create mode 100755 .github/matrix/release.sh diff --git a/.github/matrix/example-regression-matrix.sh b/.github/matrix/example-regression-matrix.sh index 73062996..1640d97b 100755 --- a/.github/matrix/example-regression-matrix.sh +++ b/.github/matrix/example-regression-matrix.sh @@ -29,10 +29,11 @@ # Class lists omit the Test suffix: ConsoleLauncherUtil appends it, so 'UserFormulaTest' matches # nothing and the run reports zero benchmarks rather than failing. # -# TSV columns: run_label, docker_image, test_package, test_class_list, +# TSV columns: run_type, run_label, docker_image, test_package, test_class_list, # test_iterations, scale_row_count, distribution, config_options EXPECTED_COMBOS=5 +RTYP='adhoc' PKG=io.deephaven.benchmark.tests.standard CLASSES='UserFormula' DIST=random @@ -49,7 +50,7 @@ jfr_opts() { TOP=deephaven:c50cd7f2fc02b819376a80e8767dff76c0624aa2 # $3 is config_options, defaulting to a JFR recording named after the row -row() { echo -e "$1\t$2\t$PKG\t$CLASSES\t$ITERS\t$ROWSM\t$DIST\t${3:-$(jfr_opts "$1")}"; } +row() { echo -e "$RTYP\t$1\t$2\t$PKG\t$CLASSES\t$ITERS\t$ROWSM\t$DIST\t${3:-$(jfr_opts "$1")}"; } row anchor_img_0911 "$ANCHOR" row src_base deephaven:9fa9e83c55ccb2e9ddedd61d1ba59d2d8da68c85 diff --git a/.github/matrix/gc-train-1000-100.sh b/.github/matrix/gc-train-1000-100.sh index 34e3c13f..d7d254d3 100755 --- a/.github/matrix/gc-train-1000-100.sh +++ b/.github/matrix/gc-train-1000-100.sh @@ -1,8 +1,9 @@ # Compare GC configurations across cycle times and profiles -# TSV columns: run_label, docker_image, test_package, test_class_list, +# TSV columns: run_type, run_label, docker_image, test_package, test_class_list, # test_iterations, scale_row_count, distribution, config_options EXPECTED_COMBOS=32 +RTYP='adhoc' IMG=ghcr.io/stanbrub/server:jvm25 PKG=io.deephaven.benchmark.tests.train CLS='*Train' @@ -23,11 +24,12 @@ R="$IMG\t$PKG\t$CLS\t$ITERS\t$ROWSM\t$DIST" # emit