diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 11089d9..e204baf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,7 +31,7 @@ jobs: - uses: actions/setup-java@v3 with: - java-version: '8' + java-version: '11' distribution: 'corretto' cache: 'sbt' diff --git a/build.sbt b/build.sbt index c8e6f46..f63aeca 100644 --- a/build.sbt +++ b/build.sbt @@ -1,5 +1,3 @@ -addCommandAlias("dist", ";riffRaffArtifact") - import play.sbt.PlayImport.PlayKeys._ name := "path-manager" @@ -8,19 +6,33 @@ resolvers += "Typesafe repository" at "https://repo.typesafe.com/typesafe/releas version := "1.0" -val awsVersion = "1.12.129" +val awsVersion = "1.12.583" lazy val dependencies = Seq( "com.amazonaws" % "aws-java-sdk-dynamodb" % awsVersion, "com.amazonaws" % "aws-java-sdk-cloudwatch" % awsVersion, "com.amazonaws" % "aws-java-sdk-ec2" % awsVersion, - "org.apache.commons" % "commons-lang3" % "3.11", - "net.logstash.logback" % "logstash-logback-encoder" % "6.6", - "ch.qos.logback" % "logback-core" % "1.2.7", - "ch.qos.logback" % "logback-classic" % "1.2.7", - "org.scalatestplus.play" %% "scalatestplus-play" % "5.1.0" % "test", + "org.apache.commons" % "commons-lang3" % "3.14.0", + "net.logstash.logback" % "logstash-logback-encoder" % "7.3", + "org.scalatestplus.play" %% "scalatestplus-play" % "7.0.1" % "test", "com.whisk" %% "docker-testkit-scalatest" % "0.9.9" % "test", - "com.whisk" %% "docker-testkit-impl-spotify" % "0.9.9" % "test" + + // By default, logstash-logback-encoder will tell jackson to dynamically discover all available jackson modules + // on the classpath by calling objectMapper.findAndRegisterModules() + // If jackson-module-jaxb-annotations is on the classpath, jackson will try to register it and fail because + // javax.xml.bind:jaxb-api is missing. This was not an issue before Java 9, because javax.xml.bind:jaxb-api was + // included in the JDK + // + // The options to solve this were either to add javaxb-api as a dependency, or to exclude jackson-module-jaxb-annotations. + // We chose the latter because it is a smaller change and does not introduce a new dependency. + // + // See https://github.com/logfellow/logstash-logback-encoder/issues/1005 + + "com.whisk" %% "docker-testkit-impl-spotify" % "0.9.9" % "test" exclude("com.fasterxml.jackson.module", "jackson-module-jaxb-annotations"), + + // docker-testkit-impl-spotif depends on jnr-unixsocket:0.18, which doesn't support M1 silicon + // see https://github.com/spotify/docker-client/pull/1221 (unmerged at present) + "com.github.jnr" % "jnr-unixsocket" % "0.38.22" % "test" exclude("com.fasterxml.jackson.module", "jackson-module-jaxb-annotations") ) enablePlugins(DockerCompose) @@ -41,10 +53,9 @@ lazy val pathManager = project.in(file("path-manager")) "-J-XX:MaxMetaspaceSize=500m", "-J-XX:+UseConcMarkSweepGC", "-J-XX:+PrintGCDetails", - "-J-XX:+PrintGCDateStamps", s"-J-Xloggc:/var/log/${packageName.value}/gc.log" ), - debianPackageDependencies := Seq("openjdk-8-jre-headless"), + debianPackageDependencies := Seq("java11-runtime-headless"), maintainer := "Editorial Tools Developers ", packageSummary := description.value, packageDescription := description.value, @@ -56,8 +67,6 @@ lazy val pathManager = project.in(file("path-manager")) name := "path-manager", playDefaultPort := 10000, libraryDependencies ++= dependencies, - //Necessary to override jackson-databind versions due to AWS and Play incompatibility - dependencyOverrides += "com.fasterxml.jackson.core" % "jackson-databind" % "2.11.4", Universal / packageName := normalizedName.value, Universal/ topLevelDirectory := Some(normalizedName.value), ) diff --git a/path-manager/app/services/Dynamo.scala b/path-manager/app/services/Dynamo.scala index 6a39068..616b99f 100644 --- a/path-manager/app/services/Dynamo.scala +++ b/path-manager/app/services/Dynamo.scala @@ -5,7 +5,7 @@ import com.amazonaws.client.builder.AwsClientBuilder.EndpointConfiguration import com.amazonaws.services.dynamodbv2.document.{DynamoDB, Item} import com.amazonaws.services.dynamodbv2.model._ import com.amazonaws.services.dynamodbv2.{AmazonDynamoDB, AmazonDynamoDBClientBuilder} -import play.api.{Logger, Logging} +import play.api.Logging object Dynamo extends AwsInstanceTags with Logging { diff --git a/path-manager/app/services/Metrics.scala b/path-manager/app/services/Metrics.scala index 79d062d..a8d0a58 100644 --- a/path-manager/app/services/Metrics.scala +++ b/path-manager/app/services/Metrics.scala @@ -3,7 +3,7 @@ package services import java.util.Date import java.util.concurrent.atomic.{AtomicLong, AtomicReference} -import akka.actor.{Actor, ActorSystem, Props} +import org.apache.pekko.actor.{Actor, ActorSystem, Props} import com.amazonaws.services.cloudwatch.model._ import scala.concurrent.ExecutionContext.Implicits.global diff --git a/project/build.properties b/project/build.properties index 6a9f038..dde206f 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=1.7.3 +sbt.version=1.9.6 \ No newline at end of file diff --git a/project/plugins.sbt b/project/plugins.sbt index fb0ddb4..178e09d 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,19 +1,5 @@ -// The Typesafe repository -resolvers += "Typesafe repository" at "https://repo.typesafe.com/typesafe/releases/" - -addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.8.11") +addSbtPlugin("org.playframework" % "sbt-plugin" % "3.0.2") addSbtPlugin("com.github.ehsanyou" % "sbt-docker-compose" % "2.0.0") -libraryDependencies += "org.vafer" % "jdeb" % "1.3" artifacts Artifact("jdeb", "jar", "jar") - -/* - Because scala-xml has not be updated to 2.x in sbt yet but has in sbt-native-packager - See: https://github.com/scala/bug/issues/12632 - - This effectively overrides the safeguards (early-semver) put in place by the library authors ensuring binary compatibility. - We consider this a safe operation because it only affects the compilation of build.sbt, not of the application build itself - */ -libraryDependencySchemes ++= Seq( - "org.scala-lang.modules" %% "scala-xml" % VersionScheme.Always -) \ No newline at end of file +libraryDependencies += "org.vafer" % "jdeb" % "1.3" artifacts Artifact("jdeb", "jar", "jar") \ No newline at end of file diff --git a/riff-raff.yaml b/riff-raff.yaml index 0272950..d9a25ed 100644 --- a/riff-raff.yaml +++ b/riff-raff.yaml @@ -6,7 +6,7 @@ deployments: app: path-manager parameters: amiTags: - Recipe: editorial-tools-focal-java8-ARM-WITH-cdk-base + Recipe: editorial-tools-focal-java11-ARM-WITH-cdk-base AmigoStage: PROD BuiltBy: amigo amiEncrypted: true