cmd: add flux admin system-scripts to list status and details of prolog, epilog, and housekeeping configuration#7640
Open
grondo wants to merge 6 commits into
Open
Conversation
Problem: Flux's system script configuration (prolog, epilog, and housekeeping) is complex and difficult for admins to understand. Scripts can be in multiple directories, may use legacy single-file format, and configuration spans multiple areas. Admins need a way to see what scripts will actually be executed. Add `flux admin system-scripts` command that shows: - Configuration status (enabled/disabled, execution mode, timeouts) - Script discovery from system and site directories - Validation of script executability - Support for legacy single-file format The command is concise by default, showing only configured systems. Use `-v/--verbose` to see all discovered scripts even when not configured. Color output (via `--color`) helps quickly identify issues like non-executable scripts. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Problem: There is no test coverage for the new flux admin system-scripts command. Without tests, regressions could be introduced and the command's behavior is not validated. Add comprehensive test coverage for flux admin system-scripts, including: - Basic command functionality and help output - Default compact output vs verbose mode - Color option handling (--color=always/never/auto, NO_COLOR env var) - Script discovery and display from filesystem - Executable vs non-executable script detection - Legacy single-file format support - Live configuration testing with flux config load - Prolog/epilog/housekeeping enabled states - Configuration parameters (per-rank, timeout, release-after) - Handling of missing directories and edge cases - Output format and width validation The test uses the sharness framework and runs under test_under_flux to verify behavior with a running instance. The test is added to t/Makefile.am so it runs as part of `make check`. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Problem: There's no manpage for the flux-admin(1) command, but the recently added system-scripts subcommand needs documentation. Add a flux-admin(1) command document both `cleanup-push` and `system-scripts`.
Problem: The admin guide does not mention the new `flux admin system-scripts` command for verifying system script configuration. Add a "Verifying Script Configuration" section to the admin guide that explains how to use `flux admin system-scripts` to view and verify prolog/epilog/housekeeping configuration. Include example output and explain what the command displays, particularly clarifying that the per-rank setting controls where scripts execute (all nodes vs rank 0), not which scripts execute. Co-Authored-By: Claude Sonnet 4 <noreply@anthropic.com>
Problem: The new `flux admin system-scripts` subcommand has no bash completions. Add completions for the system-scripts subcommand and its options (-v, --verbose, --color=). Co-Authored-By: Claude Sonnet 4 <noreply@anthropic.com>
b1c0fd3 to
03896bf
Compare
Problem: The flux admin system-scripts command fails on el8 builders with ASCII encoding errors when trying to print Unicode checkmarks (✓ and ✗). Reopen stdout with UTF-8 encoding at the start of main(), following the pattern used in other Flux commands. This allows Unicode characters to be printed correctly even when the default system encoding is ASCII. Co-Authored-By: Claude Sonnet 4 <noreply@anthropic.com>
03896bf to
67c02ec
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #7640 +/- ##
==========================================
+ Coverage 83.96% 84.00% +0.03%
==========================================
Files 576 576
Lines 96985 97166 +181
==========================================
+ Hits 81435 81624 +189
+ Misses 15550 15542 -8
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
It was brought up in this week's meeting that a command to print what is going to run for prolog, epilog, and housekeeping would be very useful. While working on new prolog/housekeeping scripts for use with flux-pam, I came to heartily agree.
This PR introduces
flux admin system-scripts, which prints the configuration status of prolog, epilog, and housekeeping along with what scripts will actually be run. For example on corona:The script handles the unfortunately diverse array of possible conditions for configuration of these scripts, including but not limited to:
flux-imp run {prolog,epilog,housekeeping}