forked from pravega/pravega
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
1168 lines (1032 loc) · 47.7 KB
/
build.gradle
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
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
import com.github.spotbugs.SpotBugsTask
import org.gradle.internal.jvm.Jvm
/**
* Copyright (c) 2017 Dell Inc., or its subsidiaries. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*/
// Apply the java plugin to add support for Java
buildscript {
// log the current JVM version.
println "Build JVM Version is : " + Jvm.current()
repositories {
jcenter()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath group: 'com.google.protobuf', name:'protobuf-gradle-plugin', version: protobufGradlePlugin
classpath "gradle.plugin.org.nosphere.apache:creadur-rat-gradle:0.3.0"
classpath group: 'org.hidetake', name: 'gradle-ssh-plugin', version: gradleSshPluginVersion
classpath group: 'ru.vyarus', name: 'gradle-mkdocs-plugin', version: gradleMkdocsPluginVersion
classpath group: 'gradle.plugin.com.github.spotbugs', name: 'spotbugs-gradle-plugin', version: spotbugsPluginVersion
classpath "org.ajoberstar:grgit:${gradleGitPluginVersion}"
classpath "io.franzbecker:gradle-lombok:${gradleLombokPluginVersion}"
}
}
if (project.hasProperty("enableMkdocs")) {
apply from: "$rootDir/gradle/mkdocs.gradle"
}
// apply the plugin outside of allProjects since the plugin attempts to set the grgit property for all the projects
// https://github.com/ajoberstar/grgit/blob/master/src/main/groovy/org/ajoberstar/grgit/gradle/GrgitPlugin.groovy#L27
apply plugin: 'org.ajoberstar.grgit'
allprojects {
apply plugin: 'idea'
apply plugin: 'eclipse'
if (file("src/main/java").isDirectory()) {
apply plugin: 'java'
apply plugin: 'io.franzbecker.gradle-lombok'
lombok {
version = lombokVersion
}
dependencies {
//These are compile time only dependencies needed accross all targets. Lombok uses them and may generate strange errors if they are missing.
compileOnly group: 'com.github.spotbugs', name: 'spotbugs-annotations', version: spotbugsAnnotationsVersion
testCompile group: 'com.github.spotbugs', name: 'spotbugs-annotations', version: spotbugsAnnotationsVersion
compileOnly group: 'net.jcip', name: 'jcip-annotations', version: jcipAnnotationsVersion
testCompile group: 'net.jcip', name: 'jcip-annotations', version: jcipAnnotationsVersion
compileOnly 'org.projectlombok:lombok:' + lombokVersion
testCompileOnly 'org.projectlombok:lombok:' + lombokVersion
annotationProcessor 'org.projectlombok:lombok:' + lombokVersion
testAnnotationProcessor 'org.projectlombok:lombok:' + lombokVersion
}
// Delombok sources.
task delombok(type: io.franzbecker.gradle.lombok.task.DelombokTask, dependsOn: compileJava) {
ext.outputDir = file("$buildDir/delombok")
outputs.dir(outputDir)
sourceSets.main.java.srcDirs.each {
inputs.dir(it)
args(it, "-d", outputDir)
}
}
}
// Plugin configurations
apply from: "$rootDir/gradle/application.gradle"
apply from: "$rootDir/gradle/checkstyle.gradle"
apply from: "$rootDir/gradle/eclipse.gradle"
apply from: "$rootDir/gradle/spotbugs.gradle"
apply from: "$rootDir/gradle/idea.gradle"
apply from: "$rootDir/gradle/jacoco.gradle"
apply from: "$rootDir/gradle/java.gradle"
apply from: "$rootDir/gradle/maven.gradle"
apply from: "$rootDir/gradle/protobuf.gradle"
apply from: "$rootDir/gradle/rat.gradle"
repositories {
jcenter()
mavenCentral()
mavenLocal()
}
gradle.projectsEvaluated {
tasks.withType(JavaCompile) {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
}
}
tasks.withType(SpotBugsTask) {
classpath += sourceSets."${(it.name - ~/^spotbugs/).uncapitalize()}".compileClasspath
reports {
xml.enabled = false
html.enabled = true
}
}
version = getProjectVersion()
group = "io.pravega"
configurations.all {
resolutionStrategy {
//failOnVersionConflict()
force "com.google.guava:guava:" + guavaVersion
force "com.google.protobuf:protobuf-java:" + protobufProtocVersion
force "io.grpc:grpc-context:" + grpcVersion
force "commons-beanutils:commons-beanutils:" + commonsBeanutilsVersion
force "org.apache.commons:commons-compress:" + apacheCommonsCompressVersion
force "org.apache.commons:commons-lang3:" + commonsLang3Version
force "org.apache.curator:curator-framework:" + apacheCuratorVersion
force "org.glassfish.jersey.core:jersey-common:" + jerseyVersion
force "org.glassfish.jersey.core:jersey-server:" + jerseyVersion
force "com.fasterxml.jackson.core:jackson-databind:" + jacksonVersion
force "org.slf4j:slf4j-api:" + slf4jApiVersion
force "org.apache.zookeeper:zookeeper:" + apacheZookeeperVersion
force "io.netty:netty-transport:" + nettyVersion
force "io.netty:netty-handler:" + nettyVersion
force "io.netty:netty-transport-native-epoll:" + nettyVersion
force "io.netty:netty-all:" + nettyVersion
force "io.netty:netty:" + nettyAllVersion
force "io.netty:netty-tcnative-boringssl-static:" + nettyBoringSSLVersion
dependencySubstitution {
substitute module("javax.ws.rs:jsr311-api") with module("javax.ws.rs:javax.ws.rs-api:" + javaxwsrsApiVersion)
}
}
}
}
project('common') {
dependencies {
testCompile project(':test:testcommon')
compile group: 'commons-io', name: 'commons-io', version: commonsioVersion
compile group: 'com.google.guava', name: 'guava', version: guavaVersion
//Do NOT add any additional dependencies here.
}
javadoc {
title = "Pravega Common Libraries"
dependsOn delombok
source = delombok.outputDir
failOnError = false
options.addBooleanOption("Xdoclint:none", true)
}
}
def withoutLogger = { exclude group: 'org.slf4j', module: 'slf4j-log4j12'
exclude group: 'org.slf4j', module: 'slf4j-simple' }
project('shared:authplugin') {
dependencies {
}
javadoc {
title = "Pravega Auth API"
dependsOn delombok
source = delombok.outputDir
failOnError = false
options.addBooleanOption("Xdoclint:none", true)
}
}
project('shared:security') {
dependencies {
compile project(':common')
compile project(':shared:authplugin')
compile group: 'io.jsonwebtoken', name: 'jjwt', version: jjwtVersion
// Adding JAXB API and the reference implementation as a dependency here, since they are not available
// in newer Java SE versions (9 and newer).
compile group: 'javax.xml.bind', name: 'jaxb-api', version: jaxbVersion
compile group: 'org.glassfish.jaxb', name: 'jaxb-runtime', version: jaxbVersion
testCompile project(':test:testcommon')
}
javadoc {
exclude 'io/pravega/shared/*'
dependsOn delombok
source = delombok.outputDir
failOnError = false
options.addBooleanOption("Xdoclint:none", true)
}
}
project ('shared:cluster') {
dependencies {
compile project(':common')
compile group: 'com.google.guava', name: 'guava', version: guavaVersion
compile group: 'org.apache.commons', name: 'commons-lang3', version: commonsLang3Version
compile group: 'org.apache.curator', name: 'curator-recipes', version: apacheCuratorVersion
testCompile group: 'org.apache.curator', name: 'curator-test', version: apacheCuratorVersion
testCompile project(':test:testcommon')
}
javadoc {
exclude 'io/pravega/shared/*'
dependsOn delombok
source = delombok.outputDir
failOnError = false
options.addBooleanOption("Xdoclint:none", true)
}
}
project ('shared:metrics') {
dependencies {
compile group: 'io.micrometer', name: 'micrometer-core', version: micrometerVersion
// https://mvnrepository.com/artifact/io.micrometer/micrometer-core/<micrometerVersion>
compile group: 'io.micrometer', name: 'micrometer-registry-statsd', version: micrometerVersion
// https://mvnrepository.com/artifact/io.micrometer/micrometer-registry-statsd/<micrometerVersion>
compile group: 'io.micrometer', name: 'micrometer-registry-influx', version: micrometerVersion
// https://mvnrepository.com/artifact/io.micrometer/micrometer-registry-influx/<micrometerVersion>
compile project(':common')
}
javadoc {
exclude 'io/pravega/shared/*'
dependsOn delombok
source = delombok.outputDir
failOnError = false
options.addBooleanOption("Xdoclint:none", true)
}
}
project('shared:protocol') {
dependencies {
compile project(':common')
compile group: 'io.netty', name: 'netty-transport', version: nettyVersion
compile group: 'io.netty', name: 'netty-handler', version: nettyVersion
compile group: 'com.google.guava', name: 'guava', version: guavaVersion
testCompile project(':test:testcommon')
}
}
project('client') {
dependencies {
compile project(':common')
compile project(':shared:authplugin')
compile project(':shared:protocol')
compile project(":shared:controller-api")
// Ensure epoll native transport is used for linux-x86_64 architecture systems.
// The client fallsback to NIO based transport if epoll is not available.
compile group: 'io.netty', name: 'netty-transport-native-epoll', version: nettyVersion, classifier: 'linux-x86_64'
compile group: 'com.google.guava', name: 'guava', version: guavaVersion
testCompile project(':test:testcommon')
testCompile group: 'com.google.code.gson', name: 'gson', version: gsonVersion
testCompile group: 'org.slf4j', name: 'log4j-over-slf4j', version: slf4jApiVersion
testCompile group: 'ch.qos.logback', name: 'logback-classic', version: qosLogbackVersion
}
javadoc {
title = "Pravega Client API"
dependsOn delombok
source = delombok.outputDir
failOnError = false
exclude "**/impl/**";
options.addBooleanOption("Xdoclint:all,-reference", true)
}
}
project('test:testcommon') {
dependencies {
compile group: 'junit', name :'junit', version: junitVersion
compile group: 'com.google.guava', name: 'guava', version: guavaVersion
compile group: 'org.apache.commons', name: 'commons-lang3', version: commonsLang3Version
compile group: 'commons-io', name: 'commons-io', version: commonsioVersion
compile group: 'io.netty', name: 'netty-all', version: nettyVersion
compile group: 'org.apache.curator', name: 'curator-test', version: apacheCuratorVersion, withoutLogger
}
javadoc {
dependsOn delombok
source = delombok.outputDir
failOnError = false
options.addBooleanOption("Xdoclint:none", true)
}
}
project('segmentstore:contracts') {
dependencies {
compile project(':common')
testCompile project(':test:testcommon')
}
javadoc {
dependsOn delombok
source = delombok.outputDir
failOnError = false
options.addBooleanOption("Xdoclint:all,-reference", true)
}
}
project('segmentstore:storage') {
dependencies {
compile project(':common')
compile project(':shared:protocol')
compile project(':segmentstore:contracts')
compile project(':shared:metrics')
testCompile project(':test:testcommon')
}
javadoc {
dependsOn delombok
source = delombok.outputDir
failOnError = false
options.addBooleanOption("Xdoclint:none", true)
}
}
project('segmentstore:storage:impl') {
dependencies {
compile project(':common')
compile project(':segmentstore:storage')
compile project(':shared:metrics')
compile group: 'org.apache.curator', name: 'curator-framework', version: apacheCuratorVersion
compile group: 'org.apache.bookkeeper', name: 'bookkeeper-server', version: bookKeeperVersion, withoutLogger
compile group: 'org.rocksdb', name: 'rocksdbjni', version: rocksdbjniVersion
testCompile project(':test:testcommon')
testCompile project(path:':segmentstore:storage', configuration:'testRuntime')
}
javadoc {
dependsOn delombok
source = delombok.outputDir
failOnError = false
options.addBooleanOption("Xdoclint:none", true)
}
}
project ('bindings') {
dependencies {
// For HDFS
compile group: 'org.apache.hadoop', name: 'hadoop-common', version: hadoopVersion, withoutLogger
compile group: 'org.apache.hadoop', name: 'hadoop-hdfs', version: hadoopVersion, withoutLogger
testCompile group: 'org.apache.hadoop', name: 'hadoop-minicluster', version: hadoopVersion, withoutLogger
testCompile group: 'ch.qos.logback', name: 'logback-classic', version: qosLogbackVersion
//For Extended S3
compile group: 'com.emc.ecs', name: 'object-client', version: ecsObjectClientVersion, withoutLogger
testCompile group: 'org.gaul', name: 's3proxy', version: '1.5.5'
testCompile group: 'commons-httpclient', name: 'commons-httpclient', version: '3.1'
testCompile group: 'org.apache.jclouds.provider', name: 'google-cloud-storage', version: '2.1.1'
compile project(':common')
compile project(':segmentstore:storage')
compile project(':shared:metrics')
testCompile project(':test:testcommon')
testCompile project(path: ':segmentstore:storage', configuration: 'testRuntime')
}
javadoc {
dependsOn delombok
source = delombok.outputDir
failOnError = false
options.addBooleanOption("Xdoclint:none", true)
}
}
project('segmentstore:server') {
dependencies {
compile project(':common')
compile project(':segmentstore:contracts')
compile project(':segmentstore:storage')
compile project(':shared:metrics')
testCompile project(':test:testcommon')
}
javadoc {
dependsOn delombok
source = delombok.outputDir
failOnError = false
options.addBooleanOption("Xdoclint:all,-reference,-missing", true)
}
}
project('segmentstore:server:host') {
apply plugin: 'application'
applicationName = "pravega-segmentstore"
mainClassName = "io.pravega.segmentstore.server.host.ServiceStarter"
startScripts {
classpath += files('$APP_HOME/pluginlib')
doLast {
def scriptFile = file getUnixScript()
scriptFile.text = scriptFile.text.replace('$APP_HOME/lib/pluginlib', '$APP_HOME/pluginlib/*')
def winScriptFile = file getWindowsScript()
winScriptFile.text = winScriptFile.text.replace('%APP_HOME%\\lib\\pluginlib', '%APP_HOME%\\pluginlib\\*')
}
}
applicationDefaultJvmArgs = ["-server", "-Xms512m", "-XX:+HeapDumpOnOutOfMemoryError",
"-Dlog.dir=PRAVEGA_APP_HOME/logs",
"-Dlog.name=segmentstore",
"-Dpravega.configurationFile=PRAVEGA_APP_HOME/conf/config.properties",
"-Dlogback.configurationFile=PRAVEGA_APP_HOME/conf/logback.xml"]
applicationDistribution.from('src/config') {
into "conf"
}
dependencies {
compile project(':common')
compile project(":shared:authplugin")
compile project(":shared:security")
compile project(':shared:cluster')
compile project(':segmentstore:contracts')
compile project(':client')
compile project(':segmentstore:storage')
compile project(':segmentstore:storage:impl')
compile project(':bindings')
compile project(':segmentstore:server')
compile group: 'ch.qos.logback', name: 'logback-classic', version: qosLogbackVersion
testCompile project(':test:testcommon')
testCompile group: 'org.apache.curator', name: 'curator-test', version: apacheCuratorVersion
testCompile project(path:':segmentstore:server', configuration:'testRuntime')
testCompile group: 'org.apache.hadoop', name: 'hadoop-minicluster', version: hadoopVersion, withoutLogger
testCompile project(path:':segmentstore:storage:impl', configuration:'testRuntime')
testCompile project(path:':bindings', configuration:'testRuntime')
testCompile group: 'commons-httpclient', name: 'commons-httpclient', version: '3.1'
}
task createAppWithGCLogging(type: CreateStartScripts) {
applicationName = "pravega-segmentstore-withGCLogging"
mainClassName = "io.pravega.controller.server.Main"
defaultJvmOpts = ["-server", "-Xms512m", "-XX:+HeapDumpOnOutOfMemoryError",
"-XX:+PrintGCDetails", "-XX:+PrintGCDateStamps",
"-Xloggc:PRAVEGA_APP_HOME/logs/gc.log", "-XX:+UseGCLogFileRotation",
"-XX:NumberOfGCLogFiles=2", "-XX:GCLogFileSize=64m",
"-Dlog.dir=PRAVEGA_APP_HOME/logs",
"-Dlog.name=segmentstore",
"-Dpravega.configurationFile=PRAVEGA_APP_HOME/conf/config.properties",
"-Dlogback.configurationFile=PRAVEGA_APP_HOME/conf/logback.xml"]
classpath = startScripts.classpath
outputDir = startScripts.outputDir
}
task admin(type: JavaExec) {
main = "io.pravega.segmentstore.server.host.admin.AdminRunner"
classpath = sourceSets.main.runtimeClasspath
standardInput = System.in
systemProperties System.getProperties()
}
applicationDistribution.into("bin") {
from(createAppWithGCLogging)
}
}
project('test:integration') {
apply plugin: 'application'
applicationName = "pravega-selftest"
mainClassName = "io.pravega.test.integration.selftest.SelfTestRunner"
applicationDefaultJvmArgs = ["-server", "-Xmx4g", "-XX:+HeapDumpOnOutOfMemoryError",
"-Dlog.dir=PRAVEGA_APP_HOME/logs",
"-Dlog.name=selftest"]
applicationDistribution.from('src/config') {
into "conf"
}
dependencies {
compile project(':common')
compile project(':client')
compile project(':segmentstore:server')
compile project(':segmentstore:server:host')
compile project(':controller')
compile project(':test:testcommon')
compile group: 'junit', name:'junit', version: junitVersion
compile group: 'org.apache.curator', name: 'curator-test', version: apacheCuratorVersion
testCompile group: 'ch.qos.logback', name: 'logback-classic', version: qosLogbackVersion
testCompile group: 'org.apache.commons', name: 'commons-csv', version: apacheCommonsCsvVersion
testCompile project(path:':common', configuration:'testRuntime')
testCompile project(path:':shared:protocol', configuration:'testRuntime')
testCompile project(path:':segmentstore:server', configuration:'testRuntime')
testCompile project(path:':segmentstore:server:host', configuration:'testRuntime')
testCompile project(path:':shared:metrics', configuration:'testRuntime')
// Workaround for intellij issue, since we cannot add both the compile dependency and the testRuntime
// dependency of the client project into the compile scope of the integration tests
compile files(project(':client').sourceSets.test.output)
}
task startServer(type: JavaExec) {
main = "io.pravega.segmentstore.server.host.ServiceStarter"
classpath = sourceSets.main.runtimeClasspath
standardInput = System.in
}
task startBenchmark(type: JavaExec) {
main = "io.pravega.segmentstore.server.host.ServiceBenchmark"
classpath = sourceSets.main.runtimeClasspath
standardInput = System.in
}
task startLocalService(type: JavaExec) {
main = "io.pravega.test.integration.demo.StartLocalService"
classpath = sourceSets.main.runtimeClasspath
standardInput = System.in
}
task startWriter(type: JavaExec) {
main = "io.pravega.test.integration.demo.StartWriter"
classpath = sourceSets.main.runtimeClasspath
standardInput = System.in
}
task startReader(type: JavaExec) {
main = "io.pravega.test.integration.demo.StartReader"
classpath = sourceSets.main.runtimeClasspath
standardInput = System.in
}
task startController(type: JavaExec) {
main = "io.pravega.controller.server.Main"
classpath = sourceSets.main.runtimeClasspath
standardInput = System.in
}
task startScaleTest(type: JavaExec) {
main = "io.pravega.test.integration.demo.ScaleTest"
classpath = sourceSets.main.runtimeClasspath
standardInput = System.in
}
task startEndToEndTransactionTest(type: JavaExec) {
main = "io.pravega.test.integration.demo.EndToEndTransactionTest"
classpath = sourceSets.main.runtimeClasspath
standardInput = System.in
}
task startEventProcessorTest(type: JavaExec) {
main = "io.pravega.test.integration.demo.EventProcessorTest"
classpath = sourceSets.main.runtimeClasspath
standardInput = System.in
}
task selftest(type: JavaExec) {
main = "io.pravega.test.integration.selftest.SelfTestRunner"
classpath = sourceSets.main.runtimeClasspath
standardInput = System.in
systemProperties System.getProperties()
}
}
project('shared:controller-api') {
apply plugin: 'com.google.protobuf'
dependencies {
compile project(':common')
compile group: 'org.apache.commons', name: 'commons-lang3', version: commonsLang3Version
compile group: 'commons-io', name: 'commons-io', version: commonsioVersion
compile "io.grpc:grpc-netty:" + grpcVersion
compile "io.grpc:grpc-auth:" + grpcVersion
compile "io.grpc:grpc-protobuf:" + grpcVersion
compile "io.grpc:grpc-stub:" + grpcVersion
compile group: 'io.netty', name: 'netty-tcnative-boringssl-static', version: nettyBoringSSLVersion
// Since Java 10 javax.annotation is no more bundled with the JRE
compileOnly group: 'javax.annotation', name: 'javax.annotation-api', version: javaxAnnotationVersion
}
javadoc {
exclude 'io/pravega/controller/*'
dependsOn delombok
source = delombok.outputDir
failOnError = false
options.addBooleanOption("Xdoclint:none", true)
}
}
project('controller') {
sourceSets {
main.resources.srcDirs += "$projectDir/src/conf"
test.resources.srcDirs += "$rootDir/config"
}
apply plugin: 'application'
applicationName = "pravega-controller"
mainClassName = "io.pravega.controller.server.Main"
applicationDefaultJvmArgs = ["-server", "-Xms128m", "-XX:+HeapDumpOnOutOfMemoryError",
"-Dconfig.file=PRAVEGA_APP_HOME/conf/controller.config.properties",
"-Dlogback.configurationFile=PRAVEGA_APP_HOME/conf/logback.xml",
"-Dlog.dir=PRAVEGA_APP_HOME/logs",
"-Dlog.name=controller"]
startScripts {
classpath += files('$APP_HOME/pluginlib')
doLast {
def scriptFile = file getUnixScript()
scriptFile.text = scriptFile.text.replace('$APP_HOME/lib/pluginlib', '$APP_HOME/pluginlib/*')
def winScriptFile = file getWindowsScript()
winScriptFile.text = winScriptFile.text.replace('%APP_HOME%\\lib\\pluginlib', '%APP_HOME%\\pluginlib\\*')
}
}
applicationDistribution.from('src/conf') {
into "conf"
rename "application.conf", "controller.conf"
}
applicationDistribution.into('') {
def pluginDirBase = new File('/tmp/dummy-dir')
pluginDirBase.mkdirs()
def logDir = new File(pluginDirBase.absolutePath + '/pluginlib')
logDir.mkdirs()
from {pluginDirBase}
}
dependencies {
compile project(':common')
compile project(":shared:authplugin")
compile project(":shared:security")
compile project(":shared:controller-api")
compile project(':shared:cluster')
compile project(":client")
compile project(":shared:metrics")
runtime group: 'ch.qos.logback', name: 'logback-classic', version: qosLogbackVersion
compile group: 'javax.servlet', name: 'javax.servlet-api', version: javaxServletApiVersion
compile(group: 'io.swagger', name : 'swagger-jersey2-jaxrs', version :swaggerJersey2JaxrsVersion) {
exclude group: 'com.google.guava', module: 'guava'
}
compile group: 'org.apache.curator', name: 'curator-framework', version: apacheCuratorVersion
compile group: 'org.apache.curator', name: 'curator-recipes', version: apacheCuratorVersion
compile group: 'org.apache.curator', name: 'curator-client', version: apacheCuratorVersion
compile group: 'org.apache.commons', name: 'commons-lang3', version: commonsLang3Version
compile group: 'org.glassfish.jersey.containers', name: 'jersey-container-grizzly2-http', version: jerseyVersion
compile group: 'org.glassfish.jersey.inject', name: 'jersey-hk2', version: jerseyVersion
compile group: 'org.glassfish.jersey.media', name: 'jersey-media-json-jackson', version: jerseyVersion
testCompile project(':test:testcommon')
testCompile group: 'org.apache.curator', name: 'curator-test', version: apacheCuratorVersion
compile group: 'io.netty', name: 'netty-tcnative-boringssl-static', version: nettyBoringSSLVersion
// since Java 10 JAXB is not more bundled with the JRE
compile group: 'javax.xml.bind', name: 'jaxb-api', version: jaxbVersion
compile group: 'org.glassfish.jaxb', name: 'jaxb-runtime', version: jaxbVersion
}
task createAppWithGCLogging(type: CreateStartScripts) {
applicationName = "pravega-controller-withGCLogging"
mainClassName = "io.pravega.controller.server.Main"
defaultJvmOpts = ["-server", "-Xms128m", "-XX:+HeapDumpOnOutOfMemoryError",
"-XX:+PrintGCDetails", "-XX:+PrintGCDateStamps",
"-Xloggc:PRAVEGA_APP_HOME/logs/gc.log", "-XX:+UseGCLogFileRotation",
"-XX:NumberOfGCLogFiles=2", "-XX:GCLogFileSize=64m",
"-Dconfig.file=PRAVEGA_APP_HOME/conf/controller.config.properties",
"-Dlogback.configurationFile=PRAVEGA_APP_HOME/conf/logback.xml",
"-Dlog.dir=PRAVEGA_APP_HOME/logs",
"-Dlog.name=controller"]
classpath = startScripts.classpath
outputDir = startScripts.outputDir
}
applicationDistribution.into("bin") {
from(createAppWithGCLogging)
}
}
project('standalone') {
apply plugin: 'application'
applicationName = "pravega-standalone"
mainClassName = "io.pravega.local.LocalPravegaEmulator"
applicationDefaultJvmArgs = ["-server", "-Xmx4g", "-XX:+HeapDumpOnOutOfMemoryError",
"-Dlogback.configurationFile=PRAVEGA_APP_HOME/conf/logback.xml",
"-Dsinglenode.configurationFile=PRAVEGA_APP_HOME/conf/standalone-config.properties",
"-Dlog.dir=PRAVEGA_APP_HOME/logs",
"-Dlog.name=pravega",
"-Xdebug",
"-Xrunjdwp:server=y,transport=dt_socket,address=8000,suspend=n"]
startScripts {
classpath += files('$APP_HOME/pluginlib')
doLast {
def scriptFile = file getUnixScript()
scriptFile.text = scriptFile.text.replace('$APP_HOME/lib/pluginlib', '$APP_HOME/pluginlib/*')
def winScriptFile = file getWindowsScript()
winScriptFile.text = winScriptFile.text.replace('%APP_HOME%\\lib\\pluginlib', '%APP_HOME%\\pluginlib\\*')
}
}
dependencies {
runtime group: 'ch.qos.logback', name: 'logback-classic', version: qosLogbackVersion
compile project(':common')
compile project(':client')
compile project(':segmentstore:server')
compile project(':segmentstore:server:host')
compile project(':controller')
compile project(':segmentstore:contracts')
compile project(':segmentstore:storage')
compile project(':segmentstore:storage:impl')
compile project(':bindings')
compile group: 'org.glassfish.jersey.containers', name: 'jersey-container-grizzly2-http', version: jerseyVersion
compile group: 'javax.ws.rs', name: 'javax.ws.rs-api', version: javaxwsrsApiVersion
compile group: 'org.apache.curator', name: 'curator-test', version: apacheCuratorVersion
// https://mvnrepository.com/artifact/org.apache.hadoop/hadoop-common
compile group: 'org.apache.hadoop', name: 'hadoop-common', version: hadoopVersion, withoutLogger
compile group: 'org.apache.hadoop', name: 'hadoop-hdfs', version: hadoopVersion, withoutLogger
compile group: 'org.apache.hadoop', name: 'hadoop-minicluster', version: hadoopVersion, withoutLogger
compile group: 'io.netty', name: 'netty-tcnative-boringssl-static', version: nettyBoringSSLVersion
testCompile project(':test:testcommon')
testCompile project(path:':common', configuration:'testRuntime')
testCompile project(path:':segmentstore:server', configuration:'testRuntime')
testCompile project(path:':segmentstore:server:host', configuration:'testRuntime')
}
configurations {
runtime.exclude group: "com.sun.jersey", module: "jersey-core"
runtime.exclude group: "com.sun.jersey", module: "jersey-server"
}
task startStandalone(type: JavaExec) {
main = "io.pravega.local.LocalPravegaEmulator"
classpath = sourceSets.main.runtimeClasspath
systemProperties System.getProperties()
systemProperties 'logback.configurationFile' : new File("${project.rootDir}/config/logback.xml")
systemProperties 'singlenode.configurationFile' : new File("${project.rootDir}/config/standalone-config.properties")
if (systemProperties.get("extDirs") != null) {
classpath += files(systemProperties.get("extDirs"))
}
jvmArgs "-Xdebug", "-Xrunjdwp:server=y,transport=dt_socket,address=8000,suspend=n"
}
}
project('test:system') {
// Specifically publish this test project
apply plugin: 'maven'
// override the compile java options to disable -Werror this will remove once https://github.com/pravega/pravega/issues/3152 is resolved.
compileJava {
options.compilerArgs.remove("-Werror")
}
dependencies {
// https://mvnrepository.com/artifact/com.mesosphere/marathon-client
runtime group: 'ch.qos.logback', name: 'logback-classic', version: qosLogbackVersion
compile group: 'com.mesosphere', name: 'marathon-client', version: marathonClientVersion, withoutLogger
compile project(':controller')
compile project(":client")
compile project(":test:testcommon")
compile group: 'junit', name: 'junit', version: junitVersion
compile group: 'javax.ws.rs', name: 'javax.ws.rs-api', version: javaxwsrsApiVersion
compile group: 'org.glassfish.jersey.core', name: 'jersey-client', version: jerseyVersion
compile group: 'org.glassfish.jersey.media', name: 'jersey-media-json-jackson', version: jerseyVersion
compile group: 'org.glassfish.jersey.connectors', name:'jersey-apache-connector', version:jerseyVersion
compile group: 'com.spotify', name: 'docker-client', version: dockerClientVersion
compile group: 'io.kubernetes', name: 'client-java', version: k8ClientVersion
}
//disable the default test task.
test {
exclude 'io/pravega/**'
}
jar { //create a fat jar
archiveName = "test-collection.jar"
from {
(configurations.runtime).collect {
it.isDirectory() ? it : zipTree(it)
}
}
from sourceSets.test.output
exclude 'META-INF/*.RSA', 'META-INF/*.SF', 'META-INF/*.DSA'
}
task testJarForDocker(type: Jar) {
archiveName = "test-docker-collection.jar"
from {
(configurations.runtime).collect {
it.isDirectory() ? it : zipTree(it)
}
}
from sourceSets.test.output
from sourceSets.main.output
exclude 'META-INF/*.RSA', 'META-INF/*.SF', 'META-INF/*.DSA'
}
//This is used to invoke systemTests
task startSystemTests(type: Test) {
ext.dockerRegistryUrl = project.hasProperty("dockerRegistryUrl") ? project.dockerRegistryUrl : ""
ext.repoUrl = project.hasProperty("repoUrl") ? project.repoUrl : ""
description 'Used to invoke system tests, example usage: gradle startSystemTests -DmasterIP=xx.xx.xx.xx'
testClassesDirs = sourceSets.test.output.classesDirs
classpath = sourceSets.test.runtimeClasspath
systemProperty "test_collection_jar_path", "$jar.archivePath.path"
systemProperty "execType", System.getProperty("execType")
systemProperty "masterIP", System.getProperty("masterIP")
systemProperty "imageVersion", System.getProperty("imageVersion")
systemProperty "skipServiceInstallation", System.getProperty("skipServiceInstallation")
systemProperty "segmentStoreExtraEnv", System.getProperty("segmentStoreExtraEnv")
if (System.getProperty("execType") == null) {
systemProperty "execType", "REMOTE_SEQUENTIAL"
}
if (System.getProperty("masterIP") == null) {
systemProperty "masterIP", "INVALID_MASTER_IP"
}
if (System.getProperty("imageVersion") == null) {
systemProperty "imageVersion", "INVALID_IMAGE_VERSION"
}
if (System.getProperty("skipServiceInstallation") == null) {
//skipServiceInstallation by default.
systemProperty "skipServiceInstallation", "true"
}
maxParallelForks = 1
systemProperty "dockerImageRegistry", "${dockerRegistryUrl}"
systemProperty "testVersion", pravegaVersion
systemProperty "testArtifactUrl", "${repoUrl}/io/pravega/pravega-test-system/" +
pravegaVersion+"/pravega-test-system-"+ pravegaVersion + ".jar"
onlyIf { dockerRegistryUrl && repoUrl }
}
task copyTestsToK8sCluster(type: Exec) {
description 'Used to copy test artifacts to the Kubernetes Cluster.'
dependsOn 'jar'
commandLine './kubernetes/setupTestPod.sh'
}
task startK8SystemTests(type: Test) {
tasks.withType(Exec) { environment "tier2Type", System.getProperty("tier2Type", "nfs") }
dependsOn 'copyTestsToK8sCluster' // ensure test artifacts are copied to the cluster.
description 'Used to invoke K8s based System Tests, example usage: gradle startK8SystemTests'
testClassesDirs = sourceSets.test.output.classesDirs
classpath = sourceSets.test.runtimeClasspath
ext.repoUrl = project.hasProperty("repoUrl") ? project.repoUrl : ""
systemProperty "execType", "KUBERNETES"
systemProperty "pravegaOperatorImage", System.getProperty("pravegaOperatorImage", "pravega/pravega-operator:latest")
systemProperty "zookeeperOperatorImage", System.getProperty("zookeeperOperatorImage", "pravega/zookeeper-operator:latest")
// The below properties are used to to specify the pravega docker image properties
// e.g: private-docker-repo/pravega-prefix/pravega:version
if (System.getProperty("dockerRegistryUrl") != null) { // docker images are pulled from dockerhub if dockerRegistryUrl is not specified.
systemProperty "dockerRegistryUrl", System.getProperty("dockerRegistryUrl") + "/"
}
systemProperty "imagePrefix", System.getProperty("imagePrefix", "pravega") // the default value of imagePrefix is pravega.
systemProperty "pravegaImageName", System.getProperty("pravegaImageName", "pravega") // pravega image name
systemProperty "bookkeeperImageName", System.getProperty("bookkeeperImageName", "bookkeeper") // bookkeeper image name
systemProperty "zookeeperImageName", System.getProperty("zookeeperImageName", "zookeeper") // zookkeeper image name
systemProperty "zookeeperImageVersion", System.getProperty("zookeeperImageVersion", "latest") // zookeeper image version
systemProperty "imageVersion", System.getProperty("imageVersion") // pravega version.
// bookkeeper version defaults to pravega version.
systemProperty "pravegaBookkeeperVersion", System.getProperty("pravegaBookkeeperVersion", System.getProperty("imageVersion"))
// tier2Type , default is NFS.
systemProperty "tier2Type", System.getProperty("tier2Type", "nfs")
// tier2 Configuration, specified as comma seperated key values k1=v1,k2=v2
systemProperty "tier2Config", System.getProperty("tier2Config")
//testPodImage , default is openjdk:8u181-jre-alpine
systemProperty "testPodImage", System.getProperty("testPodImage", "openjdk:8u181-jre-alpine")
if (System.getProperty("imageVersion") == null) {
systemProperty "imageVersion", "INVALID_IMAGE_VERSION"
}
systemProperty "securityEnabled", System.getProperty("securityEnabled", "false")
systemProperty "logLevel", System.getProperty("log.level", "DEBUG")
maxParallelForks = 1
}
task execShellScript(type: Exec) {
ext.awsExecution = project.hasProperty('awsExecution') ? project.awsExecution : 'false'
if(ext.getProperty('awsExecution').toString().equals("true")) {
commandLine './aws/preTestScript.sh'
args "$aws_access_key", "$aws_secret_key", "$aws_region", "$aws_key_name", "$cred_path", "$config_path", "$pravega_org", "$pravega_branch"
} else if (project.hasProperty('CLUSTER_NAME')) {
commandLine "./preTestScript.sh"
args "$CLUSTER_NAME", "$MASTER", "$NUM_SLAVES"
}
}
String variable
task setAwsMasterIp(type: Exec) {
commandLine 'echo', 'setting master ip for system tests execution on AWS'
doLast {
def masterIpStdOut = new ByteArrayOutputStream()
exec {
workingDir "$rootDir/test/system/aws"
executable = "terraform"
args "output", "ip"
standardOutput = masterIpStdOut
}
variable = masterIpStdOut.toString()
}
}
//This is used to invoke docker based systemTests
task startSystemTestsWithDocker(type: Test) {
dependsOn 'testJarForDocker', 'execShellScript'
if (System.getProperty("awsExec").equals("true")) {
setAwsMasterIp.outputs.upToDateWhen { false }
dependsOn 'setAwsMasterIp'
}
doFirst {
systemProperty "awsMasterIP", variable
}
ext.dockerRegistryUrl = project.hasProperty("dockerRegistryUrl") ? project.dockerRegistryUrl : ""
description 'Used to invoke docker based system tests, example usage: gradle startSystemTests -DmasterIP=xx.xx.xx.xx'
testClassesDirs = sourceSets.test.output.classesDirs
classpath = sourceSets.test.runtimeClasspath
systemProperty "execType", System.getProperty("execType")
systemProperty "masterIP", System.getProperty("masterIP")
systemProperty "imageVersion", System.getProperty("imageVersion")
systemProperty "skipServiceInstallation", System.getProperty("skipServiceInstallation")
systemProperty "segmentStoreExtraEnv", System.getProperty("segmentStoreExtraEnv")
systemProperty "awsExec", System.getProperty("awsExec")
systemProperty "pravegaImageName", System.getProperty("pravegaImageName", "pravega") // pravega image name
systemProperty "bookkeeperImageName", System.getProperty("bookkeeperImageName", "bookkeeper") // bookkeeper image name
systemProperty "zookeeperImageName", System.getProperty("zookeeperImageName", "zookeeper") // zookkeeper image name
systemProperty "zookeeperImageVersion", System.getProperty("zookeeperImageVersion", "latest") // zookeeper image version
systemProperty "imagePrefix", System.getProperty("imagePrefix", "pravega") // the default value of imagePrefix is pravega.
if (System.getProperty("execType") == null) {
systemProperty "execType", "DOCKER"
}
if (System.getProperty("masterIP") == null) {
systemProperty "masterIP", "INVALID_MASTER_IP"
}
if (System.getProperty("imageVersion") == null) {
systemProperty "imageVersion", "INVALID_IMAGE_VERSION"
}
if (System.getProperty("skipServiceInstallation") == null) {
//skipServiceInstallation by default.
systemProperty "skipServiceInstallation", "false"
}
if (System.getProperty("awsExec") == null) {
systemProperty "awsExec", "false"
}
maxParallelForks = 1
systemProperty "dockerImageRegistry", "${dockerRegistryUrl}"
systemProperty "logLevel", System.getProperty("log.level", "DEBUG")
}
task collectSystemTestLogsFromAws(type: Exec) {
if (project.hasProperty('aws_secret_key')) {
commandLine './aws/postTestScript.sh'
args "$aws_access_key", "$aws_secret_key", "$aws_region", "$aws_key_name", "$cred_path", "$config_path", "$pravega_org", "$pravega_branch", "$travis_commit"
}
}
}
def getProjectVersion() {
String ver = pravegaVersion
if (grgit && ver.contains("-SNAPSHOT")) {
String versionLabel = ver.substring(0, ver.indexOf("-SNAPSHOT"))
def count = grgit.log(includes:['HEAD']).size()
def commitId = "${grgit.head().abbreviatedId}"
ver = versionLabel + "-" + count + "." + commitId + "-SNAPSHOT"
}
return ver
}
subprojects {
task allDeps(type: DependencyReportTask) {}
}
task publishAllJars() {
dependsOn ':authplugin:publish'
dependsOn ':client:publish'
dependsOn ':common:publish'
dependsOn ':shared:publish'
dependsOn ':shared:security'
dependsOn ':shared:protocol:publish'
dependsOn ':segmentstore:contracts:publish'
dependsOn ':segmentstore:storage:publish'
dependsOn ':segmentstore:storage:impl:publish'
dependsOn ':segmentstore:server:publish'
dependsOn ':segmentstore:server:host:publish'
dependsOn ':shared:metrics:publish'
dependsOn ':shared:controller-api:publish'
dependsOn ':controller:publish'
dependsOn ':standalone:publish'
dependsOn ':test:system:publish'
}
task sourceCopy(type: Copy) {
from rootDir
into 'source'
}
task sourceTar(type: Tar) {