Add Salt package download benchmark - #12341
AkashKumar7902 wants to merge 17 commits into
Conversation
244449d to
68355d2
Compare
68355d2 to
c8594d3
Compare
|
@Pablogoliva Review updates are pushed in
Ruby syntax, targeted RuboCop, runner/quoting assertions, and diff checks pass. A new full benchmark run still requires deployed Uyuni infrastructure and minions. |
Pablogoliva
left a comment
There was a problem hiding this comment.
Change the way to use system commands.
c8594d3 to
2d693f5
Compare
|
@Pablogoliva Follow-up on the system-command review is complete on current head.
I also ran the full mounted-volume pipeline against the external RKE2 environment. The isolated checkout included the declared #12240 dependency; its The PR description now contains the updated timeout model and validation result. Please re-review the current head when convenient. |
| code = nil | ||
| exception = nil | ||
| begin | ||
| stdout, stderr, code = get_target('localhost').run_local( |
There was a problem hiding this comment.
| stdout, stderr, code = get_target('localhost').run_local( | |
| stdout, stderr, code = get_target('controller').run_local( |
Also in the other occurrences.
There was a problem hiding this comment.
the existing code already runs on the controller.
plus, the controller is not defined in:
https://github.com/uyuni-project/uyuni/blob/master/testsuite/features/support/constants.rb
| package_download_benchmark_salt_call( | ||
| inputs, | ||
| pod, | ||
| 'cmd.run_all', |
There was a problem hiding this comment.
What's the matter of this?
There was a problem hiding this comment.
It runs a Python inventory command on each minion to collect the paths and sizes of files under /var/cache/zypp/packages. The returned inventory is used for post-download verification.
Order:
-
Before benchmark
cmd.run_all → clear old RPM cache -
During benchmark (timed)
cmd.run_all → run zypper download -
After benchmark
cmd.run_all → inventory downloaded RPM files -
Verification
Compare inventory with expected channel packages
So line 848 is post-benchmark verification and is not included in the measured duration.
|
👋 Hello! Thanks for contributing to our project. You can see the progress at the end of this page and at https://github.com/uyuni-project/uyuni/pull/12341/checks If you are unsure the failing tests are related to your code, you can check the "reference jobs". These are jobs that run on a scheduled time with code from master. If they fail for the same reason as your build, it means the tests or the infrastructure are broken. If they do not fail, but yours do, it means it is related to your code. Reference tests: KNOWN ISSUES Sometimes the build can fail when pulling new jar files from download.opensuse.org . This is a known limitation. Given this happens rarely, when it does, all you need to do is rerun the test. Sorry for the inconvenience. For more tips on troubleshooting, see the troubleshooting guide. Happy hacking! |
| status: workload_errors.empty? ? 'passed' : 'failed', | ||
| command: zypper, | ||
| timeout_seconds: timeout, | ||
| timed_out: workload_error.to_s.include?('exited with 124'), |
There was a problem hiding this comment.
This exit code is not in zypper's man page with the others… Where does it come from?
There was a problem hiding this comment.
it comes from network_utils.rb where we throw this exit code when timeout happens
| @@ -0,0 +1,18 @@ | |||
| # Copyright (c) 2026 SUSE LLC | |||
There was a problem hiding this comment.
Copyright should be yours: change the SUSE LLC with your full name
There was a problem hiding this comment.
How comes that you add a new run set? Shouldn't this run after the reposync benchmark to reuse the imported repository? In which case it should be in the same run_set.
There was a problem hiding this comment.
I though of keeping it separate , will be making changes to accomodate both
| rescue Timeout::Error | ||
| puts "SSH operation timed out after #{timeout} seconds." | ||
| stderr = "SSH operation timed out after #{timeout} seconds." | ||
| exit_code = 124 |
There was a problem hiding this comment.
Where is this exit_code coming from?
There was a problem hiding this comment.
it is a timeout error code which we are synthesizing
| inputs = @package_download_inputs | ||
| api = $api_test | ||
|
|
||
| # 1. Read the current channel state from the Uyuni API. |
There was a problem hiding this comment.
AI tends to add numbered comments, but this is a pain to maintain in the long run. Remove the numbered list items from them please.
There was a problem hiding this comment.
ok, should i just remove the numbers, or the enitre comment ?
There was a problem hiding this comment.
updated, removed the numbers
| ) | ||
| end | ||
|
|
||
| Given('a ready server pod is reachable from the benchmark controller') do |
There was a problem hiding this comment.
This function needs to be shared with the other PR as it's a duplicate. Better base this PR on the other one to share code with it
| inputs = @package_download_inputs | ||
| pod = @package_download_pod | ||
|
|
||
| # 1. Run `state.apply channels` so Uyuni updates the assigned software channel |
| '--all-matches', | ||
| '--repo', | ||
| inputs[:repo_alias], | ||
| '*' |
There was a problem hiding this comment.
I wonder if we could have issue with packages conflicting each other in the repo
09c97e8 to
2229bd8
Compare
| Timeout.timeout(timeout) do # Enforce timeout on the entire SSH operation | ||
| Net::SSH.start(host, nil, port: port, verify_host_key: :never, timeout: timeout, keepalive: true, max_pkt_size: buffer_size, config: true) do |ssh| | ||
| stdout, stderr, exit_code = ssh_exec!(ssh, command, timeout: DEFAULT_TIMEOUT) | ||
| stdout, stderr, exit_code = ssh_exec!(ssh, command, timeout: timeout) |
There was a problem hiding this comment.
Leave the previous timeout pls
Snapshot all binary RPMs in the configured Uyuni channel and verify that every target minion is subscribed. Run one concurrent zypper download --all-matches command per minion, record the measured duration, and verify every cached artifact against the frozen channel checksum set. Signed-off-by: Akash Kumar <meakash7902@gmail.com> Signed-off-by: Akash Kumar <91385321+AkashKumar7902@users.noreply.github.com>
Run kubectl and Salt through the testsuite controller target while preserving process timeouts and separated command output. Keep the normal scenario watchdog enabled with a benchmark-specific limit derived from the configured download timeout. Signed-off-by: Akash Kumar <91385321+AkashKumar7902@users.noreply.github.com>
Signed-off-by: Akash Kumar <91385321+AkashKumar7902@users.noreply.github.com>
Signed-off-by: Akash Kumar <91385321+AkashKumar7902@users.noreply.github.com>
Signed-off-by: Akash Kumar <91385321+AkashKumar7902@users.noreply.github.com>
Signed-off-by: Akash Kumar <91385321+AkashKumar7902@users.noreply.github.com>
Signed-off-by: Akash Kumar <91385321+AkashKumar7902@users.noreply.github.com>
Signed-off-by: Akash Kumar <91385321+AkashKumar7902@users.noreply.github.com>
Signed-off-by: Akash Kumar <91385321+AkashKumar7902@users.noreply.github.com>
Signed-off-by: Akash Kumar <91385321+AkashKumar7902@users.noreply.github.com>
Signed-off-by: Akash Kumar <91385321+AkashKumar7902@users.noreply.github.com>
Signed-off-by: Akash Kumar <91385321+AkashKumar7902@users.noreply.github.com>
Signed-off-by: Akash Kumar <91385321+AkashKumar7902@users.noreply.github.com>
Signed-off-by: Akash Kumar <91385321+AkashKumar7902@users.noreply.github.com>
Signed-off-by: Akash Kumar <91385321+AkashKumar7902@users.noreply.github.com>
Stop converting Ruby timeouts into a shell-style exit code and remove result metadata that depends on parsing it. Signed-off-by: Akash Kumar <91385321+AkashKumar7902@users.noreply.github.com>
Move the feature into the kubernetes_storage_benchmark run set so it reuses the channel imported by the reposync benchmark: wait for the channel repodata, subscribe the configured minions through the API, and share the reposync helpers for the server pod, integer inputs and the storage backend label. Drop the network_utils.rb timeout change and require DEFAULT_TIMEOUT to cover the download timeout instead. Replace the inline Python cache inventory with a find command. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: Akash Kumar <91385321+AkashKumar7902@users.noreply.github.com>
70fb1fb to
2c1ac3c
Compare
What does this PR change?
Adds an opt-in Cucumber benchmark that downloads every binary RPM from one Uyuni software channel on a configured set of Salt minions.
Benchmark flow
Read the channel label and Salt minion IDs from environment variables.
Capture the channel's binary-RPM snapshot through the Uyuni API and confirm that every minion is registered and subscribed.
Find the ready Uyuni server pod.
Prepare the minions with:
state.apply channelsgrains.item os_family osarchpkg.get_repopkg.refresh_dbpkg.list_repo_pkgsClear the RPM payload cache outside the measured interval.
Run one concurrent Salt
cmd.run_allworkload on all selected minions:Inventory the downloaded RPMs, match them to the channel checksums, and confirm that the channel snapshot remained unchanged.
Write a structured JSON result.
Commands follow this path:
Only the package download workload is timed. Setup, cache cleanup, and verification run outside the measured interval. The RPMs are downloaded into each minion's zypper package cache and are not installed.
The benchmark expects an existing channel and existing subscriptions. It does not create channels, subscribe systems, install a Helm release, or configure a StorageClass.
Configuration
Prerequisites
kubectl.uyuninamespace.Required inputs
UYUNI_BENCH_MINIONS["minion-1.example.test","minion-2.example.test"]UYUNI_BENCH_CHANNELuyuni-bench-channelThe normal testsuite environment must also provide
SERVERand its API configuration.Optional inputs
UYUNI_BENCH_TIMEOUT_SECONDS14400UYUNI_BENCH_STORAGE_CLASSSCENARIO_HARD_LIMITControl operations use a maximum timeout of 600 seconds.
UYUNI_BENCH_STORAGE_CLASSdoes not select or configure storage.How to run
Run the dedicated Rake task from a configured testsuite controller:
If StorageClass metadata is not needed, omit
UYUNI_BENCH_STORAGE_CLASS.Results are written to:
The result contains the measured duration, per-minion command status, package and payload counts, downloaded bytes, channel snapshot digest, and verification errors.
Codespace
GUI diff
No difference.
Documentation
The configuration and run instructions are included in this PR description.
DONE
Test coverage
Validated with:
Ruby syntax checks for the benchmark steps and Rakefile;
RuboCop for the benchmark step definitions;
focused checks for API snapshot mapping and the Salt preflight sequence;
focused checks for controller target selection,
kubectl execserialization, Salt arguments, zypper arguments, and timeout values;focused checks for RPM cache verification and result schema;
run-set linkage validation;
git diff --check.DONE
Links
Issue(s): openSUSE/mentoring#252
Related: #12077
Depends on: #12240
Related Sumaform storage work: uyuni-project/sumaform#2246
Port(s): none
Changelogs
Re-run a test
Before you merge
Check How to branch and merge properly!