-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #128 from Azure/add-test-case-node10-job1-pod100
add test case with 10 virtual nodes and 100 pods
- Loading branch information
Showing
8 changed files
with
184 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
package bench | ||
|
||
import ( | ||
"context" | ||
"fmt" | ||
"sync" | ||
"time" | ||
|
||
internaltypes "github.com/Azure/kperf/contrib/internal/types" | ||
"github.com/Azure/kperf/contrib/internal/utils" | ||
|
||
"github.com/urfave/cli" | ||
) | ||
|
||
var benchNode10Job1Pod100Case = cli.Command{ | ||
Name: "node10_job1_pod100", | ||
Usage: ` | ||
The test suite is to setup 10 virtual nodes and deploy one job with 100 pods on | ||
that nodes. It repeats to create and delete job. The load profile is fixed. | ||
`, | ||
Flags: append( | ||
[]cli.Flag{ | ||
cli.IntFlag{ | ||
Name: "total", | ||
Usage: "Total requests per runner (There are 10 runners totally and runner's rate is 1)", | ||
Value: 1000, | ||
}, | ||
}, | ||
commonFlags..., | ||
), | ||
Action: func(cliCtx *cli.Context) error { | ||
_, err := renderBenchmarkReportInterceptor( | ||
addAPIServerCoresInfoInterceptor(benchNode10Job1Pod100CaseRun), | ||
)(cliCtx) | ||
return err | ||
}, | ||
} | ||
|
||
// benchNode10Job1Pod100CaseRun is for benchNode10Job1Pod100Case subcommand. | ||
func benchNode10Job1Pod100CaseRun(cliCtx *cli.Context) (*internaltypes.BenchmarkReport, error) { | ||
ctx := context.Background() | ||
kubeCfgPath := cliCtx.GlobalString("kubeconfig") | ||
|
||
rgCfgFile, rgSpec, rgCfgFileDone, err := newLoadProfileFromEmbed(cliCtx, | ||
"loadprofile/node10_job1_pod100.yaml") | ||
if err != nil { | ||
return nil, err | ||
} | ||
defer func() { _ = rgCfgFileDone() }() | ||
|
||
vcDone, err := deployVirtualNodepool(ctx, cliCtx, "node10job1pod100", | ||
100, | ||
cliCtx.Int("cpu"), | ||
cliCtx.Int("memory"), | ||
cliCtx.Int("max-pods"), | ||
) | ||
if err != nil { | ||
return nil, fmt.Errorf("failed to deploy virtual node: %w", err) | ||
} | ||
defer func() { _ = vcDone() }() | ||
|
||
var wg sync.WaitGroup | ||
wg.Add(1) | ||
|
||
jobInterval := 5 * time.Second | ||
jobCtx, jobCancel := context.WithCancel(ctx) | ||
go func() { | ||
defer wg.Done() | ||
|
||
utils.RepeatJobWithPod(jobCtx, kubeCfgPath, "job1pod100", "workload/100pod.job.yaml", jobInterval) | ||
}() | ||
|
||
rgResult, derr := utils.DeployRunnerGroup(ctx, | ||
cliCtx.GlobalString("kubeconfig"), | ||
cliCtx.GlobalString("runner-image"), | ||
rgCfgFile, | ||
cliCtx.GlobalString("runner-flowcontrol"), | ||
cliCtx.GlobalString("rg-affinity"), | ||
) | ||
jobCancel() | ||
wg.Wait() | ||
|
||
if derr != nil { | ||
return nil, derr | ||
} | ||
|
||
return &internaltypes.BenchmarkReport{ | ||
Description: fmt.Sprintf(` | ||
Environment: 100 virtual nodes managed by kwok-controller, | ||
Workload: Deploy 1 job with 3,000 pods repeatedly. The parallelism is 100. The interval is %v`, jobInterval), | ||
LoadSpec: *rgSpec, | ||
Result: *rgResult, | ||
Info: make(map[string]interface{}), | ||
}, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
contrib/internal/manifests/loadprofile/node10_job1_pod100.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
count: 1 | ||
loadProfile: | ||
version: 1 | ||
description: "node10-job1-pod100" | ||
spec: | ||
rate: 10 | ||
total: 1000 | ||
conns: 10 | ||
client: 10 | ||
contentType: json | ||
disableHTTP2: false | ||
maxRetries: 0 | ||
requests: | ||
- staleList: | ||
version: v1 | ||
resource: pods | ||
shares: 1000 # chance 1000 / (1000 + 100 + 100) | ||
- quorumList: | ||
version: v1 | ||
resource: pods | ||
limit: 1000 | ||
shares: 100 # chance 100 / (1000 + 100 + 100) | ||
- quorumList: | ||
version: v1 | ||
resource: events | ||
limit: 1000 | ||
shares: 100 # chance 100 / (1000 + 100 + 100) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
apiVersion: batch/v1 | ||
kind: Job | ||
metadata: | ||
name: batchjobs | ||
spec: | ||
completions: 100 | ||
parallelism: 10 | ||
template: | ||
metadata: | ||
labels: | ||
app: fake-pod | ||
spec: | ||
restartPolicy: Never | ||
affinity: | ||
nodeAffinity: | ||
requiredDuringSchedulingIgnoredDuringExecution: | ||
nodeSelectorTerms: | ||
- matchExpressions: | ||
- key: type | ||
operator: In | ||
values: | ||
- kperf-virtualnodes | ||
# A taints was added to an automatically created Node. | ||
# You can remove taints of Node or add this tolerations. | ||
tolerations: | ||
- key: "kperf.io/nodepool" | ||
operator: "Exists" | ||
effect: "NoSchedule" | ||
containers: | ||
- name: fake-container | ||
image: fake-image |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
version: 1 | ||
description: "node10-job1-pod100" | ||
spec: | ||
rate: 10 | ||
total: 1000 | ||
conns: 10 | ||
client: 10 | ||
contentType: json | ||
disableHTTP2: false | ||
maxRetries: 0 | ||
requests: | ||
- staleList: | ||
version: v1 | ||
resource: pods | ||
shares: 1000 # chance 1000 / (1000 + 100 + 100) | ||
- quorumList: | ||
version: v1 | ||
resource: pods | ||
limit: 1000 | ||
shares: 100 # chance 100 / (1000 + 100 + 100) | ||
- quorumList: | ||
version: v1 | ||
resource: events | ||
limit: 1000 | ||
shares: 100 # chance 100 / (1000 + 100 + 100) |