forked from SemanticBeeng/seldoncloudflow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
executable file
·132 lines (117 loc) · 5.18 KB
/
build.sbt
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
import sbt._
import sbt.Keys._
import Dependencies._
import scalariform.formatter.preferences._
name := "TFGRPC"
lazy val thisVersion = "0.1"
scalaVersion in ThisBuild := "2.12.10"
version in ThisBuild := thisVersion
test in ThisBuild := {}
lazy val protocols = (project in file("./protocol"))
.settings(
PB.targets in Compile := Seq(
scalapb.gen() -> (sourceManaged in Compile).value),
libraryDependencies ++= Seq(
"com.thesamet.scalapb" %% "scalapb-runtime" % scalapb.compiler.Version.scalapbVersion % "protobuf",
"com.thesamet.scalapb" %% "scalapb-runtime-grpc" % scalapb.compiler.Version.scalapbVersion
) ++ grpcDependencies,
// dependencyOverrides += "io.grpc" % "grpc-netty" % "1.20.0",
// dependencyOverrides += "io.grpc" % "grpc-protobuf" % "1.20.0",
// dependencyOverrides += "io.grpc" % "grpc-stub" % "1.20.0",
// dependencyOverrides += "io.grpc" % "grpc-core" % "1.20.0"
)
lazy val support = (project in file("./support"))
.enablePlugins(CloudflowAkkaStreamsLibraryPlugin)
.settings(
name := "support",
version := thisVersion,
libraryDependencies ++= Seq(gson, scalajHTTP, akkaHttpJsonJackson, fabric8Client, tensorFlow, tensorFlowProto, minio, typesafeConfig, ficus, logback, scalaTest),
// dependencyOverrides += "io.grpc" % "grpc-netty" % "1.20.0",
// dependencyOverrides += "io.grpc" % "grpc-protobuf" % "1.20.0",
// dependencyOverrides += "io.grpc" % "grpc-stub" % "1.20.0",
// dependencyOverrides += "io.grpc" % "grpc-core" % "1.20.0"
)
.dependsOn(protocols)
.settings(commonSettings)
lazy val grpcClient = (project in file("./grpcclient"))
.dependsOn(support)
.settings(commonSettings)
lazy val SeldonGRPCModelServing = (project in file("./seldon-grpc"))
.enablePlugins(CloudflowApplicationPlugin)
.settings(
name := "seldon-grpc",
version := thisVersion
)
.settings(commonSettings)
.dependsOn(support)
lazy val SeldonRESTModelServing = (project in file("./seldon-rest"))
.enablePlugins(CloudflowApplicationPlugin)
.settings(
name := "seldon-rest",
version := thisVersion
)
.settings(commonSettings)
.dependsOn(support)
lazy val FraudGRPCModelServing = (project in file("./fraud-grpc"))
.enablePlugins(CloudflowApplicationPlugin)
.settings(
name := "fraud-grpc",
version := thisVersion,
// dependencyOverrides += "io.grpc" % "grpc-netty" % "1.20.0",
// dependencyOverrides += "io.grpc" % "grpc-protobuf" % "1.20.0",
// dependencyOverrides += "io.grpc" % "grpc-stub" % "1.20.0",
// dependencyOverrides += "io.grpc" % "grpc-core" % "1.20.0"
)
.settings(commonSettings)
.dependsOn(support)
lazy val FraudRESTModelServing = (project in file("./fraud-rest"))
.enablePlugins(CloudflowApplicationPlugin)
.settings(
name := "fraud-rest",
version := thisVersion
)
.settings(commonSettings)
.dependsOn(support)
lazy val commonScalacOptions = Seq(
"-encoding", "UTF-8",
"-target:jvm-1.8",
"-Xlog-reflective-calls",
"-Xlint:_",
"-deprecation",
"-feature",
"-language:_",
"-unchecked"
)
lazy val scalacTestCompileOptions = commonScalacOptions ++ Seq(
// "-Xfatal-warnings", // Avro generates unused imports, so this is commented out not to break build
"-Ywarn-dead-code", // Warn when dead code is identified.
"-Ywarn-extra-implicit", // Warn when more than one implicit parameter section is defined.
"-Ywarn-numeric-widen", // Warn when numerics are widened.
"-Ywarn-unused:implicits", // Warn if an implicit parameter is unused.
"-Ywarn-unused:imports", // Warn if an import selector is not referenced.
"-Ywarn-unused:locals", // Warn if a local definition is unused.
"-Ywarn-unused:params", // Warn if a value parameter is unused. (But there's no way to suppress warning when legitimate!!)
"-Ywarn-unused:patvars", // Warn if a variable bound in a pattern is unused.
"-Ywarn-unused:privates", // Warn if a private member is unused.
)
lazy val scalacSrcCompileOptions = scalacTestCompileOptions ++ Seq(
"-Ywarn-value-discard")
lazy val commonSettings = Seq(
scalacOptions in Compile := scalacSrcCompileOptions,
scalacOptions in Test := scalacTestCompileOptions,
scalacOptions in (Compile, console) := commonScalacOptions,
scalacOptions in (Test, console) := commonScalacOptions,
scalariformPreferences := scalariformPreferences.value
.setPreference(AlignParameters, true)
.setPreference(AlignSingleLineCaseStatements, true)
.setPreference(AlignSingleLineCaseStatements.MaxArrowIndent, 90)
.setPreference(DoubleIndentConstructorArguments, true)
.setPreference(DoubleIndentMethodDeclaration, true)
.setPreference(IndentLocalDefs, true)
.setPreference(IndentPackageBlocks, true)
.setPreference(RewriteArrowSymbols, true)
.setPreference(DanglingCloseParenthesis, Preserve)
.setPreference(NewlineAtEndOfFile, true)
.setPreference(AllowParamGroupsOnNewlines, true)
.setPreference(SpacesWithinPatternBinders, false) // otherwise case head +: tail@_ fails to compile!
)