Skip to content

feat(vcctl): inspect HyperNode trees and member resources - #6173

Open
kevin-wangzefeng wants to merge 1 commit into
volcano-sh:masterfrom
kevin-wangzefeng:hypernode-tree-cli
Open

kevin-wangzefeng wants to merge 1 commit into
volcano-sh:masterfrom
kevin-wangzefeng:hypernode-tree-cli

Conversation

@kevin-wangzefeng

Copy link
Copy Markdown
Member

What type of PR is this?

Feature.

What this PR does / why we need it:

Add a read-only vcctl hypernode tree command to inspect the actual HyperNode topology without manually following references and resolving selectors.

The command:

  • Reuses the scheduler's topology parser and shared member-selection helper to construct independent trees with direct Kubernetes Node leaves.
  • Shows Node readiness and cordon state, with deduplicated Node and resource summaries for each HyperNode.
  • Displays extended resources as Allocatable/Capacity, separately from DRA advertised device counts by driver.
  • Provides deterministic ordering and automatic or explicit ASCII/Unicode tree rendering.
  • Reports invalid topology, inventory, and API access errors instead of silently displaying incomplete results.

DRA inventory is enabled by default and initially supports node-local ResourceSlices using spec.nodeName. --dra=false skips ResourceSlice reads.

The command does not query Pods or ResourceClaims, estimate free devices, modify cluster resources, or change scheduling behavior. Tests and user documentation are included.

Which issue(s) this PR fixes:

None.

Special notes for your reviewer:

This PR implements client-side CLI inspection only. Public topology helper extraction, the HyperNodeTopology API/controller, and scheduler adoption are separate work. It does not depend on merging the proposal PR.

The displayed topology is reconstructed from API reads, not retrieved from scheduler memory. HyperNode, Node, and ResourceSlice reads are not an atomic cross-resource snapshot.

AI assistance: Kevin led the feature design and key decisions. Copilot implemented and tested the command under Kevin's guidance. Code has been reviewed by Kevin.

Validation:

  • go test -count=1 -race ./cmd/cli ./pkg/cli/hypernode ./pkg/scheduler/api ./pkg/util/hypernode — passed.
  • make vcctl — passed.
  • Full repository and end-to-end suites were not run.

Does this PR introduce a user-facing change?

Added `vcctl hypernode tree` to display HyperNode trees with Kubernetes Node leaves, Node status, and resource summaries. DRA inventory is enabled by default and requires the resource.k8s.io/v1 API and cluster-wide ResourceSlice list permission; use --dra=false to omit it.

Resolve the actual forest with the scheduler parser and show Kubernetes Node leaves, readiness, cordon state, and deduplicated resource totals. Keep extended-resource Allocatable/Capacity separate from advertised node-local DRA inventory, with explicit diagnostics and read-only API access.

Implements the CLI inspection work item; public topology helper extraction remains separate.

Signed-off-by: Kevin Wang <kevinwzf0126@gmail.com>
Copilot AI balanced review requested due to automatic review settings October 27, 2026 17:01
@volcano-sh-bot

Copy link
Copy Markdown
Contributor

[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 ask for approval from kevin-wangzefeng. For more information see the Kubernetes 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

@volcano-sh-bot volcano-sh-bot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Oct 27, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No blocking issues were identified in the read-only implementation, and focused tests cover its principal behavior and failure paths.

No open issues 🎉

What changed in this PR

Adds the read-only vcctl hypernode tree command to inspect HyperNode topology using the scheduler’s existing parser, without changing scheduling behavior.

Changes:

  • Displays deterministic trees with Node readiness, cordon state, and deduplicated extended-resource totals.
  • Includes optional DRA advertised-device counts, with explicit topology, inventory, and API error handling.
  • Adds command integration, focused tests, and documentation covering permissions and limitations.
File Description
pkg/​cli/​hypernode/​tree.go Resolves, validates, aggregates, and renders HyperNode trees.
pkg/​cli/​hypernode/​tree_test.go Tests topology resolution, resource totals, rendering, and validation.
pkg/​cli/​hypernode/​options.go Loads configuration and reads cluster resources.
pkg/​cli/​hypernode/​options_test.go Tests API reads, DRA inventory, cancellation, and errors.
pkg/​cli/​hypernode/​dra.go Validates DRA pools and counts distinct advertised devices.
docs/​user-guide/​how_to_use_network_topology_aware_scheduling.md Documents usage, output semantics, permissions, and limitations.
cmd/​cli/​vcctl.go Registers the HyperNode command.
cmd/​cli/​hypernode.go Defines the tree subcommand and its flags.
cmd/​cli/​hypernode_test.go Tests argument validation and DRA opt-out behavior.

Review effort: Balanced

@hwdef

hwdef commented Oct 28, 2026

Copy link
Copy Markdown
Member

please fix the CI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants