forked from trinodb/trino
-
Notifications
You must be signed in to change notification settings - Fork 0
406 lines (391 loc) · 15.3 KB
/
ci.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
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
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
name: ci
on:
push:
branches:
- master
pull_request:
env:
# An envar that signals to tests we are executing in the CI environment
CONTINUOUS_INTEGRATION: true
# maven.wagon.rto is in millis, defaults to 30m
MAVEN_OPTS: "-Xmx512M -XX:+ExitOnOutOfMemoryError -Dmaven.wagon.rto=60000"
MAVEN_INSTALL_OPTS: "-Xmx2G -XX:+ExitOnOutOfMemoryError -Dmaven.wagon.rto=60000"
MAVEN_FAST_INSTALL: "-B -V --quiet -T C1 -DskipTests -Dair.check.skip-all"
MAVEN_TEST: "-B -Dair.check.skip-all --fail-at-end"
RETRY: .github/bin/retry
# Cancel previous PR builds.
concurrency:
# Cancel all workflow runs except latest within a concurrency group. This is achieved by defining a concurrency group for the PR.
# Non-PR builds have singleton concurrency groups.
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.event.number || github.sha }}
cancel-in-progress: true
jobs:
maven-checks:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
java-version:
- 11
- 16
timeout-minutes: 45
steps:
- name: Free Disk Space
run: |
df -h
sudo apt-get clean
df -h
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: ${{ matrix.java-version }}
- name: Maven Checks
run: |
export MAVEN_OPTS="${MAVEN_INSTALL_OPTS}"
$RETRY ./mvnw install -B -V -T C1 -DskipTests -P ci -pl '!:trino-server-rpm'
- name: Test Server RPM
run: |
export MAVEN_OPTS="${MAVEN_INSTALL_OPTS}"
$RETRY bash -c './mvnw verify -B -P ci -pl :trino-server-rpm || find core/trino-server-rpm/ -exec ls -ald {} +'
- name: Clean Maven Output
run: ./mvnw clean -pl '!:trino-server,!:trino-cli'
- name: Test Docker Image
run: core/docker/build-local.sh
error-prone-checks:
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: 11
- name: Maven Install
run: |
export MAVEN_OPTS="${MAVEN_INSTALL_OPTS}"
$RETRY ./mvnw install ${MAVEN_FAST_INSTALL} -pl '!:trino-docs,!:trino-server,!:trino-server-rpm'
- name: Error Prone Checks
run: |
export MAVEN_OPTS="${MAVEN_INSTALL_OPTS}"
# Run Error Prone on one module with a retry to ensure all runtime dependencies are fetched
$RETRY ./mvnw ${MAVEN_TEST} -T C1 clean test-compile -P errorprone-compiler -pl ':trino-spi'
# The main Error Prone run
./mvnw ${MAVEN_TEST} -T C1 clean test-compile -P errorprone-compiler \
-pl '!:trino-docs,!:trino-server,!:trino-server-rpm'
web-ui-checks:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v2
- name: Web UI Checks
run: core/trino-main/bin/check_webui.sh
test-jdbc-compatibility:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # checkout tags so version in Manifest is set properly
- uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: 11
- name: Maven Install
run: |
export MAVEN_OPTS="${MAVEN_INSTALL_OPTS}"
$RETRY ./mvnw install ${MAVEN_FAST_INSTALL} -pl '!:trino-test-jdbc-compatibility-old-driver,!:trino-docs,!:trino-server,!:trino-server-rpm'
- name: Test old JDBC vs current server
run: testing/trino-test-jdbc-compatibility-old-driver/bin/run_tests.sh
- name: Test current JDBC vs old server
if: always()
run: ./mvnw test ${MAVEN_TEST} -pl :trino-test-jdbc-compatibility-old-server
hive-tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
config:
- config-empty
- config-hdp3
# TODO: config-cdh5
timeout-minutes: 60
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: 11
- name: Install Hive Module
run: |
export MAVEN_OPTS="${MAVEN_INSTALL_OPTS}"
$RETRY ./mvnw install ${MAVEN_FAST_INSTALL} -am -pl :trino-hive-hadoop2
- name: Run Hive Tests
run: |
source testing/trino-product-tests/conf/product-tests-${{ matrix.config }}.sh &&
plugin/trino-hive-hadoop2/bin/run_hive_tests.sh
- name: Run Hive S3 Tests
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESSKEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRETKEY }}
S3_BUCKET: "presto-ci-test"
S3_BUCKET_ENDPOINT: "s3.us-east-2.amazonaws.com"
run: |
if [ "${AWS_ACCESS_KEY_ID}" != "" ]; then
source testing/trino-product-tests/conf/product-tests-${{ matrix.config }}.sh &&
plugin/trino-hive-hadoop2/bin/run_hive_s3_tests.sh
fi
- name: Run Hive Glue Tests
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESSKEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRETKEY }}
AWS_REGION: us-east-2
run: |
if [ "${AWS_ACCESS_KEY_ID}" != "" ]; then
./mvnw test ${MAVEN_TEST} -pl :trino-hive -P test-hive-glue
fi
- name: Run Hive Azure ABFS Access Key Tests
if: matrix.config != 'config-empty' # Hive 1.x does not support Azure storage
env:
ABFS_CONTAINER: ${{ secrets.AZURE_ABFS_CONTAINER }}
ABFS_ACCOUNT: ${{ secrets.AZURE_ABFS_ACCOUNT }}
ABFS_ACCESS_KEY: ${{ secrets.AZURE_ABFS_ACCESSKEY }}
run: |
if [ "${ABFS_CONTAINER}" != "" ]; then
source testing/trino-product-tests/conf/product-tests-${{ matrix.config }}.sh &&
plugin/trino-hive-hadoop2/bin/run_hive_abfs_access_key_tests.sh
fi
- name: Run Hive Azure ABFS OAuth Tests
if: matrix.config != 'config-empty' # Hive 1.x does not support Azure storage
env:
ABFS_CONTAINER: ${{ secrets.AZURE_ABFS_CONTAINER }}
ABFS_ACCOUNT: ${{ secrets.AZURE_ABFS_ACCOUNT }}
ABFS_OAUTH_ENDPOINT: ${{ secrets.AZURE_ABFS_OAUTH_ENDPOINT }}
ABFS_OAUTH_CLIENTID: ${{ secrets.AZURE_ABFS_OAUTH_CLIENTID }}
ABFS_OAUTH_SECRET: ${{ secrets.AZURE_ABFS_OAUTH_SECRET }}
run: |
if [ -n "$ABFS_CONTAINER" ]; then
source testing/trino-product-tests/conf/product-tests-${{ matrix.config }}.sh &&
plugin/trino-hive-hadoop2/bin/run_hive_abfs_oauth_tests.sh
fi
- name: Run Hive Azure WASB Tests
if: matrix.config != 'config-empty' # Hive 1.x does not support Azure storage
env:
WASB_CONTAINER: ${{ secrets.AZURE_WASB_CONTAINER }}
WASB_ACCOUNT: ${{ secrets.AZURE_WASB_ACCOUNT }}
WASB_ACCESS_KEY: ${{ secrets.AZURE_WASB_ACCESSKEY }}
run: |
if [ "${WASB_CONTAINER}" != "" ]; then
source testing/trino-product-tests/conf/product-tests-${{ matrix.config }}.sh &&
plugin/trino-hive-hadoop2/bin/run_hive_wasb_tests.sh
fi
- name: Run Hive Azure ADL Tests
if: matrix.config != 'config-empty' # Hive 1.x does not support Azure storage
env:
ADL_NAME: ${{ secrets.AZURE_ADL_NAME }}
ADL_CLIENT_ID: ${{ secrets.AZURE_ADL_CLIENTID }}
ADL_CREDENTIAL: ${{ secrets.AZURE_ADL_CREDENTIAL }}
ADL_REFRESH_URL: ${{ secrets.AZURE_ADL_REFRESHURL }}
run: |
if [ "${ADL_NAME}" != "" ]; then
source testing/trino-product-tests/conf/product-tests-${{ matrix.config }}.sh &&
plugin/trino-hive-hadoop2/bin/run_hive_adl_tests.sh
fi
- name: Run Hive Alluxio Tests
run: |
source testing/trino-product-tests/conf/product-tests-${{ matrix.config }}.sh &&
plugin/trino-hive-hadoop2/bin/run_hive_alluxio_tests.sh
test-other-modules:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: 11
- name: Maven Install
run: |
export MAVEN_OPTS="${MAVEN_INSTALL_OPTS}"
$RETRY ./mvnw install ${MAVEN_FAST_INSTALL} -pl '!:trino-docs,!:trino-server,!:trino-server-rpm'
- name: Maven Tests
run: |
./mvnw test ${MAVEN_TEST} -pl '
!:trino-main,
!:trino-tests,
!:trino-raptor-legacy,
!:trino-accumulo,
!:trino-cassandra,
!:trino-hive,!:trino-orc,!:trino-parquet,
!:trino-mongodb,!:trino-kafka,!:trino-elasticsearch,
!:trino-redis,
!:trino-sqlserver,!:trino-postgresql,!:trino-mysql,!:trino-memsql,
!:trino-oracle,
!:trino-kudu,
!:trino-iceberg,!:trino-druid,
!:trino-phoenix,!:trino-phoenix5,
!:trino-docs,!:trino-server,!:trino-server-rpm,
!:trino-test-jdbc-compatibility-old-server,
!:trino-bigquery'
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
modules:
- ":trino-main"
- ":trino-tests"
- ":trino-tests -P ci-only"
- ":trino-raptor-legacy"
- ":trino-accumulo"
- ":trino-cassandra"
- ":trino-hive,:trino-orc"
- ":trino-hive,:trino-parquet -P test-parquet"
- ":trino-mongodb,:trino-kafka,:trino-elasticsearch,:trino-elasticsearch -P test-stats"
- ":trino-redis"
- ":trino-sqlserver,:trino-postgresql,:trino-mysql"
- ":trino-oracle"
- ":trino-kudu"
- ":trino-iceberg,:trino-druid"
- ":trino-phoenix,:trino-phoenix5"
timeout-minutes: 60
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: 11
- name: Maven Install
run: |
export MAVEN_OPTS="${MAVEN_INSTALL_OPTS}"
$RETRY ./mvnw install ${MAVEN_FAST_INSTALL} -am -pl $(echo '${{ matrix.modules }}' | cut -d' ' -f1)
- name: Maven Tests
run: ./mvnw test ${MAVEN_TEST} -pl ${{ matrix.modules }}
test-memsql:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: 11
- name: Cleanup node
# This is required as a virtual environment update 20210219.1 left too little space for MemSQL to work
run: .github/bin/cleanup-node.sh
- name: Maven Install
run: |
export MAVEN_OPTS="${MAVEN_INSTALL_OPTS}"
$RETRY ./mvnw install ${MAVEN_FAST_INSTALL} -am -pl :trino-memsql
- name: Memsql Tests
env:
MEMSQL_LICENSE: ${{ secrets.MEMSQL_LICENSE }}
run: |
if [ "${MEMSQL_LICENSE}" != "" ]; then
./mvnw test ${MAVEN_TEST} -pl :trino-memsql -Dmemsql.license=${MEMSQL_LICENSE}
fi
test-bigquery:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: 11
- name: Maven Install
run: |
export MAVEN_OPTS="${MAVEN_INSTALL_OPTS}"
$RETRY ./mvnw install ${MAVEN_FAST_INSTALL} -am -pl :trino-bigquery
- name: Basic BigQuery Tests
run: ./mvnw test ${MAVEN_TEST} -pl :trino-bigquery
- name: Cloud BigQuery Tests
env:
BIGQUERY_CREDENTIALS_KEY: ${{ secrets.BIGQUERY_CREDENTIALS_KEY }}
run: |
if [ "${BIGQUERY_CREDENTIALS_KEY}" != "" ]; then
./mvnw test ${MAVEN_TEST} -pl :trino-bigquery -Pcloud-tests -Dbigquery.credentials-key="${BIGQUERY_CREDENTIALS_KEY}"
fi
- name: Cloud BigQuery Case Insensitive Mapping Tests
env:
BIGQUERY_CREDENTIALS_KEY: ${{ secrets.BIGQUERY_CREDENTIALS_KEY }}
run: |
if [ "${BIGQUERY_CREDENTIALS_KEY}" != "" ]; then
./mvnw test ${MAVEN_TEST} -pl :trino-bigquery -Pcloud-tests-case-insensitive-mapping -Dbigquery.credentials-key="${BIGQUERY_CREDENTIALS_KEY}"
fi
pt:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
config:
- default
- hdp3
- cdh5
suite:
- suite-1
- suite-2
- suite-3
# suite-4 does not exist
- suite-5
exclude:
- config: cdh5
ignore exclusion if: >-
${{ github.event_name != 'pull_request'
|| contains(github.event.pull_request.labels.*.name, 'tests:all')
|| contains(github.event.pull_request.labels.*.name, 'tests:hive')
}}
- config: default
ignore exclusion if: >-
${{ github.event_name != 'pull_request'
|| contains(github.event.pull_request.labels.*.name, 'tests:all')
|| contains(github.event.pull_request.labels.*.name, 'tests:hive')
}}
ignore exclusion if:
# Do not use this property outside of the matrix configuration.
#
# This is added to all matrix entries so they may be conditionally
# excluded by adding them to the excludes list with a GHA expression
# for this property.
# - If the expression evaluates to true, it will never match the a
# actual value of the property, and will therefore not be excluded.
# - If the expression evaluates to false, it will match the actual
# value of the property, and the exclusion will apply normally.
- false
include:
# this suite ignores is not meant to be run with different configs
- config: default
suite: suite-6-non-generic
# this suite ignores is not meant to be run with different configs
- config: default
suite: suite-7-non-generic
# this suite ignores is not meant to be run with different configs
- config: default
suite: suite-8-non-generic
# this suite ignores is not meant to be run with different configs
- config: default
suite: suite-tpcds
# this suite ignores is not meant to be run with different configs
- config: default
suite: suite-oauth2
# PT Launcher's timeout defaults to 2h, account for preparation steps (compilation) and add some margin
timeout-minutes: 140
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: 11
- name: Maven Install
run: |
export MAVEN_OPTS="${MAVEN_INSTALL_OPTS}"
$RETRY ./mvnw install ${MAVEN_FAST_INSTALL} -pl '!:trino-docs,!:trino-server-rpm'
- name: Free Disk Space
run: |
docker image prune -af
sudo apt-get clean
rm -rf ~/.m2/repository
- name: Product Tests
run: |
bin/ptl suite run \
--suite ${{ matrix.suite }} --config config-${{ matrix.config }} --no-bind --logs-dir logs/ --timeout 2h