ssh-ray-cluster
Skill647 starsChanged 59 days agoApache-2.0View on GitHub
3-step debug loop for remote Ray cluster — submit task via SSH, check
- Deletes or force-pushes
We split this skill into the rules it gives an agent
9 rules. About 0 are common, 2 are distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 13
Read SSH credentials and RELAX_PROJECT_ROOT from auto-memory (reference_ray_cluster_ssh.md).
- Very specific: line 17
Use paramiko to SSH into the cluster, cd to the project root, and execute the user's command.
- Very specific: line 36
Key rule: All project-relative commands (bash scripts/..., tail log/...) MUST have cd $RELAX_PROJECT_ROOT && in the same command string.
- Very specific: line 56
Use the Read tool on the log file path.
- Distinctive: line 58
Check frequency: Wait at least 1 minute between log checks.
- Distinctive: line 63
Fix the code: if the root cause is clear — edit the source file directly.
- Very specific: line 64
Add debug logging: if the root cause is unclear — add targeted logger.info/logger.error calls to narrow down the issue.
- Very specific: line 73
Only ray serve shutdown -y is allowed pre-submit (when user requests a relaunch).
- Very specific: line 75
Read-only inspection (ray status, ray job list, ray job logs, nvidia-smi, tail, grep, ps) is always safe.
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
SSH Debug Loop
Three-step cycle: submit -> check logs -> analyze & fix -> repeat.
Prerequisites
Read SSH credentials and RELAX_PROJECT_ROOT from auto-memory (reference_ray_cluster_ssh.md). Ask the user if missing — never hard-code in this file.
Step 1: Submit Task via SSH
Use paramiko to SSH into the cluster, cd to the project root, and execute the user's command.
python3 -c "
import paramiko, shlex
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect(HOST, port=PORT, username=USER, password=PASS, timeout=10)
cmd = f'cd {shlex.quote(RELAX_PROJECT_ROOT)} && <USER_COMMAND>'
try:
stdin, stdout, stderr = ssh.exec_command(cmd, timeout=60)
print(stdout.read().decode())
err = stderr.read().decode()
if err: print('STDERR:', err)
except Exception: pass # long-running commands may timeout — that's OK
finally: ssh.close()
"Key rule: All project-relative commands (bash scripts/..., tail log/...) MUST have cd $RELAX_PROJECT_ROOT && in the same command string. Paramiko opens a fresh shell each call.
For backgrounded launches, verify separately:
pgrep -af 'ray-job.sh' | head
ray job list 2>&1 | grep RUNNING | headStep 2: Check Logs Locally
The log file is on a shared filesystem mounted locally. Read it directly:
# Find the latest log
ls -lt log/<model>-*.log | head -5
# Read the tail for errors
tail -200 log/<run-name>.logUse the Read tool on the log file path. Search for keywords: Error, Exception, Traceback, FAILED, RuntimeError, AssertionError.
Check frequency: Wait at least 1 minute between log checks. Don't poll more frequently — training jobs take minutes to hours, and frequent checks waste context.
Step 3: Analyze & Fix
- Identify the error from the log (traceback, error message, hang pattern).
- Fix the code if the root cause is clear — edit the source file directly.
- Add debug logging if the root cause is unclear — add targeted
logger.info/logger.errorcalls to narrow down the issue. - Go back to Step 1 — resubmit the task and repeat until resolved.
Safety Rules
NEVER execute these without explicit user request:
ray stop,bash scripts/tools/kill_for_ray.sh,pkill,ray job stoprm -rfon/tmp/ray/or session directories
Only ray serve shutdown -y is allowed pre-submit (when user requests a relaunch).
Read-only inspection (ray status, ray job list, ray job logs, nvidia-smi, tail, grep, ps) is always safe.
In this repository20 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- agentic-rolloutSkill
- code-reviewSkill
- create-training-scriptSkill
- creating-skillsSkill
- debug-hangSkill
- relax-dev-debugSkill
- doc-writerSkill
- git-commitSkill
- model-integrationSkill
- nemo-gym-recipe-integrationSkill
- opd-tuningSkill
- perf-doctorSkill
- redaccel-to-relaxSkill
- relax-github-ciSkill
- relax-github-workflowSkill
- sglang-upgradeSkill
- sync-githubSkill
- verl-to-relaxSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

