-
Notifications
You must be signed in to change notification settings - Fork 24
140 lines (125 loc) · 4.53 KB
/
benchmarker.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
name: Benchmark
on:
workflow_call:
inputs:
shot_executable:
description: 'The SHOT executable to run'
default: ./../shot-binary/SHOT
required: false
type: string
benchmark_folder:
description: 'The benchmark to run (folder name from: https://github.com/andreaslundell/SHOT_benchmark_problems)'
default: "MINLP-convex-small"
required: false
type: string
benchmark_type:
description: 'The benchmark type to run, can be gms, nl or osil'
default: "nl"
required: false
type: string
benchmarks:
description: 'The benchmarks to run, can be a list of benchmarks or a single benchmark, defaults to all benchmarks'
default: "all"
required: false
type: string
enable_gurobi:
description: 'Is this a Gurobi build (this will install Gurobi)'
default: false
required: false
type: boolean
enable_gams:
description: 'Is this a GAMS build (this will install GAMS)'
default: false
required: false
type: boolean
shot_artifact:
description: 'The SHOT artifact to use'
default: ""
required: false
type: string
secrets:
gurobi_license:
description: 'Gurobi license file secret'
required: false
gams_license:
description: 'GAMS license file secret'
required: false
OS_USERNAME:
description: 'OpenStack username'
required: true
OS_PASSWORD:
description: 'OpenStack password'
required: true
outputs:
benchmarks:
description: 'The benchmarks that were run'
value: ${{ jobs.benchmark.outputs.benchmarks }}
env:
GRB_LICENSE_FILE: ${{ github.workspace }}/gurobi.lic
GAMS_LICENSE_FILE: ${{ github.workspace }}/ThirdParty/gams42.3_linux_x64_64_sfx/gamslice.txt
jobs:
benchmark:
outputs:
benchmarks: ${{ steps.benchmark.outputs.benchmarks }}
name: Benchmark SHOT
runs-on: [ self-hosted, linux, cmake ]
steps:
- name: Fetch SHOT artifact
if: ${{ inputs.shot_artifact != '' }}
uses: actions/download-artifact@v3
with:
name: ${{ inputs.shot_artifact }}
path: ${{ github.workspace }}/shot-binary
- shell: bash
run: git -C shot-benchmarker pull || git clone https://github.com/maxemiliang/shot-benchmarker.git
- uses: actions/setup-python@v4
with:
python-version: 3.11
cache: 'pip'
- shell: bash
run: pip install -r requirements.txt
working-directory: ${{ github.workspace }}/shot-benchmarker
# Add the license file to the GAMS installation directory
- name: Setup GAMS License file
if: ${{ inputs.enable_gams }}
shell: bash
working-directory: ${{ github.workspace }}
run: echo ${{ secrets.gams_license }} | base64 -d > $GAMS_LICENSE_FILE
- name: Setup Gurobi License file
if: ${{ inputs.enable_gurobi }}
shell: bash
working-directory: ${{ github.workspace }}
run: echo ${{ secrets.gurobi_license }} | base64 -d > $GRB_LICENSE_FILE
- shell: bash
id: benchmark
env:
INPUT_BENCHMARK_FOLDER: ${{ inputs.benchmark_folder }}
INPUT_BENCHMARK_TYPE: ${{ inputs.benchmark_type }}
INPUT_BENCHMARKS: ${{ inputs.benchmarks }}
INPUT_SHOT_EXECUTABLE: ${{ inputs.shot_executable }}
INPUT_IS_GAMS: ${{ inputs.enable_gams }}
INPUT_IS_GUROBI: ${{ inputs.enable_gurobi }}
OS_AUTH_URL: 'https://pouta.csc.fi:5001/v3'
OS_PROJECT_ID: '230dabcfb234424cb77e7de501ef7efc'
OS_PROJECT_NAME: 'project_2001223'
OS_USER_DOMAIN_NAME: "Default"
OS_PROJECT_DOMAIN_ID: "default"
OS_USERNAME: '${{ secrets.OS_USERNAME }}'
OS_PASSWORD: '${{ secrets.OS_PASSWORD }}'
OS_REGION_NAME: "regionOne"
OS_INTERFACE: "public"
OS_IDENTITY_API_VERSION: "3"
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
working-directory: ${{ github.workspace }}/shot-benchmarker
run: python main.py -c -s --runs 5
- name: Upload benchmarks
uses: actions/upload-artifact@v3
with:
name: benchmarks-${{ github.sha }}
path: ${{ github.workspace }}/shot-benchmarker/benchmarks
- name: Cleanup license files
if: ${{ success() || failure() }}
shell: bash
run: |
rm -f $GRB_LICENSE_FILE
rm -f $GAMS_LICENSE_FILE