You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by GitBox <gi...@apache.org> on 2020/06/08 08:55:35 UTC

[GitHub] [openwhisk] ningyougang opened a new pull request #4790: Add administrative interface to invoker and controller to reconfigure runtimes

ningyougang opened a new pull request #4790:
URL: https://github.com/apache/openwhisk/pull/4790


   Sometimes, admin may want to reinitalize the runtime config, e.g. nodejs:10 prewarm container number is less, lead to `cold start`, in order to handle user's request as soon as possible, admin may want to reinitalize the runtime configuration to increase the nodejs:10 prewarm containers.
   And admin may want to reinitalize the runtime config on some limited invokers, this patch includes below changes
   - [x] config runtime via controller to all managed invokers(or some limited inovkers which included in managed inovkers)
   - [x] config runtime via invoker directly
   - [x] get runtime info via invoker directly
   - [x] add documents
   - [x] test cases
   
   
   <!--- Provide a concise summary of your changes in the Title -->
   
   ## Description
   <!--- Provide a detailed description of your changes. -->
   <!--- Include details of what problem you are solving and how your changes are tested. -->
   
   ## Related issue and scope
   <!--- Please include a link to a related issue if there is one. -->
   - [ ] I opened an issue to propose and discuss this change (#????)
   
   ## My changes affect the following components
   <!--- Select below all system components are affected by your change. -->
   <!--- Enter an `x` in all applicable boxes. -->
   - [ ] API
   - [x] Controller
   - [ ] Message Bus (e.g., Kafka)
   - [x] Loadbalancer
   - [x] Invoker
   - [ ] Intrinsic actions (e.g., sequences, conductors)
   - [ ] Data stores (e.g., CouchDB)
   - [x] Tests
   - [ ] Deployment
   - [ ] CLI
   - [ ] General tooling
   - [ ] Documentation
   
   ## Types of changes
   <!--- What types of changes does your code introduce? Use `x` in all the boxes that apply: -->
   - [ ] Bug fix (generally a non-breaking change which closes an issue).
   - [x] Enhancement or new feature (adds new functionality).
   - [ ] Breaking change (a bug fix or enhancement which changes existing behavior).
   
   ## Checklist:
   <!--- Please review the points below which help you make sure you've covered all aspects of the change you're making. -->
   
   - [x] I signed an [Apache CLA](https://github.com/apache/openwhisk/blob/master/CONTRIBUTING.md).
   - [ ] I reviewed the [style guides](https://github.com/apache/openwhisk/wiki/Contributing:-Git-guidelines#code-readiness) and followed the recommendations (Travis CI will check :).
   - [ ] I added tests to cover my changes.
   - [ ] My changes require further changes to the documentation.
   - [x] I updated the documentation where necessary.
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [openwhisk] codecov-io commented on pull request #4790: Add administrative interface to invoker and controller to reconfigure runtimes

Posted by GitBox <gi...@apache.org>.
codecov-io commented on pull request #4790:
URL: https://github.com/apache/openwhisk/pull/4790#issuecomment-788746178


   # [Codecov](https://codecov.io/gh/apache/openwhisk/pull/4790?src=pr&el=h1) Report
   > Merging [#4790](https://codecov.io/gh/apache/openwhisk/pull/4790?src=pr&el=desc) (edefa8a) into [master](https://codecov.io/gh/apache/openwhisk/commit/d8cf17247bbcd8c1250873254d0c213fa28116ce?el=desc) (d8cf172) will **decrease** coverage by `51.82%`.
   > The diff coverage is `17.60%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/openwhisk/pull/4790/graphs/tree.svg?width=650&height=150&src=pr&token=l0YmsiSAso)](https://codecov.io/gh/apache/openwhisk/pull/4790?src=pr&el=tree)
   
   ```diff
   @@             Coverage Diff             @@
   ##           master    #4790       +/-   ##
   ===========================================
   - Coverage   81.81%   29.99%   -51.83%     
   ===========================================
     Files         204      212        +8     
     Lines        9950    10319      +369     
     Branches      447      435       -12     
   ===========================================
   - Hits         8141     3095     -5046     
   - Misses       1809     7224     +5415     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/openwhisk/pull/4790?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [.../org/apache/openwhisk/core/connector/Message.scala](https://codecov.io/gh/apache/openwhisk/pull/4790/diff?src=pr&el=tree#diff-Y29tbW9uL3NjYWxhL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvb3BlbndoaXNrL2NvcmUvY29ubmVjdG9yL01lc3NhZ2Uuc2NhbGE=) | `41.91% <0.00%> (-31.53%)` | :arrow_down: |
   | [.../apache/openwhisk/core/controller/Controller.scala](https://codecov.io/gh/apache/openwhisk/pull/4790/diff?src=pr&el=tree#diff-Y29yZS9jb250cm9sbGVyL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvb3BlbndoaXNrL2NvcmUvY29udHJvbGxlci9Db250cm9sbGVyLnNjYWxh) | `0.00% <0.00%> (-54.81%)` | :arrow_down: |
   | [...che/openwhisk/core/loadBalancer/LoadBalancer.scala](https://codecov.io/gh/apache/openwhisk/pull/4790/diff?src=pr&el=tree#diff-Y29yZS9jb250cm9sbGVyL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvb3BlbndoaXNrL2NvcmUvbG9hZEJhbGFuY2VyL0xvYWRCYWxhbmNlci5zY2FsYQ==) | `0.00% <0.00%> (-76.93%)` | :arrow_down: |
   | [...e/loadBalancer/ShardingContainerPoolBalancer.scala](https://codecov.io/gh/apache/openwhisk/pull/4790/diff?src=pr&el=tree#diff-Y29yZS9jb250cm9sbGVyL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvb3BlbndoaXNrL2NvcmUvbG9hZEJhbGFuY2VyL1NoYXJkaW5nQ29udGFpbmVyUG9vbEJhbGFuY2VyLnNjYWxh) | `0.00% <0.00%> (-80.80%)` | :arrow_down: |
   | [...la/org/apache/openwhisk/core/invoker/Invoker.scala](https://codecov.io/gh/apache/openwhisk/pull/4790/diff?src=pr&el=tree#diff-Y29yZS9pbnZva2VyL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvb3BlbndoaXNrL2NvcmUvaW52b2tlci9JbnZva2VyLnNjYWxh) | `69.35% <ø> (-0.49%)` | :arrow_down: |
   | [...e/openwhisk/core/containerpool/ContainerPool.scala](https://codecov.io/gh/apache/openwhisk/pull/4790/diff?src=pr&el=tree#diff-Y29yZS9pbnZva2VyL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvb3BlbndoaXNrL2NvcmUvY29udGFpbmVycG9vbC9Db250YWluZXJQb29sLnNjYWxh) | `54.83% <16.12%> (-41.98%)` | :arrow_down: |
   | [...pache/openwhisk/core/invoker/InvokerReactive.scala](https://codecov.io/gh/apache/openwhisk/pull/4790/diff?src=pr&el=tree#diff-Y29yZS9pbnZva2VyL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvb3BlbndoaXNrL2NvcmUvaW52b2tlci9JbnZva2VyUmVhY3RpdmUuc2NhbGE=) | `52.63% <26.47%> (-27.37%)` | :arrow_down: |
   | [.../openwhisk/core/invoker/DefaultInvokerServer.scala](https://codecov.io/gh/apache/openwhisk/pull/4790/diff?src=pr&el=tree#diff-Y29yZS9pbnZva2VyL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvb3BlbndoaXNrL2NvcmUvaW52b2tlci9EZWZhdWx0SW52b2tlclNlcnZlci5zY2FsYQ==) | `44.44% <44.44%> (ø)` | |
   | [.../scala/org/apache/openwhisk/core/WhiskConfig.scala](https://codecov.io/gh/apache/openwhisk/pull/4790/diff?src=pr&el=tree#diff-Y29tbW9uL3NjYWxhL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvb3BlbndoaXNrL2NvcmUvV2hpc2tDb25maWcuc2NhbGE=) | `95.51% <100.00%> (+0.11%)` | :arrow_up: |
   | [...n/scala/org/apache/openwhisk/utils/JsHelpers.scala](https://codecov.io/gh/apache/openwhisk/pull/4790/diff?src=pr&el=tree#diff-Y29tbW9uL3NjYWxhL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvb3BlbndoaXNrL3V0aWxzL0pzSGVscGVycy5zY2FsYQ==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | ... and [161 more](https://codecov.io/gh/apache/openwhisk/pull/4790/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/openwhisk/pull/4790?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/openwhisk/pull/4790?src=pr&el=footer). Last update [d8cf172...edefa8a](https://codecov.io/gh/apache/openwhisk/pull/4790?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [openwhisk] ningyougang commented on a change in pull request #4790: Add administrative interface to invoker and controller to reconfigure runtimes

Posted by GitBox <gi...@apache.org>.
ningyougang commented on a change in pull request #4790:
URL: https://github.com/apache/openwhisk/pull/4790#discussion_r585276921



##########
File path: common/scala/src/main/scala/org/apache/openwhisk/core/entity/ExecManifest.scala
##########
@@ -58,6 +58,20 @@ protected[core] object ExecManifest {
     mf
   }
 
+  /**
+   * Reads runtimes manifest from runtime string
+   *
+   * @param runtime
+   * @return the manifest if initialized successfully, or an failure
+   */
+  protected[core] def initialize(runtime: String): Try[Runtimes] = {
+    val rmc = loadConfigOrThrow[RuntimeManifestConfig](ConfigKeys.runtimes)
+    val mf = Try(runtime.parseJson.asJsObject).flatMap(runtimes(_, rmc))
+    var manifest: Option[Runtimes] = None

Review comment:
       I already changed to use existed initialize method.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [openwhisk] codecov-io edited a comment on pull request #4790: Add administrative interface to invoker and controller to reconfigure runtimes

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #4790:
URL: https://github.com/apache/openwhisk/pull/4790#issuecomment-788746178


   # [Codecov](https://codecov.io/gh/apache/openwhisk/pull/4790?src=pr&el=h1) Report
   > Merging [#4790](https://codecov.io/gh/apache/openwhisk/pull/4790?src=pr&el=desc) (edefa8a) into [master](https://codecov.io/gh/apache/openwhisk/commit/d8cf17247bbcd8c1250873254d0c213fa28116ce?el=desc) (d8cf172) will **decrease** coverage by `7.66%`.
   > The diff coverage is `20.80%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/openwhisk/pull/4790/graphs/tree.svg?width=650&height=150&src=pr&token=l0YmsiSAso)](https://codecov.io/gh/apache/openwhisk/pull/4790?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master    #4790      +/-   ##
   ==========================================
   - Coverage   81.81%   74.15%   -7.67%     
   ==========================================
     Files         204      212       +8     
     Lines        9950    10319     +369     
     Branches      447      435      -12     
   ==========================================
   - Hits         8141     7652     -489     
   - Misses       1809     2667     +858     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/openwhisk/pull/4790?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [.../org/apache/openwhisk/core/connector/Message.scala](https://codecov.io/gh/apache/openwhisk/pull/4790/diff?src=pr&el=tree#diff-Y29tbW9uL3NjYWxhL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvb3BlbndoaXNrL2NvcmUvY29ubmVjdG9yL01lc3NhZ2Uuc2NhbGE=) | `71.32% <0.00%> (-2.12%)` | :arrow_down: |
   | [...che/openwhisk/core/loadBalancer/LoadBalancer.scala](https://codecov.io/gh/apache/openwhisk/pull/4790/diff?src=pr&el=tree#diff-Y29yZS9jb250cm9sbGVyL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvb3BlbndoaXNrL2NvcmUvbG9hZEJhbGFuY2VyL0xvYWRCYWxhbmNlci5zY2FsYQ==) | `71.42% <0.00%> (-5.50%)` | :arrow_down: |
   | [...e/loadBalancer/ShardingContainerPoolBalancer.scala](https://codecov.io/gh/apache/openwhisk/pull/4790/diff?src=pr&el=tree#diff-Y29yZS9jb250cm9sbGVyL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvb3BlbndoaXNrL2NvcmUvbG9hZEJhbGFuY2VyL1NoYXJkaW5nQ29udGFpbmVyUG9vbEJhbGFuY2VyLnNjYWxh) | `77.71% <0.00%> (-3.08%)` | :arrow_down: |
   | [...la/org/apache/openwhisk/core/invoker/Invoker.scala](https://codecov.io/gh/apache/openwhisk/pull/4790/diff?src=pr&el=tree#diff-Y29yZS9pbnZva2VyL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvb3BlbndoaXNrL2NvcmUvaW52b2tlci9JbnZva2VyLnNjYWxh) | `69.35% <ø> (-0.49%)` | :arrow_down: |
   | [.../apache/openwhisk/core/controller/Controller.scala](https://codecov.io/gh/apache/openwhisk/pull/4790/diff?src=pr&el=tree#diff-Y29yZS9jb250cm9sbGVyL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvb3BlbndoaXNrL2NvcmUvY29udHJvbGxlci9Db250cm9sbGVyLnNjYWxh) | `45.52% <12.90%> (-9.29%)` | :arrow_down: |
   | [...e/openwhisk/core/containerpool/ContainerPool.scala](https://codecov.io/gh/apache/openwhisk/pull/4790/diff?src=pr&el=tree#diff-Y29yZS9pbnZva2VyL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvb3BlbndoaXNrL2NvcmUvY29udGFpbmVycG9vbC9Db250YWluZXJQb29sLnNjYWxh) | `87.45% <16.12%> (-9.36%)` | :arrow_down: |
   | [...pache/openwhisk/core/invoker/InvokerReactive.scala](https://codecov.io/gh/apache/openwhisk/pull/4790/diff?src=pr&el=tree#diff-Y29yZS9pbnZva2VyL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvb3BlbndoaXNrL2NvcmUvaW52b2tlci9JbnZva2VyUmVhY3RpdmUuc2NhbGE=) | `52.63% <26.47%> (-27.37%)` | :arrow_down: |
   | [.../openwhisk/core/invoker/DefaultInvokerServer.scala](https://codecov.io/gh/apache/openwhisk/pull/4790/diff?src=pr&el=tree#diff-Y29yZS9pbnZva2VyL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvb3BlbndoaXNrL2NvcmUvaW52b2tlci9EZWZhdWx0SW52b2tlclNlcnZlci5zY2FsYQ==) | `44.44% <44.44%> (ø)` | |
   | [.../scala/org/apache/openwhisk/core/WhiskConfig.scala](https://codecov.io/gh/apache/openwhisk/pull/4790/diff?src=pr&el=tree#diff-Y29tbW9uL3NjYWxhL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvb3BlbndoaXNrL2NvcmUvV2hpc2tDb25maWcuc2NhbGE=) | `95.51% <100.00%> (+0.11%)` | :arrow_up: |
   | [...core/database/cosmosdb/RxObservableImplicits.scala](https://codecov.io/gh/apache/openwhisk/pull/4790/diff?src=pr&el=tree#diff-Y29tbW9uL3NjYWxhL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvb3BlbndoaXNrL2NvcmUvZGF0YWJhc2UvY29zbW9zZGIvUnhPYnNlcnZhYmxlSW1wbGljaXRzLnNjYWxh) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | ... and [42 more](https://codecov.io/gh/apache/openwhisk/pull/4790/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/openwhisk/pull/4790?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/openwhisk/pull/4790?src=pr&el=footer). Last update [d8cf172...edefa8a](https://codecov.io/gh/apache/openwhisk/pull/4790?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [openwhisk] ningyougang commented on a change in pull request #4790: Add administrative interface to invoker and controller to reconfigure runtimes

Posted by GitBox <gi...@apache.org>.
ningyougang commented on a change in pull request #4790:
URL: https://github.com/apache/openwhisk/pull/4790#discussion_r436566835



##########
File path: core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/ContainerPool.scala
##########
@@ -302,6 +307,33 @@ class ContainerPool(childFactory: ActorRefFactory => ActorRef,
     case RescheduleJob =>
       freePool = freePool - sender()
       busyPool = busyPool - sender()
+    case prewarmConfigList: PreWarmConfigList =>
+      val passedPrewarmConfig = prewarmConfigList.list
+      var newPrewarmConfig: List[PrewarmingConfig] = List.empty
+      latestPrewarmConfig foreach { config =>
+        newPrewarmConfig = newPrewarmConfig :+ passedPrewarmConfig
+          .find(passedConfig =>
+            passedConfig.exec.kind == config.exec.kind && passedConfig.memoryLimit == config.memoryLimit)
+          .getOrElse(config)
+      }
+      latestPrewarmConfig = newPrewarmConfig

Review comment:
       Support just change specify runtime config as well, e.g.
   Let's assume runtimes.json include nodejs:12, python:2, swift4.1, we can change nodejs:12 runtime only via `just pass nodejs:12 runtime info`, for other runtimes, just use previous runtime info directly.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [openwhisk] rabbah commented on a change in pull request #4790: Add administrative interface to invoker and controller to reconfigure runtimes

Posted by GitBox <gi...@apache.org>.
rabbah commented on a change in pull request #4790:
URL: https://github.com/apache/openwhisk/pull/4790#discussion_r585118863



##########
File path: common/scala/src/main/scala/org/apache/openwhisk/core/entity/ExecManifest.scala
##########
@@ -58,6 +58,20 @@ protected[core] object ExecManifest {
     mf
   }
 
+  /**
+   * Reads runtimes manifest from runtime string
+   *
+   * @param runtime
+   * @return the manifest if initialized successfully, or an failure
+   */
+  protected[core] def initialize(runtime: String): Try[Runtimes] = {

Review comment:
       why not use the method above and set the `manifestOverride` to `Some(...)` at the call site?

##########
File path: common/scala/src/main/scala/org/apache/openwhisk/common/ComponentCredentials.scala
##########
@@ -0,0 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.openwhisk.common
+

Review comment:
       You can use `akka.http.scaladsl.model.headers.BasicHttpCredentials` instead of creating this class.
   
   

##########
File path: core/controller/src/main/scala/org/apache/openwhisk/core/controller/Controller.scala
##########
@@ -176,6 +184,58 @@ class Controller(val instance: ControllerInstanceId,
     LogLimit.config,
     runtimes,
     List(apiV1.basepath()))
+
+  private val controllerCredentials = loadConfigOrThrow[ControllerCredentials](ConfigKeys.controllerCredentials)
+
+  /**
+   * config runtime
+   */
+  private val configRuntime = {
+    implicit val executionContext = actorSystem.dispatcher
+    (path("config" / "runtime") & post) {
+      extractCredentials {
+        case Some(BasicHttpCredentials(username, password)) =>
+          if (username == controllerCredentials.username && password == controllerCredentials.password) {

Review comment:
       you can use as authentication directive which will automatically check the credentials and reject the request. This is OK just making an observation.

##########
File path: common/scala/src/main/scala/org/apache/openwhisk/common/ComponentCredentials.scala
##########
@@ -0,0 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.openwhisk.common
+

Review comment:
       I see later this is created to read/load the configuration - it might still work with `BasicHttpCredentials` because it's case class with the same fields. 

##########
File path: core/controller/src/main/scala/org/apache/openwhisk/core/controller/Controller.scala
##########
@@ -163,6 +164,65 @@ class Controller(val instance: ControllerInstanceId,
     LogLimit.config,
     runtimes,
     List(apiV1.basepath()))
+
+  private val controllerUsername = {
+    val source = scala.io.Source.fromFile("/conf/controllerauth.username");
+    try source.mkString.replaceAll("\r|\n", "")
+    finally source.close()
+  }
+  private val controllerPassword = {
+    val source = scala.io.Source.fromFile("/conf/controllerauth.password");
+    try source.mkString.replaceAll("\r|\n", "")
+    finally source.close()
+  }
+
+  /**
+   * config runtime
+   */
+  private val configRuntime = {
+    implicit val executionContext = actorSystem.dispatcher
+    (path("config" / "runtime") & post) {
+      extractCredentials {
+        case Some(BasicHttpCredentials(username, password)) =>
+          if (username == controllerUsername && password == controllerPassword) {
+            entity(as[String]) { runtime =>

Review comment:
       I think you can do `as json object` instead of `string` to tighten this a bit more. I agree not to deserialize into a `Runtimes` instance.

##########
File path: common/scala/src/main/scala/org/apache/openwhisk/core/entity/ExecManifest.scala
##########
@@ -58,6 +58,20 @@ protected[core] object ExecManifest {
     mf
   }
 
+  /**
+   * Reads runtimes manifest from runtime string
+   *
+   * @param runtime
+   * @return the manifest if initialized successfully, or an failure
+   */
+  protected[core] def initialize(runtime: String): Try[Runtimes] = {
+    val rmc = loadConfigOrThrow[RuntimeManifestConfig](ConfigKeys.runtimes)
+    val mf = Try(runtime.parseJson.asJsObject).flatMap(runtimes(_, rmc))
+    var manifest: Option[Runtimes] = None

Review comment:
       this is incorrect - the reason we do the assignment to `manifest` on line 57 is to set the singleton. Here, this has no effect because the variable is local.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [openwhisk] ningyougang closed pull request #4790: Add administrative interface to invoker and controller to reconfigure runtimes

Posted by GitBox <gi...@apache.org>.
ningyougang closed pull request #4790:
URL: https://github.com/apache/openwhisk/pull/4790


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [openwhisk] codecov-commenter edited a comment on pull request #4790: Add administrative interface to invoker and controller to reconfigure runtimes

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #4790:
URL: https://github.com/apache/openwhisk/pull/4790#issuecomment-640505134


   # [Codecov](https://codecov.io/gh/apache/openwhisk/pull/4790?src=pr&el=h1) Report
   > Merging [#4790](https://codecov.io/gh/apache/openwhisk/pull/4790?src=pr&el=desc) into [master](https://codecov.io/gh/apache/openwhisk/commit/395149d7e3d07e379e053c778ae6ed6f32eef33e&el=desc) will **decrease** coverage by `6.37%`.
   > The diff coverage is `48.20%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/openwhisk/pull/4790/graphs/tree.svg?width=650&height=150&src=pr&token=l0YmsiSAso)](https://codecov.io/gh/apache/openwhisk/pull/4790?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master    #4790      +/-   ##
   ==========================================
   - Coverage   83.56%   77.18%   -6.38%     
   ==========================================
     Files         201      202       +1     
     Lines        9515     9608      +93     
     Branches      400      400              
   ==========================================
   - Hits         7951     7416     -535     
   - Misses       1564     2192     +628     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/openwhisk/pull/4790?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...che/openwhisk/core/loadBalancer/LoadBalancer.scala](https://codecov.io/gh/apache/openwhisk/pull/4790/diff?src=pr&el=tree#diff-Y29yZS9jb250cm9sbGVyL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvb3BlbndoaXNrL2NvcmUvbG9hZEJhbGFuY2VyL0xvYWRCYWxhbmNlci5zY2FsYQ==) | `76.92% <0.00%> (-6.42%)` | :arrow_down: |
   | [...e/loadBalancer/ShardingContainerPoolBalancer.scala](https://codecov.io/gh/apache/openwhisk/pull/4790/diff?src=pr&el=tree#diff-Y29yZS9jb250cm9sbGVyL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvb3BlbndoaXNrL2NvcmUvbG9hZEJhbGFuY2VyL1NoYXJkaW5nQ29udGFpbmVyUG9vbEJhbGFuY2VyLnNjYWxh) | `77.71% <0.00%> (-3.08%)` | :arrow_down: |
   | [...la/org/apache/openwhisk/core/invoker/Invoker.scala](https://codecov.io/gh/apache/openwhisk/pull/4790/diff?src=pr&el=tree#diff-Y29yZS9pbnZva2VyL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvb3BlbndoaXNrL2NvcmUvaW52b2tlci9JbnZva2VyLnNjYWxh) | `71.66% <ø> (-0.47%)` | :arrow_down: |
   | [.../apache/openwhisk/core/controller/Controller.scala](https://codecov.io/gh/apache/openwhisk/pull/4790/diff?src=pr&el=tree#diff-Y29yZS9jb250cm9sbGVyL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvb3BlbndoaXNrL2NvcmUvY29udHJvbGxlci9Db250cm9sbGVyLnNjYWxh) | `45.11% <10.00%> (-9.70%)` | :arrow_down: |
   | [.../org/apache/openwhisk/core/connector/Message.scala](https://codecov.io/gh/apache/openwhisk/pull/4790/diff?src=pr&el=tree#diff-Y29tbW9uL3NjYWxhL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvb3BlbndoaXNrL2NvcmUvY29ubmVjdG9yL01lc3NhZ2Uuc2NhbGE=) | `76.86% <37.50%> (-3.30%)` | :arrow_down: |
   | [...e/openwhisk/core/containerpool/ContainerPool.scala](https://codecov.io/gh/apache/openwhisk/pull/4790/diff?src=pr&el=tree#diff-Y29yZS9pbnZva2VyL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvb3BlbndoaXNrL2NvcmUvY29udGFpbmVycG9vbC9Db250YWluZXJQb29sLnNjYWxh) | `94.14% <60.00%> (-3.73%)` | :arrow_down: |
   | [...pache/openwhisk/core/invoker/InvokerReactive.scala](https://codecov.io/gh/apache/openwhisk/pull/4790/diff?src=pr&el=tree#diff-Y29yZS9pbnZva2VyL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvb3BlbndoaXNrL2NvcmUvaW52b2tlci9JbnZva2VyUmVhY3RpdmUuc2NhbGE=) | `79.38% <64.40%> (-0.26%)` | :arrow_down: |
   | [.../openwhisk/core/invoker/DefaultInvokerServer.scala](https://codecov.io/gh/apache/openwhisk/pull/4790/diff?src=pr&el=tree#diff-Y29yZS9pbnZva2VyL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvb3BlbndoaXNrL2NvcmUvaW52b2tlci9EZWZhdWx0SW52b2tlclNlcnZlci5zY2FsYQ==) | `75.00% <75.00%> (ø)` | |
   | [.../scala/org/apache/openwhisk/core/WhiskConfig.scala](https://codecov.io/gh/apache/openwhisk/pull/4790/diff?src=pr&el=tree#diff-Y29tbW9uL3NjYWxhL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvb3BlbndoaXNrL2NvcmUvV2hpc2tDb25maWcuc2NhbGE=) | `95.00% <100.00%> (+0.03%)` | :arrow_up: |
   | [...rg/apache/openwhisk/core/entity/ExecManifest.scala](https://codecov.io/gh/apache/openwhisk/pull/4790/diff?src=pr&el=tree#diff-Y29tbW9uL3NjYWxhL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvb3BlbndoaXNrL2NvcmUvZW50aXR5L0V4ZWNNYW5pZmVzdC5zY2FsYQ==) | `92.15% <100.00%> (+0.32%)` | :arrow_up: |
   | ... and [23 more](https://codecov.io/gh/apache/openwhisk/pull/4790/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/openwhisk/pull/4790?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/openwhisk/pull/4790?src=pr&el=footer). Last update [395149d...4157ebc](https://codecov.io/gh/apache/openwhisk/pull/4790?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [openwhisk] codecov-commenter edited a comment on pull request #4790: Add administrative interface to invoker and controller to reconfigure runtimes

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #4790:
URL: https://github.com/apache/openwhisk/pull/4790#issuecomment-640505134


   # [Codecov](https://codecov.io/gh/apache/openwhisk/pull/4790?src=pr&el=h1) Report
   > Merging [#4790](https://codecov.io/gh/apache/openwhisk/pull/4790?src=pr&el=desc) into [master](https://codecov.io/gh/apache/openwhisk/commit/395149d7e3d07e379e053c778ae6ed6f32eef33e&el=desc) will **decrease** coverage by `6.56%`.
   > The diff coverage is `50.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/openwhisk/pull/4790/graphs/tree.svg?width=650&height=150&src=pr&token=l0YmsiSAso)](https://codecov.io/gh/apache/openwhisk/pull/4790?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master    #4790      +/-   ##
   ==========================================
   - Coverage   83.56%   76.99%   -6.57%     
   ==========================================
     Files         201      202       +1     
     Lines        9515     9613      +98     
     Branches      400      415      +15     
   ==========================================
   - Hits         7951     7402     -549     
   - Misses       1564     2211     +647     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/openwhisk/pull/4790?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...che/openwhisk/core/loadBalancer/LoadBalancer.scala](https://codecov.io/gh/apache/openwhisk/pull/4790/diff?src=pr&el=tree#diff-Y29yZS9jb250cm9sbGVyL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvb3BlbndoaXNrL2NvcmUvbG9hZEJhbGFuY2VyL0xvYWRCYWxhbmNlci5zY2FsYQ==) | `76.92% <0.00%> (-6.42%)` | :arrow_down: |
   | [...e/loadBalancer/ShardingContainerPoolBalancer.scala](https://codecov.io/gh/apache/openwhisk/pull/4790/diff?src=pr&el=tree#diff-Y29yZS9jb250cm9sbGVyL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvb3BlbndoaXNrL2NvcmUvbG9hZEJhbGFuY2VyL1NoYXJkaW5nQ29udGFpbmVyUG9vbEJhbGFuY2VyLnNjYWxh) | `77.71% <0.00%> (-3.08%)` | :arrow_down: |
   | [...la/org/apache/openwhisk/core/invoker/Invoker.scala](https://codecov.io/gh/apache/openwhisk/pull/4790/diff?src=pr&el=tree#diff-Y29yZS9pbnZva2VyL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvb3BlbndoaXNrL2NvcmUvaW52b2tlci9JbnZva2VyLnNjYWxh) | `71.66% <ø> (-0.47%)` | :arrow_down: |
   | [.../apache/openwhisk/core/controller/Controller.scala](https://codecov.io/gh/apache/openwhisk/pull/4790/diff?src=pr&el=tree#diff-Y29yZS9jb250cm9sbGVyL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvb3BlbndoaXNrL2NvcmUvY29udHJvbGxlci9Db250cm9sbGVyLnNjYWxh) | `45.11% <10.00%> (-9.70%)` | :arrow_down: |
   | [.../org/apache/openwhisk/core/connector/Message.scala](https://codecov.io/gh/apache/openwhisk/pull/4790/diff?src=pr&el=tree#diff-Y29tbW9uL3NjYWxhL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvb3BlbndoaXNrL2NvcmUvY29ubmVjdG9yL01lc3NhZ2Uuc2NhbGE=) | `76.11% <37.50%> (-4.04%)` | :arrow_down: |
   | [...pache/openwhisk/core/invoker/InvokerReactive.scala](https://codecov.io/gh/apache/openwhisk/pull/4790/diff?src=pr&el=tree#diff-Y29yZS9pbnZva2VyL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvb3BlbndoaXNrL2NvcmUvaW52b2tlci9JbnZva2VyUmVhY3RpdmUuc2NhbGE=) | `77.86% <64.40%> (-1.79%)` | :arrow_down: |
   | [...e/openwhisk/core/containerpool/ContainerPool.scala](https://codecov.io/gh/apache/openwhisk/pull/4790/diff?src=pr&el=tree#diff-Y29yZS9pbnZva2VyL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvb3BlbndoaXNrL2NvcmUvY29udGFpbmVycG9vbC9Db250YWluZXJQb29sLnNjYWxh) | `94.25% <66.66%> (-3.62%)` | :arrow_down: |
   | [.../openwhisk/core/invoker/DefaultInvokerServer.scala](https://codecov.io/gh/apache/openwhisk/pull/4790/diff?src=pr&el=tree#diff-Y29yZS9pbnZva2VyL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvb3BlbndoaXNrL2NvcmUvaW52b2tlci9EZWZhdWx0SW52b2tlclNlcnZlci5zY2FsYQ==) | `75.00% <75.00%> (ø)` | |
   | [.../scala/org/apache/openwhisk/core/WhiskConfig.scala](https://codecov.io/gh/apache/openwhisk/pull/4790/diff?src=pr&el=tree#diff-Y29tbW9uL3NjYWxhL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvb3BlbndoaXNrL2NvcmUvV2hpc2tDb25maWcuc2NhbGE=) | `95.00% <100.00%> (+0.03%)` | :arrow_up: |
   | [...rg/apache/openwhisk/core/entity/ExecManifest.scala](https://codecov.io/gh/apache/openwhisk/pull/4790/diff?src=pr&el=tree#diff-Y29tbW9uL3NjYWxhL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvb3BlbndoaXNrL2NvcmUvZW50aXR5L0V4ZWNNYW5pZmVzdC5zY2FsYQ==) | `92.15% <100.00%> (+0.32%)` | :arrow_up: |
   | ... and [22 more](https://codecov.io/gh/apache/openwhisk/pull/4790/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/openwhisk/pull/4790?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/openwhisk/pull/4790?src=pr&el=footer). Last update [395149d...4157ebc](https://codecov.io/gh/apache/openwhisk/pull/4790?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [openwhisk] ningyougang commented on a change in pull request #4790: Add administrative interface to invoker and controller to reconfigure runtimes

Posted by GitBox <gi...@apache.org>.
ningyougang commented on a change in pull request #4790:
URL: https://github.com/apache/openwhisk/pull/4790#discussion_r436566835



##########
File path: core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/ContainerPool.scala
##########
@@ -302,6 +307,33 @@ class ContainerPool(childFactory: ActorRefFactory => ActorRef,
     case RescheduleJob =>
       freePool = freePool - sender()
       busyPool = busyPool - sender()
+    case prewarmConfigList: PreWarmConfigList =>
+      val passedPrewarmConfig = prewarmConfigList.list
+      var newPrewarmConfig: List[PrewarmingConfig] = List.empty
+      latestPrewarmConfig foreach { config =>
+        newPrewarmConfig = newPrewarmConfig :+ passedPrewarmConfig
+          .find(passedConfig =>
+            passedConfig.exec.kind == config.exec.kind && passedConfig.memoryLimit == config.memoryLimit)
+          .getOrElse(config)
+      }
+      latestPrewarmConfig = newPrewarmConfig

Review comment:
       Support just change specify runtime config, e.g.
   Let's assume runtimes.json include nodejs:12, python:2, swift4.1, we can change nodejs:12 runtime only via `just pass nodejs:12 runtime info`, for other runtimes, just use previous runtime info directly.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [openwhisk] codecov-commenter edited a comment on pull request #4790: Add administrative interface to invoker and controller to reconfigure runtimes

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #4790:
URL: https://github.com/apache/openwhisk/pull/4790#issuecomment-640505134


   # [Codecov](https://codecov.io/gh/apache/openwhisk/pull/4790?src=pr&el=h1) Report
   > Merging [#4790](https://codecov.io/gh/apache/openwhisk/pull/4790?src=pr&el=desc) into [master](https://codecov.io/gh/apache/openwhisk/commit/395149d7e3d07e379e053c778ae6ed6f32eef33e&el=desc) will **decrease** coverage by `6.56%`.
   > The diff coverage is `50.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/openwhisk/pull/4790/graphs/tree.svg?width=650&height=150&src=pr&token=l0YmsiSAso)](https://codecov.io/gh/apache/openwhisk/pull/4790?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master    #4790      +/-   ##
   ==========================================
   - Coverage   83.56%   76.99%   -6.57%     
   ==========================================
     Files         201      202       +1     
     Lines        9515     9613      +98     
     Branches      400      415      +15     
   ==========================================
   - Hits         7951     7402     -549     
   - Misses       1564     2211     +647     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/openwhisk/pull/4790?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...che/openwhisk/core/loadBalancer/LoadBalancer.scala](https://codecov.io/gh/apache/openwhisk/pull/4790/diff?src=pr&el=tree#diff-Y29yZS9jb250cm9sbGVyL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvb3BlbndoaXNrL2NvcmUvbG9hZEJhbGFuY2VyL0xvYWRCYWxhbmNlci5zY2FsYQ==) | `76.92% <0.00%> (-6.42%)` | :arrow_down: |
   | [...e/loadBalancer/ShardingContainerPoolBalancer.scala](https://codecov.io/gh/apache/openwhisk/pull/4790/diff?src=pr&el=tree#diff-Y29yZS9jb250cm9sbGVyL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvb3BlbndoaXNrL2NvcmUvbG9hZEJhbGFuY2VyL1NoYXJkaW5nQ29udGFpbmVyUG9vbEJhbGFuY2VyLnNjYWxh) | `77.71% <0.00%> (-3.08%)` | :arrow_down: |
   | [...la/org/apache/openwhisk/core/invoker/Invoker.scala](https://codecov.io/gh/apache/openwhisk/pull/4790/diff?src=pr&el=tree#diff-Y29yZS9pbnZva2VyL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvb3BlbndoaXNrL2NvcmUvaW52b2tlci9JbnZva2VyLnNjYWxh) | `71.66% <ø> (-0.47%)` | :arrow_down: |
   | [.../apache/openwhisk/core/controller/Controller.scala](https://codecov.io/gh/apache/openwhisk/pull/4790/diff?src=pr&el=tree#diff-Y29yZS9jb250cm9sbGVyL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvb3BlbndoaXNrL2NvcmUvY29udHJvbGxlci9Db250cm9sbGVyLnNjYWxh) | `45.11% <10.00%> (-9.70%)` | :arrow_down: |
   | [.../org/apache/openwhisk/core/connector/Message.scala](https://codecov.io/gh/apache/openwhisk/pull/4790/diff?src=pr&el=tree#diff-Y29tbW9uL3NjYWxhL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvb3BlbndoaXNrL2NvcmUvY29ubmVjdG9yL01lc3NhZ2Uuc2NhbGE=) | `76.11% <37.50%> (-4.04%)` | :arrow_down: |
   | [...pache/openwhisk/core/invoker/InvokerReactive.scala](https://codecov.io/gh/apache/openwhisk/pull/4790/diff?src=pr&el=tree#diff-Y29yZS9pbnZva2VyL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvb3BlbndoaXNrL2NvcmUvaW52b2tlci9JbnZva2VyUmVhY3RpdmUuc2NhbGE=) | `77.86% <64.40%> (-1.79%)` | :arrow_down: |
   | [...e/openwhisk/core/containerpool/ContainerPool.scala](https://codecov.io/gh/apache/openwhisk/pull/4790/diff?src=pr&el=tree#diff-Y29yZS9pbnZva2VyL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvb3BlbndoaXNrL2NvcmUvY29udGFpbmVycG9vbC9Db250YWluZXJQb29sLnNjYWxh) | `94.25% <66.66%> (-3.62%)` | :arrow_down: |
   | [.../openwhisk/core/invoker/DefaultInvokerServer.scala](https://codecov.io/gh/apache/openwhisk/pull/4790/diff?src=pr&el=tree#diff-Y29yZS9pbnZva2VyL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvb3BlbndoaXNrL2NvcmUvaW52b2tlci9EZWZhdWx0SW52b2tlclNlcnZlci5zY2FsYQ==) | `75.00% <75.00%> (ø)` | |
   | [.../scala/org/apache/openwhisk/core/WhiskConfig.scala](https://codecov.io/gh/apache/openwhisk/pull/4790/diff?src=pr&el=tree#diff-Y29tbW9uL3NjYWxhL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvb3BlbndoaXNrL2NvcmUvV2hpc2tDb25maWcuc2NhbGE=) | `95.00% <100.00%> (+0.03%)` | :arrow_up: |
   | [...rg/apache/openwhisk/core/entity/ExecManifest.scala](https://codecov.io/gh/apache/openwhisk/pull/4790/diff?src=pr&el=tree#diff-Y29tbW9uL3NjYWxhL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvb3BlbndoaXNrL2NvcmUvZW50aXR5L0V4ZWNNYW5pZmVzdC5zY2FsYQ==) | `92.15% <100.00%> (+0.32%)` | :arrow_up: |
   | ... and [22 more](https://codecov.io/gh/apache/openwhisk/pull/4790/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/openwhisk/pull/4790?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/openwhisk/pull/4790?src=pr&el=footer). Last update [395149d...4157ebc](https://codecov.io/gh/apache/openwhisk/pull/4790?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [openwhisk] ningyougang commented on pull request #4790: Add administrative interface to invoker and controller to reconfigure runtimes

Posted by GitBox <gi...@apache.org>.
ningyougang commented on pull request #4790:
URL: https://github.com/apache/openwhisk/pull/4790#issuecomment-640396258


   Rebased


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [openwhisk] codecov-commenter edited a comment on pull request #4790: Add administrative interface to invoker and controller to reconfigure runtimes

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #4790:
URL: https://github.com/apache/openwhisk/pull/4790#issuecomment-640505134


   # [Codecov](https://codecov.io/gh/apache/openwhisk/pull/4790?src=pr&el=h1) Report
   > Merging [#4790](https://codecov.io/gh/apache/openwhisk/pull/4790?src=pr&el=desc) into [master](https://codecov.io/gh/apache/openwhisk/commit/395149d7e3d07e379e053c778ae6ed6f32eef33e&el=desc) will **decrease** coverage by `6.37%`.
   > The diff coverage is `48.20%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/openwhisk/pull/4790/graphs/tree.svg?width=650&height=150&src=pr&token=l0YmsiSAso)](https://codecov.io/gh/apache/openwhisk/pull/4790?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master    #4790      +/-   ##
   ==========================================
   - Coverage   83.56%   77.18%   -6.38%     
   ==========================================
     Files         201      202       +1     
     Lines        9515     9608      +93     
     Branches      400      400              
   ==========================================
   - Hits         7951     7416     -535     
   - Misses       1564     2192     +628     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/openwhisk/pull/4790?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...che/openwhisk/core/loadBalancer/LoadBalancer.scala](https://codecov.io/gh/apache/openwhisk/pull/4790/diff?src=pr&el=tree#diff-Y29yZS9jb250cm9sbGVyL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvb3BlbndoaXNrL2NvcmUvbG9hZEJhbGFuY2VyL0xvYWRCYWxhbmNlci5zY2FsYQ==) | `76.92% <0.00%> (-6.42%)` | :arrow_down: |
   | [...e/loadBalancer/ShardingContainerPoolBalancer.scala](https://codecov.io/gh/apache/openwhisk/pull/4790/diff?src=pr&el=tree#diff-Y29yZS9jb250cm9sbGVyL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvb3BlbndoaXNrL2NvcmUvbG9hZEJhbGFuY2VyL1NoYXJkaW5nQ29udGFpbmVyUG9vbEJhbGFuY2VyLnNjYWxh) | `77.71% <0.00%> (-3.08%)` | :arrow_down: |
   | [...la/org/apache/openwhisk/core/invoker/Invoker.scala](https://codecov.io/gh/apache/openwhisk/pull/4790/diff?src=pr&el=tree#diff-Y29yZS9pbnZva2VyL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvb3BlbndoaXNrL2NvcmUvaW52b2tlci9JbnZva2VyLnNjYWxh) | `71.66% <ø> (-0.47%)` | :arrow_down: |
   | [.../apache/openwhisk/core/controller/Controller.scala](https://codecov.io/gh/apache/openwhisk/pull/4790/diff?src=pr&el=tree#diff-Y29yZS9jb250cm9sbGVyL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvb3BlbndoaXNrL2NvcmUvY29udHJvbGxlci9Db250cm9sbGVyLnNjYWxh) | `45.11% <10.00%> (-9.70%)` | :arrow_down: |
   | [.../org/apache/openwhisk/core/connector/Message.scala](https://codecov.io/gh/apache/openwhisk/pull/4790/diff?src=pr&el=tree#diff-Y29tbW9uL3NjYWxhL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvb3BlbndoaXNrL2NvcmUvY29ubmVjdG9yL01lc3NhZ2Uuc2NhbGE=) | `76.86% <37.50%> (-3.30%)` | :arrow_down: |
   | [...e/openwhisk/core/containerpool/ContainerPool.scala](https://codecov.io/gh/apache/openwhisk/pull/4790/diff?src=pr&el=tree#diff-Y29yZS9pbnZva2VyL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvb3BlbndoaXNrL2NvcmUvY29udGFpbmVycG9vbC9Db250YWluZXJQb29sLnNjYWxh) | `94.14% <60.00%> (-3.73%)` | :arrow_down: |
   | [...pache/openwhisk/core/invoker/InvokerReactive.scala](https://codecov.io/gh/apache/openwhisk/pull/4790/diff?src=pr&el=tree#diff-Y29yZS9pbnZva2VyL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvb3BlbndoaXNrL2NvcmUvaW52b2tlci9JbnZva2VyUmVhY3RpdmUuc2NhbGE=) | `79.38% <64.40%> (-0.26%)` | :arrow_down: |
   | [.../openwhisk/core/invoker/DefaultInvokerServer.scala](https://codecov.io/gh/apache/openwhisk/pull/4790/diff?src=pr&el=tree#diff-Y29yZS9pbnZva2VyL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvb3BlbndoaXNrL2NvcmUvaW52b2tlci9EZWZhdWx0SW52b2tlclNlcnZlci5zY2FsYQ==) | `75.00% <75.00%> (ø)` | |
   | [.../scala/org/apache/openwhisk/core/WhiskConfig.scala](https://codecov.io/gh/apache/openwhisk/pull/4790/diff?src=pr&el=tree#diff-Y29tbW9uL3NjYWxhL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvb3BlbndoaXNrL2NvcmUvV2hpc2tDb25maWcuc2NhbGE=) | `95.00% <100.00%> (+0.03%)` | :arrow_up: |
   | [...rg/apache/openwhisk/core/entity/ExecManifest.scala](https://codecov.io/gh/apache/openwhisk/pull/4790/diff?src=pr&el=tree#diff-Y29tbW9uL3NjYWxhL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvb3BlbndoaXNrL2NvcmUvZW50aXR5L0V4ZWNNYW5pZmVzdC5zY2FsYQ==) | `92.15% <100.00%> (+0.32%)` | :arrow_up: |
   | ... and [23 more](https://codecov.io/gh/apache/openwhisk/pull/4790/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/openwhisk/pull/4790?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/openwhisk/pull/4790?src=pr&el=footer). Last update [395149d...4157ebc](https://codecov.io/gh/apache/openwhisk/pull/4790?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [openwhisk] ningyougang commented on a change in pull request #4790: Add administrative interface to invoker and controller to reconfigure runtimes

Posted by GitBox <gi...@apache.org>.
ningyougang commented on a change in pull request #4790:
URL: https://github.com/apache/openwhisk/pull/4790#discussion_r585276745



##########
File path: common/scala/src/main/scala/org/apache/openwhisk/core/entity/ExecManifest.scala
##########
@@ -58,6 +58,20 @@ protected[core] object ExecManifest {
     mf
   }
 
+  /**
+   * Reads runtimes manifest from runtime string
+   *
+   * @param runtime
+   * @return the manifest if initialized successfully, or an failure
+   */
+  protected[core] def initialize(runtime: String): Try[Runtimes] = {

Review comment:
       Yes, you are right, updated accordingly.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [openwhisk] codecov-commenter commented on pull request #4790: Add administrative interface to invoker and controller to reconfigure runtimes

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on pull request #4790:
URL: https://github.com/apache/openwhisk/pull/4790#issuecomment-640505134


   # [Codecov](https://codecov.io/gh/apache/openwhisk/pull/4790?src=pr&el=h1) Report
   > Merging [#4790](https://codecov.io/gh/apache/openwhisk/pull/4790?src=pr&el=desc) into [master](https://codecov.io/gh/apache/openwhisk/commit/395149d7e3d07e379e053c778ae6ed6f32eef33e&el=desc) will **decrease** coverage by `6.37%`.
   > The diff coverage is `48.20%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/openwhisk/pull/4790/graphs/tree.svg?width=650&height=150&src=pr&token=l0YmsiSAso)](https://codecov.io/gh/apache/openwhisk/pull/4790?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master    #4790      +/-   ##
   ==========================================
   - Coverage   83.56%   77.18%   -6.38%     
   ==========================================
     Files         201      202       +1     
     Lines        9515     9608      +93     
     Branches      400      400              
   ==========================================
   - Hits         7951     7416     -535     
   - Misses       1564     2192     +628     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/openwhisk/pull/4790?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...che/openwhisk/core/loadBalancer/LoadBalancer.scala](https://codecov.io/gh/apache/openwhisk/pull/4790/diff?src=pr&el=tree#diff-Y29yZS9jb250cm9sbGVyL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvb3BlbndoaXNrL2NvcmUvbG9hZEJhbGFuY2VyL0xvYWRCYWxhbmNlci5zY2FsYQ==) | `76.92% <0.00%> (-6.42%)` | :arrow_down: |
   | [...e/loadBalancer/ShardingContainerPoolBalancer.scala](https://codecov.io/gh/apache/openwhisk/pull/4790/diff?src=pr&el=tree#diff-Y29yZS9jb250cm9sbGVyL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvb3BlbndoaXNrL2NvcmUvbG9hZEJhbGFuY2VyL1NoYXJkaW5nQ29udGFpbmVyUG9vbEJhbGFuY2VyLnNjYWxh) | `77.71% <0.00%> (-3.08%)` | :arrow_down: |
   | [...la/org/apache/openwhisk/core/invoker/Invoker.scala](https://codecov.io/gh/apache/openwhisk/pull/4790/diff?src=pr&el=tree#diff-Y29yZS9pbnZva2VyL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvb3BlbndoaXNrL2NvcmUvaW52b2tlci9JbnZva2VyLnNjYWxh) | `71.66% <ø> (-0.47%)` | :arrow_down: |
   | [.../apache/openwhisk/core/controller/Controller.scala](https://codecov.io/gh/apache/openwhisk/pull/4790/diff?src=pr&el=tree#diff-Y29yZS9jb250cm9sbGVyL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvb3BlbndoaXNrL2NvcmUvY29udHJvbGxlci9Db250cm9sbGVyLnNjYWxh) | `45.11% <10.00%> (-9.70%)` | :arrow_down: |
   | [.../org/apache/openwhisk/core/connector/Message.scala](https://codecov.io/gh/apache/openwhisk/pull/4790/diff?src=pr&el=tree#diff-Y29tbW9uL3NjYWxhL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvb3BlbndoaXNrL2NvcmUvY29ubmVjdG9yL01lc3NhZ2Uuc2NhbGE=) | `76.86% <37.50%> (-3.30%)` | :arrow_down: |
   | [...e/openwhisk/core/containerpool/ContainerPool.scala](https://codecov.io/gh/apache/openwhisk/pull/4790/diff?src=pr&el=tree#diff-Y29yZS9pbnZva2VyL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvb3BlbndoaXNrL2NvcmUvY29udGFpbmVycG9vbC9Db250YWluZXJQb29sLnNjYWxh) | `94.14% <60.00%> (-3.73%)` | :arrow_down: |
   | [...pache/openwhisk/core/invoker/InvokerReactive.scala](https://codecov.io/gh/apache/openwhisk/pull/4790/diff?src=pr&el=tree#diff-Y29yZS9pbnZva2VyL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvb3BlbndoaXNrL2NvcmUvaW52b2tlci9JbnZva2VyUmVhY3RpdmUuc2NhbGE=) | `79.38% <64.40%> (-0.26%)` | :arrow_down: |
   | [.../openwhisk/core/invoker/DefaultInvokerServer.scala](https://codecov.io/gh/apache/openwhisk/pull/4790/diff?src=pr&el=tree#diff-Y29yZS9pbnZva2VyL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvb3BlbndoaXNrL2NvcmUvaW52b2tlci9EZWZhdWx0SW52b2tlclNlcnZlci5zY2FsYQ==) | `75.00% <75.00%> (ø)` | |
   | [.../scala/org/apache/openwhisk/core/WhiskConfig.scala](https://codecov.io/gh/apache/openwhisk/pull/4790/diff?src=pr&el=tree#diff-Y29tbW9uL3NjYWxhL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvb3BlbndoaXNrL2NvcmUvV2hpc2tDb25maWcuc2NhbGE=) | `95.00% <100.00%> (+0.03%)` | :arrow_up: |
   | [...rg/apache/openwhisk/core/entity/ExecManifest.scala](https://codecov.io/gh/apache/openwhisk/pull/4790/diff?src=pr&el=tree#diff-Y29tbW9uL3NjYWxhL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvb3BlbndoaXNrL2NvcmUvZW50aXR5L0V4ZWNNYW5pZmVzdC5zY2FsYQ==) | `92.15% <100.00%> (+0.32%)` | :arrow_up: |
   | ... and [23 more](https://codecov.io/gh/apache/openwhisk/pull/4790/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/openwhisk/pull/4790?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/openwhisk/pull/4790?src=pr&el=footer). Last update [395149d...4157ebc](https://codecov.io/gh/apache/openwhisk/pull/4790?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [openwhisk] ningyougang commented on a change in pull request #4790: Add administrative interface to invoker and controller to reconfigure runtimes

Posted by GitBox <gi...@apache.org>.
ningyougang commented on a change in pull request #4790:
URL: https://github.com/apache/openwhisk/pull/4790#discussion_r436566835



##########
File path: core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/ContainerPool.scala
##########
@@ -302,6 +307,33 @@ class ContainerPool(childFactory: ActorRefFactory => ActorRef,
     case RescheduleJob =>
       freePool = freePool - sender()
       busyPool = busyPool - sender()
+    case prewarmConfigList: PreWarmConfigList =>
+      val passedPrewarmConfig = prewarmConfigList.list
+      var newPrewarmConfig: List[PrewarmingConfig] = List.empty
+      latestPrewarmConfig foreach { config =>
+        newPrewarmConfig = newPrewarmConfig :+ passedPrewarmConfig
+          .find(passedConfig =>
+            passedConfig.exec.kind == config.exec.kind && passedConfig.memoryLimit == config.memoryLimit)
+          .getOrElse(config)
+      }
+      latestPrewarmConfig = newPrewarmConfig

Review comment:
       Support just change specify runtime config, e.g.
   Let's assume runtimes.json include nodejs:12, python:2, swift4.1, we can change nodejs:12 runtime only via `just pass nodejs:12 runtime info`.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org