@@ -4,13 +4,15 @@ defaults: &defaults
4
4
docker :
5
5
- image : palantirtechnologies/circle-spark-base
6
6
resource_class : xlarge
7
- environment :
7
+ environment : &defaults-environment
8
8
TERM : dumb
9
+ BUILD_SBT_CACHE : " /home/circleci/build-sbt-cache"
9
10
10
11
11
12
test-defaults : &test-defaults
12
13
<< : *defaults
13
14
environment :
15
+ << : *defaults-environment
14
16
CIRCLE_TEST_REPORTS : /tmp/circle-test-reports
15
17
TEST_RESULTS_FILE : /tmp/test-results/results.json
16
18
@@ -29,6 +31,35 @@ deployable-branches-and-tags: &deployable-branches-and-tags
29
31
only : master
30
32
31
33
34
+ # Step templates
35
+
36
+ step_templates :
37
+ restore-build-binaries-cache : &restore-build-binaries-cache
38
+ restore_cache :
39
+ key : build-binaries-{{ checksum "build/mvn" }}-{{ checksum "build/sbt" }}
40
+ restore-ivy-cache : &restore-ivy-cache
41
+ restore_cache :
42
+ keys :
43
+ - v7-ivy-dependency-cache-{{ .Branch }}-{{ checksum "pom.xml" }}
44
+ # if cache for exact version of `pom.xml` is not present then load any most recent one
45
+ - v7-ivy-dependency-cache-{{ .Branch }}-
46
+ - v7-ivy-dependency-cache-master-{{ checksum "pom.xml" }}
47
+ - v7-ivy-dependency-cache-master-
48
+ restore-home-sbt-cache : &restore-home-sbt-cache
49
+ restore_cache :
50
+ keys :
51
+ - v2-home-sbt-{{ checksum "build/sbt" }}-{{ checksum "project/target/streams/$global/update/$global/streams/update_cache_2.10/inputs" }}
52
+ restore-build-sbt-cache : &restore-build-sbt-cache
53
+ restore_cache :
54
+ key : v1-build-sbt-{{ .Branch }}-{{ .Revision }}
55
+ link-in-build-sbt-cache : &link-in-build-sbt-cache
56
+ run :
57
+ name : Hard link cache contents into current build directory
58
+ command : |
59
+ if [[ -d "$BUILD_SBT_CACHE" ]]; then
60
+ rsync --info=stats2,misc1,flist0 -a --link-dest="$BUILD_SBT_CACHE" "$BUILD_SBT_CACHE/" .
61
+ fi
62
+
32
63
jobs :
33
64
build-maven :
34
65
<< : *defaults
@@ -80,14 +111,11 @@ jobs:
80
111
resource_class : small
81
112
steps :
82
113
- checkout
83
- - restore_cache :
84
- key : build-maven-{{ .Branch }}-{{ .BuildNum }}
85
114
# Need maven dependency cache, otherwise checkstyle tests fail as such:
86
115
# Failed to execute goal on project spark-assembly_2.11: Could not resolve dependencies for project org.apache.spark:spark-assembly_2.11:pom:2.4.0-SNAPSHOT
87
116
- restore_cache :
88
117
key : maven-dependency-cache-{{ checksum "pom.xml" }}
89
- - restore_cache :
90
- key : build-binaries-{{ checksum "build/mvn" }}-{{ checksum "build/sbt" }}
118
+ - *restore-build-binaries-cache
91
119
- run : dev/run-style-tests.py | tee /tmp/run-style-tests.log
92
120
- store_artifacts :
93
121
path : /tmp/run-style-tests.log
@@ -103,8 +131,7 @@ jobs:
103
131
key : build-maven-{{ .Branch }}-{{ .BuildNum }}
104
132
- restore_cache :
105
133
key : maven-dependency-cache-{{ checksum "pom.xml" }}
106
- - restore_cache :
107
- key : build-binaries-{{ checksum "build/mvn" }}-{{ checksum "build/sbt" }}
134
+ - *restore-build-binaries-cache
108
135
- run : |
109
136
dev/run-build-tests.py | tee /tmp/run-build-tests.log
110
137
- store_artifacts :
@@ -113,13 +140,11 @@ jobs:
113
140
114
141
build-sbt :
115
142
<< : *defaults
116
- environment :
117
- BUILD_SBT_CACHE : " /home/circleci/build-sbt-cache"
118
143
steps :
119
144
# Saves us from recompiling every time...
120
145
- restore_cache :
121
146
keys :
122
- - v1-build-sbt-{{ .Branch }}-{{ .BuildNum }}
147
+ - v1-build-sbt-{{ .Branch }}-{{ .Revision }}
123
148
- v1-build-sbt-{{ .Branch }}-
124
149
- v1-build-sbt-master-
125
150
- checkout
@@ -129,19 +154,9 @@ jobs:
129
154
if [[ -d "$BUILD_SBT_CACHE" ]]; then
130
155
rsync --info=stats2,misc1,flist0 -a --link-dest="$BUILD_SBT_CACHE" "$BUILD_SBT_CACHE/" .
131
156
fi
132
- - restore_cache :
133
- keys :
134
- - v5-ivy-dependency-cache-{{ checksum "pom.xml" }}
135
- # if cache for exact version of `pom.xml` is not present then load any most recent one
136
- - v5-ivy-dependency-cache-
137
- - restore_cache :
138
- key : maven-dependency-cache-{{ checksum "pom.xml" }}
139
- - restore_cache :
140
- keys :
141
- - v2-home-sbt-{{ checksum "build/sbt" }}-{{ checksum "project/target/streams/$global/update/$global/streams/update_cache_2.10/inputs" }}
142
- # Given the build-sbt cache, this is superfluous, but leave it in in case we will want to remove the former
143
- - restore_cache :
144
- key : build-binaries-{{ checksum "build/mvn" }}-{{ checksum "build/sbt" }}
157
+ - *restore-ivy-cache
158
+ - *restore-home-sbt-cache
159
+ - *restore-build-binaries-cache
145
160
- run :
146
161
name : Download all external dependencies for the test configuration (which extends compile) and ensure we update first
147
162
command : dev/sbt test:externalDependencyClasspath oldDeps/test:externalDependencyClasspath
@@ -150,7 +165,7 @@ jobs:
150
165
- store_artifacts :
151
166
path : /tmp/heap.bin
152
167
- save_cache :
153
- key : v5 -ivy-dependency-cache-{{ checksum "pom.xml" }}
168
+ key : v7 -ivy-dependency-cache-{{ .Branch }} -{{ checksum "pom.xml" }}
154
169
paths :
155
170
- " ~/.ivy2"
156
171
- store_artifacts :
@@ -167,22 +182,16 @@ jobs:
167
182
--exclude '***/*.jar' --include 'target/***'
168
183
--include '**/' --exclude '*' . "$BUILD_SBT_CACHE/"
169
184
- save_cache :
170
- key : v1-build-sbt-{{ .Branch }}-{{ .BuildNum }}
185
+ key : v1-build-sbt-{{ .Branch }}-{{ .Revision }}
171
186
paths :
172
187
- " ~/build-sbt-cache"
173
- # Also save all the target directories to the workspace - need assembly jars for spark submitting
188
+ # Also save all the assembly jars directories to the workspace - need them for spark submitting
174
189
- persist_to_workspace :
175
190
root : .
176
191
paths :
177
- - " target"
178
- - " */target"
179
- - " common/*/target"
180
- - " dists/*/target"
181
- - " external/*/target"
182
- - " resource-managers/*/target"
183
- - " resource-managers/*/*/target"
184
- - " sql/*/target"
185
- - " project/project/target"
192
+ - ' assembly/target/scala-*/jars'
193
+ - ' examples/target/scala-*/jars'
194
+ - ' external/*/target/scala-*/*.jar'
186
195
187
196
run-backcompat-tests :
188
197
# depends on build-sbt
@@ -191,16 +200,9 @@ jobs:
191
200
- checkout
192
201
- attach_workspace :
193
202
at : .
194
- - restore_cache :
195
- key : v5-ivy-dependency-cache-{{ checksum "pom.xml" }}
196
- # TODO(dsanduleac): do we need the maven cache?
197
- - restore_cache :
198
- key : maven-dependency-cache-{{ checksum "pom.xml" }}
199
- - restore_cache :
200
- key : build-binaries-{{ checksum "build/mvn" }}-{{ checksum "build/sbt" }}
201
- - restore_cache :
202
- keys :
203
- - v2-home-sbt-{{ checksum "build/sbt" }}-{{ checksum "project/target/streams/$global/update/$global/streams/update_cache_2.10/inputs" }}
203
+ - *restore-ivy-cache
204
+ - *restore-build-binaries-cache
205
+ - *restore-home-sbt-cache
204
206
- run : |
205
207
dev/run-backcompat-tests.py | tee /tmp/run-backcompat-tests.log
206
208
- store_artifacts :
@@ -209,13 +211,19 @@ jobs:
209
211
210
212
211
213
run-python-tests :
212
- # depends on build-sbt, so we're restoring the build-sbt cache
214
+ # depends on build-sbt, but we only need the assembly jars
213
215
<< : *defaults
214
216
docker :
215
217
- image : palantirtechnologies/circle-spark-python
216
218
parallelism : 2
217
219
steps :
218
220
- checkout
221
+ # These two steps restore all the target directories except jars
222
+ # Necessary because of SPARK_PREPEND_CLASSES being used in python tests, and some python tests
223
+ # accessing classes from the core/test configuration.
224
+ - *restore-build-sbt-cache
225
+ - *link-in-build-sbt-cache
226
+ # ---
219
227
# Python tests need assembly files build by the `build-sbt` job
220
228
# e.g. external/kafka-0-8-assembly/target/scala-2.11/spark-streaming-kafka-0-8-assembly-2.4.0-SNAPSHOT.jar
221
229
- attach_workspace :
@@ -228,7 +236,7 @@ jobs:
228
236
229
237
230
238
run-r-tests :
231
- # depends on build-sbt, so we're restoring the build-sbt cache
239
+ # depends on build-sbt, but we only need the assembly jars
232
240
<< : *defaults
233
241
docker :
234
242
- image : palantirtechnologies/circle-spark-r
@@ -257,15 +265,13 @@ jobs:
257
265
- checkout
258
266
- attach_workspace :
259
267
at : .
260
- - restore_cache :
261
- key : maven-dependency-cache-{{ checksum "pom.xml" }}
262
- - restore_cache :
263
- key : v5-ivy-dependency-cache-{{ checksum "pom.xml" }}
264
- - restore_cache :
265
- key : build-binaries-{{ checksum "build/mvn" }}-{{ checksum "build/sbt" }}
266
- - restore_cache :
267
- keys :
268
- - v2-home-sbt-{{ checksum "build/sbt" }}-{{ checksum "project/target/streams/$global/update/$global/streams/update_cache_2.10/inputs" }}
268
+ # These two steps restore all the target directories except jars
269
+ - *restore-build-sbt-cache
270
+ - *link-in-build-sbt-cache
271
+ # ---
272
+ - *restore-ivy-cache
273
+ - *restore-build-binaries-cache
274
+ - *restore-home-sbt-cache
269
275
- restore_cache :
270
276
keys :
271
277
- v1-test-results-{{ .Branch }}-{{ .BuildNum }}
@@ -346,8 +352,7 @@ jobs:
346
352
- checkout
347
353
- restore_cache :
348
354
key : maven-dependency-cache-{{ checksum "pom.xml" }}
349
- - restore_cache :
350
- key : build-binaries-{{ checksum "build/mvn" }}-{{ checksum "build/sbt" }}
355
+ - *restore-build-binaries-cache
351
356
- run :
352
357
command : dev/set_version_and_package.sh
353
358
# This is potentially costly but we can't use the workspace as it would conflict with
@@ -371,8 +376,7 @@ jobs:
371
376
key : v1-maven-build-with-version-{{ .Branch }}-{{ .Revision }}
372
377
- restore_cache :
373
378
key : v1-maven-dependency-cache-versioned-{{ checksum "pom.xml" }}
374
- - restore_cache :
375
- key : build-binaries-{{ checksum "build/mvn" }}-{{ checksum "build/sbt" }}
379
+ - *restore-build-binaries-cache
376
380
377
381
- run : echo "user=$BINTRAY_USERNAME" > .credentials
378
382
- run : echo "password=$BINTRAY_PASSWORD" >> .credentials
@@ -402,8 +406,6 @@ workflows:
402
406
- build-maven
403
407
<< : *all-branches-and-tags
404
408
- build-sbt :
405
- requires :
406
- - build-maven
407
409
<< : *all-branches-and-tags
408
410
- run-backcompat-tests :
409
411
requires :
@@ -424,7 +426,7 @@ workflows:
424
426
- build-maven-versioned :
425
427
requires :
426
428
- build-maven
427
- << : *deployable -branches-and-tags
429
+ << : *all -branches-and-tags
428
430
- deploy :
429
431
requires :
430
432
- build-maven
0 commit comments