forked from twitter-forks/presto
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
268 lines (252 loc) · 11.3 KB
/
.travis.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
language: java
env:
global:
- MAVEN_OPTS="-Xmx512M -XX:+ExitOnOutOfMemoryError"
- MAVEN_SKIP_CHECKS_AND_DOCS="-Dair.check.skip-all=true -Dmaven.javadoc.skip=true"
- MAVEN_FAST_INSTALL="-DskipTests $MAVEN_SKIP_CHECKS_AND_DOCS -B -q -T C1"
- ARTIFACTS_UPLOAD_PATH_BRANCH=travis_build_artifacts/${TRAVIS_REPO_SLUG}/${TRAVIS_BRANCH}/${TRAVIS_BUILD_NUMBER}
- ARTIFACTS_UPLOAD_PATH_PR=travis_build_artifacts_pr/${TRAVIS_REPO_SLUG}/${TRAVIS_BRANCH}/${TRAVIS_BUILD_NUMBER}
- TEST_FLAGS=""
matrix:
- MAVEN_CHECKS=true
- TEST_SPECIFIC_MODULES=presto-tests
- TEST_SPECIFIC_MODULES=presto-tests TEST_FLAGS="-P ci-only"
- TEST_SPECIFIC_MODULES=presto-raptor
- TEST_SPECIFIC_MODULES=presto-accumulo
- TEST_SPECIFIC_MODULES=presto-cassandra
- TEST_SPECIFIC_MODULES=presto-hive
- TEST_SPECIFIC_MODULES=presto-main
- TEST_OTHER_MODULES=!presto-tests,!presto-raptor,!presto-accumulo,!presto-cassandra,!presto-hive,!presto-kudu,!presto-docs,!presto-server,!presto-server-rpm,!presto-main
- PRODUCT_TESTS_BASIC_ENVIRONMENT=true
- PRODUCT_TESTS_SPECIFIC_ENVIRONMENT=true
- PRODUCT_TESTS_SPECIFIC_ENVIRONMENT_2=true
- PRODUCT_TESTS_SPECIFIC_ENVIRONMENT_3=true
- HIVE_TESTS=true
- KUDU_TESTS=true
sudo: required
dist: trusty
cache:
directories:
- $HOME/.m2/repository
- $HOME/.thrift
services:
- docker
before_install:
- |
if [[ ! -e $HOME/.thrift/bin/thrift ]]; then
sudo apt-get install libboost-dev libboost-test-dev libboost-program-options-dev libboost-filesystem-dev libboost-thread-dev libevent-dev automake libtool flex bison pkg-config g++ libssl-dev
wget https://www.apache.org/dist/thrift/0.9.3/thrift-0.9.3.tar.gz
tar xfz thrift-0.9.3.tar.gz
cd thrift-0.9.3 && ./configure --without-cpp --without-c_glib --without-python --without-ruby --without-php --without-erlang --without-go --without-nodejs -q --prefix=$HOME/.thrift
sudo make install > thrift_make_install.log
cd ..
fi
- |
if [[ ! -e /usr/local/bin/thrift ]]; then
sudo ln -s $HOME/.thrift/bin/thrift /usr/local/bin/thrift
fi
install:
- ./mvnw -v
- |
if [[ -v TEST_SPECIFIC_MODULES ]]; then
./mvnw install $MAVEN_FAST_INSTALL -pl $TEST_SPECIFIC_MODULES -am
fi
- |
if [[ -v TEST_OTHER_MODULES ]]; then
./mvnw install $MAVEN_FAST_INSTALL -pl '!presto-docs,!presto-server,!presto-server-rpm'
fi
- |
if [[ -v PRODUCT_TESTS_BASIC_ENVIRONMENT || -v PRODUCT_TESTS_SPECIFIC_ENVIRONMENT || -v PRODUCT_TESTS_SPECIFIC_ENVIRONMENT_2 || -v PRODUCT_TESTS_SPECIFIC_ENVIRONMENT_3 ]]; then
./mvnw install $MAVEN_FAST_INSTALL -pl '!presto-docs,!presto-server-rpm'
fi
- |
if [[ -v HIVE_TESTS ]]; then
./mvnw install $MAVEN_FAST_INSTALL -pl presto-hive-hadoop2 -am
fi
- |
if [[ -v KUDU_TESTS ]]; then
./mvnw install $MAVEN_FAST_INSTALL -pl presto-kudu -am
fi
before_script:
- |
export ARTIFACTS_UPLOAD_PATH=${ARTIFACTS_UPLOAD_PATH_BRANCH}
if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
export ARTIFACTS_UPLOAD_PATH=${ARTIFACTS_UPLOAD_PATH_PR}
fi
# *** WARNING ***
#
# A single script block must include exactly ONE command.
# Travis runs a script block without the `-e` flag. Any failures in the middle are simply ignored.
#
# Specifying the `-e` flag manually is not recommended.
# It will stop the execution after the very first failure.
# Travis runs the remaining blocks even if one of the scripts returns a non zero status.
# Non zero status is propagated at the end of the build.
script:
- |
if [[ -v MAVEN_CHECKS ]]; then
./mvnw install -DskipTests -B -T C1 -P ci
fi
- |
if [[ -v TEST_SPECIFIC_MODULES ]]; then
travis_wait 60 ./mvnw test $MAVEN_SKIP_CHECKS_AND_DOCS -B -pl $TEST_SPECIFIC_MODULES $TEST_FLAGS
fi
- |
if [[ -v TEST_OTHER_MODULES ]]; then
./mvnw test $MAVEN_SKIP_CHECKS_AND_DOCS -B -pl $TEST_OTHER_MODULES
fi
- |
if [[ -v PRODUCT_TESTS_BASIC_ENVIRONMENT ]]; then
presto-product-tests/bin/run_on_docker.sh \
multinode -x quarantine,big_query,storage_formats,profile_specific_tests,tpcds,cassandra,mysql_connector,postgresql_connector,mysql,kafka
fi
- |
if [[ -v PRODUCT_TESTS_SPECIFIC_ENVIRONMENT ]]; then
presto-product-tests/bin/run_on_docker.sh \
singlenode -g hdfs_no_impersonation
fi
- |
if [[ -v PRODUCT_TESTS_SPECIFIC_ENVIRONMENT ]]; then
presto-product-tests/bin/run_on_docker.sh \
singlenode-kerberos-hdfs-no-impersonation -g hdfs_no_impersonation
fi
- |
if [[ -v PRODUCT_TESTS_SPECIFIC_ENVIRONMENT ]]; then
presto-product-tests/bin/run_on_docker.sh \
singlenode-hdfs-impersonation -g storage_formats,cli,hdfs_impersonation
fi
- |
if [[ -v PRODUCT_TESTS_SPECIFIC_ENVIRONMENT_3 ]]; then
presto-product-tests/bin/run_on_docker.sh \
singlenode-kerberos-hdfs-impersonation -g storage_formats,cli,hdfs_impersonation,authorization,hive_file_header
fi
- |
if [[ -v PRODUCT_TESTS_SPECIFIC_ENVIRONMENT_3 ]]; then
presto-product-tests/bin/run_on_docker.sh \
singlenode-kerberos-hdfs-impersonation-cross-realm -g storage_formats,cli,hdfs_impersonation
fi
- |
if [[ -v PRODUCT_TESTS_SPECIFIC_ENVIRONMENT_2 ]]; then
presto-product-tests/bin/run_on_docker.sh \
singlenode-ldap -g ldap -x simba_jdbc
fi
# SQL server image sporadically hangs during the startup
# TODO: Uncomment it once issue is fixed
# https://github.com/Microsoft/mssql-docker/issues/76
# - |
# if [[ -v PRODUCT_TESTS_SPECIFIC_ENVIRONMENT ]]; then
# presto-product-tests/bin/run_on_docker.sh \
# singlenode-sqlserver -g sqlserver
# fi
- |
if [[ -v PRODUCT_TESTS_SPECIFIC_ENVIRONMENT_2 ]]; then
presto-product-tests/bin/run_on_docker.sh \
multinode-tls -g smoke,cli,group-by,join,tls
fi
- |
if [[ -v PRODUCT_TESTS_SPECIFIC_ENVIRONMENT_2 ]]; then
presto-product-tests/bin/run_on_docker.sh \
singlenode-mysql -g mysql_connector,mysql
fi
- |
if [[ -v PRODUCT_TESTS_SPECIFIC_ENVIRONMENT_2 ]]; then
presto-product-tests/bin/run_on_docker.sh \
singlenode-postgresql -g postgresql_connector
fi
- |
if [[ -v PRODUCT_TESTS_SPECIFIC_ENVIRONMENT_2 ]]; then
presto-product-tests/bin/run_on_docker.sh \
singlenode-cassandra -g cassandra
fi
if [[ -v PRODUCT_TESTS_SPECIFIC_ENVIRONMENT_3 ]]; then
presto-product-tests/bin/run_on_docker.sh \
multinode-tls-kerberos -g cli,group-by,join,tls
fi
- |
if [[ -v PRODUCT_TESTS_SPECIFIC_ENVIRONMENT_2 ]]; then
presto-product-tests/bin/run_on_docker.sh \
singlenode-kerberos-hdfs-impersonation-with-wire-encryption -g storage_formats,cli,hdfs_impersonation,authorization
fi
- |
if [[ -v PRODUCT_TESTS_SPECIFIC_ENVIRONMENT_2 ]]; then
presto-product-tests/bin/run_on_docker.sh \
singlenode-kafka -g kafka
fi
- |
if [[ -v HIVE_TESTS ]]; then
presto-hive-hadoop2/bin/run_hive_tests.sh
fi
- |
if [[ -v HIVE_TESTS && -v HIVE_TESTS_AWS_ACCESS_KEY_ID ]]; then
env AWS_ACCESS_KEY_ID=$HIVE_TESTS_AWS_ACCESS_KEY_ID \
AWS_SECRET_ACCESS_KEY=$HIVE_TESTS_AWS_SECRET_ACCESS_KEY \
S3_BUCKET_ENDPOINT=$S3_TESTS_BUCKET_ENDPOINT \
S3_BUCKET=$S3_TESTS_BUCKET \
presto-hive-hadoop2/bin/run_hive_s3_tests.sh
fi
- |
if [[ -v HIVE_TESTS && -v HIVE_TESTS_AWS_ACCESS_KEY_ID ]]; then
env AWS_ACCESS_KEY_ID=$HIVE_TESTS_AWS_ACCESS_KEY_ID \
AWS_SECRET_ACCESS_KEY=$HIVE_TESTS_AWS_SECRET_ACCESS_KEY \
./mvnw -pl presto-hive test -B -P test-hive-glue
fi
- |
if [[ -v KUDU_TESTS ]]; then
presto-kudu/bin/run_kudu_tests.sh 3 null
presto-kudu/bin/run_kudu_tests.sh 1 ""
presto-kudu/bin/run_kudu_tests.sh 1 presto::
fi
before_cache:
# Make the cache stable between builds by removing build output
- rm -rf $HOME/.m2/repository/com/facebook
notifications:
hipchat:
rooms:
secure: peNh1KxwlxIpFyb60S8AMvaJThgh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yueNzaLJ+KSlgwFblIQKp6WGZYSRorL0F7s50pIoqMVoebcrnB0ObK/CcE2ywS/HeTgoSkWSDSmKBsO+cmtv1yAamy9DlmgRGZlxIxdBELXtHRkQ2B6Z2QdiQU4MHiFBc/IESJbnCait4odn+oJUjehZg+b9vjCoWwVw3zNMIJhokyxO8SiyKJmbO0z1g2L/BykWGI1DQu8HkeQzO+CmNUV3AOrxDG3amL/tkB/06fyQtnYMDhUhvX64uWSaE36sYL4=
before_deploy:
- mkdir /tmp/artifacts
- cp -n presto-server/target/presto-server-*.tar.gz /tmp/artifacts
- cp -n presto-server-rpm/target/presto-server-rpm-*.x86_64.rpm /tmp/artifacts
- cp -n presto-product-tests/target/presto-product-tests-*-executable.jar /tmp/artifacts
- cp -n presto-jdbc/target/presto-jdbc-*.jar /tmp/artifacts
- cp -n presto-cli/target/presto-cli-*-executable.jar /tmp/artifacts
- echo $TRAVIS_COMMIT > /tmp/artifacts/git-revision.txt
- echo "<script>location='https://travis-ci.org/${TRAVIS_REPO_SLUG}/builds/${TRAVIS_BUILD_ID}'</script>"
> /tmp/artifacts/travis_build.html
- ls -lah /tmp/artifacts
deploy:
on:
all_branches: true
condition: -v DEPLOY_S3_ACCESS_KEY && -v MAVEN_CHECKS
provider: s3
access_key_id: ${DEPLOY_S3_ACCESS_KEY}
secret_access_key: ${DEPLOY_S3_SECRET_KEY}
bucket: ${DEPLOY_S3_BUCKET}
skip_cleanup: true
local-dir: /tmp/artifacts
upload-dir: ${ARTIFACTS_UPLOAD_PATH}
acl: public_read
after_script:
- |
if [[ -v DEPLOY_S3_ACCESS_KEY ]]; then
sudo pip install awscli
export AWS_ACCESS_KEY_ID=${DEPLOY_S3_ACCESS_KEY}
export AWS_SECRET_ACCESS_KEY=${DEPLOY_S3_SECRET_KEY}
JOB_ARTIFACTS_URL_PREFIX=s3://${DEPLOY_S3_BUCKET}/${ARTIFACTS_UPLOAD_PATH}/travis_jobs/${TRAVIS_JOB_NUMBER}-run
JOB_RUN_ATTEMPTS=$( aws s3 ls ${JOB_ARTIFACTS_URL_PREFIX} | wc -l | tr -d '[:space:]' )
JOB_STATUS=$( [ "$TRAVIS_TEST_RESULT" == "0" ] && echo SUCCESS || echo FAILURE )
mkdir -p /tmp/job_artifacts/
rsync -av -m \
--include='**/' \
--include='**/surefire-reports/**.xml' \
--include='**/surefire-reports/emailable-report.html' \
--include='**/product-tests-presto-jvm-error-file.log' \
--include='**/test-reports/junitreports/**.xml' \
--include='**/test-reports/emailable-report.html' \
--exclude='*' \
. /tmp/job_artifacts/
wget https://api.travis-ci.org/jobs/${TRAVIS_JOB_ID}/log.txt?deansi=true -O /tmp/job_artifacts/log.txt
aws s3 sync /tmp/job_artifacts ${JOB_ARTIFACTS_URL_PREFIX}_$((JOB_RUN_ATTEMPTS + 1))-${JOB_STATUS} --quiet
fi