RunsOn CLI
The RunsOn CLI (roc
) is a command line tool designed to help you manage and troubleshoot your RunsOn installation. It provides essential debugging and management capabilities for your self-hosted GitHub Actions runners.
Note: the CLI only works with RunsOn >= v2.6.3.
Installation
Section titled “Installation”You can download the binaries for your platform (Linux, macOS) from the Releases ↗ page.
macOS (ARM64)
Section titled “macOS (ARM64)”curl -Lo ./roc https://github.com/runs-on/cli/releases/download/v0.1.6/roc_0.1.6_darwin_arm64chmod a+x ./roc./roc --help
Linux (AMD64)
Section titled “Linux (AMD64)”curl -Lo ./roc https://github.com/runs-on/cli/releases/download/v0.1.6/roc_0.1.6_linux_amd64chmod a+x ./roc./roc --help
Core Commands
Section titled “Core Commands”roc connect
Section titled “roc connect”Connect to the instance running a specific job via SSM, by just pasting the GitHub Actions job URL or ID.
This feature requires the AWS Session Manager plugin ↗ to be installed on your local machine.
# Connect using job ID or URLroc connect 12345678roc connect https://github.com/owner/repo/actions/runs/123/job/456
# Connect with debug outputroc connect 12345678 --debug
# Wait for instance ID if not foundroc connect 12345678 --watch
Flags:
--debug
: Enable debug output--watch
: Wait for instance ID if not found
Global Flags:
--stack string
: CloudFormation stack name (default “runs-on”)
roc logs
Section titled “roc logs”Fetch RunsOn server and instance logs for a specific job ID or URL. Use the --include
flag to specify additional log types.
# Fetch logs for a specific job (default behavior)roc logs 12345678roc logs https://github.com/owner/repo/actions/runs/123/job/456
# Fetch all application logs for a run (all jobs in the run)roc logs https://github.com/owner/repo/actions/runs/123/job/456 --include=run --watch
# Fetch EC2 instance console logsroc logs 34661958899 --include=console
# Fetch both run logs and console logsroc logs 34661958899 --include=run,console --watch
# Watch for new logs with custom intervalroc logs 12345678 --watch 2s --since 30m
Flags:
-d, --debug
: Enable debug output-f, --format string
: Output format: long (default) or short--include strings
: Include additional log types: ‘run’ (all logs from entire run), ‘console’ (EC2 instance console logs)--no-color
: Disable color output-s, --since string
: Show logs since duration (e.g. 30m, 2h) (default “2h”)-w, --watch string[="5s"]
: Watch for new logs with optional interval (e.g. —watch 2s)
roc interrupt
Section titled “roc interrupt”Trigger a spot interruption on the instance running a specific job, simulating a spot instance interruption for testing purposes.
This command uses AWS Fault Injection Simulator (FIS) to send a spot interruption notification to the running instance.
# Trigger spot interruptionroc interrupt https://github.com/owner/repo/actions/runs/123/job/456
# Wait for instance if job hasn't started yetroc interrupt 34661958899 --wait
# Custom delay before interruption (default is 5 seconds)roc interrupt 34661958899 --delay 30s
Requirements:
- The target instance must be a running spot instance
- AWS FIS service must be available in your region
How it works:
- Validates the instance is a running spot instance
- Creates an IAM role for FIS if it doesn’t exist
- Creates and starts a FIS experiment to send the interruption
- Monitors the experiment progress
- Automatically cleans up the experiment template when complete
Flags:
--debug
: Enable debug output--delay duration
: Delay before interruption (e.g., 2m, 30s) (default 5s)-w, --wait
: Wait for instance ID if not found
Stack Management
Section titled “Stack Management”roc stack doctor
Section titled “roc stack doctor”Diagnose RunsOn stack health and export troubleshooting information.
This command performs comprehensive health checks on your RunsOn CloudFormation stack:
- Verifies CloudFormation stack status
- Checks AppRunner service health and version
- Tests endpoint accessibility
- Validates service configuration
- Fetches application logs
Results are exported as a timestamped ZIP file containing checks.json and logs.
roc stack doctor
# Fetch logs for last 2 hoursroc stack doctor --since 2h
Flags:
--since string
: Fetch logs since duration (e.g. 30m, 2h, 24h) (default “24h”)
roc stack logs
Section titled “roc stack logs”Stream all RunsOn application logs from CloudWatch log streams.
This command streams all application logs from the RunsOn service, not filtered by specific jobs. Use this to monitor overall service activity and troubleshoot system-wide issues.
# Stream last 2 hours of application logs (default)roc stack logs
# Stream last 24 hours of logsroc stack logs --since 24h
# Stream logs with watch mode (refreshes every 5 seconds)roc stack logs --watch
# Stream logs with custom watch intervalroc stack logs --watch 10s
# Stream logs in short format without colorroc stack logs --format short --no-color
Flags:
-d, --debug
: Enable debug output-f, --format string
: Output format: long (default) or short--no-color
: Disable color output-s, --since string
: Show logs since duration (e.g. 30m, 2h) (default “2h”)-w, --watch string[="5s"]
: Watch for new logs with optional interval (e.g. —watch 2s)
Use Cases
Section titled “Use Cases”Debugging Job Failures
Section titled “Debugging Job Failures”When a GitHub Actions job fails on your RunsOn infrastructure:
- Get logs: Use
roc logs JOB_ID
to fetch detailed logs - Connect to instance: Use
roc connect JOB_ID
to SSH into the runner - Check stack health: Run
roc stack doctor
to ensure infrastructure is healthy - Test interruption handling: Use
roc interrupt JOB_ID
to simulate spot interruptions
Real-time Monitoring
Section titled “Real-time Monitoring”# Monitor logs in real-time for active jobsroc logs JOB_ID --watch
# Monitor all application logsroc stack logs --watch
Health Checks
Section titled “Health Checks”# Regular stack health verificationroc stack doctor
# Stream application logs for monitoringroc stack logs --since 1h
Troubleshooting
Section titled “Troubleshooting”Connection Issues
Section titled “Connection Issues”If roc connect
fails:
- Ensure AWS Session Manager plugin is installed
- Verify your AWS credentials have appropriate permissions to access the RunsOn stack
- Check that you are targeting the correct stack (
--stack
flag) and region (AWS profile orAWS_REGION
environment variable) - Use
--debug
flag for detailed error information
Log Access Issues
Section titled “Log Access Issues”If roc logs
returns no results:
- Verify the job ID or URL is correct
- Check your AWS credentials and permissions
- Check that you are targeting the correct stack (
--stack
flag) and region (AWS profile orAWS_REGION
environment variable) - Try adjusting the
--since
timeframe
Interruption Testing Issues
Section titled “Interruption Testing Issues”If roc interrupt
fails:
- Ensure the target instance is a running spot instance
- Verify AWS FIS service is available in your region
- Check that your AWS credentials have appropriate FIS permissions
- Use
--debug
flag for detailed error information
Support
Section titled “Support”For issues with the RunsOn CLI:
- Open an issue on GitHub ↗
- Contact support at [email protected]
- Include output from
roc stack doctor
when reporting problems
License
Section titled “License”The RunsOn CLI is open source software licensed under the MIT License.