Skip to content

Commit

Permalink
Add benchmark workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
wzshiming committed Nov 22, 2024
1 parent 73130b2 commit 809adfd
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 9 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/benchmark.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Benchmark

on:
pull_request:
paths:
- pkg/**/*
- cmd/**/*
- test/**/*
- hack/**/*
- kustomize/**/*
- go.mod
- .github/workflows/benchmark.yaml
- '!hack/releases-helm-chart.sh'
push:
paths:
- pkg/**/*
- cmd/**/*
- test/**/*
- hack/**/*
- kustomize/**/*
- go.mod
- .github/workflows/benchmark.yaml
- '!hack/releases-helm-chart.sh'

env:
CGO_ENABLED: "0"
GO_VERSION: "1.23.0"

jobs:
benchmark:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}

- name: Test Benchmark
shell: bash
run: |
./hack/e2e-test.sh e2e/kwokctl/benchmark
- name: Upload logs
uses: actions/upload-artifact@v4
if: failure()
with:
name: kwok-logs-benchmark
path: ${{ github.workspace }}/logs
6 changes: 0 additions & 6 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -270,12 +270,6 @@ jobs:
fi
./hack/e2e-test.sh kwokctl/kwokctl_${{ matrix.kwokctl-runtime }}
- name: Test Benchmark
if: ${{ matrix.os == 'ubuntu-latest' && matrix.kwokctl-runtime == 'binary' }}
shell: bash
run: |
./hack/e2e-test.sh e2e/kwokctl/benchmark
- name: Test Auto Detect
if: ${{ matrix.kwokctl-runtime == 'binary' }}
shell: bash
Expand Down
6 changes: 3 additions & 3 deletions test/e2e/benchmark.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,10 @@ func scaleCreateNode(ctx context.Context, t *testing.T, kwokctlPath string, name
func CaseBenchmark(kwokctlPath, clusterName string) *features.FeatureBuilder {
return features.New("Benchmark").
Assess("Create nodes", func(ctx context.Context, t *testing.T, c *envconf.Config) context.Context {
ctx0, cancel := context.WithTimeout(ctx, 120*time.Second)
ctx0, cancel := context.WithTimeout(ctx, 180*time.Second)
defer cancel()

err := scaleCreateNode(ctx0, t, kwokctlPath, clusterName, 2000)
err := scaleCreateNode(ctx0, t, kwokctlPath, clusterName, 5000)
if err != nil {
t.Fatal(err)
}
Expand All @@ -133,7 +133,7 @@ func CaseBenchmark(kwokctlPath, clusterName string) *features.FeatureBuilder {
ctx0, cancel := context.WithTimeout(ctx, 240*time.Second)
defer cancel()

err := scaleCreatePod(ctx0, t, kwokctlPath, clusterName, 5000)
err := scaleCreatePod(ctx0, t, kwokctlPath, clusterName, 10000)
if err != nil {
t.Fatal(err)
}
Expand Down
1 change: 1 addition & 0 deletions test/e2e/kwokctl/benchmark/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ var (
"--runtime=" + runtimeEnv,
"--wait=15m",
"--disable-kube-scheduler",
"--disable-qps-limits",
}
)

Expand Down

0 comments on commit 809adfd

Please sign in to comment.