From 8582306c2910bece5519343db8a62ca7e7ff7347 Mon Sep 17 00:00:00 2001 From: Patrik Nordwall Date: Wed, 27 Sep 2023 15:50:19 +0200 Subject: [PATCH 1/3] chore: Drop JDK 8 --- .github/workflows/unit-tests.yml | 1 - integration-test/aws-api-ec2/README.md | 2 +- .../resources/CloudFormation/akka-cluster.json | 4 ++-- integration-test/kubernetes-api-java/pom.xml | 4 +--- project/Common.scala | 18 ++++++++---------- project/project-info.conf | 2 +- 6 files changed, 13 insertions(+), 18 deletions(-) diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 5ac80d2df..8e0af4e78 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -21,7 +21,6 @@ jobs: fail-fast: false matrix: include: - - { jdkVersion: "1.8.0", jvmName: "temurin:1.8.0", extraOpts: '' } - { jdkVersion: "1.11.0", jvmName: "temurin:1.11.0", extraOpts: '-J-XX:+UnlockExperimentalVMOptions -J-XX:+UseJVMCICompiler' } - { jdkVersion: "1.17.0", jvmName: "temurin:1.17.0", extraOpts: '' } steps: diff --git a/integration-test/aws-api-ec2/README.md b/integration-test/aws-api-ec2/README.md index c47828d1e..a4837aa21 100644 --- a/integration-test/aws-api-ec2/README.md +++ b/integration-test/aws-api-ec2/README.md @@ -15,7 +15,7 @@ Step 1: Launch Instances From the AWS Management Console, provision a few EC2 instances (you'll need at least 2). Recommended image: Ubuntu Server 16.04. As for the instance type, this demo app runs fine even on t1.micro instances. As for the security group, for now, just select the default one and make sure you allow yourself ssh access to your instances. Once the instances are ready, -ssh into them - you may need to install Java 8 ( you can use this [guide](https://www.digitalocean.com/community/tutorials/how-to-install-java-with-apt-get-on-ubuntu-16-04)). +ssh into them - you may need to install Java 11 ( you can use this [guide](https://www.digitalocean.com/community/tutorials/how-to-install-java-with-apt-get-on-ubuntu-16-04)). Step 2: Create IAM Role diff --git a/integration-test/aws-api-ec2/src/main/resources/CloudFormation/akka-cluster.json b/integration-test/aws-api-ec2/src/main/resources/CloudFormation/akka-cluster.json index 91aa6433d..776ee40dc 100644 --- a/integration-test/aws-api-ec2/src/main/resources/CloudFormation/akka-cluster.json +++ b/integration-test/aws-api-ec2/src/main/resources/CloudFormation/akka-cluster.json @@ -63,7 +63,7 @@ "UserData": { "Fn::Base64": { "Fn::Join": ["", ["#!/bin/bash -xe\n", - "sudo yum install -y java-1.8.0\n", + "sudo yum install -y java-11-openjdk\n", "sudo yum remove -y java-1.7.0-openjdk\n", "wget ", {"Ref": "Build"}, "\n", "export PURPOSE=", {"Ref": "Purpose"}, "\n", @@ -227,4 +227,4 @@ "Description": "ASG name" } } -} \ No newline at end of file +} diff --git a/integration-test/kubernetes-api-java/pom.xml b/integration-test/kubernetes-api-java/pom.xml index 606bf15e9..fd846f97a 100644 --- a/integration-test/kubernetes-api-java/pom.xml +++ b/integration-test/kubernetes-api-java/pom.xml @@ -15,8 +15,6 @@ - 1.8 - 1.8 UTF-8 2.8.2 10.5.1 @@ -135,7 +133,7 @@ integration-test-kubernetes-api:1.3.3.7 - openjdk:8-jre-alpine + docker.io/library/eclipse-temurin:17.0.8.1_1-jre 8080 8558 diff --git a/project/Common.scala b/project/Common.scala index 7925f2258..9da744324 100644 --- a/project/Common.scala +++ b/project/Common.scala @@ -63,14 +63,8 @@ object Common extends AutoPlugin { javacOptions ++= Seq( "-Xlint:unchecked" ), - javacOptions ++= ( - if (isJdk8) Seq.empty - else Seq("--release", "8") - ), - scalacOptions ++= ( - if (isJdk8) Seq.empty - else Seq("--release", "8") - ), + javacOptions ++= Seq("--release", "11"), + scalacOptions ++= Seq("--release", "11"), doc / javacOptions := Nil, Compile / doc / scalacOptions := scalacOptions.value ++ Seq( "-doc-title", @@ -99,6 +93,10 @@ object Common extends AutoPlugin { sonatypeProfileName := "com.lightbend" ) - private def isJdk8 = - VersionNumber(sys.props("java.specification.version")).matchesSemVer(SemanticSelector(s"=1.8")) + val isJdk11orHigher: Boolean = { + val result = VersionNumber(sys.props("java.specification.version")).matchesSemVer(SemanticSelector(">=11")) + if (!result) + throw new IllegalArgumentException("JDK 11 or higher is required") + result + } } diff --git a/project/project-info.conf b/project/project-info.conf index a451ad07d..baa207647 100644 --- a/project/project-info.conf +++ b/project/project-info.conf @@ -2,7 +2,7 @@ project-info { version: "current" scala-versions: ["2.13", "3.3"] shared-info { - jdk-versions: ["Adopt OpenJDK 8 with Hotspot", "Adopt OpenJDK 11 with Hotspot"] + jdk-versions: ["Eclipse Temurin JDK 11", "Eclipse Temurin JDK 17"] snapshots: { url: "https://oss.sonatype.org/content/repositories/snapshots/com/lightbend/akka/management/" text: "Snapshots are available" From 59db118270eb9dffb4503553b05a1500bab44763 Mon Sep 17 00:00:00 2001 From: Patrik Nordwall Date: Wed, 27 Sep 2023 16:07:22 +0200 Subject: [PATCH 2/3] more in integration test --- build.sbt | 2 +- integration-test/kubernetes-api-java/pom.xml | 9 +++++++++ integration-test/kubernetes-api/build.sbt | 2 +- integration-test/kubernetes-dns/build.sbt | 2 +- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/build.sbt b/build.sbt index 5afd8925b..31d005305 100644 --- a/build.sbt +++ b/build.sbt @@ -198,7 +198,7 @@ lazy val `lease-kubernetes-int-test` = project publish / skip := true, libraryDependencies := Dependencies.LeaseKubernetesTest, version ~= (_.replace('+', '-')), - dockerBaseImage := "openjdk:8-jre-alpine", + dockerBaseImage := "docker.io/library/eclipse-temurin:17.0.8.1_1-jre", dockerUpdateLatest := true, dockerCommands := dockerCommands.value.flatMap { case ExecCmd("ENTRYPOINT", args @ _*) => Seq(Cmd("ENTRYPOINT", args.mkString(" "))) diff --git a/integration-test/kubernetes-api-java/pom.xml b/integration-test/kubernetes-api-java/pom.xml index fd846f97a..2a9ed4327 100644 --- a/integration-test/kubernetes-api-java/pom.xml +++ b/integration-test/kubernetes-api-java/pom.xml @@ -16,6 +16,7 @@ UTF-8 + 11 2.8.2 10.5.1 1.2.0 @@ -72,6 +73,14 @@ + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + 11 + + org.apache.maven.plugins maven-shade-plugin diff --git a/integration-test/kubernetes-api/build.sbt b/integration-test/kubernetes-api/build.sbt index 9479b7396..da48aa3d2 100644 --- a/integration-test/kubernetes-api/build.sbt +++ b/integration-test/kubernetes-api/build.sbt @@ -11,7 +11,7 @@ dockerCommands := } dockerExposedPorts := Seq(8080, 8558, 2552) -dockerBaseImage := "openjdk:8-jre-alpine" +dockerBaseImage := "docker.io/library/eclipse-temurin:17.0.8.1_1-jre" dockerCommands ++= Seq( Cmd("USER", "root"), diff --git a/integration-test/kubernetes-dns/build.sbt b/integration-test/kubernetes-dns/build.sbt index 829d37a98..93f998544 100644 --- a/integration-test/kubernetes-dns/build.sbt +++ b/integration-test/kubernetes-dns/build.sbt @@ -10,7 +10,7 @@ dockerCommands := } dockerExposedPorts := Seq(8080, 8558, 2552) -dockerBaseImage := "openjdk:8-jre-alpine" +dockerBaseImage := "docker.io/library/eclipse-temurin:17.0.8.1_1-jre" dockerCommands ++= Seq( Cmd("USER", "root"), From 6dbeb2e183c9c49f7fe540215f9de1bef763cb56 Mon Sep 17 00:00:00 2001 From: Patrik Nordwall Date: Wed, 27 Sep 2023 16:41:47 +0200 Subject: [PATCH 3/3] apk --- build.sbt | 1 - integration-test/kubernetes-api/build.sbt | 1 - integration-test/kubernetes-dns/build.sbt | 1 - 3 files changed, 3 deletions(-) diff --git a/build.sbt b/build.sbt index 31d005305..af8e16cff 100644 --- a/build.sbt +++ b/build.sbt @@ -207,7 +207,6 @@ lazy val `lease-kubernetes-int-test` = project dockerCommands ++= Seq( Cmd("USER", "root"), Cmd("RUN", "chgrp -R 0 . && chmod -R g=u ."), - Cmd("RUN", "/sbin/apk", "add", "--no-cache", "bash", "bind-tools", "busybox-extras", "curl", "strace"), Cmd("RUN", "chmod +x /opt/docker/bin/akka-lease-kubernetes-int-test") ) ) diff --git a/integration-test/kubernetes-api/build.sbt b/integration-test/kubernetes-api/build.sbt index da48aa3d2..c9e496be8 100644 --- a/integration-test/kubernetes-api/build.sbt +++ b/integration-test/kubernetes-api/build.sbt @@ -15,6 +15,5 @@ dockerBaseImage := "docker.io/library/eclipse-temurin:17.0.8.1_1-jre" dockerCommands ++= Seq( Cmd("USER", "root"), - Cmd("RUN", "/sbin/apk", "add", "--no-cache", "bash", "bind-tools", "busybox-extras", "curl", "strace"), Cmd("RUN", "chgrp -R 0 . && chmod -R g=u .") ) diff --git a/integration-test/kubernetes-dns/build.sbt b/integration-test/kubernetes-dns/build.sbt index 93f998544..e54270d45 100644 --- a/integration-test/kubernetes-dns/build.sbt +++ b/integration-test/kubernetes-dns/build.sbt @@ -14,6 +14,5 @@ dockerBaseImage := "docker.io/library/eclipse-temurin:17.0.8.1_1-jre" dockerCommands ++= Seq( Cmd("USER", "root"), - Cmd("RUN", "/sbin/apk", "add", "--no-cache", "bash", "bind-tools", "busybox-extras", "curl", "strace"), Cmd("RUN", "chgrp -R 0 . && chmod -R g=u .") )