Skip to content

Commit daf7c53

Browse files
Merge branch 'master' into remove_containers_gradually
2 parents 61fefdf + 0c4aab1 commit daf7c53

File tree

7 files changed

+25
-11
lines changed

7 files changed

+25
-11
lines changed

ansible/group_vars/all

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,8 @@ invoker:
213213
{% endif %}"
214214
extraEnv: "{{ invoker_extraEnv | default({}) }}"
215215
protocol: "{{ invoker_protocol | default('https') }}"
216+
username: "{{ invoker_username | default('invoker.user') }}"
217+
password: "{{ invoker_password | default('invoker.pass') }}"
216218
ssl:
217219
cn: "openwhisk-invokers"
218220
keyPrefix: "{{ __invoker_ssl_keyPrefix }}"

ansible/roles/invoker/tasks/deploy.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,8 @@
288288
"CONFIG_whisk_containerPool_prewarmPromotion": "{{ container_pool_strict | default('false') | lower }}"
289289
"CONFIG_whisk_containerPool_prewarmMaxRetryLimit": "{{ container_pool_prewarm_max_retry_limit | default(5) }}"
290290
"CONFIG_whisk_containerPool_batchDeletionSize": "{{ container_pool_batchDeletionSize | default(10) }}"
291+
"CONFIG_whisk_invoker_username": "{{ invoker.username }}"
292+
"CONFIG_whisk_invoker_password": "{{ invoker.password }}"
291293

292294
- name: extend invoker dns env
293295
set_fact:

common/scala/src/main/scala/org/apache/openwhisk/core/WhiskConfig.scala

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,4 +308,10 @@ object ConfigKeys {
308308
val whiskClusterName = "whisk.cluster.name"
309309

310310
val dataManagementServiceRetryInterval = "whisk.scheduler.data-management-service.retry-interval"
311+
312+
val whiskSchedulerUsername = "whisk.scheduler.username"
313+
val whiskSchedulerPassword = "whisk.scheduler.password"
314+
315+
val whiskInvokerUsername = "whisk.invoker.username"
316+
val whiskInvokerPassword = "whisk.invoker.password"
311317
}

core/invoker/src/main/resources/application.conf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,8 @@ whisk {
177177
}
178178

179179
invoker {
180+
username: "invoker.user"
181+
password: "invoker.pass"
180182
protocol: http
181183
}
182184
runtime.delete.timeout = "30 seconds"

core/invoker/src/main/scala/org/apache/openwhisk/core/invoker/DefaultInvokerServer.scala

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,10 @@ import akka.http.scaladsl.model.StatusCodes
2222
import akka.http.scaladsl.model.headers.BasicHttpCredentials
2323
import akka.http.scaladsl.server.Route
2424
import org.apache.openwhisk.common.{Logging, TransactionId}
25+
import org.apache.openwhisk.core.ConfigKeys
2526
import org.apache.openwhisk.http.BasicRasService
2627
import org.apache.openwhisk.http.ErrorResponse.terminate
28+
import pureconfig.loadConfigOrThrow
2729
import spray.json.PrettyPrinter
2830

2931
import scala.concurrent.ExecutionContext
@@ -57,9 +59,8 @@ class DefaultInvokerServer(val invoker: InvokerCore, systemUsername: String, sys
5759

5860
object DefaultInvokerServer extends InvokerServerProvider {
5961

60-
// TODO: TBD, after FPCInvokerReactive is ready, can read the credentials from pureconfig
61-
val invokerUsername = "admin"
62-
val invokerPassword = "admin"
62+
private val invokerUsername = loadConfigOrThrow[String](ConfigKeys.whiskInvokerUsername)
63+
private val invokerPassword = loadConfigOrThrow[String](ConfigKeys.whiskInvokerPassword)
6364

6465
override def instance(
6566
invoker: InvokerCore)(implicit ec: ExecutionContext, actorSystem: ActorSystem, logger: Logging): BasicRasService =

core/invoker/src/main/scala/org/apache/openwhisk/core/invoker/FPCInvokerServer.scala

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,10 @@ import akka.http.scaladsl.model.StatusCodes
2222
import akka.http.scaladsl.model.headers.BasicHttpCredentials
2323
import akka.http.scaladsl.server.Route
2424
import org.apache.openwhisk.common.{Logging, TransactionId}
25+
import org.apache.openwhisk.core.ConfigKeys
2526
import org.apache.openwhisk.http.BasicRasService
2627
import org.apache.openwhisk.http.ErrorResponse.terminate
28+
import pureconfig.loadConfigOrThrow
2729
import spray.json.PrettyPrinter
2830

2931
import scala.concurrent.ExecutionContext
@@ -57,9 +59,8 @@ class FPCInvokerServer(val invoker: InvokerCore, systemUsername: String, systemP
5759

5860
object FPCInvokerServer extends InvokerServerProvider {
5961

60-
// TODO: TBD, after FPCInvokerReactive is ready, can read the credentials from pureconfig
61-
val invokerUsername = "admin"
62-
val invokerPassword = "admin"
62+
private val invokerUsername = loadConfigOrThrow[String](ConfigKeys.whiskInvokerUsername)
63+
private val invokerPassword = loadConfigOrThrow[String](ConfigKeys.whiskInvokerPassword)
6364

6465
override def instance(
6566
invoker: InvokerCore)(implicit ec: ExecutionContext, actorSystem: ActorSystem, logger: Logging): BasicRasService =

core/scheduler/src/main/scala/org/apache/openwhisk/core/scheduler/FPCSchedulerServer.scala

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,10 @@ import akka.http.scaladsl.model.StatusCodes
2323
import akka.http.scaladsl.model.headers.BasicHttpCredentials
2424
import akka.http.scaladsl.server.Route
2525
import org.apache.openwhisk.common.{Logging, TransactionId}
26+
import org.apache.openwhisk.core.ConfigKeys
2627
import org.apache.openwhisk.http.BasicRasService
2728
import org.apache.openwhisk.http.ErrorResponse.terminate
29+
import pureconfig.loadConfigOrThrow
2830
import spray.json.DefaultJsonProtocol._
2931
import spray.json._
3032

@@ -75,11 +77,9 @@ class FPCSchedulerServer(scheduler: SchedulerCore, systemUsername: String, syste
7577

7678
object FPCSchedulerServer {
7779

78-
// TODO: TBD, after FPCScheduler is ready, can read the credentials from pureconfig
79-
val schedulerUsername = "admin"
80-
val schedulerPassword = "admin"
81-
82-
val queuePathPrefix = "queue"
80+
private val schedulerUsername = loadConfigOrThrow[String](ConfigKeys.whiskSchedulerUsername)
81+
private val schedulerPassword = loadConfigOrThrow[String](ConfigKeys.whiskSchedulerPassword)
82+
private val queuePathPrefix = "queue"
8383

8484
def instance(scheduler: SchedulerCore)(implicit ec: ExecutionContext,
8585
actorSystem: ActorSystem,

0 commit comments

Comments
 (0)