Adding Concurrency in Pool Manager (#1698)

Concurrency in the pool manager allows specializing pods concurrently based on a specified limit. 

Co-authored-by: Vishal <vishal-biyani@users.noreply.github.com>
This commit is contained in:
Rahul Bhati
2020-09-16 18:48:08 +05:30
committed by GitHub
co-authored by Vishal
parent c1ac7fcd38
commit f3fe3123b3
25 changed files with 659 additions and 402 deletions
+2 -2
View File
@@ -35,7 +35,7 @@ func Commands() *cobra.Command {
flag.FnEnvName, flag.FnEntryPoint, flag.FnPkgName,
flag.FnExecutorType, flag.FnCfgMap, flag.FnSecret,
flag.FnSpecializationTimeout, flag.FnExecutionTimeout,
flag.FnIdleTimeout,
flag.FnIdleTimeout, flag.FnConcurrency,
// TODO retired pkg & trigger related flags from function cmd
flag.PkgCode, flag.PkgSrcArchive, flag.PkgDeployArchive,
@@ -86,7 +86,7 @@ func Commands() *cobra.Command {
flag.FnEnvName, flag.FnEntryPoint, flag.FnPkgName,
flag.FnExecutorType, flag.FnSecret, flag.FnCfgMap,
flag.FnSpecializationTimeout, flag.FnExecutionTimeout,
flag.FnIdleTimeout,
flag.FnIdleTimeout, flag.FnConcurrency,
flag.PkgCode, flag.PkgSrcArchive, flag.PkgDeployArchive,
flag.PkgSrcChecksum, flag.PkgDeployChecksum, flag.PkgInsecure,
+7
View File
@@ -41,6 +41,7 @@ import (
const (
DEFAULT_MIN_SCALE = 1
DEFAULT_TARGET_CPU_PERCENTAGE = 80
DEFAULT_CONCURRENCY = 5
)
type CreateSubCommand struct {
@@ -96,6 +97,11 @@ func (opts *CreateSubCommand) complete(input cli.Input) error {
fnIdleTimeout := input.Int(flagkey.FnIdleTimeout)
fnConcurrency := DEFAULT_CONCURRENCY
if input.IsSet(flagkey.FnConcurrency) {
fnConcurrency = input.Int(flagkey.FnConcurrency)
}
pkgName := input.String(flagkey.FnPackageName)
secretNames := input.StringSlice(flagkey.FnSecret)
@@ -294,6 +300,7 @@ func (opts *CreateSubCommand) complete(input cli.Input) error {
InvokeStrategy: *invokeStrategy,
FunctionTimeout: fnTimeout,
IdleTimeout: &fnIdleTimeout,
Concurrency: fnConcurrency,
},
}
+4
View File
@@ -155,6 +155,10 @@ func (opts *UpdateSubCommand) complete(input cli.Input) error {
function.Spec.IdleTimeout = &fnTimeout
}
if input.IsSet(flagkey.FnConcurrency) {
function.Spec.Concurrency = input.Int(flagkey.FnConcurrency)
}
if len(pkgName) == 0 {
pkgName = function.Spec.Package.PackageRef.Name
}