diff --git a/build.sbt b/build.sbt index db8cd1c906..1355952320 100644 --- a/build.sbt +++ b/build.sbt @@ -17,6 +17,8 @@ import sbt.Tests.{Group, SubProcess} // java incompatibility is probably not an issue, hopefully we can cross build flink 1.17 & 1.18 without code changes lazy val scala_2_12 = "2.12.18" +lazy val scala_2_13 = "2.13.14" + // spark deps: https://mvnrepository.com/artifact/org.apache.spark/spark-core_2.12/3.5.0 // avro 1.11.2, jackson: 2.15.2 lazy val spark_3_5 = "3.5.1" @@ -48,7 +50,7 @@ inThisBuild( lazy val supportedVersions = List(scala_2_12) // List(scala211, scala212, scala213) lazy val root = (project in file(".")) - .aggregate(api, aggregator, online, spark, flink, cloud_gcp) + .aggregate(api, aggregator, online, spark, flink, cloud_gcp, hub) .settings(name := "chronon") val spark_sql = Seq( @@ -91,7 +93,6 @@ lazy val api = project }.taskValue, crossScalaVersions := supportedVersions, libraryDependencies ++= spark_sql_provided, - libraryDependencies ++= Seq( "org.apache.thrift" % "libthrift" % "0.13.0", // cannot upgrade this without breaking compatibility "org.scala-lang" % "scala-reflect" % scalaVersion.value, @@ -100,16 +101,16 @@ lazy val api = project "org.scalatest" %% "scalatest" % "3.2.19" % "test", "org.scalatestplus" %% "mockito-3-4" % "3.2.10.0" % "test" ) -) + ) lazy val aggregator = project .dependsOn(api.%("compile->compile;test->test")) .settings( libraryDependencies ++= Seq( - "com.yahoo.datasketches" % "sketches-core" % "0.13.4", - "com.google.code.gson" % "gson" % "2.10.1" - ), - libraryDependencies ++= spark_sql_provided, + "com.yahoo.datasketches" % "sketches-core" % "0.13.4", + "com.google.code.gson" % "gson" % "2.10.1" + ), + libraryDependencies ++= spark_sql_provided ) // todo add a service module with spark as a hard dependency @@ -129,7 +130,6 @@ lazy val online = project libraryDependencies ++= flink_all.map(_ % "provided") ) - lazy val tmp_warehouse = "/tmp/chronon/" def cleanSparkMeta(): Unit = { Folder.clean(file(".") / "spark" / "spark-warehouse", @@ -158,7 +158,7 @@ lazy val spark = project crossScalaVersions := supportedVersions, libraryDependencies ++= spark_all_provided, libraryDependencies ++= spark_all.map(_ % "test"), - libraryDependencies += "jakarta.servlet" % "jakarta.servlet-api" % "4.0.3", + libraryDependencies += "jakarta.servlet" % "jakarta.servlet-api" % "4.0.3" ) lazy val flink = project @@ -177,12 +177,24 @@ lazy val cloud_gcp = project libraryDependencies ++= spark_all ) +lazy val hub = (project in file("hub")) + .enablePlugins(PlayScala) + .settings( + name := "hub", + // play dropped support for Scala 2.12 in release 2.9 + scalaVersion := scala_2_13, + libraryDependencies ++= Seq( + guice, + "org.scalatestplus.play" %% "scalatestplus-play" % "5.1.0" % Test + ) + ) + ThisBuild / assemblyMergeStrategy := { case PathList("META-INF", "MANIFEST.MF") => MergeStrategy.discard - case PathList("META-INF", _*) => MergeStrategy.filterDistinctLines + case PathList("META-INF", _*) => MergeStrategy.filterDistinctLines case "plugin.xml" => MergeStrategy.last - case PathList("com", "fasterxml", _*) => MergeStrategy.last - case PathList("com", "google", _*) => MergeStrategy.last + case PathList("com", "fasterxml", _*) => MergeStrategy.last + case PathList("com", "google", _*) => MergeStrategy.last case _ => MergeStrategy.first } exportJars := true diff --git a/hub/app/controllers/FrontendController.scala b/hub/app/controllers/FrontendController.scala new file mode 100644 index 0000000000..95ef955938 --- /dev/null +++ b/hub/app/controllers/FrontendController.scala @@ -0,0 +1,13 @@ +package controllers + +import play.api.mvc._ + +import javax.inject._ + +@Singleton +class FrontendController @Inject() (val controllerComponents: ControllerComponents) extends BaseController { + def home(): Action[AnyContent] = + Action { implicit request: Request[AnyContent] => + Ok(views.html.index("Welcome to the Zipline homepage!")) + } +} diff --git a/hub/app/views/index.scala.html b/hub/app/views/index.scala.html new file mode 100644 index 0000000000..bdea5d4d4e --- /dev/null +++ b/hub/app/views/index.scala.html @@ -0,0 +1,12 @@ +@(message: String) + + + + + Chronon Home + + + +

@message

+ + diff --git a/hub/conf/application.conf b/hub/conf/application.conf new file mode 100644 index 0000000000..815f0dfdb3 --- /dev/null +++ b/hub/conf/application.conf @@ -0,0 +1,21 @@ +# This is the main configuration file for the application. +# https://www.playframework.com/documentation/latest/ConfigFile + +play.http.secret.key = ${?PLAY_HTTP_SECRET_KEY} +play.i18n.langs = ["en"] + +# Database configuration +# ~~~~~ +# You can declare as many datasources as you want. +# By convention, the default datasource is named `default` +# +# db.default.driver=org.h2.Driver +# db.default.url="jdbc:h2:mem:play" + +# Evolutions +# ~~~~~ +# You can disable evolutions if needed +# play.evolutions.enabled=false + +# You can disable evolutions for a specific datasource if necessary +# play.evolutions.db.default.enabled=false diff --git a/hub/conf/routes b/hub/conf/routes new file mode 100644 index 0000000000..58c1c8b8d1 --- /dev/null +++ b/hub/conf/routes @@ -0,0 +1,4 @@ +GET / controllers.FrontendController.home() + +# Map static resources from the /public folder to the /assets URL path +GET /assets/*file controllers.Assets.versioned(path="/public", file: Asset) diff --git a/hub/public/images/favicon.png b/hub/public/images/favicon.png new file mode 100644 index 0000000000..90257ddb72 Binary files /dev/null and b/hub/public/images/favicon.png differ diff --git a/project/plugins.sbt b/project/plugins.sbt index aab4e5e8aa..9d0bf29429 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -7,3 +7,4 @@ addSbtPlugin("com.github.sbt" % "sbt-git" % "2.0.0") addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.10.0") addSbtPlugin("io.get-coursier" % "sbt-shading" % "2.1.1") addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.12.1") +addSbtPlugin("org.playframework" % "sbt-plugin" % "3.0.5")