Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Untangle & update Google deps [PROD-397, BA-6155] #5565

Merged
merged 11 commits into from
Jul 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ lazy val centaur = project
.dependsOn(womtool)

lazy val services = project
.withLibrarySettings("cromwell-services")
.withLibrarySettings("cromwell-services", servicesDependencies)
.dependsOn(databaseSql)
.dependsOn(databaseMigration)
.dependsOn(cloudSupport)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import akka.stream._
import akka.stream.scaladsl.{Flow, GraphDSL, MergePreferred, Partition}
import com.google.api.client.googleapis.batch.BatchRequest
import com.google.api.client.http.{HttpRequest, HttpRequestInitializer}
import com.google.api.client.json.jackson2.JacksonFactory
import com.google.api.services.storage.Storage
import cromwell.cloudsupport.gcp.GoogleConfiguration
import cromwell.cloudsupport.gcp.gcs.GcsStorage
import cromwell.engine.io.IoActor._
Expand Down Expand Up @@ -48,7 +50,10 @@ class GcsBatchFlow(batchSize: Int, scheduler: Scheduler, onRetry: IoCommandConte
}
}

private val batch: BatchRequest = new BatchRequest(GcsStorage.HttpTransport, httpRequestInitializer)
private val batchRequest: BatchRequest = {
val storage = new Storage(GcsStorage.HttpTransport, JacksonFactory.getDefaultInstance, httpRequestInitializer)
storage.batch()
}

val flow = GraphDSL.create() { implicit builder =>
import GraphDSL.Implicits._
Expand Down Expand Up @@ -114,12 +119,12 @@ class GcsBatchFlow(batchSize: Int, scheduler: Scheduler, onRetry: IoCommandConte
}

// Add all requests to the batch
contexts foreach { _.queue(batch) }
contexts foreach { _.queue(batchRequest) }

// Try to execute the batch request.
// If it fails with an IO Exception, fail all the underlying promises with a retyrable BatchFailedException
// Otherwise fail with the original exception
Try(batch.execute()) match {
Try(batchRequest.execute()) match {
case Failure(failure: IOException) => failAllPromisesWith(BatchFailedException(failure))
case Failure(failure) => failAllPromisesWith(failure)
case _ =>
Expand Down
29 changes: 18 additions & 11 deletions project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,22 @@ object Dependencies {
private val ficusV = "1.4.4"
private val fs2V = "2.0.0"
private val fs2VStatsDProxy = "1.0.3"
private val googleApiClientV = "1.28.0"
private val googleCloudCoreV = "1.61.0"
private val googleApiClientV = "1.30.9"
private val googleCloudBigQueryV = "1.116.3"
private val googleCloudKmsV = "v1-rev63-1.25.0"
private val googleCloudMonitoringV = "1.70.0"
private val googleCloudMonitoringV = "1.100.1"
private val googleCloudNioV = "0.61.0-alpha"
private val googleCloudStorageV = "1.111.1"
private val googleGaxGrpcV = "1.57.0"
private val googleGenomicsServicesV1ApiV = "v1alpha2-rev495-1.23.0"
private val googleGenomicsServicesV2Alpha1ApiV = "v2alpha1-rev31-1.25.0"
private val googleHttpClientApacheV = "2.1.2"
private val googleHttpClientV = "1.36.0"
private val googleLifeSciencesServicesV2BetaApiV = "v2beta-rev5-1.25.0"
private val googleHttpClientApacheV = "2.1.1"
private val googleHttpClientV = "1.29.1"
private val googleOauth2V = "0.13.0"
private val googleOauth2V = "0.21.0"
private val googleOauthClientV = "1.31.0"
private val googleCloudResourceManagerV = "0.87.0-alpha"
private val grpcV = "1.20.0"
private val grpcV = "1.28.1"
private val guavaV = "27.0.1-jre"
private val heterodonV = "1.0.0-beta3"
private val hsqldbV = "2.4.1"
Expand Down Expand Up @@ -171,8 +174,8 @@ object Dependencies {

val implDrsDependencies = List(
"org.apache.commons" % "commons-lang3" % commonsLang3V,
"com.google.cloud" % "google-cloud-storage" % googleCloudCoreV,
"com.google.oauth-client" % "google-oauth-client" % googleApiClientV
"com.google.cloud" % "google-cloud-storage" % googleCloudStorageV,
"com.google.oauth-client" % "google-oauth-client" % googleOauthClientV
) ++ circeDependencies ++ catsDependencies

// Internal collections of dependencies
Expand Down Expand Up @@ -487,7 +490,7 @@ object Dependencies {
val centaurDependencies = List(
"org.apache.commons" % "commons-math3" % commonsMathV,
"com.github.kxbmap" %% "configs" % configsV,
"com.google.cloud" % "google-cloud-bigquery" % googleCloudCoreV % IntegrationTest,
"com.google.cloud" % "google-cloud-bigquery" % googleCloudBigQueryV % IntegrationTest,
"org.gnieh" %% "diffson-spray-json" % "4.0.1"
) ++ circeDependencies ++ slf4jBindingDependencies ++ cloudSupportDependencies ++ http4sDependencies

Expand All @@ -506,6 +509,10 @@ object Dependencies {
"net.thisptr" % "jackson-jq" % jacksonJqV % Test
)

val servicesDependencies = List(
"com.google.api" % "gax-grpc" % googleGaxGrpcV % Test
)

val serverDependencies = slf4jBindingDependencies

val cromiamDependencies = List(
Expand Down Expand Up @@ -551,7 +558,7 @@ object Dependencies {

val drsLocalizerDependencies = List(
"com.google.auth" % "google-auth-library-oauth2-http" % googleOauth2V,
"com.google.cloud" % "google-cloud-storage" % googleCloudCoreV,
"com.google.cloud" % "google-cloud-storage" % googleCloudStorageV,
"org.typelevel" %% "cats-effect" % catsEffectV,
"com.iheart" %% "ficus" % ficusV,
"com.softwaremill.sttp" %% "circe" % sttpV
Expand Down
1 change: 1 addition & 0 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ addSbtPlugin("com.github.gseitz" % "sbt-release" % "1.0.8")
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.5.1")
addSbtPlugin("org.xerial.sbt" % "sbt-pack" % "0.10.1")
addSbtPlugin("io.get-coursier" % "sbt-coursier" % "1.1.0-M1")
addSbtPlugin("net.virtual-void" % "sbt-dependency-graph" % "0.10.0-RC1")