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 2022/05/03 08:08:56 UTC

[GitHub] [openwhisk] upgle opened a new pull request, #5229: [Proposal] Provide different action limits for different namespaces

upgle opened a new pull request, #5229:
URL: https://github.com/apache/openwhisk/pull/5229

   <!--- 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. -->
   
   Currently, openwhisk has only the system limit shared by all namespaces. I have received requirements to set different limits for each namespace/user. So I propose a new feature for namespace limit.
   
   - There are **(1) system limits**, **(2) namespace default limits**, **(3) namespace limits**.
     - (1) system limits: under no circumstances may this limit be exceeded.
     - (2) namespace default limits: use this limit value unless a limit has been set in the namespace.
     - (3) namespace limit: It can be set by the system administrator. This value cannot exceed the range of the system limit.
   
   _case1) Using default namespace limit_
   <img src="https://user-images.githubusercontent.com/5635513/166409786-bb6759f8-e860-4f1e-8524-a91cc8ddd2f9.png" width="600">
   
   _case1) Using namespace limit (for `foo` namespace)_
   <img src="https://user-images.githubusercontent.com/5635513/166409938-66a257e5-e9a5-4031-9f3a-a0001a9c5c93.png" width="600">
   
   ### Limit doc
   You can set namespace limits with `{namespace}/limits` document just like any other existing setting.
   
   ```json
   {
     "concurrentInvocations": 100,
     "invocationsPerMinute": 100,
     "firesPerMinute": 100,
     "memoryMax": 128,
     "concurrencyMax": 400
     "logMax": 128
   }
   ```
   
   ### New namespace limit config
   config key | description
   -- | --
   memoryMin | minimum action memory size for namespace
   memoryMax | maximum action memory size for namespace
   logMin | minimum activation log size for namespace
   logMax | maximum activation log size for namespace
   durationMin | minimum action time limit for namespace
   durationMax | maximum action time limit for namespace
   concurrencyMin | minimum action concurrency limit for namespace
   concurrencyMax | maximum action concurrency limit for namespace
   
   
   ## Related issue and scope
   <!--- Please include a link to a related issue if there is one. -->
   I didn't open new issue, but described the changes here.
   
   ## My changes affect the following components
   <!--- Select below all system components are affected by your change. -->
   <!--- Enter an `x` in all applicable boxes. -->
   - [x] API
   - [x] Controller
   - [x] Tests
   - [ ] 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).
   - [x] I reviewed the [style guides](https://github.com/apache/openwhisk/blob/master/CONTRIBUTING.md#coding-standards) and followed the recommendations (Travis CI will check :).
   - [x] I added tests to cover my changes.
   - [ ] My changes require further changes to the documentation.
   - [ ] 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.

To unsubscribe, e-mail: issues-unsubscribe@openwhisk.apache.org

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


[GitHub] [openwhisk] style95 commented on a diff in pull request #5229: Provide action limit configuration for each namespace

Posted by GitBox <gi...@apache.org>.
style95 commented on code in PR #5229:
URL: https://github.com/apache/openwhisk/pull/5229#discussion_r897866510


##########
common/scala/src/main/scala/org/apache/openwhisk/core/containerpool/ApacheBlockingContainerClient.scala:
##########
@@ -124,13 +129,13 @@ protected class ApacheBlockingContainerClient(hostname: String,
 
           // Negative contentLength means unknown or overflow. We don't want to consume in either case.
           if (contentLength >= 0) {
-            if (contentLength <= maxResponseBytes) {
+            if (contentLength <= maxResponse.toBytes) {

Review Comment:
   Do we need `toBytes` here?



##########
common/scala/src/main/scala/org/apache/openwhisk/core/containerpool/AkkaContainerClient.scala:
##########
@@ -87,12 +85,18 @@ protected class AkkaContainerClient(
    *
    * @param endpoint the path the api call relative to hostname
    * @param body the JSON value to post (this is usually a JSON objecT)
+   * @param maxResponse the maximum size in bytes the connection will accept

Review Comment:
   Seems the description about the `truncation` is missing.
   



##########
common/scala/src/main/scala/org/apache/openwhisk/core/entity/ActivationEntityLimit.scala:
##########
@@ -32,8 +32,20 @@ case class ActivationEntityLimitConf(serdesOverhead: ByteSize, payload: Activati
  */
 protected[core] object ActivationEntityLimit {
   private val config = loadConfigOrThrow[ActivationEntityLimitConf](ConfigKeys.activation)
+  private val namespacePayloadLimitConfig = try {
+    loadConfigOrThrow[ActivationEntityPayload](ConfigKeys.namespaceActivationPayloadLimit)
+  } catch {
+    case _: Throwable =>
+      // Supports backwards compatibility for openwhisk that do not use the namespace default limit
+      ActivationEntityPayload(config.payload.max, config.payload.truncation)

Review Comment:
   πŸ‘ 



##########
tests/src/test/scala/org/apache/openwhisk/core/entity/test/SchemaTests.scala:
##########
@@ -826,61 +825,16 @@ class SchemaTests extends FlatSpec with BeforeAndAfter with ExecHelpers with Mat
 
     serdes foreach { s =>
       withClue(s"serializer $s") {
-        if (s != LogLimit.serdes) {
-          val lb = the[DeserializationException] thrownBy s.read(JsNumber(0))
-          lb.getMessage should include("below allowed threshold")
-        } else {
+        if (s == LogLimit.serdes) {
           val lb = the[DeserializationException] thrownBy s.read(JsNumber(-1))
           lb.getMessage should include("a negative size of an object is not allowed")
         }
-
-        val ub = the[DeserializationException] thrownBy s.read(JsNumber(Int.MaxValue))
-        ub.getMessage should include("exceeds allowed threshold")
-
         val int = the[DeserializationException] thrownBy s.read(JsNumber(2.5))
         int.getMessage should include("limit must be whole number")
       }
     }
   }
 
-  it should "reject bad limit values" in {

Review Comment:
   Don't we need this negative test case?



-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@openwhisk.apache.org

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


[GitHub] [openwhisk] style95 merged pull request #5229: Provide action limit configuration for each namespace

Posted by "style95 (via GitHub)" <gi...@apache.org>.
style95 merged PR #5229:
URL: https://github.com/apache/openwhisk/pull/5229


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@openwhisk.apache.org

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


[GitHub] [openwhisk] ningyougang commented on a diff in pull request #5229: [Proposal] Provide action limit configuration for each namespace

Posted by GitBox <gi...@apache.org>.
ningyougang commented on code in PR #5229:
URL: https://github.com/apache/openwhisk/pull/5229#discussion_r867575121


##########
common/scala/src/main/scala/org/apache/openwhisk/core/entity/ConcurrencyLimit.scala:
##########
@@ -37,21 +40,67 @@ case class ConcurrencyLimitConfig(min: Int, max: Int, std: Int)
  * The constructor is private so that argument requirements are checked and normalized
  * before creating a new instance.
  *
- * @param maxConcurrent the max number of concurrent activations in a single container
+ * @param maxConcurrent the max or min number of concurrent activations in a single container

Review Comment:
   Because it is `@param maxConcrrent`, why also has `min` meaning?



-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@openwhisk.apache.org

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


[GitHub] [openwhisk] upgle commented on pull request #5229: Provide action limit configuration for each namespace

Posted by GitBox <gi...@apache.org>.
upgle commented on PR #5229:
URL: https://github.com/apache/openwhisk/pull/5229#issuecomment-1204905199

   @bdoyle0182 Thanks for your comments.
   
   > i.e. if the system memory limit default is 256mb, can you change the default value for a specific namespace to 128mb?
   
   If the system memory limit is 256mb, and default memory limit is 128mb, you can create action with 128mb memory, higher memory is not available. If administrator gives you a higher memory limit (called namespace limit), you can create an action with 256mb memory.
   
   This namespace limit can be set in a document with the key `{namespace}/limits` by system administrator.
   
   And the default limit of a namespace is a value set as an environment variable during deployment. If not set, the same value is set as the current system limit for backward compatibility.
   
   ----
   
   I also feel it's not easy to explain different types of concurrency. The name "action concurrency" is already used a lot in code, and configs. I used the same name because using a different name from the existing one is rather confusing.
   
   ```scala
   behavior of "Action concurrency limits"
   ```
   ```scala
   val actionConcurrency = 5
   ```
   ```scala
      * @param concurrency the action concurrency limit to be set in test
      * @param ec the expected exit code when creating the action
     val concurrencyEnabled = Option(WhiskProperties.getProperty("whisk.action.concurrency")).exists(_.toBoolean)
   ```
   
   And the difference is that the "maxActionConcurrency" config added in this PR are not exposed to the user.
   
   Because the name is similar to the existing "concurrency" config, users may need to read the document to understand the concept of new container concurrency.
   
   - maxActionConcurrency
     - The config is not exposed to the user. (It's admin setting)
   - maxContainerConcurrency
     - The config is exposed to the user by action limit.
   
   ```scala
   concurrency: ConcurrencyLimit = ConcurrencyLimit(),
   maxContainerConcurrency: Option[ContainerConcurrencyLimit] = None)
   ```


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@openwhisk.apache.org

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


[GitHub] [openwhisk] style95 commented on pull request #5229: [Proposal] Provide action limit configuration for each namespace

Posted by GitBox <gi...@apache.org>.
style95 commented on PR #5229:
URL: https://github.com/apache/openwhisk/pull/5229#issuecomment-1122355669

   > 
   
   According to this process, we need a separate PR to add a POEM along with this PR.
   https://github.com/apache/openwhisk/blob/master/proposals/POEM-1-proposal-for-openwhisk-enhancements.md#procedures


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@openwhisk.apache.org

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


[GitHub] [openwhisk] ningyougang commented on pull request #5229: [Proposal] Provide action limit configuration for each namespace

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

   If this pr: apache/openwhisk/pull/5229 merged.
   
   If user wants to use a higher memory for her action(e.g. 3GB)
   
   * Does openwhisk admin need to reconfigure his system limit (e.g. make system limit to a high value)?
   * and make sure user namespace's limit value < system limit?
   * As common user,  he just changes the $namespace/limit document is enough?
   * Has any extra work on wskadmin? e.g. Admin can use wskadmin can change the $namespace/limit
    
   Have any influence for old action? e.g. user or admin may need some migration works.
   


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@openwhisk.apache.org

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


[GitHub] [openwhisk] upgle commented on a diff in pull request #5229: Provide action limit configuration for each namespace

Posted by GitBox <gi...@apache.org>.
upgle commented on code in PR #5229:
URL: https://github.com/apache/openwhisk/pull/5229#discussion_r928474363


##########
common/scala/src/main/scala/org/apache/openwhisk/core/containerpool/ApacheBlockingContainerClient.scala:
##########
@@ -124,13 +129,13 @@ protected class ApacheBlockingContainerClient(hostname: String,
 
           // Negative contentLength means unknown or overflow. We don't want to consume in either case.
           if (contentLength >= 0) {
-            if (contentLength <= maxResponseBytes) {
+            if (contentLength <= maxResponse.toBytes) {

Review Comment:
   Yes. Since maxResponse is a ByteSize type, it needs a cast.
   
   ```scala
       maxResponse: ByteSize,
   ```



-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@openwhisk.apache.org

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


[GitHub] [openwhisk] ningyougang commented on a diff in pull request #5229: [Proposal] Provide action limit configuration for each namespace

Posted by GitBox <gi...@apache.org>.
ningyougang commented on code in PR #5229:
URL: https://github.com/apache/openwhisk/pull/5229#discussion_r867647922


##########
core/controller/src/main/scala/org/apache/openwhisk/core/controller/Actions.scala:
##########
@@ -212,11 +212,13 @@ trait WhiskActionsApi extends WhiskCollectionAPI with PostActionActivation with
     parameter('overwrite ? false) { overwrite =>
       entity(as[WhiskActionPut]) { content =>
         val request = content.resolve(user.namespace)
-        val checkAdditionalPrivileges = entitleReferencedEntities(user, Privilege.READ, request.exec).flatMap {
-          case _ => entitlementProvider.check(user, content.exec)
-        }
+        val check = for {
+          checkLimits <- checkNamespaceAndSystemLimits(user, content)

Review Comment:
   Got it



-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@openwhisk.apache.org

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


[GitHub] [openwhisk] upgle commented on a diff in pull request #5229: [Proposal] Provide action limit configuration for each namespace

Posted by GitBox <gi...@apache.org>.
upgle commented on code in PR #5229:
URL: https://github.com/apache/openwhisk/pull/5229#discussion_r868859626


##########
proposals/POEM-3-action-limit-for-namespace.md:
##########
@@ -0,0 +1,132 @@
+<!--
+#
+# 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.
+#
+-->
+
+# Title
+Providing action limits for each namespace
+
+## Status
+* Current state: In-progress
+* Author(s): @upgle
+
+## Summary and Motivation
+
+This POEM proposes a new feature that allows administrators to set action limits (memory, timeout, log, and concurrency) for each namespace.
+
+Sometimes some users want to make an action with more memory and longer duration. But, Openwhisk only has a system limit for action, which is shared by all namespaces.
+There is no way to loosen the action limit for just a few users, and changing the action limit setting will affect all users.
+
+## Proposed changes
+
+### 3 types of action limits
+
+There are 3 types of action limits:
+
+- (1) system limits: This limits can never be exceeded.
+- (2) namespace default limits: This limit can be used if a limit has not been set for the namespace.
+- (3) namespace limits: This limit can be set by the system administrator for namespace and cannot exceed the range of the system limit.
+
+
+#### namespace default limit
+Namespaces without additional namespace limits can create actions with memory ranging from 512MB to 1024MB.
+
+<img src="https://user-images.githubusercontent.com/5635513/166409786-bb6759f8-e860-4f1e-8524-a91cc8ddd2f9.png" width="600">
+
+#### namespace limit (for `foo` namespace)
+The `foo` namespace with a maximum memory limit of 2048MB can create actions that have between 512MB and 2048MB of memory.
+
+<img src="https://user-images.githubusercontent.com/5635513/166409938-66a257e5-e9a5-4031-9f3a-a0001a9c5c93.png" width="600">
+
+### Limit document for CouchDB
+
+You can set namespace limits with `{namespace}/limits` document just like any other existing setting.
+The config keys related to the action limit start with the string `action` and end with `Min`, and `Max`.
+
+```json
+{
+  "concurrentInvocations": 100,
+  "invocationsPerMinute": 100,
+  "firesPerMinute": 100,
+  "actionMemoryMax": 1024,
+  "actionMemoryMin": 128,
+  "actionConcurrencyMax": 400,
+  "actionConcurrencyMin": 1,
+  "actionLogsMax": 128,
+  "actionLogsMin": 0
+}
+```
+
+#### namespace limit configs

Review Comment:
   I appreciate your comments on the situation of concern.
   
   > How does a user update their set limits?
   
   You can set namespace limits by updating `/limits` document in CouchDB. (wskadmin also can be used, not implemented yet).  And this is only for system administrators, not users.
   
   > Whereas action concurrency still needs to have a set limit for the namespace within the min and max because the concurrency limit is by namespace, not set when creating an action.
   
   The concurrency limit I said in document is the number of simultaneous executions in one action. his can be specified when creating an action. So this is an action scope, not a namespace scope.
   
   https://github.com/apache/openwhisk/blob/master/docs/concurrency.md
   
   ```
   create a new action
   Usage:
     wsk action create ACTION_NAME ACTION [flags]
   
   Flags:
     -c, --concurrency LIMIT      the maximum intra-container concurrent activation LIMIT for the action (default 1)
   ```
   
   ```json
   {
       "namespace": "whisk.system",
       "name": "hello",
       "version": "0.0.5",
       "exec": {
           "kind": "nodejs:10",
           "binary": false
       },
       "annotations": [
           {
               "key": "provide-api-key",
               "value": false
           },
           {
               "key": "exec",
               "value": "nodejs:10"
           }
       ],
       "parameters": [
           {
               "key": "key",
               "value": "value"
           }
       ],
       "limits": {
           "timeout": 10000001,
           "memory": 256,
           "logs": 10,
           "concurrency": 100 <- 
       },
   ```
   



-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@openwhisk.apache.org

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


[GitHub] [openwhisk] ningyougang commented on pull request #5229: Provide action limit configuration for each namespace

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

   Need rebase


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@openwhisk.apache.org

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


[GitHub] [openwhisk] upgle commented on pull request #5229: [Proposal] Provide action limit configuration for each namespace

Posted by GitBox <gi...@apache.org>.
upgle commented on PR #5229:
URL: https://github.com/apache/openwhisk/pull/5229#issuecomment-1127712975

   Removed the POEM document file from this PR as it created a separate PR for POEM https://github.com/apache/openwhisk/pull/5236.
   


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@openwhisk.apache.org

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


[GitHub] [openwhisk] upgle commented on a diff in pull request #5229: [Proposal] Provide action limit configuration for each namespace

Posted by GitBox <gi...@apache.org>.
upgle commented on code in PR #5229:
URL: https://github.com/apache/openwhisk/pull/5229#discussion_r867615556


##########
core/controller/src/main/scala/org/apache/openwhisk/core/controller/Actions.scala:
##########
@@ -212,11 +212,13 @@ trait WhiskActionsApi extends WhiskCollectionAPI with PostActionActivation with
     parameter('overwrite ? false) { overwrite =>
       entity(as[WhiskActionPut]) { content =>
         val request = content.resolve(user.namespace)
-        val checkAdditionalPrivileges = entitleReferencedEntities(user, Privilege.READ, request.exec).flatMap {
-          case _ => entitlementProvider.check(user, content.exec)
-        }
+        val check = for {
+          checkLimits <- checkNamespaceAndSystemLimits(user, content)

Review Comment:
   @ningyougang 
   It is an existing spec to check the limit when creating an action.
   You still can't create an action that exceeds the system limit.
   
   And this method is to check the limit of the namespace along with the system limit.



-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@openwhisk.apache.org

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


[GitHub] [openwhisk] style95 commented on pull request #5229: [Proposal] Provide different action limits for different namespaces

Posted by GitBox <gi...@apache.org>.
style95 commented on PR #5229:
URL: https://github.com/apache/openwhisk/pull/5229#issuecomment-1115861081

   Nice!
   Could you open another PR to add a POEM for this feature as well?
   https://github.com/apache/openwhisk/tree/master/proposals


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@openwhisk.apache.org

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


[GitHub] [openwhisk] bdoyle0182 commented on a diff in pull request #5229: [Proposal] Provide action limit configuration for each namespace

Posted by GitBox <gi...@apache.org>.
bdoyle0182 commented on code in PR #5229:
URL: https://github.com/apache/openwhisk/pull/5229#discussion_r868863888


##########
proposals/POEM-3-action-limit-for-namespace.md:
##########
@@ -0,0 +1,132 @@
+<!--
+#
+# 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.
+#
+-->
+
+# Title
+Providing action limits for each namespace
+
+## Status
+* Current state: In-progress
+* Author(s): @upgle
+
+## Summary and Motivation
+
+This POEM proposes a new feature that allows administrators to set action limits (memory, timeout, log, and concurrency) for each namespace.
+
+Sometimes some users want to make an action with more memory and longer duration. But, Openwhisk only has a system limit for action, which is shared by all namespaces.
+There is no way to loosen the action limit for just a few users, and changing the action limit setting will affect all users.
+
+## Proposed changes
+
+### 3 types of action limits
+
+There are 3 types of action limits:
+
+- (1) system limits: This limits can never be exceeded.
+- (2) namespace default limits: This limit can be used if a limit has not been set for the namespace.
+- (3) namespace limits: This limit can be set by the system administrator for namespace and cannot exceed the range of the system limit.
+
+
+#### namespace default limit
+Namespaces without additional namespace limits can create actions with memory ranging from 512MB to 1024MB.
+
+<img src="https://user-images.githubusercontent.com/5635513/166409786-bb6759f8-e860-4f1e-8524-a91cc8ddd2f9.png" width="600">
+
+#### namespace limit (for `foo` namespace)
+The `foo` namespace with a maximum memory limit of 2048MB can create actions that have between 512MB and 2048MB of memory.
+
+<img src="https://user-images.githubusercontent.com/5635513/166409938-66a257e5-e9a5-4031-9f3a-a0001a9c5c93.png" width="600">
+
+### Limit document for CouchDB
+
+You can set namespace limits with `{namespace}/limits` document just like any other existing setting.
+The config keys related to the action limit start with the string `action` and end with `Min`, and `Max`.
+
+```json
+{
+  "concurrentInvocations": 100,
+  "invocationsPerMinute": 100,
+  "firesPerMinute": 100,
+  "actionMemoryMax": 1024,
+  "actionMemoryMin": 128,
+  "actionConcurrencyMax": 400,
+  "actionConcurrencyMin": 1,
+  "actionLogsMax": 128,
+  "actionLogsMin": 0
+}
+```
+
+#### namespace limit configs

Review Comment:
   Ah yes I forgot about the concurrency within a single container for an action, makes sense. Okay I understand now I was just confused on the concurrency limit since that's not created as a limit with the action, but this is the inner container concurrency. So all of these limits are just action limits and the administrator just manages the max and min and the users of the namespace can create actions with limits anywhere between that max and min whereas before it was just a single max and min for each limit across the entire system.
   
   The only other thing I really want to check on then is that this is a backwards compatible change for existing systems who don't have a need to add this?



-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@openwhisk.apache.org

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


[GitHub] [openwhisk] codecov-commenter commented on pull request #5229: [Proposal] Provide action limit configuration for each namespace

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

   # [Codecov](https://codecov.io/gh/apache/openwhisk/pull/5229?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#5229](https://codecov.io/gh/apache/openwhisk/pull/5229?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (44e5270) into [master](https://codecov.io/gh/apache/openwhisk/commit/3e3414ced7fb6e6d85b95f0f9cdd43a0a68da4fd?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (3e3414c) will **increase** coverage by `17.44%`.
   > The diff coverage is `98.88%`.
   
   ```diff
   @@             Coverage Diff             @@
   ##           master    #5229       +/-   ##
   ===========================================
   + Coverage   44.53%   61.98%   +17.44%     
   ===========================================
     Files         238      238               
     Lines       13957    14033       +76     
     Branches      570      557       -13     
   ===========================================
   + Hits         6216     8698     +2482     
   + Misses       7741     5335     -2406     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/openwhisk/pull/5229?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Ξ” | |
   |---|---|---|
   | [...cala/org/apache/openwhisk/core/entity/Limits.scala](https://codecov.io/gh/apache/openwhisk/pull/5229/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29tbW9uL3NjYWxhL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvb3BlbndoaXNrL2NvcmUvZW50aXR5L0xpbWl0cy5zY2FsYQ==) | `85.71% <ΓΈ> (ΓΈ)` | |
   | [...la/org/apache/openwhisk/core/entity/LogLimit.scala](https://codecov.io/gh/apache/openwhisk/pull/5229/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29tbW9uL3NjYWxhL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvb3BlbndoaXNrL2NvcmUvZW50aXR5L0xvZ0xpbWl0LnNjYWxh) | `93.93% <94.44%> (-0.18%)` | :arrow_down: |
   | [.../scala/org/apache/openwhisk/core/WhiskConfig.scala](https://codecov.io/gh/apache/openwhisk/pull/5229/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29tbW9uL3NjYWxhL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvb3BlbndoaXNrL2NvcmUvV2hpc2tDb25maWcuc2NhbGE=) | `94.08% <100.00%> (-1.68%)` | :arrow_down: |
   | [...pache/openwhisk/core/entity/ConcurrencyLimit.scala](https://codecov.io/gh/apache/openwhisk/pull/5229/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29tbW9uL3NjYWxhL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvb3BlbndoaXNrL2NvcmUvZW50aXR5L0NvbmN1cnJlbmN5TGltaXQuc2NhbGE=) | `92.85% <100.00%> (-1.27%)` | :arrow_down: |
   | [...la/org/apache/openwhisk/core/entity/Identity.scala](https://codecov.io/gh/apache/openwhisk/pull/5229/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29tbW9uL3NjYWxhL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvb3BlbndoaXNrL2NvcmUvZW50aXR5L0lkZW50aXR5LnNjYWxh) | `93.33% <100.00%> (ΓΈ)` | |
   | [...org/apache/openwhisk/core/entity/MemoryLimit.scala](https://codecov.io/gh/apache/openwhisk/pull/5229/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29tbW9uL3NjYWxhL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvb3BlbndoaXNrL2NvcmUvZW50aXR5L01lbW9yeUxpbWl0LnNjYWxh) | `96.87% <100.00%> (+3.12%)` | :arrow_up: |
   | [...a/org/apache/openwhisk/core/entity/TimeLimit.scala](https://codecov.io/gh/apache/openwhisk/pull/5229/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29tbW9uL3NjYWxhL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvb3BlbndoaXNrL2NvcmUvZW50aXR5L1RpbWVMaW1pdC5zY2FsYQ==) | `97.14% <100.00%> (+5.83%)` | :arrow_up: |
   | [...cala/org/apache/openwhisk/http/ErrorResponse.scala](https://codecov.io/gh/apache/openwhisk/pull/5229/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29tbW9uL3NjYWxhL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvb3BlbndoaXNrL2h0dHAvRXJyb3JSZXNwb25zZS5zY2FsYQ==) | `88.67% <100.00%> (+20.67%)` | :arrow_up: |
   | [...org/apache/openwhisk/core/controller/Actions.scala](https://codecov.io/gh/apache/openwhisk/pull/5229/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29yZS9jb250cm9sbGVyL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvb3BlbndoaXNrL2NvcmUvY29udHJvbGxlci9BY3Rpb25zLnNjYWxh) | `91.66% <100.00%> (+91.66%)` | :arrow_up: |
   | [...che/openwhisk/core/invoker/LogStoreCollector.scala](https://codecov.io/gh/apache/openwhisk/pull/5229/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29yZS9pbnZva2VyL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvb3BlbndoaXNrL2NvcmUvaW52b2tlci9Mb2dTdG9yZUNvbGxlY3Rvci5zY2FsYQ==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | ... and [165 more](https://codecov.io/gh/apache/openwhisk/pull/5229/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/openwhisk/pull/5229?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Ξ” = absolute <relative> (impact)`, `ΓΈ = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/openwhisk/pull/5229?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [3e3414c...44e5270](https://codecov.io/gh/apache/openwhisk/pull/5229?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@openwhisk.apache.org

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


[GitHub] [openwhisk] upgle commented on a diff in pull request #5229: [Proposal] Provide action limit configuration for each namespace

Posted by GitBox <gi...@apache.org>.
upgle commented on code in PR #5229:
URL: https://github.com/apache/openwhisk/pull/5229#discussion_r869872032


##########
proposals/POEM-3-action-limit-for-namespace.md:
##########
@@ -0,0 +1,132 @@
+<!--
+#
+# 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.
+#
+-->
+
+# Title
+Providing action limits for each namespace
+
+## Status
+* Current state: In-progress
+* Author(s): @upgle
+
+## Summary and Motivation
+
+This POEM proposes a new feature that allows administrators to set action limits (memory, timeout, log, and concurrency) for each namespace.
+
+Sometimes some users want to make an action with more memory and longer duration. But, Openwhisk only has a system limit for action, which is shared by all namespaces.
+There is no way to loosen the action limit for just a few users, and changing the action limit setting will affect all users.
+
+## Proposed changes
+
+### 3 types of action limits
+
+There are 3 types of action limits:
+
+- (1) system limits: This limits can never be exceeded.
+- (2) namespace default limits: This limit can be used if a limit has not been set for the namespace.
+- (3) namespace limits: This limit can be set by the system administrator for namespace and cannot exceed the range of the system limit.
+
+
+#### namespace default limit
+Namespaces without additional namespace limits can create actions with memory ranging from 512MB to 1024MB.
+
+<img src="https://user-images.githubusercontent.com/5635513/166409786-bb6759f8-e860-4f1e-8524-a91cc8ddd2f9.png" width="600">
+
+#### namespace limit (for `foo` namespace)
+The `foo` namespace with a maximum memory limit of 2048MB can create actions that have between 512MB and 2048MB of memory.
+
+<img src="https://user-images.githubusercontent.com/5635513/166409938-66a257e5-e9a5-4031-9f3a-a0001a9c5c93.png" width="600">
+
+### Limit document for CouchDB
+
+You can set namespace limits with `{namespace}/limits` document just like any other existing setting.
+The config keys related to the action limit start with the string `action` and end with `Min`, and `Max`.
+
+```json
+{
+  "concurrentInvocations": 100,
+  "invocationsPerMinute": 100,
+  "firesPerMinute": 100,
+  "actionMemoryMax": 1024,
+  "actionMemoryMin": 128,
+  "actionConcurrencyMax": 400,
+  "actionConcurrencyMin": 1,
+  "actionLogsMax": 128,
+  "actionLogsMin": 0
+}
+```
+
+#### namespace limit configs

Review Comment:
   Ok. I'll change the config structure to support backward compatible.



-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@openwhisk.apache.org

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


[GitHub] [openwhisk] ningyougang commented on a diff in pull request #5229: [Proposal] Provide action limit configuration for each namespace

Posted by GitBox <gi...@apache.org>.
ningyougang commented on code in PR #5229:
URL: https://github.com/apache/openwhisk/pull/5229#discussion_r867649969


##########
tests/src/test/scala/org/apache/openwhisk/core/controller/test/ActionsApiTests.scala:
##########
@@ -546,6 +545,342 @@ class ActionsApiTests extends ControllerTestCommon with WhiskActionsApi {
     }
   }
 
+  it should "reject create when memory is greater than maximum allowed namespace limit" in {
+    implicit val tid = transid()
+
+    val allowed = ByteSize(128, SizeUnits.MB)
+    val is = ByteSize(512, SizeUnits.MB)
+
+    val credsWithNamespaceLimits = WhiskAuthHelpers
+      .newIdentity()
+      .copy(limits = UserLimits(actionMemoryMax = Some(MemoryLimit(allowed))))
+
+    val content = WhiskActionPut(
+      Some(jsDefault("_")),
+      Some(Parameters("x", "X")),
+      Some(
+        ActionLimitsOption(
+          Some(TimeLimit(TimeLimit.MAX_DURATION)),
+          Some(MemoryLimit(is)),
+          Some(LogLimit(LogLimit.MAX_LOGSIZE)),
+          Some(ConcurrencyLimit(ConcurrencyLimit.MAX_CONCURRENT)))))
+
+    Put(s"$collectionPath/${aname()}", content) ~> Route.seal(routes(credsWithNamespaceLimits)) ~> check {
+      status should be(BadRequest)
+      responseAs[String] should include {
+        Messages.sizeExceedsAllowedThreshold(MemoryLimit.memoryLimitFieldName, is.toMB.toInt, allowed.toMB.toInt)
+      }
+    }
+  }

Review Comment:
   I am ok with test case, can provide the opposite test case? e.g. allow create when memory is greater than maximum allowed namespace limit



##########
tests/src/test/scala/org/apache/openwhisk/core/controller/test/ActionsApiTests.scala:
##########
@@ -546,6 +545,342 @@ class ActionsApiTests extends ControllerTestCommon with WhiskActionsApi {
     }
   }
 
+  it should "reject create when memory is greater than maximum allowed namespace limit" in {
+    implicit val tid = transid()
+
+    val allowed = ByteSize(128, SizeUnits.MB)
+    val is = ByteSize(512, SizeUnits.MB)
+
+    val credsWithNamespaceLimits = WhiskAuthHelpers
+      .newIdentity()
+      .copy(limits = UserLimits(actionMemoryMax = Some(MemoryLimit(allowed))))
+
+    val content = WhiskActionPut(
+      Some(jsDefault("_")),
+      Some(Parameters("x", "X")),
+      Some(
+        ActionLimitsOption(
+          Some(TimeLimit(TimeLimit.MAX_DURATION)),
+          Some(MemoryLimit(is)),
+          Some(LogLimit(LogLimit.MAX_LOGSIZE)),
+          Some(ConcurrencyLimit(ConcurrencyLimit.MAX_CONCURRENT)))))
+
+    Put(s"$collectionPath/${aname()}", content) ~> Route.seal(routes(credsWithNamespaceLimits)) ~> check {
+      status should be(BadRequest)
+      responseAs[String] should include {
+        Messages.sizeExceedsAllowedThreshold(MemoryLimit.memoryLimitFieldName, is.toMB.toInt, allowed.toMB.toInt)
+      }
+    }
+  }

Review Comment:
   I am ok with test case, can provide the opposite test case? e.g. allow create when memory is greater than maximum allowed namespace limit?



-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@openwhisk.apache.org

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


[GitHub] [openwhisk] upgle commented on a diff in pull request #5229: Provide action limit configuration for each namespace

Posted by GitBox <gi...@apache.org>.
upgle commented on code in PR #5229:
URL: https://github.com/apache/openwhisk/pull/5229#discussion_r928475692


##########
tests/src/test/scala/org/apache/openwhisk/core/entity/test/SchemaTests.scala:
##########
@@ -826,61 +825,16 @@ class SchemaTests extends FlatSpec with BeforeAndAfter with ExecHelpers with Mat
 
     serdes foreach { s =>
       withClue(s"serializer $s") {
-        if (s != LogLimit.serdes) {
-          val lb = the[DeserializationException] thrownBy s.read(JsNumber(0))
-          lb.getMessage should include("below allowed threshold")
-        } else {
+        if (s == LogLimit.serdes) {
           val lb = the[DeserializationException] thrownBy s.read(JsNumber(-1))
           lb.getMessage should include("a negative size of an object is not allowed")
         }
-
-        val ub = the[DeserializationException] thrownBy s.read(JsNumber(Int.MaxValue))
-        ub.getMessage should include("exceeds allowed threshold")
-
         val int = the[DeserializationException] thrownBy s.read(JsNumber(2.5))
         int.getMessage should include("limit must be whole number")
       }
     }
   }
 
-  it should "reject bad limit values" in {

Review Comment:
   The scheme test based on the hardcoded limit value is no longer used and validation checks are performed based on user input at runtime.
   
   



-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@openwhisk.apache.org

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


[GitHub] [openwhisk] upgle commented on pull request #5229: [Proposal] Provide action limit configuration for each namespace

Posted by GitBox <gi...@apache.org>.
upgle commented on PR #5229:
URL: https://github.com/apache/openwhisk/pull/5229#issuecomment-1122351449

   @style95 As the implementation continues to change, POEM has been added to this PR for consistency.
   I will continue to update the PR content as well.
   
   > Nice!
   > Could you open another PR to add a POEM for this feature as well?
   > https://github.com/apache/openwhisk/tree/master/proposals


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@openwhisk.apache.org

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


[GitHub] [openwhisk] upgle commented on pull request #5229: [Proposal] Provide action limit configuration for each namespace

Posted by GitBox <gi...@apache.org>.
upgle commented on PR #5229:
URL: https://github.com/apache/openwhisk/pull/5229#issuecomment-1124435343

   - > Does openwhisk admin need to reconfigure his system limit (e.g. make system limit to a high value)?
     So openwhisk admin needs to adjust the system limit value to >=3GB?
     - If the existing system limit was 2GB and you want to allocate up to 3GB, you need to raise the system limit and redeploy it. And if the namespace default limit is 2GB, existing users without a limit setting will use this limit.
   - > Has any check mechanism that when user changes the $namespace/limit document, namespace limit value can't be greater than system limit?
     - If the namespace limit is greater than the system limit, it is lowered to the system limit.
   - > Has any extra work on wskadmin? e.g. Admin can use wskadmin can change the $namespace/limit document as well.
     - Not yet. There is a plan to add it, but it seems to have to be created as a separate PR because there are a lot of changes in the PR.
   
   I'm working on integrating with the new scheduler and improving backward compatibility. I'ill create a separate POEM PR as soon as it is completed.


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@openwhisk.apache.org

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


[GitHub] [openwhisk] upgle commented on a diff in pull request #5229: [Proposal] Provide action limit configuration for each namespace

Posted by GitBox <gi...@apache.org>.
upgle commented on code in PR #5229:
URL: https://github.com/apache/openwhisk/pull/5229#discussion_r868859626


##########
proposals/POEM-3-action-limit-for-namespace.md:
##########
@@ -0,0 +1,132 @@
+<!--
+#
+# 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.
+#
+-->
+
+# Title
+Providing action limits for each namespace
+
+## Status
+* Current state: In-progress
+* Author(s): @upgle
+
+## Summary and Motivation
+
+This POEM proposes a new feature that allows administrators to set action limits (memory, timeout, log, and concurrency) for each namespace.
+
+Sometimes some users want to make an action with more memory and longer duration. But, Openwhisk only has a system limit for action, which is shared by all namespaces.
+There is no way to loosen the action limit for just a few users, and changing the action limit setting will affect all users.
+
+## Proposed changes
+
+### 3 types of action limits
+
+There are 3 types of action limits:
+
+- (1) system limits: This limits can never be exceeded.
+- (2) namespace default limits: This limit can be used if a limit has not been set for the namespace.
+- (3) namespace limits: This limit can be set by the system administrator for namespace and cannot exceed the range of the system limit.
+
+
+#### namespace default limit
+Namespaces without additional namespace limits can create actions with memory ranging from 512MB to 1024MB.
+
+<img src="https://user-images.githubusercontent.com/5635513/166409786-bb6759f8-e860-4f1e-8524-a91cc8ddd2f9.png" width="600">
+
+#### namespace limit (for `foo` namespace)
+The `foo` namespace with a maximum memory limit of 2048MB can create actions that have between 512MB and 2048MB of memory.
+
+<img src="https://user-images.githubusercontent.com/5635513/166409938-66a257e5-e9a5-4031-9f3a-a0001a9c5c93.png" width="600">
+
+### Limit document for CouchDB
+
+You can set namespace limits with `{namespace}/limits` document just like any other existing setting.
+The config keys related to the action limit start with the string `action` and end with `Min`, and `Max`.
+
+```json
+{
+  "concurrentInvocations": 100,
+  "invocationsPerMinute": 100,
+  "firesPerMinute": 100,
+  "actionMemoryMax": 1024,
+  "actionMemoryMin": 128,
+  "actionConcurrencyMax": 400,
+  "actionConcurrencyMin": 1,
+  "actionLogsMax": 128,
+  "actionLogsMin": 0
+}
+```
+
+#### namespace limit configs

Review Comment:
   I appreciate your comments on the situation of concern.
   
   > How does a user update their set limits?
   
   You can set namespace limits by setting limits document. (wskadmin can be used, not implemented yet). 
   And this is for administrators, not users.
   
   > Whereas action concurrency still needs to have a set limit for the namespace within the min and max because the concurrency limit is by namespace, not set when creating an action.
   
   The concurrency limit I said in document is the number of simultaneous executions in one action. his can be specified when creating an action. So this is an action scope, not a namespace scope.
   
   https://github.com/apache/openwhisk/blob/master/docs/concurrency.md
   
   ```
   create a new action
   Usage:
     wsk action create ACTION_NAME ACTION [flags]
   
   Flags:
     -c, --concurrency LIMIT      the maximum intra-container concurrent activation LIMIT for the action (default 1)
   ```
   
   ```json
   {
       "namespace": "whisk.system",
       "name": "hello",
       "version": "0.0.5",
       "exec": {
           "kind": "nodejs:10",
           "binary": false
       },
       "annotations": [
           {
               "key": "provide-api-key",
               "value": false
           },
           {
               "key": "exec",
               "value": "nodejs:10"
           }
       ],
       "parameters": [
           {
               "key": "key",
               "value": "value"
           }
       ],
       "limits": {
           "timeout": 10000001,
           "memory": 256,
           "logs": 10,
           "concurrency": 100 <- 
       },
   ```
   



-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@openwhisk.apache.org

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


[GitHub] [openwhisk] upgle commented on a diff in pull request #5229: Provide action limit configuration for each namespace

Posted by GitBox <gi...@apache.org>.
upgle commented on code in PR #5229:
URL: https://github.com/apache/openwhisk/pull/5229#discussion_r928480712


##########
core/invoker/src/main/scala/org/apache/openwhisk/core/invoker/InvokerReactive.scala:
##########
@@ -179,6 +178,8 @@ class InvokerReactive(
     WhiskAction
       .get(entityStore, actionid.id, actionid.rev, fromCache = actionid.rev != DocRevision.empty)
       .flatMap(action => {
+        // action that exceed the system limit cannot be executed.
+        action.limits.checkSystemLimits()

Review Comment:
   Yes, It supports new scheduler. 



-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@openwhisk.apache.org

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


[GitHub] [openwhisk] bdoyle0182 commented on a diff in pull request #5229: [Proposal] Provide action limit configuration for each namespace

Posted by GitBox <gi...@apache.org>.
bdoyle0182 commented on code in PR #5229:
URL: https://github.com/apache/openwhisk/pull/5229#discussion_r868850566


##########
proposals/POEM-3-action-limit-for-namespace.md:
##########
@@ -0,0 +1,132 @@
+<!--
+#
+# 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.
+#
+-->
+
+# Title
+Providing action limits for each namespace
+
+## Status
+* Current state: In-progress
+* Author(s): @upgle
+
+## Summary and Motivation
+
+This POEM proposes a new feature that allows administrators to set action limits (memory, timeout, log, and concurrency) for each namespace.
+
+Sometimes some users want to make an action with more memory and longer duration. But, Openwhisk only has a system limit for action, which is shared by all namespaces.
+There is no way to loosen the action limit for just a few users, and changing the action limit setting will affect all users.
+
+## Proposed changes
+
+### 3 types of action limits
+
+There are 3 types of action limits:
+
+- (1) system limits: This limits can never be exceeded.
+- (2) namespace default limits: This limit can be used if a limit has not been set for the namespace.
+- (3) namespace limits: This limit can be set by the system administrator for namespace and cannot exceed the range of the system limit.
+
+
+#### namespace default limit
+Namespaces without additional namespace limits can create actions with memory ranging from 512MB to 1024MB.
+
+<img src="https://user-images.githubusercontent.com/5635513/166409786-bb6759f8-e860-4f1e-8524-a91cc8ddd2f9.png" width="600">
+
+#### namespace limit (for `foo` namespace)
+The `foo` namespace with a maximum memory limit of 2048MB can create actions that have between 512MB and 2048MB of memory.
+
+<img src="https://user-images.githubusercontent.com/5635513/166409938-66a257e5-e9a5-4031-9f3a-a0001a9c5c93.png" width="600">
+
+### Limit document for CouchDB
+
+You can set namespace limits with `{namespace}/limits` document just like any other existing setting.
+The config keys related to the action limit start with the string `action` and end with `Min`, and `Max`.
+
+```json
+{
+  "concurrentInvocations": 100,
+  "invocationsPerMinute": 100,
+  "firesPerMinute": 100,
+  "actionMemoryMax": 1024,
+  "actionMemoryMin": 128,
+  "actionConcurrencyMax": 400,
+  "actionConcurrencyMin": 1,
+  "actionLogsMax": 128,
+  "actionLogsMin": 0
+}
+```
+
+#### namespace limit configs

Review Comment:
   How does a user update their set limits?
   
   It seems like there's two concepts of limits here. Action memory and action duration should allow the user of the namespace to create actions anywhere in the range of the min and the max. Whereas action concurrency still needs to have a set limit for the namespace within the min and max because the concurrency limit is by namespace, not set when creating an action.
   
   And how will a user update their concurrency for their namespace? Currently the only way to update a namespace's concurrency is by accessing the db not through the controller api which isn't safe to hand over to the user. The limits api should be updated to support puts if the namespace user can now update this config.
   
   I still think it makes more sense for there to be a single concurrency limit for each namespace set by the operator of the system, then when uploading the action a user can include provisioned concurrency that is reserved to the action.
   
   Say the namespace concurrency limit is 30 and they upload an action with concurrency limit of 5. The free pool of concurrency to take from is now 25 and the action is guaranteed to be allowed to have up to 5 concurrency, but it can also take from the shared pool of 25 to go over 5 if needed and the namespace has spare capacity. This is how aws lambda works.
   
   
   



-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@openwhisk.apache.org

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


[GitHub] [openwhisk] style95 commented on pull request #5229: Provide action limit configuration for each namespace

Posted by "style95 (via GitHub)" <gi...@apache.org>.
style95 commented on PR #5229:
URL: https://github.com/apache/openwhisk/pull/5229#issuecomment-1403389400

   merged as it's been so long.
   


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@openwhisk.apache.org

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


[GitHub] [openwhisk] upgle commented on a diff in pull request #5229: [Proposal] Provide action limit configuration for each namespace

Posted by GitBox <gi...@apache.org>.
upgle commented on code in PR #5229:
URL: https://github.com/apache/openwhisk/pull/5229#discussion_r867615556


##########
core/controller/src/main/scala/org/apache/openwhisk/core/controller/Actions.scala:
##########
@@ -212,11 +212,13 @@ trait WhiskActionsApi extends WhiskCollectionAPI with PostActionActivation with
     parameter('overwrite ? false) { overwrite =>
       entity(as[WhiskActionPut]) { content =>
         val request = content.resolve(user.namespace)
-        val checkAdditionalPrivileges = entitleReferencedEntities(user, Privilege.READ, request.exec).flatMap {
-          case _ => entitlementProvider.check(user, content.exec)
-        }
+        val check = for {
+          checkLimits <- checkNamespaceAndSystemLimits(user, content)

Review Comment:
   @ningyougang 
   Sorry, I don't understand. It is an existing spec to check the limit when creating an action.
   You still can't create an action that exceeds the system limit.
   
   And this method is to check the limit of the namespace along with the system limit.



-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@openwhisk.apache.org

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


[GitHub] [openwhisk] jiangpengcheng commented on a diff in pull request #5229: [Proposal] Provide action limit configuration for each namespace

Posted by GitBox <gi...@apache.org>.
jiangpengcheng commented on code in PR #5229:
URL: https://github.com/apache/openwhisk/pull/5229#discussion_r867595472


##########
core/invoker/src/main/scala/org/apache/openwhisk/core/invoker/InvokerReactive.scala:
##########
@@ -179,6 +178,8 @@ class InvokerReactive(
     WhiskAction
       .get(entityStore, actionid.id, actionid.rev, fromCache = actionid.rev != DocRevision.empty)
       .flatMap(action => {
+        // action that exceed the system limit cannot be executed.
+        action.limits.checkSystemLimits()

Review Comment:
   I think it already check the limit here? https://github.com/apache/openwhisk/pull/5229/files#diff-618ee3b5632d322d90e279346bd69b1d30f39f22b237e557f1a4f507414b61fdR216



-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@openwhisk.apache.org

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


[GitHub] [openwhisk] ningyougang commented on a diff in pull request #5229: [Proposal] Provide action limit configuration for each namespace

Posted by GitBox <gi...@apache.org>.
ningyougang commented on code in PR #5229:
URL: https://github.com/apache/openwhisk/pull/5229#discussion_r867608207


##########
core/controller/src/main/scala/org/apache/openwhisk/core/controller/Actions.scala:
##########
@@ -212,11 +212,13 @@ trait WhiskActionsApi extends WhiskCollectionAPI with PostActionActivation with
     parameter('overwrite ? false) { overwrite =>
       entity(as[WhiskActionPut]) { content =>
         val request = content.resolve(user.namespace)
-        val checkAdditionalPrivileges = entitleReferencedEntities(user, Privilege.READ, request.exec).flatMap {
-          case _ => entitlementProvider.check(user, content.exec)
-        }
+        val check = for {
+          checkLimits <- checkNamespaceAndSystemLimits(user, content)

Review Comment:
   For this kind check, the limit check should be checked under the action's activation is executing?
   Why when create action, should check this kind limit? 



-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@openwhisk.apache.org

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


[GitHub] [openwhisk] upgle commented on a diff in pull request #5229: [Proposal] Provide action limit configuration for each namespace

Posted by GitBox <gi...@apache.org>.
upgle commented on code in PR #5229:
URL: https://github.com/apache/openwhisk/pull/5229#discussion_r868859626


##########
proposals/POEM-3-action-limit-for-namespace.md:
##########
@@ -0,0 +1,132 @@
+<!--
+#
+# 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.
+#
+-->
+
+# Title
+Providing action limits for each namespace
+
+## Status
+* Current state: In-progress
+* Author(s): @upgle
+
+## Summary and Motivation
+
+This POEM proposes a new feature that allows administrators to set action limits (memory, timeout, log, and concurrency) for each namespace.
+
+Sometimes some users want to make an action with more memory and longer duration. But, Openwhisk only has a system limit for action, which is shared by all namespaces.
+There is no way to loosen the action limit for just a few users, and changing the action limit setting will affect all users.
+
+## Proposed changes
+
+### 3 types of action limits
+
+There are 3 types of action limits:
+
+- (1) system limits: This limits can never be exceeded.
+- (2) namespace default limits: This limit can be used if a limit has not been set for the namespace.
+- (3) namespace limits: This limit can be set by the system administrator for namespace and cannot exceed the range of the system limit.
+
+
+#### namespace default limit
+Namespaces without additional namespace limits can create actions with memory ranging from 512MB to 1024MB.
+
+<img src="https://user-images.githubusercontent.com/5635513/166409786-bb6759f8-e860-4f1e-8524-a91cc8ddd2f9.png" width="600">
+
+#### namespace limit (for `foo` namespace)
+The `foo` namespace with a maximum memory limit of 2048MB can create actions that have between 512MB and 2048MB of memory.
+
+<img src="https://user-images.githubusercontent.com/5635513/166409938-66a257e5-e9a5-4031-9f3a-a0001a9c5c93.png" width="600">
+
+### Limit document for CouchDB
+
+You can set namespace limits with `{namespace}/limits` document just like any other existing setting.
+The config keys related to the action limit start with the string `action` and end with `Min`, and `Max`.
+
+```json
+{
+  "concurrentInvocations": 100,
+  "invocationsPerMinute": 100,
+  "firesPerMinute": 100,
+  "actionMemoryMax": 1024,
+  "actionMemoryMin": 128,
+  "actionConcurrencyMax": 400,
+  "actionConcurrencyMin": 1,
+  "actionLogsMax": 128,
+  "actionLogsMin": 0
+}
+```
+
+#### namespace limit configs

Review Comment:
   I appreciate your comments on the situation of concern.
   
   > How does a user update their set limits?
   
   You can set namespace limits by updating `/limits` document in CouchDB. (wskadmin also can be used, not implemented yet).  And this is only for system administrators, not users.
   
   > Whereas action concurrency still needs to have a set limit for the namespace within the min and max because the concurrency limit is by namespace, not set when creating an action.
   
   The concurrency limit I said in document is the number of simultaneous executions in one action. It can be specified when creating an action with `--concurrency` flag. So this is an action scope, not a namespace scope.
   
   https://github.com/apache/openwhisk/blob/master/docs/concurrency.md
   
   ```
   create a new action
   Usage:
     wsk action create ACTION_NAME ACTION [flags]
   
   Flags:
     -c, --concurrency LIMIT      the maximum intra-container concurrent activation LIMIT for the action (default 1)
   ```
   
   ```json
   {
       "namespace": "whisk.system",
       "name": "hello",
       "version": "0.0.5",
       "exec": {
           "kind": "nodejs:10",
           "binary": false
       },
       "annotations": [
           {
               "key": "provide-api-key",
               "value": false
           },
           {
               "key": "exec",
               "value": "nodejs:10"
           }
       ],
       "parameters": [
           {
               "key": "key",
               "value": "value"
           }
       ],
       "limits": {
           "timeout": 10000001,
           "memory": 256,
           "logs": 10,
           "concurrency": 100 <- 
       },
   ```
   



-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@openwhisk.apache.org

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


[GitHub] [openwhisk] upgle commented on a diff in pull request #5229: [Proposal] Provide action limit configuration for each namespace

Posted by GitBox <gi...@apache.org>.
upgle commented on code in PR #5229:
URL: https://github.com/apache/openwhisk/pull/5229#discussion_r867598703


##########
core/invoker/src/main/scala/org/apache/openwhisk/core/invoker/InvokerReactive.scala:
##########
@@ -179,6 +178,8 @@ class InvokerReactive(
     WhiskAction
       .get(entityStore, actionid.id, actionid.rev, fromCache = actionid.rev != DocRevision.empty)
       .flatMap(action => {
+        // action that exceed the system limit cannot be executed.
+        action.limits.checkSystemLimits()

Review Comment:
   @jiangpengcheng The code you shared is for checking the limit when **creating an action**.
   In order to prevent execution by malicious modifications such as DB alteration, the invoker side verifies once more **before invoking an action**.



-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@openwhisk.apache.org

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


[GitHub] [openwhisk] bdoyle0182 commented on pull request #5229: Provide action limit configuration for each namespace

Posted by GitBox <gi...@apache.org>.
bdoyle0182 commented on PR #5229:
URL: https://github.com/apache/openwhisk/pull/5229#issuecomment-1204220026

   Before you merge I just have one last comment to discuss on naming with my separate poem on giving users the ability to configure max container / "server" concurrency, which I currently have to be `maxContainerConcurrency` as a field in the limits section of an action document. I've named it this way because there is already `concurrency` in the limits section for max concurrent requests within an individual container / "server".  
   
   I suspect we will add a similar configuration to this feature for a namespace to allow a min and max container concurrency setting to be allowed to be configured per action within a namespace. Since in this pr the configuration to control max and min of concurrent requests per container is `maxActionConcurrency`
   
   So I think we've gotten to the point where we have many concurrency knobs and it's getting confusing in naming.
   
   1. `concurrentInvocations` on the namespace global limit which represents the total containers that can be up at once, which isn't really representative of the semantics of that limit anymore since you can have more concurrent invocations than the set value.
   2. `concurrency` as a limit on the action document which represents max requests that a single container for an action can handle at once.
   3. `maxActionConcurrency` defined in this pr which represents the min and max defined as namespace limits of a window of what values can be configured for 2.
   4. `maxContainerConcurrency` defined in my poem which is also a limit on the action document like 2. but represents the max containers that can be running for that action at once such that max throughput for an action is then 2. * 4.
   
   If we were to add lower and upper limits in the same vein for my new `maxContainerConcurrency` value here, what would we name it. `maxContainerConcurrency` and `minContainerConcurrency`. Should I then rename the limit defined in the action document to then just be `containerConcurrency` rather than include `max`?
   
   Don't want to hang up this pr much more as I know it's been sitting for awhile just want to make sure we get the naming right as the concurrency knobs are the most important for controlling the system and I don't want it to be confusing for new users or even existing users that see these new configurations.
   
   Does `maxActionConcurrency` and `maxContainerConcurrency` feel adequately different in name and actually representative of what these limits do?


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@openwhisk.apache.org

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


[GitHub] [openwhisk] style95 commented on pull request #5229: Provide action limit configuration for each namespace

Posted by GitBox <gi...@apache.org>.
style95 commented on PR #5229:
URL: https://github.com/apache/openwhisk/pull/5229#issuecomment-1204637710

   It's worth discussing.
   
   I feel there are mainly two big concurrencies.
   
   1. Concurrent containers. (concurrent in-flight activations in the old scheduler)
   2. Concurrent activations in one container.
   
   Currently, we call 1. as `concurrentInvocations` and for 2., just `concurrency`.
   I feel we need to clean up these names first.
   
   Since the name, `concurrentInvocations` best fits with `ShardingContainerPoolBalancer` and it is still being used,
   it might not be easy to change the name before we drop supporting it.
   
   So we can think about `concurrency`.
   The `concurrency` is only referring to the intra-concurrency in one container until now.
   Since it is related to the action container, I feel `maxActionConcurrency` is sort of aligned with it.
   
   But for `maxContainerConcurrency`, I am unsure if this best describes what we intended.
   `Container` may not best fit in case OW is running on K8S as it is using Pod.
   I feel it should not include a certain implementation in the name. We might introduce containerless runtime in the future.
   
   This configuration is basically to allow overprovision of containers beyond the default `concurrentInvocations`.
   We may consider names like the below until we keep using `concurrentInvocations` for container-level concurrency.
   
   * `maxConcurrentInvocations`.
   * Some names related to `overprovision`.
   


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@openwhisk.apache.org

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


[GitHub] [openwhisk] bdoyle0182 commented on a diff in pull request #5229: [Proposal] Provide action limit configuration for each namespace

Posted by GitBox <gi...@apache.org>.
bdoyle0182 commented on code in PR #5229:
URL: https://github.com/apache/openwhisk/pull/5229#discussion_r868840103


##########
core/controller/src/main/scala/org/apache/openwhisk/core/controller/Actions.scala:
##########
@@ -624,6 +626,30 @@ trait WhiskActionsApi extends WhiskCollectionAPI with PostActionActivation with
     })
   }
 
+  private def checkNamespaceAndSystemLimits(user: Identity, content: WhiskActionPut)(

Review Comment:
   Should this be two separate functions? The context in which you check the set limits for a namespace are different from the context you check the system limits. You check against the system limits when creating the action or updating your namespace's configuration. When you check against the namespace's limit it would be on the execution path when an activation is occurring.



-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@openwhisk.apache.org

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


[GitHub] [openwhisk] upgle commented on a diff in pull request #5229: [Proposal] Provide action limit configuration for each namespace

Posted by GitBox <gi...@apache.org>.
upgle commented on code in PR #5229:
URL: https://github.com/apache/openwhisk/pull/5229#discussion_r868859626


##########
proposals/POEM-3-action-limit-for-namespace.md:
##########
@@ -0,0 +1,132 @@
+<!--
+#
+# 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.
+#
+-->
+
+# Title
+Providing action limits for each namespace
+
+## Status
+* Current state: In-progress
+* Author(s): @upgle
+
+## Summary and Motivation
+
+This POEM proposes a new feature that allows administrators to set action limits (memory, timeout, log, and concurrency) for each namespace.
+
+Sometimes some users want to make an action with more memory and longer duration. But, Openwhisk only has a system limit for action, which is shared by all namespaces.
+There is no way to loosen the action limit for just a few users, and changing the action limit setting will affect all users.
+
+## Proposed changes
+
+### 3 types of action limits
+
+There are 3 types of action limits:
+
+- (1) system limits: This limits can never be exceeded.
+- (2) namespace default limits: This limit can be used if a limit has not been set for the namespace.
+- (3) namespace limits: This limit can be set by the system administrator for namespace and cannot exceed the range of the system limit.
+
+
+#### namespace default limit
+Namespaces without additional namespace limits can create actions with memory ranging from 512MB to 1024MB.
+
+<img src="https://user-images.githubusercontent.com/5635513/166409786-bb6759f8-e860-4f1e-8524-a91cc8ddd2f9.png" width="600">
+
+#### namespace limit (for `foo` namespace)
+The `foo` namespace with a maximum memory limit of 2048MB can create actions that have between 512MB and 2048MB of memory.
+
+<img src="https://user-images.githubusercontent.com/5635513/166409938-66a257e5-e9a5-4031-9f3a-a0001a9c5c93.png" width="600">
+
+### Limit document for CouchDB
+
+You can set namespace limits with `{namespace}/limits` document just like any other existing setting.
+The config keys related to the action limit start with the string `action` and end with `Min`, and `Max`.
+
+```json
+{
+  "concurrentInvocations": 100,
+  "invocationsPerMinute": 100,
+  "firesPerMinute": 100,
+  "actionMemoryMax": 1024,
+  "actionMemoryMin": 128,
+  "actionConcurrencyMax": 400,
+  "actionConcurrencyMin": 1,
+  "actionLogsMax": 128,
+  "actionLogsMin": 0
+}
+```
+
+#### namespace limit configs

Review Comment:
   I appreciate your comments on the situation of concern.
   
   > How does a user update their set limits?
   
   You can set namespace limits by updating `/limits` document in CouchDB. (wskadmin also can be used, not implemented yet).  And this is only for system administrators, not users.
   
   > Whereas action concurrency still needs to have a set limit for the namespace within the min and max because the concurrency limit is by namespace, not set when creating an action.
   
   The concurrency limit I said in document is the number of simultaneous executions in one action. It can be specified when creating an action. So this is an action scope, not a namespace scope.
   
   https://github.com/apache/openwhisk/blob/master/docs/concurrency.md
   
   ```
   create a new action
   Usage:
     wsk action create ACTION_NAME ACTION [flags]
   
   Flags:
     -c, --concurrency LIMIT      the maximum intra-container concurrent activation LIMIT for the action (default 1)
   ```
   
   ```json
   {
       "namespace": "whisk.system",
       "name": "hello",
       "version": "0.0.5",
       "exec": {
           "kind": "nodejs:10",
           "binary": false
       },
       "annotations": [
           {
               "key": "provide-api-key",
               "value": false
           },
           {
               "key": "exec",
               "value": "nodejs:10"
           }
       ],
       "parameters": [
           {
               "key": "key",
               "value": "value"
           }
       ],
       "limits": {
           "timeout": 10000001,
           "memory": 256,
           "logs": 10,
           "concurrency": 100 <- 
       },
   ```
   



-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@openwhisk.apache.org

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


[GitHub] [openwhisk] upgle commented on a diff in pull request #5229: [Proposal] Provide action limit configuration for each namespace

Posted by GitBox <gi...@apache.org>.
upgle commented on code in PR #5229:
URL: https://github.com/apache/openwhisk/pull/5229#discussion_r868876334


##########
proposals/POEM-3-action-limit-for-namespace.md:
##########
@@ -0,0 +1,132 @@
+<!--
+#
+# 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.
+#
+-->
+
+# Title
+Providing action limits for each namespace
+
+## Status
+* Current state: In-progress
+* Author(s): @upgle
+
+## Summary and Motivation
+
+This POEM proposes a new feature that allows administrators to set action limits (memory, timeout, log, and concurrency) for each namespace.
+
+Sometimes some users want to make an action with more memory and longer duration. But, Openwhisk only has a system limit for action, which is shared by all namespaces.
+There is no way to loosen the action limit for just a few users, and changing the action limit setting will affect all users.
+
+## Proposed changes
+
+### 3 types of action limits
+
+There are 3 types of action limits:
+
+- (1) system limits: This limits can never be exceeded.
+- (2) namespace default limits: This limit can be used if a limit has not been set for the namespace.
+- (3) namespace limits: This limit can be set by the system administrator for namespace and cannot exceed the range of the system limit.
+
+
+#### namespace default limit
+Namespaces without additional namespace limits can create actions with memory ranging from 512MB to 1024MB.
+
+<img src="https://user-images.githubusercontent.com/5635513/166409786-bb6759f8-e860-4f1e-8524-a91cc8ddd2f9.png" width="600">
+
+#### namespace limit (for `foo` namespace)
+The `foo` namespace with a maximum memory limit of 2048MB can create actions that have between 512MB and 2048MB of memory.
+
+<img src="https://user-images.githubusercontent.com/5635513/166409938-66a257e5-e9a5-4031-9f3a-a0001a9c5c93.png" width="600">
+
+### Limit document for CouchDB
+
+You can set namespace limits with `{namespace}/limits` document just like any other existing setting.
+The config keys related to the action limit start with the string `action` and end with `Min`, and `Max`.
+
+```json
+{
+  "concurrentInvocations": 100,
+  "invocationsPerMinute": 100,
+  "firesPerMinute": 100,
+  "actionMemoryMax": 1024,
+  "actionMemoryMin": 128,
+  "actionConcurrencyMax": 400,
+  "actionConcurrencyMin": 1,
+  "actionLogsMax": 128,
+  "actionLogsMin": 0
+}
+```
+
+#### namespace limit configs

Review Comment:
   > The only other thing I really want to check on then is that this is a backwards compatible change for existing systems who don't have a need to add this?
   
   Since the namespace default limit settings are included in application.conf, they are not completely backwards compatible. When deploying, you need to add a new configuration.



-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@openwhisk.apache.org

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


[GitHub] [openwhisk] style95 commented on pull request #5229: Provide action limit configuration for each namespace

Posted by GitBox <gi...@apache.org>.
style95 commented on PR #5229:
URL: https://github.com/apache/openwhisk/pull/5229#issuecomment-1162533418

   @upgle It seems it does not pass the unit test.
   I kept rerunning the test but could not make it work.
   


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@openwhisk.apache.org

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


[GitHub] [openwhisk] upgle commented on a diff in pull request #5229: [Proposal] Provide action limit configuration for each namespace

Posted by GitBox <gi...@apache.org>.
upgle commented on code in PR #5229:
URL: https://github.com/apache/openwhisk/pull/5229#discussion_r867581198


##########
common/scala/src/main/scala/org/apache/openwhisk/core/entity/ConcurrencyLimit.scala:
##########
@@ -37,21 +40,67 @@ case class ConcurrencyLimitConfig(min: Int, max: Int, std: Int)
  * The constructor is private so that argument requirements are checked and normalized
  * before creating a new instance.
  *
- * @param maxConcurrent the max number of concurrent activations in a single container
+ * @param maxConcurrent the max or min number of concurrent activations in a single container

Review Comment:
   @ningyougang my mistake, I'll update it.



-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@openwhisk.apache.org

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


[GitHub] [openwhisk] bdoyle0182 commented on a diff in pull request #5229: [Proposal] Provide action limit configuration for each namespace

Posted by GitBox <gi...@apache.org>.
bdoyle0182 commented on code in PR #5229:
URL: https://github.com/apache/openwhisk/pull/5229#discussion_r869504388


##########
proposals/POEM-3-action-limit-for-namespace.md:
##########
@@ -0,0 +1,132 @@
+<!--
+#
+# 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.
+#
+-->
+
+# Title
+Providing action limits for each namespace
+
+## Status
+* Current state: In-progress
+* Author(s): @upgle
+
+## Summary and Motivation
+
+This POEM proposes a new feature that allows administrators to set action limits (memory, timeout, log, and concurrency) for each namespace.
+
+Sometimes some users want to make an action with more memory and longer duration. But, Openwhisk only has a system limit for action, which is shared by all namespaces.
+There is no way to loosen the action limit for just a few users, and changing the action limit setting will affect all users.
+
+## Proposed changes
+
+### 3 types of action limits
+
+There are 3 types of action limits:
+
+- (1) system limits: This limits can never be exceeded.
+- (2) namespace default limits: This limit can be used if a limit has not been set for the namespace.
+- (3) namespace limits: This limit can be set by the system administrator for namespace and cannot exceed the range of the system limit.
+
+
+#### namespace default limit
+Namespaces without additional namespace limits can create actions with memory ranging from 512MB to 1024MB.
+
+<img src="https://user-images.githubusercontent.com/5635513/166409786-bb6759f8-e860-4f1e-8524-a91cc8ddd2f9.png" width="600">
+
+#### namespace limit (for `foo` namespace)
+The `foo` namespace with a maximum memory limit of 2048MB can create actions that have between 512MB and 2048MB of memory.
+
+<img src="https://user-images.githubusercontent.com/5635513/166409938-66a257e5-e9a5-4031-9f3a-a0001a9c5c93.png" width="600">
+
+### Limit document for CouchDB
+
+You can set namespace limits with `{namespace}/limits` document just like any other existing setting.
+The config keys related to the action limit start with the string `action` and end with `Min`, and `Max`.
+
+```json
+{
+  "concurrentInvocations": 100,
+  "invocationsPerMinute": 100,
+  "firesPerMinute": 100,
+  "actionMemoryMax": 1024,
+  "actionMemoryMin": 128,
+  "actionConcurrencyMax": 400,
+  "actionConcurrencyMin": 1,
+  "actionLogsMax": 128,
+  "actionLogsMin": 0
+}
+```
+
+#### namespace limit configs

Review Comment:
   I'm against merging non-backwards compatible changes unless there's no other way to solve the problem since many down streams are working off the master branch right now. I think this is the type of thing should be easy to make backwards compatible by setting a default configuration value for the new configuration to whatever the existing behavior is so the config is already applied when pulling in the change



-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@openwhisk.apache.org

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


[GitHub] [openwhisk] upgle commented on a diff in pull request #5229: [Proposal] Provide action limit configuration for each namespace

Posted by GitBox <gi...@apache.org>.
upgle commented on code in PR #5229:
URL: https://github.com/apache/openwhisk/pull/5229#discussion_r868859626


##########
proposals/POEM-3-action-limit-for-namespace.md:
##########
@@ -0,0 +1,132 @@
+<!--
+#
+# 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.
+#
+-->
+
+# Title
+Providing action limits for each namespace
+
+## Status
+* Current state: In-progress
+* Author(s): @upgle
+
+## Summary and Motivation
+
+This POEM proposes a new feature that allows administrators to set action limits (memory, timeout, log, and concurrency) for each namespace.
+
+Sometimes some users want to make an action with more memory and longer duration. But, Openwhisk only has a system limit for action, which is shared by all namespaces.
+There is no way to loosen the action limit for just a few users, and changing the action limit setting will affect all users.
+
+## Proposed changes
+
+### 3 types of action limits
+
+There are 3 types of action limits:
+
+- (1) system limits: This limits can never be exceeded.
+- (2) namespace default limits: This limit can be used if a limit has not been set for the namespace.
+- (3) namespace limits: This limit can be set by the system administrator for namespace and cannot exceed the range of the system limit.
+
+
+#### namespace default limit
+Namespaces without additional namespace limits can create actions with memory ranging from 512MB to 1024MB.
+
+<img src="https://user-images.githubusercontent.com/5635513/166409786-bb6759f8-e860-4f1e-8524-a91cc8ddd2f9.png" width="600">
+
+#### namespace limit (for `foo` namespace)
+The `foo` namespace with a maximum memory limit of 2048MB can create actions that have between 512MB and 2048MB of memory.
+
+<img src="https://user-images.githubusercontent.com/5635513/166409938-66a257e5-e9a5-4031-9f3a-a0001a9c5c93.png" width="600">
+
+### Limit document for CouchDB
+
+You can set namespace limits with `{namespace}/limits` document just like any other existing setting.
+The config keys related to the action limit start with the string `action` and end with `Min`, and `Max`.
+
+```json
+{
+  "concurrentInvocations": 100,
+  "invocationsPerMinute": 100,
+  "firesPerMinute": 100,
+  "actionMemoryMax": 1024,
+  "actionMemoryMin": 128,
+  "actionConcurrencyMax": 400,
+  "actionConcurrencyMin": 1,
+  "actionLogsMax": 128,
+  "actionLogsMin": 0
+}
+```
+
+#### namespace limit configs

Review Comment:
   I appreciate your comments on the situation of concern.
   
   > How does a user update their set limits?
   
   You can set namespace limits by updating `/limits` document in CouchDB. (wskadmin can be used, not implemented yet). 
   And this is for administrators, not users.
   
   > Whereas action concurrency still needs to have a set limit for the namespace within the min and max because the concurrency limit is by namespace, not set when creating an action.
   
   The concurrency limit I said in document is the number of simultaneous executions in one action. his can be specified when creating an action. So this is an action scope, not a namespace scope.
   
   https://github.com/apache/openwhisk/blob/master/docs/concurrency.md
   
   ```
   create a new action
   Usage:
     wsk action create ACTION_NAME ACTION [flags]
   
   Flags:
     -c, --concurrency LIMIT      the maximum intra-container concurrent activation LIMIT for the action (default 1)
   ```
   
   ```json
   {
       "namespace": "whisk.system",
       "name": "hello",
       "version": "0.0.5",
       "exec": {
           "kind": "nodejs:10",
           "binary": false
       },
       "annotations": [
           {
               "key": "provide-api-key",
               "value": false
           },
           {
               "key": "exec",
               "value": "nodejs:10"
           }
       ],
       "parameters": [
           {
               "key": "key",
               "value": "value"
           }
       ],
       "limits": {
           "timeout": 10000001,
           "memory": 256,
           "logs": 10,
           "concurrency": 100 <- 
       },
   ```
   



##########
proposals/POEM-3-action-limit-for-namespace.md:
##########
@@ -0,0 +1,132 @@
+<!--
+#
+# 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.
+#
+-->
+
+# Title
+Providing action limits for each namespace
+
+## Status
+* Current state: In-progress
+* Author(s): @upgle
+
+## Summary and Motivation
+
+This POEM proposes a new feature that allows administrators to set action limits (memory, timeout, log, and concurrency) for each namespace.
+
+Sometimes some users want to make an action with more memory and longer duration. But, Openwhisk only has a system limit for action, which is shared by all namespaces.
+There is no way to loosen the action limit for just a few users, and changing the action limit setting will affect all users.
+
+## Proposed changes
+
+### 3 types of action limits
+
+There are 3 types of action limits:
+
+- (1) system limits: This limits can never be exceeded.
+- (2) namespace default limits: This limit can be used if a limit has not been set for the namespace.
+- (3) namespace limits: This limit can be set by the system administrator for namespace and cannot exceed the range of the system limit.
+
+
+#### namespace default limit
+Namespaces without additional namespace limits can create actions with memory ranging from 512MB to 1024MB.
+
+<img src="https://user-images.githubusercontent.com/5635513/166409786-bb6759f8-e860-4f1e-8524-a91cc8ddd2f9.png" width="600">
+
+#### namespace limit (for `foo` namespace)
+The `foo` namespace with a maximum memory limit of 2048MB can create actions that have between 512MB and 2048MB of memory.
+
+<img src="https://user-images.githubusercontent.com/5635513/166409938-66a257e5-e9a5-4031-9f3a-a0001a9c5c93.png" width="600">
+
+### Limit document for CouchDB
+
+You can set namespace limits with `{namespace}/limits` document just like any other existing setting.
+The config keys related to the action limit start with the string `action` and end with `Min`, and `Max`.
+
+```json
+{
+  "concurrentInvocations": 100,
+  "invocationsPerMinute": 100,
+  "firesPerMinute": 100,
+  "actionMemoryMax": 1024,
+  "actionMemoryMin": 128,
+  "actionConcurrencyMax": 400,
+  "actionConcurrencyMin": 1,
+  "actionLogsMax": 128,
+  "actionLogsMin": 0
+}
+```
+
+#### namespace limit configs

Review Comment:
   I appreciate your comments on the situation of concern.
   
   > How does a user update their set limits?
   
   You can set namespace limits by updating `/limits` document in CouchDB. (wskadmin also can be used, not implemented yet). 
   And this is for administrators, not users.
   
   > Whereas action concurrency still needs to have a set limit for the namespace within the min and max because the concurrency limit is by namespace, not set when creating an action.
   
   The concurrency limit I said in document is the number of simultaneous executions in one action. his can be specified when creating an action. So this is an action scope, not a namespace scope.
   
   https://github.com/apache/openwhisk/blob/master/docs/concurrency.md
   
   ```
   create a new action
   Usage:
     wsk action create ACTION_NAME ACTION [flags]
   
   Flags:
     -c, --concurrency LIMIT      the maximum intra-container concurrent activation LIMIT for the action (default 1)
   ```
   
   ```json
   {
       "namespace": "whisk.system",
       "name": "hello",
       "version": "0.0.5",
       "exec": {
           "kind": "nodejs:10",
           "binary": false
       },
       "annotations": [
           {
               "key": "provide-api-key",
               "value": false
           },
           {
               "key": "exec",
               "value": "nodejs:10"
           }
       ],
       "parameters": [
           {
               "key": "key",
               "value": "value"
           }
       ],
       "limits": {
           "timeout": 10000001,
           "memory": 256,
           "logs": 10,
           "concurrency": 100 <- 
       },
   ```
   



-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@openwhisk.apache.org

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


[GitHub] [openwhisk] upgle commented on a diff in pull request #5229: [Proposal] Provide action limit configuration for each namespace

Posted by GitBox <gi...@apache.org>.
upgle commented on code in PR #5229:
URL: https://github.com/apache/openwhisk/pull/5229#discussion_r869203781


##########
core/controller/src/main/scala/org/apache/openwhisk/core/controller/Actions.scala:
##########
@@ -624,6 +626,30 @@ trait WhiskActionsApi extends WhiskCollectionAPI with PostActionActivation with
     })
   }
 
+  private def checkNamespaceAndSystemLimits(user: Identity, content: WhiskActionPut)(

Review Comment:
   Because updating the namespace limit configuration directly inserts/updates into the Couch DB, I've updated the code to fallback to the system limit if the namespace limit that exceeds the system limit.
   
   So, namespace limits that can not exceed the system limit are checked when an action is created/invoked.
   



-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@openwhisk.apache.org

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


[GitHub] [openwhisk] bdoyle0182 commented on pull request #5229: Provide action limit configuration for each namespace

Posted by GitBox <gi...@apache.org>.
bdoyle0182 commented on PR #5229:
URL: https://github.com/apache/openwhisk/pull/5229#issuecomment-1204229563

   Also one other thing since I don't have time to comb through the code again right now, but you mention in the description that you can update the default limit of a namespace but don't see in the description any limit options to set default for namespace so was wondering if it's in the pr.
   
   i.e. if the system memory limit default is 256mb, can you change the default value for a specific namespace to 128mb?


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@openwhisk.apache.org

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


[GitHub] [openwhisk] bdoyle0182 commented on pull request #5229: Provide action limit configuration for each namespace

Posted by GitBox <gi...@apache.org>.
bdoyle0182 commented on PR #5229:
URL: https://github.com/apache/openwhisk/pull/5229#issuecomment-1205599901

   Do you all think `instanceConcurrency` would make more sense as the identifier of the limit on the action document rather than `maxContainerConcurrency` in my pr?
   
   I think including `max` doesn't make sense on the action document to follow the same nomenclature of the existing `concurrency` field and that works in a similar matter where it's the max requests the container can serve at once but isn't guaranteed to be using at once, same would apply to total number of containers. So that a `maxInstanceConcurrency` and `minInstanceConcurrency` can then be defined as new namespace default limits that this pr is adding


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@openwhisk.apache.org

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


[GitHub] [openwhisk] ningyougang commented on a diff in pull request #5229: [Proposal] Provide action limit configuration for each namespace

Posted by GitBox <gi...@apache.org>.
ningyougang commented on code in PR #5229:
URL: https://github.com/apache/openwhisk/pull/5229#discussion_r867648883


##########
core/invoker/src/main/scala/org/apache/openwhisk/core/invoker/InvokerReactive.scala:
##########
@@ -179,6 +178,8 @@ class InvokerReactive(
     WhiskAction
       .get(entityStore, actionid.id, actionid.rev, fromCache = actionid.rev != DocRevision.empty)
       .flatMap(action => {
+        // action that exceed the system limit cannot be executed.
+        action.limits.checkSystemLimits()

Review Comment:
   Does it apply the new scheduler? e.g. when FunctionPoolConatinerProxy fetches the activation from memoryQueue's activation



-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@openwhisk.apache.org

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