Skip to content

network-perf-v2: support MicroShift runs#855

Open
sjug wants to merge 1 commit into
cloud-bulldozer:masterfrom
sjug:netperf-microshift
Open

network-perf-v2: support MicroShift runs#855
sjug wants to merge 1 commit into
cloud-bulldozer:masterfrom
sjug:netperf-microshift

Conversation

@sjug
Copy link
Copy Markdown
Collaborator

@sjug sjug commented May 16, 2026

  • Skip OpenShift-only metadata helpers in utils/index.sh and synthesize the fields index_task() needs from Kubernetes resources, the microshift-version ConfigMap, and node labels.
  • Drop eval in run.sh in favor of an argv array; safer handling of values containing shell metacharacters.
  • env.sh: PLATFORM=microshift defaults LOCAL=true and METRICS=false so a default run does not trip the PROMETHEUS_URL guard.
  • README.md: document PLATFORM, MicroShift workflow / LOCAL=true requirement, refresh the env-vars table (adds POD, UDNL2, UDNL3, USE_VIRTCTL, VM, NETPERF_FILENAME, WORKLOAD_NAME), correct the full-run/OSSM coverage tables, fix a broken OSSM table separator and a levevl typo.
  • env.sh: bump default NETPERF_VERSION to v0.1.41 (the latest upstream release that includes the MicroShift archive metadata fixes).

Type of change

  • Refactor
  • New feature
  • Bug fix
  • Optimization
  • Documentation Update

Description

Enables the network-perf-v2 workload to run against MicroShift clusters in addition to OpenShift, so the same continuous performance pipelines we run against OpenShift in prow CI can also be exercised against MicroShift.

MicroShift has no in-cluster Prometheus and no machine-config / cluster-version / infrastructure CRs, so the workload previously failed at two points: (1) the PROMETHEUS_URL guard in run.sh rejected the run, and (2) utils/index.sh::index_task() called oc helpers that assume OpenShift APIs are present. This PR adapts both code paths:

  • utils/index.sh adds a MicroShift branch that reads the microshift-version ConfigMap, node labels, and basic Kubernetes resources to synthesize the same perf_scale_ci metadata fields index_task() writes for OpenShift (ocpVersion, releaseStream, platform, clusterType, node counts/types, networkType, ovnVersion, computeArch, controlPlaneArch).
  • run.sh replaces eval with an argv array (cmd=(...) + add_flag), which is also a hardening step regardless of platform — values containing shell metacharacters are now safely quoted.
  • env.sh keys LOCAL and METRICS defaults off PLATFORM. Default MicroShift runs go LOCAL=true / METRICS=false, so the existing PROMETHEUS_URL guard isn't hit when no Prometheus is configured. Existing PLATFORM=openshift behavior is unchanged.
  • README.md is refreshed alongside: new MicroShift section, updated env-vars table that includes the variables already in env.sh but missing from the docs, and corrected coverage tables for full-run.yaml and ossm.yaml.

Related Tickets & Documents

  • Related Jira: USHIFT-6964Add MicroShift support to e2e-benchmarking network-perf-v2 workload

Checklist before requesting a review

  • I have performed a self-review of my code.
  • If it is a core feature, I have added thorough tests.

Testing

System Under Test:

  • MicroShift 4.22.0~rc.2 on RHEL 9.8 Beta (Plow)
  • Kubernetes v1.35.3, kernel 5.14.0-687.5.1.el9_8.x86_64
  • Single-node bare metal (masterNodesType: rhde)
  • k8s-netperf v0.1.42 (driver: netperf)

Steps:

  1. cd workloads/network-perf-v2
  2. export PLATFORM=microshift WORKLOAD=full-run.yaml ES_SERVER=<url> NETPERF_VERSION=v0.1.42
  3. ./run.sh

Verification:

Run UUID 3ca0e34b-fbe2-4d4c-96a5-688fb648ee30. Queried Elasticsearch k8s-netperf index after the run:

  • 29/29 documents indexed (matches created=29 from k8s-netperf log)
  • Coverage matrix complete: TCP_STREAM×12, UDP_STREAM×12, TCP_RR×3, TCP_CRR×2 across message sizes 64/1024/4096/8192
  • MicroShift metadata populated uniformly on all 29 docs:
    • metadata.distribution=microshift
    • metadata.microshift=true
    • metadata.microshiftVersion=4.22.0~rc.2
    • metadata.microshiftMajorVersion=4.22
    • metadata.k8sVersion=v1.35.3
    • metadata.kernel=5.14.0-687.5.1.el9_8.x86_64
    • metadata.masterNodesType=rhde
    • metadata.totalNodes=1
  • Data sanity: no zero/negative throughput or latency; all measured throughputs fall inside their reported confidence:[lo,hi] interval (0 violations across 29 docs).
  • Throughput shape matches loopback expectations on single-node netperf (TCP_STREAM 1.5–28 Gb/s, UDP_STREAM 0.26–22 Gb/s, TCP_RR ~9 µs latency, TCP_CRR ~10× slower than RR — all consistent with expected behavior).

Summary by CodeRabbit

  • New Features

    • Added MicroShift support for network performance testing with platform-aware defaults and validations (PLATFORM, LOCAL, METRICS, NETPERF_VERSION bump).
    • Enforced MicroShift-specific run constraints (LOCAL/METRICS/PROMETHEUS checks) and safer CLI construction/execution with sensitive-argument redaction.
  • Documentation

    • README updated with MicroShift guidance, revised workload examples, matrices, environment variable table, and collection instructions.

Review Change Stack

@openshift-ci openshift-ci Bot requested review from mukrishn and venkataanil May 16, 2026 13:38
@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented May 16, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign chentex for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 16, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: b310dd5a-7ab7-4b81-a6b3-299030210f6e

📥 Commits

Reviewing files that changed from the base of the PR and between 9184587 and 0f7cdaa.

📒 Files selected for processing (4)
  • utils/index.sh
  • workloads/network-perf-v2/README.md
  • workloads/network-perf-v2/env.sh
  • workloads/network-perf-v2/run.sh
🚧 Files skipped from review as they are similar to previous changes (3)
  • utils/index.sh
  • workloads/network-perf-v2/env.sh
  • workloads/network-perf-v2/run.sh

📝 Walkthrough

Walkthrough

Adds PLATFORM-aware env defaults and validation, refactors k8s-netperf to array-based execution, implements MicroShift-specific cluster discovery and early exit in utils/index.sh, and updates network-perf v2 documentation.

Changes

MicroShift Platform Support

Layer / File(s) Summary
Platform configuration defaults
workloads/network-perf-v2/env.sh
Introduces PLATFORM (default openshift) and conditionally sets LOCAL/METRICS (LOCAL=true & METRICS=false when PLATFORM=microshift; otherwise LOCAL=false & METRICS=true). Also updates NETPERF_VERSION and preserves PROMETHEUS_URL export.
Network-perf v2 documentation
workloads/network-perf-v2/README.md
Rewrites intro and examples, updates benchmark/result tables, adds a MicroShift section describing LOCAL/METRICS behavior and external metrics collection, and refreshes the Environment Variables table.
Run script validation and command refactor
workloads/network-perf-v2/run.sh
Enforces MicroShift constraints (LOCAL=true required; METRICS=true requires PROMETHEUS_URL), refactors k8s-netperf invocation to array-based cmd with add_flag/print_command, skips infra-label removal for LOCAL MicroShift runs, conditions --all on LOCAL, tolerates label-cleanup failures, and passes PLATFORM to utils/index.sh.
MicroShift cluster discovery
utils/index.sh
setup() gains a PLATFORM=microshift branch that derives cluster name/version/stream (from microshift-version ConfigMap or oc version), optionally discovers OVN controller version, computes node role counts/types and architectures using node labels/taints, and initializes OCP/IPsec/FIPS/encryption/virt/publish-related fields to MicroShift-safe defaults, then returns early.
Discovery early exit guard
utils/index.sh
After setup(), a PLATFORM=microshift guard runs index_tasks and exits early, bypassing subsequent OpenShift-specific discovery calls and the normal indexing sequence.

Sequence Diagram(s)

sequenceDiagram
  participant Runner as Network-perf Runner
  participant RunSh as workloads/run.sh
  participant Index as utils/index.sh
  participant K8s as Kubernetes API
  Runner->>RunSh: invoke workload (with PLATFORM)
  RunSh->>Index: call index.sh (env includes PLATFORM=microshift)
  Index->>K8s: read microshift-version ConfigMap / node info / pods
  K8s-->>Index: return cluster/version/labels
  Index->>Index: set MicroShift defaults and run index_tasks, exit
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Poem

🐰 I hop in fields of MicroShift light,
Defaults set gentle, commands built tight,
Labels left be where local tests play,
Discovery swift — index leads the way,
A cheerful rabbit nods at the new day 🌿

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically identifies the main change: adding MicroShift support to network-perf-v2 workload.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@sjug sjug force-pushed the netperf-microshift branch from 3cd0f38 to 2b70b40 Compare May 16, 2026 13:41
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@workloads/network-perf-v2/run.sh`:
- Line 46: The command that runs the netperf binary uses a hardcoded path
"./k8s-netperf" which breaks when NETPERF_FILENAME is overridden; update the cmd
construction (the cmd array where TEST_TIMEOUT is used) to reference the
NETPERF_FILENAME variable instead of the hardcoded name so the script executes
the validated/downloaded file (preserving the timeout usage via TEST_TIMEOUT and
keeping the same array form).
- Around line 57-69: The print_command function currently only redacts
"--search=*" but logs other sensitive flags like "--prom=*"; update the case in
print_command (iterate over "${cmd[@]}") to also match and replace "--prom=*"
(e.g. add a pattern branch like --prom=*) so redacted_cmd receives
"--prom=<redacted>" for any prom URL/value, then continue printing redacted_cmd
as before; reference the print_command function and the cmd array and the
"--search" handling when adding the new "--prom" redaction branch.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: e8cd15e4-f50a-411a-b653-1e6420f82e6e

📥 Commits

Reviewing files that changed from the base of the PR and between 6f8696f and 3cd0f38.

📒 Files selected for processing (3)
  • utils/index.sh
  • workloads/network-perf-v2/env.sh
  • workloads/network-perf-v2/run.sh

Comment thread workloads/network-perf-v2/run.sh Outdated
Comment thread workloads/network-perf-v2/run.sh
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@utils/index.sh`:
- Around line 84-89: The export of RELEASE_STREAM currently runs the
substitution inline (export RELEASE_STREAM=$(...)), which masks failures under
set -e; change both occurrences so you first compute the value into a variable
(e.g., release_stream_TMP or RELEASE_STREAM_UNEXPORTED) using the jq/sed command
(the same expressions used now), check or let set -e catch failures, then export
the computed variable with a separate export
RELEASE_STREAM="$release_stream_TMP" assignment; update the branches that set
cluster_version and RELEASE_STREAM (the block using mscm=$(kubectl ...) and the
else branch using oc version and sed) to follow this two-step assign-then-export
pattern.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: ba3d3c73-02a2-4ad4-b8d6-e4acc5cfdc64

📥 Commits

Reviewing files that changed from the base of the PR and between 3cd0f38 and 2b70b40.

📒 Files selected for processing (3)
  • utils/index.sh
  • workloads/network-perf-v2/env.sh
  • workloads/network-perf-v2/run.sh
🚧 Files skipped from review as they are similar to previous changes (2)
  • workloads/network-perf-v2/env.sh
  • workloads/network-perf-v2/run.sh

Comment thread utils/index.sh Outdated
@sjug sjug force-pushed the netperf-microshift branch from 2b70b40 to 0ce7f99 Compare May 16, 2026 13:50
@sjug
Copy link
Copy Markdown
Collaborator Author

sjug commented May 16, 2026

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 16, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@sjug sjug force-pushed the netperf-microshift branch from 0ce7f99 to 9184587 Compare May 16, 2026 14:01
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@workloads/network-perf-v2/README.md`:
- Line 46: The "MicroShift" heading uses H3 (### MicroShift) and skips a heading
level; change it to H2 (## MicroShift) so the document hierarchy complies with
Markdown lint rule MD001. Locate the "MicroShift" heading in the README.md and
replace the leading "###" with "##" to restore correct nesting and maintain
consistency with surrounding H1/H2 headings.
- Around line 50-52: Remove the leading shell prompt from the fenced code block
so it no longer starts with "$"; locate the fenced block containing the command
"PLATFORM=microshift WORKLOAD=full-run.yaml ./run.sh" in README.md and edit it
to present the command without the "$" prefix (i.e., plain PLATFORM=...
./run.sh) to satisfy markdownlint MD014.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 63de666f-8a0a-4693-a47b-f3c15a1de7f4

📥 Commits

Reviewing files that changed from the base of the PR and between 0ce7f99 and 9184587.

📒 Files selected for processing (4)
  • utils/index.sh
  • workloads/network-perf-v2/README.md
  • workloads/network-perf-v2/env.sh
  • workloads/network-perf-v2/run.sh
🚧 Files skipped from review as they are similar to previous changes (2)
  • utils/index.sh
  • workloads/network-perf-v2/run.sh

Comment thread workloads/network-perf-v2/README.md Outdated
Comment thread workloads/network-perf-v2/README.md
- Skip OpenShift-only metadata helpers in utils/index.sh and synthesize
  the fields index_task() needs from Kubernetes resources, the
  microshift-version ConfigMap, and node labels.
- Drop eval in run.sh in favor of an argv array; safer handling of
  values containing shell metacharacters.
- env.sh: PLATFORM=microshift defaults LOCAL=true and METRICS=false so
  a default run does not trip the PROMETHEUS_URL guard.

Signed-off-by: Sebastian Jug <seb@stianj.ug>
@sjug sjug force-pushed the netperf-microshift branch from 9184587 to 0f7cdaa Compare May 16, 2026 17:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant