-
Notifications
You must be signed in to change notification settings - Fork 2
260 lines (251 loc) · 15.3 KB
/
experiment.yaml
File metadata and controls
260 lines (251 loc) · 15.3 KB
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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
name: Experiment
on:
workflow_dispatch:
inputs:
repository:
description: "GitHub repository to run the experiment"
required: true
default: "cdsap/ExperimentGradle8.9"
variantA:
description: "Experiment branch name for variant A"
required: true
default: "gradle_8_9_no_caching_transforms"
variantB:
description: "Experiment branch name for variant B"
required: true
default: "gradle_8_9_no_caching_transforms"
task:
description: "Gradle task to be executed"
required: true
default: ":core:model:compileKotlin"
iterations:
description: "Number of iterations for the experiment"
required: true
default: 10
mode:
description: "Type of execution relative to caching"
type: choice
required: true
default: 'dependencies cache'
options:
- 'no caching'
- 'dependencies cache'
- 'dependencies cache - transforms cache'
- 'local task cache'
- 'local task cache + dependencies cache'
- 'local task cache - transforms cache'
- 'local task cache + dependencies cache - transforms cache'
- 'remote task cache'
- 'remote task cache + dependencies cache'
- 'remote task cache - transforms cache'
- 'remote task cache + dependencies cache - transforms cache'
- 'dependencies cache - javaCompile cache'
os_args:
description: "Operating system configurations for variants"
type: string
default: "{variantA:'ubuntu-latest',variantB:'ubuntu-latest'}"
required: true
java_args:
description: "JDK vendor and version for each variant"
type: string
default: "{javaVersionVariantA:'23',javaVersionVariantB:'23',javaVendorVariantA:'zulu',javaVendorVariantB:'zulu'}"
required: true
extra_build_args:
description: "Extra build arguments for each variant"
type: string
default: "{extraArgsVariantA:' ',extraArgsVariantB:' '}"
required: true
extra_report_args:
description: "Configuration for generating reports"
type: string
default: "{deploy_results:'false',experiment_title:'', open_ai_request:'false', report_enabled:'true',tasktype_report:'true',taskpath_report:'true',kotlin_build_report:'false',process_report:'false',resource_usage_report:'true',gc_report:'false',only_cacheable_outcome:'false',threshold_task_duration:'1000'}"
required: true
run-name: "${{ github.event.inputs.repository }}-${{ github.event.inputs.mode }}-${{ github.event.inputs.variantA }}-${{ github.event.inputs.variantB }}-${{ github.event.inputs.task }}"
jobs:
iterations:
name: Generate Iterations
runs-on: ubuntu-latest
steps:
- id: calculate_iterations
run: |
iterations="["
for i in {1..${{ github.event.inputs.iterations }}}
do
if [ $i == 1 ]; then
iterations="$iterations \"$i\""
else
iterations="$iterations, \"$i\""
fi
done
iterations="$iterations ]"
echo "iterations=$iterations" >> $GITHUB_OUTPUT
outputs:
iterations: ${{ steps.calculate_iterations.outputs.iterations }}
seed:
name: Seed Job
if: github.event.inputs.mode != 'no caching'
needs: [iterations]
strategy:
matrix:
config:
- variant: ${{ github.event.inputs.variantA }}
index: 0
- variant: ${{ github.event.inputs.variantB }}
index: 1
runs-on: "${{ (matrix.config.variant == github.event.inputs.variantA) && matrix.config.index == 0 && fromJson(github.event.inputs.os_args).variantA || (matrix.config.variant == github.event.inputs.variantB) && matrix.config.index == 1 && fromJson(github.event.inputs.os_args).variantB }}"
steps:
- uses: actions/checkout@v4
- uses: ./.github/workflows/runner-seed
with:
cache-exclude-script: "${{ env.cache_exclude_content }}"
task: "${{ github.event.inputs.task }}"
mode: "${{ github.event.inputs.mode }}"
experiment-id: "${{ github.run_number }}"
variant: ${{ matrix.config.variant }}
api-key: ${{ secrets.DV_ACCESS_KEY }}
repository: ${{ github.event.inputs.repository }}
variant-prefix: ${{ (matrix.config.variant == github.event.inputs.variantA) && matrix.config.index == 0 && 'varianta_' || (matrix.config.variant == github.event.inputs.variantB) && matrix.config.index == 1 && 'variantb_' }}
extra-args: ${{ (matrix.config.variant == github.event.inputs.variantA) && matrix.config.index == 0 && fromJson(github.event.inputs.extra_build_args).extraArgsVariantA || (matrix.config.variant == github.event.inputs.variantB) && matrix.config.index == 1 && fromJson(github.event.inputs.extra_build_args).extraArgsVariantB }}
jdk_version: ${{ (matrix.config.variant == github.event.inputs.variantA) && matrix.config.index == 0 && fromJson(github.event.inputs.java_args).javaVersionVariantA || (matrix.config.variant == github.event.inputs.variantB) && matrix.config.index == 1 && fromJson(github.event.inputs.java_args).javaVersionVariantB }}
jdk_vendor: ${{ (matrix.config.variant == github.event.inputs.variantA) && matrix.config.index == 0 && fromJson(github.event.inputs.java_args).javaVendorVariantA || (matrix.config.variant == github.event.inputs.variantB) && matrix.config.index == 1 && fromJson(github.event.inputs.java_args).javaVendorVariantB }}
cache-url: ${{ secrets.CI_URL_CACHE_NODE }}
- uses: actions/checkout@v4
outputs:
iterations: ${{ needs.iterations.outputs.iterations }}
skip: ${{ github.event.inputs.mode == 'no caching' }}
execution-caching:
name: Execution with Caching
if: github.event.inputs.mode != 'no caching'
needs: [seed]
runs-on: "${{ (matrix.config.variant == github.event.inputs.variantA) && matrix.config.index == 0 && fromJson(github.event.inputs.os_args).variantA || (matrix.config.variant == github.event.inputs.variantB) && matrix.config.index == 1 && fromJson(github.event.inputs.os_args).variantB }}"
strategy:
matrix:
runs: ${{ fromJson(needs.seed.outputs.iterations) }}
config:
- variant: ${{ github.event.inputs.variantA }}
index: 0
- variant: ${{ github.event.inputs.variantB }}
index: 1
steps:
- uses: actions/checkout@v4
- name: Conditionally Wait for Seed Job
if: ${{ github.event.inputs.mode != 'no caching' }}
run: echo "Waiting for seed job to complete"
- uses: ./.github/workflows/runner
with:
task: "${{ github.event.inputs.task }}"
mode: "${{ github.event.inputs.mode }}"
experiment-id: "${{ github.repository_owner }}-${{ github.run_number }}"
execution-number: ${{ github.run_number }}
variant: ${{ matrix.config.variant }}
api-key: ${{ secrets.DV_ACCESS_KEY }}
cache-excludes: ${{ steps.seed.outputs.cache-excludes }}
cache-url: ${{ secrets.CI_URL_CACHE_NODE }}
repository: ${{ github.event.inputs.repository }}
variant-prefix: ${{ (matrix.config.variant == github.event.inputs.variantA) && matrix.config.index == 0 && 'varianta_' || (matrix.config.variant == github.event.inputs.variantB) && matrix.config.index == 1 && 'variantb_' }}
extra-args: ${{ (matrix.config.variant == github.event.inputs.variantA) && matrix.config.index == 0 && fromJson(github.event.inputs.extra_build_args).extraArgsVariantA || (matrix.config.variant == github.event.inputs.variantB) && matrix.config.index == 1 && fromJson(github.event.inputs.extra_build_args).extraArgsVariantB }}
jdk_version: ${{ (matrix.config.variant == github.event.inputs.variantA) && matrix.config.index == 0 && fromJson(github.event.inputs.java_args).javaVersionVariantA || (matrix.config.variant == github.event.inputs.variantB) && matrix.config.index == 1 && fromJson(github.event.inputs.java_args).javaVersionVariantB }}
jdk_vendor: ${{ (matrix.config.variant == github.event.inputs.variantA) && matrix.config.index == 0 && fromJson(github.event.inputs.java_args).javaVendorVariantA || (matrix.config.variant == github.event.inputs.variantB) && matrix.config.index == 1 && fromJson(github.event.inputs.java_args).javaVendorVariantB }}
- uses: actions/checkout@v4
execution-no-caching:
name: Execution without Caching
if: github.event.inputs.mode == 'no caching'
needs: [iterations]
runs-on: "${{ (matrix.config.variant == github.event.inputs.variantA) && matrix.config.index == 0 && fromJson(github.event.inputs.os_args).variantA || (matrix.config.variant == github.event.inputs.variantB) && matrix.config.index == 1 && fromJson(github.event.inputs.os_args).variantB }}"
strategy:
matrix:
runs: ${{ fromJson(needs.iterations.outputs.iterations) }}
config:
- variant: ${{ github.event.inputs.variantA }}
index: 0
- variant: ${{ github.event.inputs.variantB }}
index: 1
steps:
- uses: actions/checkout@v4
- name: Conditionally Wait for Seed Job
if: ${{ github.event.inputs.mode != 'no caching' }}
run: echo "Waiting for seed job to complete"
- uses: ./.github/workflows/runner
with:
task: "${{ github.event.inputs.task }}"
mode: "${{ github.event.inputs.mode }}"
experiment-id: "${{ github.repository_owner }}-${{ github.run_number }}"
execution-number: ${{ github.run_number }}
variant: ${{ matrix.config.variant }}
api-key: ${{ secrets.DV_ACCESS_KEY }}
repository: ${{ github.event.inputs.repository }}
variant-prefix: ${{ (matrix.config.variant == github.event.inputs.variantA) && matrix.config.index == 0 && 'varianta_' || (matrix.config.variant == github.event.inputs.variantB) && matrix.config.index == 1 && 'variantb_' }}
extra-args: ${{ (matrix.config.variant == github.event.inputs.variantA) && matrix.config.index == 0 && fromJson(github.event.inputs.extra_build_args).extraArgsVariantA || (matrix.config.variant == github.event.inputs.variantB) && matrix.config.index == 1 && fromJson(github.event.inputs.extra_build_args).extraArgsVariantB }}
jdk_version: ${{ (matrix.config.variant == github.event.inputs.variantA) && matrix.config.index == 0 && fromJson(github.event.inputs.java_args).javaVersionVariantA || (matrix.config.variant == github.event.inputs.variantB) && matrix.config.index == 1 && fromJson(github.event.inputs.java_args).javaVersionVariantB }}
jdk_vendor: ${{ (matrix.config.variant == github.event.inputs.variantA) && matrix.config.index == 0 && fromJson(github.event.inputs.java_args).javaVendorVariantA || (matrix.config.variant == github.event.inputs.variantB) && matrix.config.index == 1 && fromJson(github.event.inputs.java_args).javaVendorVariantB }}
- uses: actions/checkout@v4
report-no-caching:
permissions:
contents: write
actions: write
name: Report for No Caching
if: fromJson(github.event.inputs.extra_report_args).report_enabled == 'true'
runs-on: ubuntu-latest
needs: [execution-no-caching]
steps:
- uses: actions/checkout@v4
- uses: ./.github/workflows/report
with:
task: "${{ github.event.inputs.task }}"
experiment-id: "${{ github.repository_owner }}-${{ github.run_number }}"
tags: "${{ github.repository_owner }}-${{ github.run_number }}_varianta_${{ github.event.inputs.variantA }},${{ github.repository_owner }}-${{ github.run_number }}_variantb_${{ github.event.inputs.variantB }}"
api-key: ${{ secrets.DV_API_KEY }}
url: ${{ secrets.DV_URL }}
gh_token: ${{ secrets.GITHUB_TOKEN }}
profile: false
mode: "${{ github.event.inputs.mode }}"
repository: ${{ github.event.inputs.repository }}
run_id: ${{ github.run_id }}
experiment_title: ${{ fromJson(github.event.inputs.extra_report_args).experiment_title }}
taskpathreport: ${{ fromJson(github.event.inputs.extra_report_args).taskpath_report }}
tasktypereport: ${{ fromJson(github.event.inputs.extra_report_args).tasktype_report }}
processreport: ${{ fromJson(github.event.inputs.extra_report_args).process_report }}
gcreport: ${{ fromJson(github.event.inputs.extra_report_args).gc_report }}
kotlinreport: ${{ fromJson(github.event.inputs.extra_report_args).kotlin_build_report }}
resourceusagereport: ${{ fromJson(github.event.inputs.extra_report_args).resource_usage_report }}
onlycacheableoutcome: ${{ fromJson(github.event.inputs.extra_report_args).only_cacheable_outcome }}
thresholdtaskduration: ${{ fromJson(github.event.inputs.extra_report_args).threshold_task_duration }}
deploy_results: ${{ fromJson(github.event.inputs.extra_report_args).deploy_results }}
open-ai-request: ${{ fromJson(github.event.inputs.extra_report_args).open_ai_request }}
open-ai-api-key: ${{ secrets.OPEN_API_KEY }}
deployment-key: ${{ secrets.GH_BUILD_DEPLOYMENT }}
report:
permissions:
contents: write
actions: write
name: Report with Caching
if: fromJson(github.event.inputs.extra_report_args).report_enabled == 'true'
runs-on: ubuntu-latest
needs: [execution-caching]
steps:
- uses: actions/checkout@v4
- uses: ./.github/workflows/report
with:
task: "${{ github.event.inputs.task }}"
experiment-id: "${{ github.repository_owner }}-${{ github.run_number }}"
tags: "${{ github.repository_owner }}-${{ github.run_number }}_varianta_${{ github.event.inputs.variantA }},${{ github.repository_owner }}-${{ github.run_number }}_variantb_${{ github.event.inputs.variantB }}"
api-key: ${{ secrets.DV_API_KEY }}
url: ${{ secrets.DV_URL }}
gh_token: ${{ secrets.GITHUB_TOKEN }}
profile: false
mode: "${{ github.event.inputs.mode }}"
repository: ${{ github.event.inputs.repository }}
run_id: ${{ github.run_id }}
experiment_title: ${{ fromJson(github.event.inputs.extra_report_args).experiment_title }}
taskpathreport: ${{ fromJson(github.event.inputs.extra_report_args).taskpath_report }}
tasktypereport: ${{ fromJson(github.event.inputs.extra_report_args).tasktype_report }}
processreport: ${{ fromJson(github.event.inputs.extra_report_args).process_report }}
gcreport: ${{ fromJson(github.event.inputs.extra_report_args).gc_report }}
kotlinreport: ${{ fromJson(github.event.inputs.extra_report_args).kotlin_build_report }}
resourceusagereport: ${{ fromJson(github.event.inputs.extra_report_args).resource_usage_report }}
onlycacheableoutcome: ${{ fromJson(github.event.inputs.extra_report_args).only_cacheable_outcome }}
thresholdtaskduration: ${{ fromJson(github.event.inputs.extra_report_args).threshold_task_duration }}
deploy_results: ${{ fromJson(github.event.inputs.extra_report_args).deploy_results }}
open-ai-request: ${{ fromJson(github.event.inputs.extra_report_args).open_ai_request }}
open-ai-api-key: ${{ secrets.OPEN_API_KEY }}
deployment-key: ${{ secrets.GH_BUILD_DEPLOYMENT }}