Skip to content

rpk: Refactor benchmark#30007

Merged
StephanDollberg merged 4 commits intodevfrom
stephan/rpk-benchmark-refactor
Apr 8, 2026
Merged

rpk: Refactor benchmark#30007
StephanDollberg merged 4 commits intodevfrom
stephan/rpk-benchmark-refactor

Conversation

@StephanDollberg
Copy link
Copy Markdown
Member

Non-functional refactor of rpk benchmark to prepare for introduction of other subcommands like consume.

Plus two commits on top to add some more freedom in regards to topic selection (reset and preexisting).

Backports Required

  • none - not a bug fix
  • none - this is a backport
  • none - issue does not exist in previous branches
  • none - papercut/not impactful enough to backport
  • v26.1.x
  • v25.3.x
  • v25.2.x

Release Notes

  • none

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the hidden rpk benchmark CLI into a subcommand-based structure (starting with produce) and updates the ducktape RpkBenchmarkService wrapper + tests to invoke the new CLI shape. It also introduces new topic-handling flexibility in the CLI via --reset-topic and --use-existing-topic.

Changes:

  • Refactor rpk benchmark into rpk benchmark produce, moving produce logic into a new produce.go command implementation.
  • Add topic lifecycle options (--reset-topic, --use-existing-topic) and refactor shared benchmark setup/teardown into reusable helpers.
  • Update ducktape service wrapper and tests/perf harnesses to pass a benchmark mode (currently "produce").

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/rptest/tests/rpk_benchmark_service_test.py Refactors smoke test helper and updates test to run produce mode.
tests/rptest/services/rpk_benchmark_service.py Updates rpk invocation to benchmark <mode> and plumbs mode through service.
tests/rptest/perf/rpk_benchmark_test.py Updates perf test harness to run the benchmark with an explicit mode.
src/go/rpk/pkg/cli/benchmark/benchmark.go Introduces shared benchmark config/run lifecycle, topic setup options, and hooks in subcommands.
src/go/rpk/pkg/cli/benchmark/produce.go Adds the benchmark produce subcommand implementation.
src/go/rpk/pkg/cli/benchmark/BUILD Adds produce.go to the Bazel target sources.

Comment thread src/go/rpk/pkg/cli/benchmark/benchmark.go
@vbotbuildovich
Copy link
Copy Markdown
Collaborator

vbotbuildovich commented Mar 31, 2026

Retry command for Build#82536

please wait until all jobs are finished before running the slash command

/ci-repeat 1
skip-redpanda-build
skip-units
skip-rebase
tests/rptest/tests/cluster_features_test.py::FeaturesNodeJoinTest.test_old_node_join
tests/rptest/tests/cluster_features_test.py::FeaturesMultiNodeUpgradeTest.test_upgrade
tests/rptest/tests/license_enforcement_test.py::LicenseEnforcementTest.test_license_enforcement@{"clean_node_after_recovery":false,"clean_node_before_recovery":true}
tests/rptest/tests/license_enforcement_test.py::LicenseEnforcementTest.test_license_enforcement@{"clean_node_after_recovery":true,"clean_node_before_recovery":false}
tests/rptest/tests/cluster_features_test.py::FeaturesMultiNodeUpgradeTest.test_rollback
tests/rptest/tests/cluster_features_test.py::FeaturesSingleNodeUpgradeTest.test_upgrade
tests/rptest/tests/license_enforcement_test.py::LicenseEnforcementTest.test_license_enforcement@{"clean_node_after_recovery":true,"clean_node_before_recovery":true}
tests/rptest/tests/license_enforcement_test.py::LicenseEnforcementTest.test_license_enforcement@{"clean_node_after_recovery":false,"clean_node_before_recovery":false}

@vbotbuildovich
Copy link
Copy Markdown
Collaborator

CI test results

test results on build#82536
test_class test_method test_arguments test_kind job_url test_status passed reason test_history
FeaturesMultiNodeUpgradeTest test_rollback null integration https://buildkite.com/redpanda/redpanda/builds/82536#019d4354-62f5-4bf1-abcd-464a576ada44 FAIL 0/11 Test FAILS after retries.Significant increase in flaky rate(baseline=0.3520, p0=0.0000, reject_threshold=0.0100) https://redpanda.metabaseapp.com/dashboard/87-tests?tab=142-dt-individual-test-history&test_class=FeaturesMultiNodeUpgradeTest&test_method=test_rollback
FeaturesMultiNodeUpgradeTest test_rollback null integration https://buildkite.com/redpanda/redpanda/builds/82536#019d4356-5949-4e0a-8156-1486acb7ba62 FAIL 0/11 Test FAILS after retries.Significant increase in flaky rate(baseline=0.3520, p0=0.0000, reject_threshold=0.0100) https://redpanda.metabaseapp.com/dashboard/87-tests?tab=142-dt-individual-test-history&test_class=FeaturesMultiNodeUpgradeTest&test_method=test_rollback
FeaturesMultiNodeUpgradeTest test_upgrade null integration https://buildkite.com/redpanda/redpanda/builds/82536#019d4354-62f5-4192-804e-7256b9525b5f FAIL 0/11 Test FAILS after retries.Significant increase in flaky rate(baseline=0.3520, p0=0.0000, reject_threshold=0.0100) https://redpanda.metabaseapp.com/dashboard/87-tests?tab=142-dt-individual-test-history&test_class=FeaturesMultiNodeUpgradeTest&test_method=test_upgrade
FeaturesMultiNodeUpgradeTest test_upgrade null integration https://buildkite.com/redpanda/redpanda/builds/82536#019d4356-5949-4494-908a-d85f6eb69ff0 FAIL 0/11 Test FAILS after retries.Significant increase in flaky rate(baseline=0.3520, p0=0.0000, reject_threshold=0.0100) https://redpanda.metabaseapp.com/dashboard/87-tests?tab=142-dt-individual-test-history&test_class=FeaturesMultiNodeUpgradeTest&test_method=test_upgrade
FeaturesNodeJoinTest test_old_node_join null integration https://buildkite.com/redpanda/redpanda/builds/82536#019d4354-62f6-4c2a-9782-0a6c85d6f2d3 FAIL 0/11 Test FAILS after retries.Significant increase in flaky rate(baseline=0.3513, p0=0.0000, reject_threshold=0.0100) https://redpanda.metabaseapp.com/dashboard/87-tests?tab=142-dt-individual-test-history&test_class=FeaturesNodeJoinTest&test_method=test_old_node_join
FeaturesNodeJoinTest test_old_node_join null integration https://buildkite.com/redpanda/redpanda/builds/82536#019d4356-594a-49b2-adc6-8b4ccc43ab64 FAIL 0/11 Test FAILS after retries.Significant increase in flaky rate(baseline=0.3513, p0=0.0000, reject_threshold=0.0100) https://redpanda.metabaseapp.com/dashboard/87-tests?tab=142-dt-individual-test-history&test_class=FeaturesNodeJoinTest&test_method=test_old_node_join
FeaturesSingleNodeUpgradeTest test_upgrade null integration https://buildkite.com/redpanda/redpanda/builds/82536#019d4354-62f2-4aca-840e-d58f3c1a01c1 FAIL 0/11 Test FAILS after retries.Significant increase in flaky rate(baseline=0.3513, p0=0.0000, reject_threshold=0.0100) https://redpanda.metabaseapp.com/dashboard/87-tests?tab=142-dt-individual-test-history&test_class=FeaturesSingleNodeUpgradeTest&test_method=test_upgrade
FeaturesSingleNodeUpgradeTest test_upgrade null integration https://buildkite.com/redpanda/redpanda/builds/82536#019d4356-5945-4fb7-8598-71dc09ec0ec2 FAIL 0/11 Test FAILS after retries.Significant increase in flaky rate(baseline=0.3513, p0=0.0000, reject_threshold=0.0100) https://redpanda.metabaseapp.com/dashboard/87-tests?tab=142-dt-individual-test-history&test_class=FeaturesSingleNodeUpgradeTest&test_method=test_upgrade
LicenseEnforcementTest test_license_enforcement {"clean_node_after_recovery": false, "clean_node_before_recovery": false} integration https://buildkite.com/redpanda/redpanda/builds/82536#019d4354-62f6-45eb-8ba8-2cd561944355 FAIL 0/11 Test FAILS after retries.Significant increase in flaky rate(baseline=0.3493, p0=0.0000, reject_threshold=0.0100) https://redpanda.metabaseapp.com/dashboard/87-tests?tab=142-dt-individual-test-history&test_class=LicenseEnforcementTest&test_method=test_license_enforcement
LicenseEnforcementTest test_license_enforcement {"clean_node_after_recovery": false, "clean_node_before_recovery": false} integration https://buildkite.com/redpanda/redpanda/builds/82536#019d4356-594e-4b37-a4bf-c260d79d5d01 FAIL 0/11 Test FAILS after retries.Significant increase in flaky rate(baseline=0.3493, p0=0.0000, reject_threshold=0.0100) https://redpanda.metabaseapp.com/dashboard/87-tests?tab=142-dt-individual-test-history&test_class=LicenseEnforcementTest&test_method=test_license_enforcement
LicenseEnforcementTest test_license_enforcement {"clean_node_after_recovery": true, "clean_node_before_recovery": false} integration https://buildkite.com/redpanda/redpanda/builds/82536#019d4354-62f7-4fbd-ab09-f92a385fb236 FAIL 0/11 Test FAILS after retries.Significant increase in flaky rate(baseline=0.3493, p0=0.0000, reject_threshold=0.0100) https://redpanda.metabaseapp.com/dashboard/87-tests?tab=142-dt-individual-test-history&test_class=LicenseEnforcementTest&test_method=test_license_enforcement
LicenseEnforcementTest test_license_enforcement {"clean_node_after_recovery": true, "clean_node_before_recovery": false} integration https://buildkite.com/redpanda/redpanda/builds/82536#019d4356-594f-4b52-9886-fbb742ece4ec FAIL 0/11 Test FAILS after retries.Significant increase in flaky rate(baseline=0.3493, p0=0.0000, reject_threshold=0.0100) https://redpanda.metabaseapp.com/dashboard/87-tests?tab=142-dt-individual-test-history&test_class=LicenseEnforcementTest&test_method=test_license_enforcement
LicenseEnforcementTest test_license_enforcement {"clean_node_after_recovery": false, "clean_node_before_recovery": true} integration https://buildkite.com/redpanda/redpanda/builds/82536#019d4354-62f2-4baa-b2c7-a73ddf2a78e2 FAIL 0/11 Test FAILS after retries.Significant increase in flaky rate(baseline=0.3493, p0=0.0000, reject_threshold=0.0100) https://redpanda.metabaseapp.com/dashboard/87-tests?tab=142-dt-individual-test-history&test_class=LicenseEnforcementTest&test_method=test_license_enforcement
LicenseEnforcementTest test_license_enforcement {"clean_node_after_recovery": false, "clean_node_before_recovery": true} integration https://buildkite.com/redpanda/redpanda/builds/82536#019d4356-5944-4846-95ec-2d450a7ccaae FAIL 0/11 Test FAILS after retries.Significant increase in flaky rate(baseline=0.3493, p0=0.0000, reject_threshold=0.0100) https://redpanda.metabaseapp.com/dashboard/87-tests?tab=142-dt-individual-test-history&test_class=LicenseEnforcementTest&test_method=test_license_enforcement
LicenseEnforcementTest test_license_enforcement {"clean_node_after_recovery": true, "clean_node_before_recovery": true} integration https://buildkite.com/redpanda/redpanda/builds/82536#019d4354-62f2-4aca-840e-d58f3c1a01c1 FAIL 0/11 Test FAILS after retries.Significant increase in flaky rate(baseline=0.3493, p0=0.0000, reject_threshold=0.0100) https://redpanda.metabaseapp.com/dashboard/87-tests?tab=142-dt-individual-test-history&test_class=LicenseEnforcementTest&test_method=test_license_enforcement
LicenseEnforcementTest test_license_enforcement {"clean_node_after_recovery": true, "clean_node_before_recovery": true} integration https://buildkite.com/redpanda/redpanda/builds/82536#019d4356-5945-4fb7-8598-71dc09ec0ec2 FAIL 0/11 Test FAILS after retries.Significant increase in flaky rate(baseline=0.3493, p0=0.0000, reject_threshold=0.0100) https://redpanda.metabaseapp.com/dashboard/87-tests?tab=142-dt-individual-test-history&test_class=LicenseEnforcementTest&test_method=test_license_enforcement

Copy link
Copy Markdown
Contributor

@graham-rp graham-rp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like this breaks existing behavior (rpk benchmark now errors out). Would rpk benchmark --mode work instead?

@StephanDollberg
Copy link
Copy Markdown
Member Author

StephanDollberg commented Apr 7, 2026

Yes, this changes that intentionally. No need to maintain that.

Make the current (and only) produce mode be explicit by requiring a
"produce" subcommand.

This is in preparation for adding "consume".
Pure non-functional refactor of moving everything purely produce related
to its own file and into subfunctions. Again in preparation for adding
other subcommands like consume.
When cancelling the command we delete the test topic we created.

Sometimes the topic might still leak (SIGKILL or rpk is killed during
topic creation before RP has responded).

Provide a `--reset-topic` flag which deletes and recreates the topic
similar to what OMB provides.
Add a flag to use a prexisting topic. Can sometimes be useful for
various reasons (existing data etc.).
@StephanDollberg StephanDollberg force-pushed the stephan/rpk-benchmark-refactor branch from 822fef8 to 986b62e Compare April 7, 2026 13:50
@StephanDollberg
Copy link
Copy Markdown
Member Author

Pure rebase

@StephanDollberg StephanDollberg merged commit 4d29664 into dev Apr 8, 2026
28 checks passed
@StephanDollberg StephanDollberg deleted the stephan/rpk-benchmark-refactor branch April 8, 2026 07:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants