nastra commented on a change in pull request #3304: URL: https://github.com/apache/iceberg/pull/3304#discussion_r731531191
########## File path: .github/workflows/java-ci-bechmarks.yml ########## @@ -0,0 +1,90 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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: "Java CI Benchmark" +on: + pull_request: + types: [ labeled, opened, synchronize, reopened ] + paths-ignore: + - '.github/workflows/python-ci.yml' + - 'python/**' + - 'python_legacy/**' + - 'site/**' + +jobs: + matrix: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.set-matrix.outputs.matrix }} + foundlabel: ${{ steps.set-matrix.outputs.foundlabel }} + steps: + - uses: actions/checkout@v2 + - id: set-matrix + run: | + cat <<EOF > labels.json + ${{ toJson(github.event.pull_request.labels.*) }} + EOF + matrix=$(cat labels.json | jq '.[] | select(.name | startswith("benchmark-")) | .name' | jq .) + 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')" + + show-matrix: + needs: matrix + runs-on: ubuntu-latest + steps: + - run: | + echo ${{ needs.matrix.outputs.matrix }} + echo ${{ needs.matrix.outputs.foundlabel }} + + run-benchmark: + if: ${{ needs.matrix.outputs.foundlabel == 'true' }} + needs: matrix + runs-on: ubuntu-latest + strategy: + matrix: + benchmark: ${{ fromJson(needs.matrix.outputs.matrix) }} + env: + SPARK_LOCAL_IP: localhost + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: 11 + - uses: actions/cache@v2 + with: + path: ~/.gradle/caches + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} + restore-keys: ${{ runner.os }}-gradle + - 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: Get Benchmark to run + id: get_benchmark + run: | + benchmark=$(echo ${{ matrix.benchmark }} | sed 's/benchmark-//g') + echo "::set-output name=BENCHMARK::${benchmark}Benchmark" + + - name: Run Benchmark + run: ./gradlew :iceberg-spark:iceberg-spark3:jmh -PjmhIncludeRegex=${{ steps.get_benchmark.outputs.BENCHMARK }} -PjmhOutputPath=benchmark/${{ steps.get_benchmark.outputs.BENCHMARK }}.txt Review comment: we don't need a randomized value here, as every benchmark execution in the matrix will have its own name, thus the gathered benchmark results will be unique. You can also check the results from my fork run in https://github.com/nastra/iceberg/actions/runs/1354529194 and see that this isn't an issue. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
