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

chore: Drop JDK 8 #1196

Merged
merged 3 commits into from
Sep 29, 2023
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
1 change: 0 additions & 1 deletion .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 1 addition & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -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(" ")))
Expand All @@ -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")
)
)
Expand Down
2 changes: 1 addition & 1 deletion integration-test/aws-api-ec2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -227,4 +227,4 @@
"Description": "ASG name"
}
}
}
}
13 changes: 10 additions & 3 deletions integration-test/kubernetes-api-java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@
</licenses>

<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<encoding>UTF-8</encoding>
<maven.compiler.release>11</maven.compiler.release>
<akka.version>2.8.2</akka.version>
<akka.http.version>10.5.1</akka.http.version>
<akka-management.version>1.2.0</akka-management.version>
Expand Down Expand Up @@ -74,6 +73,14 @@

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<release>11</release>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
Expand Down Expand Up @@ -135,7 +142,7 @@
<image>
<name>integration-test-kubernetes-api:1.3.3.7</name>
<build>
<from>openjdk:8-jre-alpine</from>
<from>docker.io/library/eclipse-temurin:17.0.8.1_1-jre</from>
<ports>
<port>8080</port>
<port>8558</port>
Expand Down
3 changes: 1 addition & 2 deletions integration-test/kubernetes-api/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,9 @@ 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"),
Cmd("RUN", "/sbin/apk", "add", "--no-cache", "bash", "bind-tools", "busybox-extras", "curl", "strace"),
Cmd("RUN", "chgrp -R 0 . && chmod -R g=u .")
)
3 changes: 1 addition & 2 deletions integration-test/kubernetes-dns/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@ 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"),
Cmd("RUN", "/sbin/apk", "add", "--no-cache", "bash", "bind-tools", "busybox-extras", "curl", "strace"),
Cmd("RUN", "chgrp -R 0 . && chmod -R g=u .")
)
18 changes: 8 additions & 10 deletions project/Common.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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
}
}
2 changes: 1 addition & 1 deletion project/project-info.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Loading