Skip to content
This repository has been archived by the owner on May 25, 2023. It is now read-only.

Commit

Permalink
Merge pull request #197 from eed3si9n/wip/play
Browse files Browse the repository at this point in the history
-Dplay.server.pidfile.path=/dev/null
  • Loading branch information
eed3si9n authored Feb 5, 2019
2 parents 6dde74d + 2468511 commit 4cdb737
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@ object PodTemplate {
}) ++
List(
s"-Dakka.management.cluster.bootstrap.contact-point-discovery.required-contact-point-nr=$noOfReplicas",
s"${if (akkaClusterJoinExisting) "-Dakka.management.cluster.bootstrap.form-new-cluster=false" else ""}"))
s"${if (akkaClusterJoinExisting) "-Dakka.management.cluster.bootstrap.form-new-cluster=false" else ""}",
s"-Dplay.server.pidfile.path=/dev/null"))
.filter(_.nonEmpty)
.mkString(" ")),
"RP_DYN_JAVA_OPTS" -> LiteralEnvironmentVariable(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ object RpEnvironmentVariables {
s"-Dakka.management.cluster.bootstrap.contact-point-discovery.effective-name=$serviceResourceName",
s"-Dakka.management.cluster.bootstrap.contact-point-discovery.required-contact-point-nr=$noOfReplicas",
akkaClusterBootstrapSystemName.fold("-Dakka.discovery.marathon-api.app-label-query=APP_NAME==%s")(systemName => s"-Dakka.discovery.marathon-api.app-label-query=ACTOR_SYSTEM_NAME==$systemName"),
s"${if (akkaClusterJoinExisting) "-Dakka.management.cluster.bootstrap.form-new-cluster=false" else ""}")
s"${if (akkaClusterJoinExisting) "-Dakka.management.cluster.bootstrap.form-new-cluster=false" else ""}",
s"-Dplay.server.pidfile.path=/dev/null")
.filter(_.nonEmpty)
.mkString(" "))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,8 @@ object DeploymentJsonTest extends TestSuite {
assert(javaOpts.contains("-Dakka.management.cluster.bootstrap.contact-point-discovery.discovery-method=kubernetes-api") &&
javaOpts.contains("-Dakka.management.cluster.bootstrap.contact-point-discovery.port-name=management") &&
javaOpts.contains("-Dakka.management.cluster.bootstrap.contact-point-discovery.effective-name=friendimpl") &&
javaOpts.contains("-Dakka.discovery.kubernetes-api.pod-label-selector=akka.lightbend.com/service-name=%s"))
javaOpts.contains("-Dakka.discovery.kubernetes-api.pod-label-selector=akka.lightbend.com/service-name=%s") &&
javaOpts.contains("-Dplay.server.pidfile.path=/dev/null"))
})
}

Expand Down Expand Up @@ -308,13 +309,14 @@ object DeploymentJsonTest extends TestSuite {
javaOpts.contains("-Dakka.management.cluster.bootstrap.contact-point-discovery.service-name=friendimpl-internal") &&
javaOpts.contains("-Dakka.management.cluster.bootstrap.contact-point-discovery.port-name=management") &&
!javaOpts.contains("-Dakka.management.cluster.bootstrap.contact-point-discovery.effective-name=friendimpl") &&
!javaOpts.contains("-Dakka.discovery.kubernetes-api.pod-label-selector=akka.lightbend.com/service-name=%s"))
!javaOpts.contains("-Dakka.discovery.kubernetes-api.pod-label-selector=akka.lightbend.com/service-name=%s") &&
javaOpts.contains("-Dplay.server.pidfile.path=/dev/null"))
})
}

"should generate application health check given status module" - {
val expectedJson =
"""
("""
|{
| "apiVersion": "apps/v1beta2",
| "kind": "Deployment",
Expand Down Expand Up @@ -418,7 +420,16 @@ object DeploymentJsonTest extends TestSuite {
| },
| {
| "name": "RP_JAVA_OPTS",
| "value": "-Dconfig.resource=my-config.conf -Dakka.management.cluster.bootstrap.contact-point-discovery.discovery-method=kubernetes-api -Dakka.management.cluster.bootstrap.contact-point-discovery.port-name=management -Dakka.management.cluster.bootstrap.contact-point-discovery.effective-name=friendimpl -Dakka.discovery.kubernetes-api.pod-label-selector=akka.lightbend.com/service-name=%s -Dakka.management.cluster.bootstrap.contact-point-discovery.required-contact-point-nr=1"
| "value": """".stripMargin +
List(
"-Dconfig.resource=my-config.conf",
"-Dakka.management.cluster.bootstrap.contact-point-discovery.discovery-method=kubernetes-api",
"-Dakka.management.cluster.bootstrap.contact-point-discovery.port-name=management",
"-Dakka.management.cluster.bootstrap.contact-point-discovery.effective-name=friendimpl",
"-Dakka.discovery.kubernetes-api.pod-label-selector=akka.lightbend.com/service-name=%s",
"-Dakka.management.cluster.bootstrap.contact-point-discovery.required-contact-point-nr=1",
"-Dplay.server.pidfile.path=/dev/null").mkString(" ") +
""""
| },
| {
| "name": "RP_KUBERNETES_POD_IP",
Expand Down Expand Up @@ -471,7 +482,7 @@ object DeploymentJsonTest extends TestSuite {
| }
| }
|}
""".stripMargin.parse.right.get
""".stripMargin).parse.right.get
val result = Deployment.generate(annotations.copy(
modules = Set("akka-management", "status", "akka-cluster-bootstrapping"),
managementEndpointName = Some("management")), "apps/v1beta2", None, imageName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,13 @@ object RpEnvironmentVariablesTest extends TestSuite {
Map(
"RP_ENDPOINT_0_BIND_PORT" -> "$PORT_EP",
"RP_ENDPOINTS" -> "EP1", "RP_APP_VERSION" -> "3.2.1-SNAPSHOT",
"RP_JAVA_OPTS" -> "-Dakka.management.cluster.bootstrap.contact-point-discovery.discovery-method=marathon-api -Dakka.management.cluster.bootstrap.contact-point-discovery.port-name=management -Dakka.management.cluster.bootstrap.contact-point-discovery.effective-name=friendimpl -Dakka.management.cluster.bootstrap.contact-point-discovery.required-contact-point-nr=3 -Dakka.discovery.marathon-api.app-label-query=APP_NAME==%s",
"RP_JAVA_OPTS" -> List(
"-Dakka.management.cluster.bootstrap.contact-point-discovery.discovery-method=marathon-api",
"-Dakka.management.cluster.bootstrap.contact-point-discovery.port-name=management",
"-Dakka.management.cluster.bootstrap.contact-point-discovery.effective-name=friendimpl",
"-Dakka.management.cluster.bootstrap.contact-point-discovery.required-contact-point-nr=3",
"-Dakka.discovery.marathon-api.app-label-query=APP_NAME==%s",
"-Dplay.server.pidfile.path=/dev/null").mkString(" "),
"RP_PLATFORM" -> "mesos",
"RP_ENDPOINT_EP1_PORT" -> "$PORT_EP",
"RP_MODULES" -> "akka-cluster-bootstrapping",
Expand Down Expand Up @@ -176,7 +182,10 @@ object RpEnvironmentVariablesTest extends TestSuite {
"RP_ENDPOINT_EP1_HOST" -> "$HOST",
"RP_ENDPOINT_EP1_BIND_HOST" -> "0.0.0.0",
"RP_MODULES" -> "service-discovery",
"RP_JAVA_OPTS" -> "-Dcom.lightbend.platform-tooling.service-discovery.external-service-addresses.chirpservice.0=_chirpservice._tcp.marathon.mesos -Dcom.lightbend.platform-tooling.service-discovery.external-service-addresses.chirpservice.1=_chirpservice._udp.marathon.mesos -Dcom.lightbend.platform-tooling.service-discovery.external-service-addresses.friendservice.0=_friendservice._tcp.marathon.mesos")
"RP_JAVA_OPTS" -> List(
"-Dcom.lightbend.platform-tooling.service-discovery.external-service-addresses.chirpservice.0=_chirpservice._tcp.marathon.mesos",
"-Dcom.lightbend.platform-tooling.service-discovery.external-service-addresses.chirpservice.1=_chirpservice._udp.marathon.mesos",
"-Dcom.lightbend.platform-tooling.service-discovery.external-service-addresses.friendservice.0=_friendservice._tcp.marathon.mesos").mkString(" "))

val actual =
RpEnvironmentVariables
Expand Down

0 comments on commit 4cdb737

Please sign in to comment.