Skip to content

Commit

Permalink
Merge pull request #125 from fuweid/follow-up
Browse files Browse the repository at this point in the history
follow-up: contrib: allow to tune nodepool scale #124
  • Loading branch information
fuweid authored May 22, 2024
2 parents 8ef024d + be5c3fd commit c71f28a
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 49 deletions.
17 changes: 10 additions & 7 deletions contrib/cmd/runkperf/commands/bench/node100_job1_pod3k.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,16 @@ var benchNode100Job1Pod3KCase = cli.Command{
The test suite is to setup 100 virtual nodes and deploy one job with 3k pods on
that nodes. It repeats to create and delete job. The load profile is fixed.
`,
Flags: []cli.Flag{
cli.IntFlag{
Name: "total",
Usage: "Total requests per runner (There are 10 runners totally and runner's rate is 10)",
Value: 36000,
Flags: append(
[]cli.Flag{
cli.IntFlag{
Name: "total",
Usage: "Total requests per runner (There are 10 runners totally and runner's rate is 10)",
Value: 36000,
},
},
},
commonFlags...,
),
Action: func(cliCtx *cli.Context) error {
_, err := renderBenchmarkReportInterceptor(
addAPIServerCoresInfoInterceptor(benchNode100Job1Pod3KCaseRun),
Expand All @@ -47,7 +50,7 @@ func benchNode100Job1Pod3KCaseRun(cliCtx *cli.Context) (*internaltypes.Benchmark
defer func() { _ = rgCfgFileDone() }()

vcDone, err := deployVirtualNodepool(ctx, cliCtx, "node100job1pod3k",
cliCtx.Int("nodes"),
100,
cliCtx.Int("cpu"),
cliCtx.Int("memory"),
cliCtx.Int("max-pods"),
Expand Down
47 changes: 25 additions & 22 deletions contrib/cmd/runkperf/commands/bench/node100_pod10k.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,28 +23,31 @@ The test suite is to setup 100 virtual nodes and deploy N deployments for 10k
pods on that nodes. It repeats to rolling-update deployments one by one during
benchmark.
`,
Flags: []cli.Flag{
cli.IntFlag{
Name: "deployments",
Usage: "The total number of deployments for 10k pods",
Value: 20,
Flags: append(
[]cli.Flag{
cli.IntFlag{
Name: "deployments",
Usage: "The total number of deployments for 10k pods",
Value: 20,
},
cli.IntFlag{
Name: "total",
Usage: "Total requests per runner (There are 10 runners totally and runner's rate is 10)",
Value: 36000,
},
cli.IntFlag{
Name: "padding-bytes",
Usage: "Add <key=data, value=randomStringByLen(padding-bytes)> in pod's annotation to increase pod size",
Value: 0,
},
cli.DurationFlag{
Name: "interval",
Usage: "Interval to restart deployments",
Value: time.Second * 10,
},
},
cli.IntFlag{
Name: "total",
Usage: "Total requests per runner (There are 10 runners totally and runner's rate is 10)",
Value: 36000,
},
cli.IntFlag{
Name: "padding-bytes",
Usage: "Add <key=data, value=randomStringByLen(padding-bytes)> in pod's annotation to increase pod size",
Value: 0,
},
cli.DurationFlag{
Name: "interval",
Usage: "Interval to restart deployments",
Value: time.Second * 10,
},
},
commonFlags...,
),
Action: func(cliCtx *cli.Context) error {
_, err := renderBenchmarkReportInterceptor(
addAPIServerCoresInfoInterceptor(benchNode100DeploymentNPod10KRun),
Expand All @@ -67,7 +70,7 @@ func benchNode100DeploymentNPod10KRun(cliCtx *cli.Context) (*internaltypes.Bench

// NOTE: The nodepool name should be aligned with ../../../../internal/manifests/loadprofile/node100_pod10k.yaml.
vcDone, err := deployVirtualNodepool(ctx, cliCtx, "node100pod10k",
cliCtx.Int("nodes"),
100,
cliCtx.Int("cpu"),
cliCtx.Int("memory"),
cliCtx.Int("max-pods"),
Expand Down
44 changes: 24 additions & 20 deletions contrib/cmd/runkperf/commands/bench/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,29 +50,33 @@ var Command = cli.Command{
Name: "result",
Usage: "Path to the file which stores results",
},
cli.IntFlag{
Name: "nodes",
Usage: "The number of virtual nodes",
Value: 100,
},
cli.IntFlag{
Name: "cpu",
Usage: "The allocatable CPU resource per node",
Value: 32,
},
cli.IntFlag{
Name: "memory",
Usage: "The allocatable Memory resource per node (GiB)",
Value: 96,
},
cli.IntFlag{
Name: "max-pods",
Usage: "The maximum Pods per node",
Value: 110,
},
},
Subcommands: []cli.Command{
benchNode100Job1Pod3KCase,
benchNode100DeploymentNPod10KCase,
},
}

// commonFlags is used as subcommand's option instead of global options.
//
// NOTE: The format of global options, like `--option xyz subcommand`, is not
// easy to extend existing configuration. If the subcommand extends it with
// its own option, the user can just append options, like `subcommand --options
// xyz.
var commonFlags = []cli.Flag{
cli.IntFlag{
Name: "cpu",
Usage: "the allocatable cpu resource per node",
Value: 32,
},
cli.IntFlag{
Name: "memory",
Usage: "The allocatable Memory resource per node (GiB)",
Value: 96,
},
cli.IntFlag{
Name: "max-pods",
Usage: "The maximum Pods per node",
Value: 110,
},
}

0 comments on commit c71f28a

Please sign in to comment.