Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 19 additions & 8 deletions .github/workflows/jmh-benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,10 @@ jobs:
repository: ${{ github.event.inputs.repo }}
ref: ${{ github.event.inputs.ref }}
- id: set-matrix
env:
BENCHMARKS_INPUT: ${{ github.event.inputs.benchmarks }}
run: |
matrix=$(echo '[${{ github.event.inputs.benchmarks }}]' | jq '.[] | select(endswith("Benchmark")) | .')
matrix=$(echo "[$BENCHMARKS_INPUT]" | jq '.[] | select(endswith("Benchmark")) | .')
matrix=$(echo $matrix | sed 's/ /,/g' | sed 's/"/\"/g')
echo "::set-output name=matrix::[$matrix]"
echo "::set-output name=foundlabel::$(echo "[$matrix]" | jq 'if . | length > 0 then true else false end')"
Expand All @@ -57,12 +59,18 @@ jobs:
needs: matrix
runs-on: ubuntu-22.04
steps:
- run: |
echo "Repo: ${{ github.event.inputs.repo }}"
echo "Ref: ${{ github.event.inputs.ref }}"
echo "Benchmarks: ${{ needs.matrix.outputs.matrix }}"
echo "Spark Project Version: ${{ needs.matrix.outputs.spark_version }}"
echo "Found Benchmarks? ${{ needs.matrix.outputs.foundlabel }}"
- env:
INPUT_REPO: ${{ github.event.inputs.repo }}
INPUT_REF: ${{ github.event.inputs.ref }}
INPUT_SPARK_VERSION: ${{ github.event.inputs.spark_version }}
MATRIX_OUTPUT: ${{ needs.matrix.outputs.matrix }}
FOUNDLABEL_OUTPUT: ${{ needs.matrix.outputs.foundlabel }}
run: |
echo "Repo: $INPUT_REPO"
echo "Ref: $INPUT_REF"
echo "Benchmarks: $MATRIX_OUTPUT"
echo "Spark Project Version: $INPUT_SPARK_VERSION"
echo "Found Benchmarks? $FOUNDLABEL_OUTPUT"

run-benchmark:
if: ${{ needs.matrix.outputs.foundlabel == 'true' }}
Expand All @@ -74,6 +82,7 @@ jobs:
benchmark: ${{ fromJson(needs.matrix.outputs.matrix) }}
env:
SPARK_LOCAL_IP: localhost
SPARK_VERSION: ${{ github.event.inputs.spark_version }}
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -93,7 +102,9 @@ jobs:
- run: echo -e "$(ip addr show eth0 | grep "inet\b" | awk '{print $2}' | cut -d/ -f1)\t$(hostname -f) $(hostname -s)" | sudo tee -a /etc/hosts

- name: Run Benchmark
run: ./gradlew :iceberg-spark:${{ github.event.inputs.spark_version }}:jmh -PjmhIncludeRegex=${{ matrix.benchmark }} -PjmhOutputPath=benchmark/${{ matrix.benchmark }}.txt
env:
BENCHMARK: ${{ matrix.benchmark }}
run: ./gradlew ":iceberg-spark:${SPARK_VERSION}:jmh" "-PjmhIncludeRegex=${BENCHMARK}" "-PjmhOutputPath=benchmark/${BENCHMARK}.txt"

- uses: actions/upload-artifact@v4
if: ${{ always() }}
Expand Down