Skip to content

Conversation

@Ryan-Rong-24
Copy link
Contributor

Add --no-tui flag for plain text output

Summary

Adds a --no-tui flag to skip the TUI interface and output results directly to stdout. Useful for CI/CD pipelines, scripting, and automated workflows. Also enables stdout/stderr logging from submission runs, which was previously ignored by the original implementation.

Motivation

  • TUI mode doesn't work well in CI/CD pipelines
  • Difficult to parse output programmatically
  • Cannot capture logs or stream results
  • May not work in remote/containerized environments
  • Stdout/stderr from submitted code was being received but never displayed

Changes

  1. Added --no-tui CLI flag to Cli and Submit command structs
  2. Created run_submit_plain() - 110+ line function for non-TUI submission flow
  3. Enhanced submit_solution() - added on_log callback parameter to:
    • Print status updates during submission
    • Extract and display stdout/stderr from results JSON (results[].runs.{mode}.run.stdout)
    • Log previously ignored output from code execution
  4. Updated routing logic - dispatches to appropriate function based on flag

Key Features

  • ✅ Full backward compatibility (default behavior unchanged)
  • Captures and displays stdout/stderr from submission runs - enables seeing print statements, errors, and debug output from submitted code
  • ✅ Progress logging to stderr, results to stdout (clean separation for parsing)
  • ✅ File output support via -o/--output
  • ✅ Proper error handling and validation

Usage

Basic usage - see stdout from your code

popcorn-cli submit --gpu A100 --leaderboard my-board --mode test --no-tui submission.py

Save and stream all output (stdout + stderr)

popcorn-cli submit --gpu A100 --leaderboard my-board --mode test --no-tui submission.py 2>&1 | tee log.txt

This PR unlocks visibility into execution output. The API response includes stdout/stderr from submission runs, but the original implementation ignored this data. Now users can:

  • See print statements from their submitted code
  • View error messages and stack traces
  • Debug issues with real-time output
  • Log all execution details for analysis

Testing

  • ✅ Default TUI mode (no regression)
  • ✅ Plain text mode with various submission modes
  • ✅ Stdout/stderr capture and display
  • ✅ Output to file
  • ✅ Error cases

Add option to skip the TUI interface and print results directly to stdout.
This is useful for CI/CD pipelines and scripting scenarios.
@S1ro1 S1ro1 merged commit 02c089d into gpu-mode:main Dec 6, 2025
2 of 3 checks passed
@S1ro1
Copy link
Member

S1ro1 commented Dec 6, 2025

Thank you!

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.

2 participants