Skip to content
Draft
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: 1 addition & 0 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
push:
branches:
- main
- 1.*
tags-ignore: [ v.* ]

jobs:
Expand Down
22 changes: 20 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ commands := commands.value.filterNot { command =>
}

ThisBuild / resolvers += Resolver.ApacheMavenSnapshotsRepo
ThisBuild / resolvers += Resolver.ApacheMavenStagingRepo
ThisBuild / reproducibleBuildsCheckResolver := Resolver.ApacheMavenStagingRepo

inThisBuild(Def.settings(
Expand Down Expand Up @@ -141,6 +142,10 @@ lazy val managementClusterHttp = pekkoModule("management-cluster-http")
.settings(
name := "pekko-management-cluster-http",
libraryDependencies := Dependencies.managementClusterHttp,
// following is needed by Agrona lib
// https://github.com/aeron-io/agrona/wiki/Change-Log#200-2024-12-17
Test / fork := true,
Test / javaOptions += "--add-opens=java.base/jdk.internal.misc=ALL-UNNAMED",
mimaPreviousArtifactsSet)
.dependsOn(management)

Expand All @@ -149,6 +154,10 @@ lazy val managementClusterBootstrap = pekkoModule("management-cluster-bootstrap"
.settings(
name := "pekko-management-cluster-bootstrap",
libraryDependencies := Dependencies.managementClusterBootstrap,
// following is needed by Agrona lib
// https://github.com/aeron-io/agrona/wiki/Change-Log#200-2024-12-17
Test / fork := true,
Test / javaOptions += "--add-opens=java.base/jdk.internal.misc=ALL-UNNAMED",
mimaPreviousArtifactsSet)
.dependsOn(management)
.dependsOn(managementPki)
Expand Down Expand Up @@ -179,6 +188,9 @@ lazy val leaseKubernetesIntTest = pekkoModule("lease-kubernetes-int-test")
name := "pekko-lease-kubernetes-int-test",
libraryDependencies := Dependencies.leaseKubernetesTest,
version ~= (_.replace('+', '-')),
// following is needed by Agrona lib
// https://github.com/aeron-io/agrona/wiki/Change-Log#200-2024-12-17
Runtime / javaOptions += "--add-opens=java.base/jdk.internal.misc=ALL-UNNAMED",
dockerBaseImage := "eclipse-temurin:17-jre-alpine",
dockerUpdateLatest := true,
dockerCommands := dockerCommands.value.flatMap {
Expand All @@ -196,7 +208,10 @@ lazy val integrationTestKubernetesApi = pekkoIntTestModule("kubernetes-api")
.disablePlugins(MimaPlugin)
.enablePlugins(AutomateHeaderPlugin)
.settings(
libraryDependencies := Dependencies.bootstrapDemos)
libraryDependencies := Dependencies.bootstrapDemos,
// following is needed by Agrona lib
// https://github.com/aeron-io/agrona/wiki/Change-Log#200-2024-12-17
Runtime / javaOptions += "--add-opens=java.base/jdk.internal.misc=ALL-UNNAMED")
.dependsOn(management, managementClusterHttp, managementClusterBootstrap, discoveryKubernetesApi)
.enablePlugins(NoPublish)

Expand All @@ -215,7 +230,10 @@ lazy val integrationTestKubernetesDns = pekkoIntTestModule("kubernetes-dns")
.disablePlugins(MimaPlugin)
.enablePlugins(AutomateHeaderPlugin, NoPublish)
.settings(
libraryDependencies := Dependencies.bootstrapDemos)
libraryDependencies := Dependencies.bootstrapDemos,
// following is needed by Agrona lib
// https://github.com/aeron-io/agrona/wiki/Change-Log#200-2024-12-17
Runtime / javaOptions += "--add-opens=java.base/jdk.internal.misc=ALL-UNNAMED")
.dependsOn(
management,
managementClusterHttp,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@ package org.apache.pekko.management.cluster.bootstrap
import java.time.Duration

import scala.concurrent.Future
import scala.annotation.nowarn

import org.apache.pekko
import pekko.actor.ActorSystem
import pekko.actor.Address
import pekko.discovery.ServiceDiscovery.ResolvedTarget
import pekko.util.unused

/**
* The decision of joining "self" is made by deterministically sorting the discovered services
Expand Down Expand Up @@ -145,7 +146,8 @@ class LowestAddressJoinDecider(system: ActorSystem, settings: ClusterBootstrapSe
* contact points have not been confirmed (unreachable or not running).
* `hasEnoughContactPoints` and `isPastStableMargin` must still be fulfilled.
*/
protected def isConfirmedCommunicationWithAllContactPointsRequired(@unused info: SeedNodesInformation): Boolean =
@nowarn("msg=unused")
protected def isConfirmedCommunicationWithAllContactPointsRequired(info: SeedNodesInformation): Boolean =
settings.contactPointDiscovery.contactWithAllContactPoints

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ import org.scalatest.wordspec.AnyWordSpec

class HttpContactPointBootstrapSpec extends AnyWordSpec with Matchers {

val userDir = System.getProperty("user.dir")

"HttpContactPointBootstrap" should {
"use a safe name when connecting over IPv6" in {
val name = HttpContactPointBootstrap.name(Host("[fe80::1013:2070:258a:c662]"), 443)
Expand All @@ -45,9 +47,9 @@ class HttpContactPointBootstrapSpec extends AnyWordSpec with Matchers {
val sys = ActorSystem("HttpContactPointBootstrapSpec")
val log = Logging(sys, classOf[HttpContactPointBootstrapSpec])
try {
val cfg = ConfigFactory.parseString("""
val cfg = ConfigFactory.parseString(s"""
pekko.management.cluster.bootstrap.contact-point.http-client {
ca-path = "management-cluster-bootstrap/src/test/files/ca.crt"
ca-path = "${userDir}/src/test/files/ca.crt"
}""").withFallback(sys.settings.config)
val settings = new ClusterBootstrapSettings(cfg, log)
HttpContactPointBootstrap.generateSSLContext(settings) should not be null
Expand All @@ -59,9 +61,9 @@ class HttpContactPointBootstrapSpec extends AnyWordSpec with Matchers {
val sys = ActorSystem("HttpContactPointBootstrapSpec")
val log = Logging(sys, classOf[HttpContactPointBootstrapSpec])
try {
val cfg = ConfigFactory.parseString("""
val cfg = ConfigFactory.parseString(s"""
pekko.management.cluster.bootstrap.contact-point.http-client {
ca-path = "management-cluster-bootstrap/src/test/files/non-existent.crt"
ca-path = "${userDir}/src/test/files/non-existent.crt"
}""").withFallback(sys.settings.config)
val settings = new ClusterBootstrapSettings(cfg, log)
intercept[NoSuchFileException] {
Expand All @@ -75,9 +77,9 @@ class HttpContactPointBootstrapSpec extends AnyWordSpec with Matchers {
val sys = ActorSystem("HttpContactPointBootstrapSpec")
val log = Logging(sys, classOf[HttpContactPointBootstrapSpec])
try {
val cfg = ConfigFactory.parseString("""
val cfg = ConfigFactory.parseString(s"""
pekko.management.cluster.bootstrap.contact-point.http-client {
ca-path = "management-cluster-bootstrap/src/test/files/ca.crt"
ca-path = "${userDir}/src/test/files/ca.crt"
tls-version = "BAD_VERSION"
}""").withFallback(sys.settings.config)
val settings = new ClusterBootstrapSettings(cfg, log)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ object ClusterHttpManagementRoutes extends ClusterHttpManagementJsonProtocol {
eventualActorRef.success(Some(actorRef))
()
}
.watchTermination() {
.watchTermination {
case (_, eventualDone) =>
eventualDone.onComplete { _ =>
// the stream has terminated, so complete the promise if it isn't already, and
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public void start() {
// #start-pekko-management-with-https-context
PekkoManagement management = PekkoManagement.get(system);

HttpsConnectionContext https = ConnectionContext.https(sslContext);
HttpsConnectionContext https = ConnectionContext.httpsServer(sslContext);
management.start(settings -> settings.withHttpsConnectionContext(https));
// #start-pekko-management-with-https-context
}
Expand Down
2 changes: 1 addition & 1 deletion project/PekkoCoreDependency.scala
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ import com.github.pjfanning.pekkobuild.PekkoDependency
object PekkoCoreDependency extends PekkoDependency {
override val checkProject: String = "pekko-cluster-sharding-typed"
override val module: Option[String] = None
override val currentVersion: String = "1.3.0"
override val currentVersion: String = "2.0.0-M1"
}
2 changes: 1 addition & 1 deletion project/PekkoHttpDependency.scala
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ import com.github.pjfanning.pekkobuild.PekkoDependency
object PekkoHttpDependency extends PekkoDependency {
override val checkProject: String = "pekko-http-testkit"
override val module: Option[String] = Some("http")
override val currentVersion: String = "1.3.0"
override val currentVersion: String = "2.0.0-M1"
}
Loading