Skip to content

Commit

Permalink
feat: Moved the benchmarking to be done directly after build, to corr…
Browse files Browse the repository at this point in the history
…ectly used the linked binaries.
  • Loading branch information
maxemiliang committed Apr 20, 2024
1 parent 49b8a1b commit 9053d13
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 22 deletions.
20 changes: 15 additions & 5 deletions .github/workflows/benchmarker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ name: Benchmark
on:
workflow_call:
inputs:
shot_executable:
description: 'The SHOT executable to run'
default: ./SHOT
shot_executable_path:
description: 'The path to the SHOT executable to run'
default: "/SHOT"
required: false
type: string
benchmark_folder:
Expand Down Expand Up @@ -86,10 +86,20 @@ jobs:
name: ${{ inputs.shot_artifact }}
path: ${{ github.workspace }}/shot-benchmarker

- name: Set the SHOT executable path if an artifact is used
if : ${{ inputs.shot_executable_path == '' }}
shell: bash
run: echo "SHOT_EXECUTABLE_PATH=${{ github.workspace }}/shot-benchmarker" >> $GITHUB_ENV

- name: Set the SHOT executable path
if: ${{ inputs.shot_executable_path != '' }}
shell: bash
run: echo "SHOT_EXECUTABLE_PATH=${{ inputs.shot_executable_path }}" >> $GITHUB_ENV

- name: Make SHOT executable
shell: bash
run: |
cd ${{ github.workspace }}/shot-benchmarker
cd ${{ env.SHOT_EXECUTABLE_PATH }}
chmod +x SHOT
- name: Show linked libraries
Expand Down Expand Up @@ -125,7 +135,7 @@ jobs:
INPUT_BENCHMARK_FOLDER: ${{ inputs.benchmark_folder }}
INPUT_BENCHMARK_TYPE: ${{ inputs.benchmark_type }}
INPUT_BENCHMARKS: ${{ inputs.benchmarks }}
INPUT_SHOT_EXECUTABLE: ${{ inputs.shot_executable }}
INPUT_SHOT_EXECUTABLE: ${{ env.SHOT_EXECUTABLE_PATH }}/SHOT
INPUT_IS_GAMS: ${{ inputs.enable_gams }}
INPUT_IS_GUROBI: ${{ inputs.enable_gurobi }}
OS_AUTH_URL: 'https://pouta.csc.fi:5001/v3'
Expand Down
18 changes: 1 addition & 17 deletions .github/workflows/build-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,24 +34,8 @@ jobs:
gurobi_license: ${{ secrets.GUROBI_LICENSE_FILE }}
gams_license: ${{ secrets.GAMS_LICENSE_FILE }}

# Finally, we run some simple benchmarks
benchmark:
name: Benchmark
needs: [ build-test, build-proprietary ]
uses: ./.github/workflows/benchmarker.yml
with:
benchmark_folder: "MINLP-convex-small"
benchmark_type: "nl"
enable_gurobi: false
enable_gams: false
shot_artifact: shot-binary-${{ github.sha }}
secrets:
gurobi_license: ${{ secrets.GUROBI_LICENSE_FILE }}
gams_license: ${{ secrets.GAMS_LICENSE_FILE }}
OS_USERNAME: ${{ secrets.OS_USERNAME }}
OS_PASSWORD: ${{ secrets.OS_PASSWORD }}

# Publish the test results as an output
# Publish the test results as an output
publish-test:
name: Publish test results
needs: [ build-test, build-proprietary, benchmark ]
Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/build-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -347,3 +347,19 @@ jobs:
run: |
rm -f $GRB_LICENSE_FILE
rm -f $GAMS_LICENSE_FILE
# Finally, we run some simple benchmarks
benchmark:
name: Benchmark
uses: ./.github/workflows/benchmarker.yml
with:
shot_executable_path: "${{ github.workspace }}/build"
benchmark_folder: "MINLP-convex-small"
benchmark_type: "nl"
enable_gurobi: ${{ inputs.enable_gurobi }}
enable_gams: ${{ inputs.enable_gams }}
secrets:
gurobi_license: ${{ secrets.GUROBI_LICENSE_FILE }}
gams_license: ${{ secrets.GAMS_LICENSE_FILE }}
OS_USERNAME: ${{ secrets.OS_USERNAME }}
OS_PASSWORD: ${{ secrets.OS_PASSWORD }}

0 comments on commit 9053d13

Please sign in to comment.