Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions .claude/skills/remote-gpu-testing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Remote GPU Testing for GitHub Actions

Local machine is macOS with no GPUs. To test GitHub Action workflows and GPU code, run them on remote machines via SSH.

## Machines

<!-- Add machines here, e.g.: -->
<!-- - **gpu-box**: `ssh user@10.0.0.1` -->
<!-- - **train-server**: `ssh -i ~/.ssh/key user@hostname.com` -->

## How to run remote commands

Never run GPU code locally. Always use this pattern:

1. **Set up a tmux session** on the remote machine (idempotent):
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using || true makes the command appear successful even when tmux fails for real reasons (e.g., tmux not installed, permission issues), which can mask problems and lead to confusing follow-on failures. Prefer an idempotent check that only suppresses the 'session already exists' case (e.g., tmux has-session ... || tmux new-session ...) so genuine failures still surface.

Copilot uses AI. Check for mistakes.
```bash
ssh host "tmux new-session -d -s work || true"
```

2. **Run commands** via send-keys, always tee to a log file:
```bash
ssh host "tmux send-keys -t work 'command 2>&1 | tee /tmp/jobname.log' Enter"
```

3. **Check output** by tailing the log file directly:
```bash
ssh host "tail -100 /tmp/jobname.log"
```

4. **Check if a command is still running**:
```bash
ssh host "pgrep -f command_name"
```

## Testing GitHub Actions locally on a remote GPU machine

To replicate what a GitHub Action workflow does on a remote GPU box:

1. **Push code to the remote machine**:
```bash
rsync -avz --exclude '.git' --exclude '__pycache__' ./ host:/home/user/kernelbot/
```

2. **Set up the environment** (mirrors the GH Action):
```bash
ssh host "tmux send-keys -t work 'cd /home/user/kernelbot && pip install -r requirements-dev.txt && pip install -e . 2>&1 | tee /tmp/setup.log' Enter"
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shell redirection/piping precedence here means 2>&1 | tee /tmp/setup.log applies only to the final pip install -e ., so output from pip install -r requirements-dev.txt will not be captured in /tmp/setup.log. If the intent is to log the entire setup sequence, group the commands so the redirection/pipe wraps both installs.

Suggested change
ssh host "tmux send-keys -t work 'cd /home/user/kernelbot && pip install -r requirements-dev.txt && pip install -e . 2>&1 | tee /tmp/setup.log' Enter"
ssh host "tmux send-keys -t work 'cd /home/user/kernelbot && (pip install -r requirements-dev.txt && pip install -e .) 2>&1 | tee /tmp/setup.log' Enter"

Copilot uses AI. Check for mistakes.
```

3. **Run the tests**:
```bash
ssh host "tmux send-keys -t work 'cd /home/user/kernelbot && pytest 2>&1 | tee /tmp/tests.log' Enter"
```

4. **Run GPU kernel submissions** (what the bot dispatches to GitHub Actions):
```bash
ssh host "tmux send-keys -t work 'cd /home/user/kernelbot && python src/kernelbot/main.py --debug 2>&1 | tee /tmp/bot.log' Enter"
```

## Rules

- Assume all remote commands are long-running.
- Always log output to a file with `tee`. Never rely on tmux scrollback.
- Use direct `ssh host "tail ..."` to read logs, not tmux capture-pane.
- For file transfers use `scp` or `rsync`.
- Multiple parallel jobs: use separate tmux windows (`tmux new-window -t work -n jobname`).
- Keep tmux sessions alive across interactions. Always `|| true` on session creation to avoid errors if it already exists.
- To run a command in a specific directory, include `cd` in the send-keys.
- After making local code changes, always `rsync` to the remote machine before re-running tests.
File renamed without changes.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ package-lock.json
reference-kernels/
yoyo.ini
.venv
.claude/
.claude/*
!.claude/skills/
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ Reuse existing patterns:

## Local Development

See `SKILLS/test_bot.md` for local testing setup instructions.
See `.claude/skills/test_bot.md` for local testing setup instructions.

## Architecture

Expand Down
Loading