Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

follow-up: contrib: allow to tune nodepool scale #124 #125

Merged
merged 2 commits into from
May 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,
},
}
Loading