Skip to content

test#5

Closed
youngtaekiim wants to merge 60 commits into
resourcemanagerfrom
main
Closed

test#5
youngtaekiim wants to merge 60 commits into
resourcemanagerfrom
main

Conversation

@youngtaekiim
Copy link
Copy Markdown
Owner

No description provided.

yeohyeon-i and others added 30 commits September 29, 2025 17:20
Co-authored-by: eunhyeYu <121590845+eunhyeYu@users.noreply.github.com>
Co-authored-by: eunhyeYu <121590845+eunhyeYu@users.noreply.github.com>
….lock change

Co-authored-by: eunhyeYu <121590845+eunhyeYu@users.noreply.github.com>
Co-authored-by: eunhyeYu <121590845+eunhyeYu@users.noreply.github.com>
Pirictl - yaml command related modifications
- Change enum variants from Get to Describe across all commands
- Rename functions: get_* to describe_*
- Update function comments and documentation
- Update README.md with new command syntax
- Align CLI with kubectl-style conventions
refactor(settingscli): rename 'get' command to 'describe'
- 1.NodeAgent_DesiredState_Storage.md
- 2.NodeAgent_Reconciliation_Loop.md
- 3.NodeAgent_Liveness_Probe.md
- 4.NodeAgent_Restart_Policy.md
yeohyeon-i and others added 29 commits March 12, 2026 10:44
- Change enum variants from List to Get across all commands
- Rename functions: list_* to get_*
- Update function comments and documentation
- Update README.md with new command syntax
- Keep user-facing messages unchanged
refactor(settingscli): rename 'list' command to 'get'
Feature: NodeAgent Self-Healing Implementation
This commit includes three major refactoring changes:

1. Change command order from resource-action to action-resource pattern
   - Old: settingscli board get → New: settingscli get board
   - Old: settingscli node describe <id> → New: settingscli describe node <id>
   - Old: settingscli container raw → New: settingscli raw container
   - Follows kubectl-style conventions for better UX

2. Add new 'top' command for live system monitoring
   - Create dedicated top.rs module with TopResource enum
   - Move formatted metrics display from metrics.rs to top.rs
   - New command: settingscli top metrics (replaces get metrics)
   - Keep 'raw metrics' for JSON output only
   - Separates monitoring from data retrieval operations

3. Change 'get' command resources to plural form
   - get board → get boards
   - get node → get nodes
   - get soc → get socs
   - get container → get containers
   - Aligns with REST API naming conventions (/api/v1/boards, etc.)
   - describe/raw commands remain singular (describe board, raw board)

Changes:
- Add src/tools/settingscli/src/commands/top.rs (new module)
- Refactor src/tools/settingscli/src/main.rs (command structure)
- Update src/tools/settingscli/src/commands/metrics.rs (remove describe)
- Update src/tools/settingscli/src/commands/mod.rs (add top module)
- Update src/tools/settingscli/README.md (full documentation update)

Breaking Changes:
- All commands now use action-resource order
- 'get metrics' removed (use 'top metrics' instead)
- 'get' commands require plural resource names (boards/nodes/socs/containers)
refactor(settingscli): restructure command syntax for consistency
…ting utilities

1. Redesign describe command outputs to kubectl-style format
   - Board: Aggregated resources, network/disk I/O, last updated timestamp
   - Node: System info, capacity, current usage with percentage display
   - SoC: Status, aggregated resources, node list with usage hints
   - Container: State-aware display for running vs terminated containers
   - Human-readable units: KB/MB/GB for I/O, Mi for memory
   - Relative timestamps: 'X hours ago' format for better UX

2. Apply kubectl-style column alignment and visual improvements
   - Primary fields (Name, Status, Last Updated): 24-char fixed width
   - Nested fields (cpu, memory, OS Image, etc): 22-char fixed width
   - Remove separator lines (=====) for cleaner output
   - Remove unnecessary newlines between sections
   - Simplify field labels: remove 'Total' prefixes
   - Terminology updates: 'Current Usage' → 'Allocatable' (kubectl standard)
   - Update hint messages: 'Hint:' → 'For more details:'
   - Consistent alignment across all describe commands (node, board, soc, container)

3. Redesign 'top metrics' command to kubectl-style table format
   - Replace verbose nested output with clean tabular display
   - Column layout: LEVEL, NAME/ID, CPU, CPU%, MEMORY, MEM%, GPU, ARCH, NET(RX/TX), DISK(R/W)
   - Fetch data from 3 API endpoints: /api/v1/boards, /api/v1/socs, /api/v1/nodes
   - Display all resource levels (Board, SoC, Node) in unified table
   - Compact column widths (6-18 chars) for efficient terminal display
   - Memory format: 'used / total' with Mi suffix
   - Network/Disk format: 'RX/TX' and 'Read/Write' with human-readable units

4. Extract duplicate formatting functions to common format module
   - Create src/commands/format.rs with 9 utility functions
   - Remove ~274 lines of duplicate code from board/node/soc/container modules
   - Functions: format_bytes, format_memory, format_duration, format_duration_ago,
     capitalize, format_timestamp, calculate_uptime, calculate_runtime, extract_network_value
   - Add 5 comprehensive unit tests for formatters
   - Follows DRY principle for improved maintainability

5. Code quality improvements
   - Replace wildcard imports with explicit function imports (container.rs)
   - Fix clippy warnings: remove empty format string literals
   - Remove unnecessary empty string parameters in println! statements
   - Improve code readability and maintainability

6. Add chrono v0.4 dependency for timestamp parsing and formatting
   - ISO 8601 timestamp conversion to human-readable format
   - Timezone-aware datetime operations
   - No dependency conflicts

Changes preserve data integrity while improving readability following kubectl design patterns.
All existing functionality verified. No breaking changes.
refactor(settingscli): improve describe outputs and centralize format…
- Simplify get commands table output (remove title and separators)
- Add print_table_header() helper function to reduce code duplication
- Refactor board/node/soc/container get commands to use helper
- Simplify yaml apply/withdraw output (remove bold titles and separators)
- Fix Node metric field names in top.rs (network_rx->rx_bytes, disk_read->read_bytes)
- All outputs now follow consistent kubectl-style formatting
refactor(settingscli): improve output formatting to kubectl-style
- Rename project folder: src/tools/settingscli → src/tools/pirictl
- Update package name in Cargo.toml: settingscli → pirictl
- Update all code references and imports to use 'pirictl'
- Update command name, help messages, and hints to 'pirictl'
- Change container ID display from 12-char short ID to full 64-char ID
  - Fixes ETCD key lookup issue in describe container command

All 17 commands tested and verified.
refactor: rename settingscli to pirictl
- Add 'pirictl apply -f <file>' command (replaces 'yaml apply')
- Add 'pirictl delete -f <file>' command (replaces 'yaml withdraw')
- Remove legacy 'yaml' subcommand completely
- Align with kubectl conventions for better UX

Usage:
  pirictl apply -f examples/resources/helloworld.yaml
  pirictl delete -f examples/resources/helloworld.yaml
feat: add kubectl-style apply/delete commands
…ling

Nodeagent new feature : model(pod) Desired State Management, Liveness Probe, and Automatic Container Recovery
Implementation handling Schedule information for Timpani
fix formatting fail issue during CI workflow
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.

6 participants