feat(submit): display cluv submit first commands and results in rich tables#57
feat(submit): display cluv submit first commands and results in rich tables#57Copilot wants to merge 4 commits into
cluv submit first commands and results in rich tables#57Conversation
- Add _build_submission_table() helper that renders a ROUNDED rich.Table with Cluster / Job ID columns (green job IDs, red error messages) - Replace the plain console.print loop in submit_first() with the table - Move the sacct watch hint to after the table (and after cancel_all_jobs) - Use zip(..., strict=True) to catch length mismatches - Add TestBuildSubmissionTable unit tests that use rich Console rendering to avoid brittle internal-API access Agent-Logs-Url: https://github.com/mila-iqia/cluv/sessions/bcbbed1d-5595-4ef3-9164-37d2628488d7 Co-authored-by: lebrice <13387299+lebrice@users.noreply.github.com>
cluv submit first results in a rich table
|
@copilot Here's what the end of the output looks like now: The alignment of the tables is slightly wonky when there are error messages coming form sbatch. Perhaps that could be fixed with Also, the commands used for each cluster still show up as one big blob of text. Can we use a table for that as well? |
- Add _build_commands_table() helper: pre-compute all sbatch commands before the parallel gather and display them in a ROUNDED rich.Table with overflow="fold" so long commands wrap cleanly within the column. The gather now passes display=False to avoid the interleaved command blob in the console output. - sbatch() gains a display kwarg (default True) so the single-cluster path is unchanged. - _build_submission_table: drop the redundant "error: " prefix on sbatch stderr rows — sbatch already includes "sbatch: error:" / "SBATCH ERROR:" itself, producing an ugly double-error line. - Move StringIO / Console imports to module level in test_submit.py. Agent-Logs-Url: https://github.com/mila-iqia/cluv/sessions/d363751b-2ea8-4638-a12c-77d466042183 Co-authored-by: lebrice <13387299+lebrice@users.noreply.github.com>
... Both issues addressed in d9b0db5: Commands table — sbatch commands are now pre-computed before the parallel gather and shown in a Error alignment — the doubled Here's what the output now looks like: |
cluv submit first results in a rich tablecluv submit first commands and results in rich tables
|
@copilot Fix the pre-commit issues, please and thank you |
Agent-Logs-Url: https://github.com/mila-iqia/cluv/sessions/8bf36774-81f0-4019-b030-e2aa2619831f Co-authored-by: lebrice <13387299+lebrice@users.noreply.github.com>
cluv submit firstprinted submission results and the watch-progress hint as flatconsole.printlines, making it hard to scan across multiple clusters. The sbatch commands also appeared as an interleaved blob of text.Changes
_build_commands_table()— new helper that renders arich.Table(ROUNDED box) with Cluster and Command columns (overflow="fold"so long commands wrap cleanly within the cell); displayed before submission so the user can see exactly what will run on each cluster_build_submission_table()— new helper that renders arich.Table(ROUNDED box) with Cluster and Job ID / Status columns; job IDs in green, errors (both non-zerosbatchexit and remote exceptions) in red;sbatch's own error prefix is preserved without duplicationsbatch()— gains adisplaykeyword argument (defaultTrue) sosubmit_firstcan passdisplay=False, preventing the per-cluster command log from appearing as an interleaved blob during the parallel gathersubmit_first()— pre-computes all sbatch commands before the gather, prints the commands table, then runs the gather withdisplay=False; replaces the manual result loop with the submission table; moves thesacctwatch-progress hint to aftercancel_all_jobs()so it always appears lastTestBuildSubmissionTableandTestBuildCommandsTablecover success,sbatchfailure, remote exception, and rendered output content (viarich.Console → StringIO)Example output after the change: