From 809adfd36a55ce175ce6a89ba92ddf72ef3fc6ce Mon Sep 17 00:00:00 2001 From: Shiming Zhang Date: Fri, 22 Nov 2024 14:07:08 +0800 Subject: [PATCH] Add benchmark workflows --- .github/workflows/benchmark.yaml | 48 +++++++++++++++++++++++++ .github/workflows/test.yaml | 6 ---- test/e2e/benchmark.go | 6 ++-- test/e2e/kwokctl/benchmark/main_test.go | 1 + 4 files changed, 52 insertions(+), 9 deletions(-) create mode 100644 .github/workflows/benchmark.yaml diff --git a/.github/workflows/benchmark.yaml b/.github/workflows/benchmark.yaml new file mode 100644 index 000000000..24ef5dbf1 --- /dev/null +++ b/.github/workflows/benchmark.yaml @@ -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 diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 57952ad68..eb8ac8d7a 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -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 diff --git a/test/e2e/benchmark.go b/test/e2e/benchmark.go index 968dab28f..6482c4650 100644 --- a/test/e2e/benchmark.go +++ b/test/e2e/benchmark.go @@ -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) } @@ -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) } diff --git a/test/e2e/kwokctl/benchmark/main_test.go b/test/e2e/kwokctl/benchmark/main_test.go index 8dfab855e..481814684 100644 --- a/test/e2e/kwokctl/benchmark/main_test.go +++ b/test/e2e/kwokctl/benchmark/main_test.go @@ -45,6 +45,7 @@ var ( "--runtime=" + runtimeEnv, "--wait=15m", "--disable-kube-scheduler", + "--disable-qps-limits", } )