Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
772a115
Share SSH monitoring connections and persist host retry backoff
sox8502 Oct 22, 2026
ee67264
Fix explicit reconnect, growing logs, and long SSH setup
sox8502 Oct 22, 2026
97df5cd
Require idle SSH monitors before dev-slot data cleanup
sox8502 Oct 22, 2026
d2ee43a
Merge remote-tracking branch 'origin/main' into daniel/or-558-shared-ssh
sox8502 Oct 22, 2026
39cb2e4
Show SSH connection and run monitoring diagnostics
sox8502 Oct 22, 2026
aca6872
Preserve quoted SSH known-hosts filename lists
sox8502 Oct 22, 2026
b06a279
Merge remote-tracking branch 'origin/main' into daniel/or-558-shared-ssh
sox8502 Oct 22, 2026
6d046a0
Merge remote-tracking branch 'origin/main' into daniel/or-558-shared-ssh
sox8502 Oct 22, 2026
18157f6
Include shared SSH log files in run artifact cleanup
sox8502 Oct 22, 2026
575f8fa
Support Python 3.6 remote SSH helpers
sox8502 Oct 22, 2026
74d4901
Merge remote-tracking branch 'origin/main' into daniel/or-558-shared-ssh
sox8502 Oct 22, 2026
cc13526
Finish Slurm runs despite unavailable logs
sox8502 Oct 22, 2026
55af17d
Validate SSH log chunks during concurrent rewrites
sox8502 Oct 22, 2026
778114b
Merge origin/main and preserve shared SSH monitoring compatibility
sox8502 Oct 23, 2026
6025952
Detect full-prefix log rewrites and isolate legacy SSH monitors
sox8502 Oct 23, 2026
1e6c37d
Preserve whitespace in interactive SSH credentials
sox8502 Oct 23, 2026
21906b7
Reuse verified log digests and ignore unrelated obsolete SSH routes
sox8502 Oct 23, 2026
ca8fb01
Merge latest main and rebuild the reviewed dashboard
sox8502 Oct 23, 2026
99e8a39
Keep pinned SSH connections stable across unrelated config edits
sox8502 Oct 23, 2026
5cfb903
Merge current main and migrate saved SSH connection bindings
sox8502 Oct 23, 2026
cde56e5
Merge current main and isolate Slurm status read failures
sox8502 Oct 23, 2026
13b0bdf
Merge current main and close SSH retry and Slurm completion gaps
sox8502 Oct 23, 2026
6bee71f
Stream large SSH command input through bounded upload frames
sox8502 Oct 23, 2026
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
Prev Previous commit
Next Next commit
Merge current main and close SSH retry and Slurm completion gaps
  • Loading branch information
sox8502 committed Oct 23, 2026
commit 13b0bdf56c231c016861a7de6d3c4b4861cc64b1
2 changes: 1 addition & 1 deletion SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ group below has a module (`orx skill <name>`) with the full flags and rules.
| `orx compute [--gpu <id>] [--count <n>] [--provider <name>]` / `orx compute --cpu` | List the GPU/CPU compute catalog. |
| `orx instance create <orgId> (--gpu <id> … \| --cpu <flavor> …)` | Spin up a standalone instance in an org; see `orx-instances`. |
| `orx exp status/run/cancel/wait/wake <localExpId>` | Inspect, run, cancel, wait on, or register a wake-up for a local experiment node. |
| `orx exp move/archive/unarchive <localExpId>` | Re-parent, hide, or restore experiment nodes; see `orx-experiment-tree`. |
| `orx exp move/archive/unarchive/delete <localExpId>` | Re-parent, hide, restore, or permanently delete experiment nodes; see `orx-experiment-tree`. |
| `orx exp desc <expId> [--set "<text>" \| --stdin]` | Read or overwrite the experiment's description. |
| `orx agent spawn "<task>" [--title "<t>"] [--stdin] [--no-wake]` | Delegate an independent task to a helper session; see `orx-agent-delegation`. |

Expand Down
2 changes: 2 additions & 0 deletions agent-skills/orx-compute/references/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ orx compute configure ssh --host lab --container research
orx compute configure ssh --host lab --clear container
orx compute configure ssh --host lab --remote-root /data/me/orx # runs + source cache; default ~/.orx
orx compute configure ssh --host lab --clear remote-root
orx compute configure ssh --host lab --keep-remote-runs true # keep every finished run dir on the host
orx compute test ssh --host lab # tests saved container too
orx compute test ssh --host lab --no-container # explicitly tests host
orx compute connect ssh --host lab # interactive login/MFA
Expand All @@ -20,6 +21,7 @@ orx compute configure slurm --cpus-per-task 8 --mem 64G # defaults; exp run --
orx compute configure slurm --clear cpus-per-task --clear mem
orx compute configure slurm --clear time-limit # cluster chooses
orx compute configure slurm --remote-root /scratch/me/orx # shared FS; --clear remote-root for ~/.orx
orx compute configure slurm --keep-remote-runs true # keep every finished run dir on the cluster
orx compute connect slurm --host cluster
orx compute configure k8s --context research --namespace experiments
orx compute configure ray --address http://127.0.0.1:8265
Expand Down
9 changes: 9 additions & 0 deletions agent-skills/orx-compute/references/slurm.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,14 @@ orx exp run <expId> --backend slurm
absolute directory, such as scratch space when home quota is small. It must
be on a filesystem the compute nodes share. Each run keeps the root it was
submitted with; `--clear remote-root` restores the default for new runs.
- Each project's three newest SSH and Slurm runs, counted together across
hosts and including unfinished ones, stay whole. Once an older finished
run's log is collected, the running OpenResearch app removes its remote run
dir except `tensorboard/`. It also removes orx's cached source archives that
no active run uses and that have been idle for an hour, then checks again an
hour later. Anything the job wrote into `repo/` goes with it. To keep every run
on the cluster, set `orx compute configure slurm --keep-remote-runs true`
(it covers runs not yet cleaned up), or write outputs outside the run dir.
Deleting a project removes its runs' remote dirs entirely regardless.
- A detached `orx supervise` process records scheduler status and logs; do not
kill it.
17 changes: 15 additions & 2 deletions agent-skills/orx-compute/references/ssh.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,18 @@ agents still connect directly to the host.
- Omitted container selection uses the host's saved target. `--container`
overrides it; `--no-container` explicitly runs on the host. The flags conflict.

Each project's three newest SSH and Slurm runs, counted together across hosts
and including unfinished ones, stay whole. Once an older finished run's log is
collected, the running OpenResearch app removes its host dir except
`tensorboard/`, and the container's copy entirely (retried while the container
is stopped), so anything written into `repo/` goes with it. While cleaning a host it also removes orx's cached source
archives that no active run uses and that have been idle for an hour, and
checks again an hour later.
Unreachable hosts are retried later.
`orx compute configure ssh --host lab --keep-remote-runs true` keeps all of
that host's runs not yet cleaned up. Deleting a project removes its runs'
remote dirs entirely, regardless of that setting.

Keep environment preparation in the project's committed setup/run scripts and
invoke them through the fixed run command, just as with other backends. For
example, a committed `run.sh` can source Conda, activate the environment, and
Expand All @@ -64,8 +76,9 @@ creation or lifecycle management. `--image` and `--flavor` are unsupported.
The committed source archive is cached on the host, then streamed into the
container's `$HOME/.orx/runs/<runId>/repo`. Host logs and exit status stay in the
host's `<root>/runs/<runId>/` (`~/.orx` unless a remote root is saved), so
container removal does not erase them. A detached supervisor reattaches using the saved container ID and start time; later settings
changes cannot redirect an existing run. Do not kill the supervisor.
container removal does not erase them before they are collected. A detached
supervisor reattaches using the saved container ID and start time; later
settings changes cannot redirect an existing run. Do not kill the supervisor.

Cancellation targets only the experiment process group, waits five seconds for
TERM, then uses KILL if needed. It leaves the container and unrelated processes
Expand Down
5 changes: 5 additions & 0 deletions agent-skills/orx-experiment-tree/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ orx exp move <expId> --parent <newParentId> # re-parent the node and its subtr
orx exp move <expId> --baseline # make it a new root
orx exp archive <expId> --only # hide superseded nodes (also --ancestors/--descendants)
orx exp unarchive <expId> --only # restore them
orx exp delete <expId> # permanently remove a leaf node, its runs and branch
```

- `move` changes only the tree; runs and results stay attached to the node.
Expand All @@ -241,3 +242,7 @@ orx exp unarchive <expId> --only # restore them
for `--baseline`). Move only nodes whose code fits the new parent.
- Don't recreate a node that has runs just to fix its place in the tree: move
or archive it so its results keep their provenance.
- `delete` cannot be undone except for the branch (it prints the commit to
restore it from). Use it only when the user asks to remove a node
permanently; archive otherwise. It refuses nodes with children or active
runs, and branches checked out in any worktree.
31 changes: 27 additions & 4 deletions src/commands/compute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,10 @@ pub struct ConfigureArgs {
/// Absolute remote dir for runs and the source cache (SSH per host, or Slurm); default ~/.orx.
#[arg(long)]
remote_root: Option<String>,
/// true keeps every finished run's remote dir; false (the default) keeps each project's 3 newest
/// SSH/Slurm runs and removes older ones except tensorboard/.
#[arg(long)]
keep_remote_runs: Option<bool>,
#[arg(long)]
default_host: Option<String>,
#[arg(long)]
Expand Down Expand Up @@ -324,7 +328,13 @@ impl ConfigureArgs {
fn body(self) -> Result<Value> {
let backend = self.backend.name();
let allowed: &[&str] = match backend {
"ssh" => &["host", "container", "remoteRoot", "defaultHost"],
"ssh" => &[
"host",
"container",
"remoteRoot",
"keepRemoteRuns",
"defaultHost",
],
"slurm" => &[
"host",
"partition",
Expand All @@ -333,6 +343,7 @@ impl ConfigureArgs {
"cpusPerTask",
"mem",
"remoteRoot",
"keepRemoteRuns",
],
"k8s" => &["context", "namespace"],
"ray" => &["address"],
Expand All @@ -359,6 +370,9 @@ impl ConfigureArgs {
body.insert(key.into(), json!(value));
}
}
if let Some(keep) = self.keep_remote_runs {
body.insert("keepRemoteRuns".into(), json!(keep));
}
if let Some(cpus) = self.cpus_per_task {
body.insert("cpusPerTask".into(), json!(cpus));
}
Expand Down Expand Up @@ -395,6 +409,7 @@ impl ConfigureArgs {
"cpus-per-task" => "cpusPerTask",
"default-host" => "defaultHost",
"remote-root" => "remoteRoot",
"keep-remote-runs" => "keepRemoteRuns",
other => other,
};
if !allowed.contains(&key)
Expand All @@ -412,6 +427,8 @@ impl ConfigureArgs {
Value::Null
} else if key == "cpusPerTask" {
json!(0)
} else if key == "keepRemoteRuns" {
json!(false)
} else {
json!("")
},
Expand All @@ -427,13 +444,15 @@ impl ConfigureArgs {
"Supply settings to change; use compute show {backend} to inspect."
));
}
let host_setting = body.contains_key("container") || body.contains_key("remoteRoot");
let host_setting = ["container", "remoteRoot", "keepRemoteRuns"]
.iter()
.any(|key| body.contains_key(*key));
if backend == "ssh" && body.contains_key("host") && !host_setting {
return Err(anyhow!("--host needs --container, --remote-root, or a matching --clear; use --default-host to pick a default."));
return Err(anyhow!("--host needs --container, --remote-root, --keep-remote-runs, or a matching --clear; use --default-host to pick a default."));
}
if backend == "ssh" && host_setting && !body.contains_key("host") {
return Err(anyhow!(
"A container or remote root change requires --host."
"A container, remote root, or keep-remote-runs change requires --host."
));
}
Ok(Value::Object(body))
Expand Down Expand Up @@ -844,6 +863,10 @@ mod tests {
body(&["slurm", "--clear", "remote-root"]).unwrap(),
json!({"remoteRoot":""})
);
assert_eq!(
body(&["ssh", "--host", "lab", "--keep-remote-runs", "true"]).unwrap(),
json!({"host":"lab", "keepRemoteRuns":true})
);
assert!(body(&["ssh", "--remote-root", "/scratch/me/orx"]).is_err());
assert!(crate::Cli::try_parse_from(["orx", "compute", "status", "--json"]).is_ok());
}
Expand Down
17 changes: 17 additions & 0 deletions src/commands/exp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//! orx exp archive <expId> --ancestors|--only|--descendants hide the chosen scope
//! orx exp unarchive <expId> --ancestors|--only|--descendants restore the same nodes
//! orx exp move <expId> --parent <expId>|--baseline re-parent a subtree
//! orx exp delete <expId> permanently delete a leaf node, its runs and branch
//!
//! Unlike the project-scoped data commands, every verb here takes an
//! *experiment* id from `orx project view <projectId>`.
Expand Down Expand Up @@ -46,6 +47,7 @@ pub async fn run(args: crate::ExpArgs) -> Result<()> {
descendants,
..
} => archive(&mut store, &exp_id, ancestors, only, descendants, false),
ExpCommand::Delete { exp_id } => delete(&store, &exp_id),
ExpCommand::Move { exp_id, parent, .. } => reparent(&store, &exp_id, parent.as_deref()),
ExpCommand::Status { exp_id, scheduler } => {
crate::local::chat::record_chat_target("experiments", &exp_id);
Expand Down Expand Up @@ -97,6 +99,21 @@ fn archive(
Ok(())
}

fn delete(store: &Store, id: &str) -> Result<()> {
let deleted = crate::local::experiments::delete_experiment(store, id)?;
println!(
"Deleted experiment {} ({}) and {} run(s).",
deleted.experiment.id,
deleted.experiment.display_name(),
deleted.runs
);
if let Some(sha) = &deleted.branch_commit {
let branch = &deleted.experiment.branch_name;
println!(" Deleted branch {branch} (restore with `git branch {branch} {sha}`).");
}
Ok(())
}

fn reparent(store: &Store, id: &str, parent: Option<&str>) -> Result<()> {
let before = crate::local::experiments::move_experiment(store, id, parent)?;
println!(
Expand Down
23 changes: 19 additions & 4 deletions src/commands/supervise.rs
Original file line number Diff line number Diff line change
Expand Up @@ -862,6 +862,9 @@ async fn watch_ssh_job(
)
.await;
}
if collected {
queue_remote_cleanup(store, run_id);
}
eprintln!("supervise {run_id}: finished ({status})");
return Ok(status);
}
Expand Down Expand Up @@ -1454,10 +1457,11 @@ async fn run_slurm(

if is_terminal_stage(stage) {
let _ = done_tx.send(true);
if tokio::time::timeout(Duration::from_secs(20), &mut log_task)
.await
.is_err()
{
let collected = matches!(
tokio::time::timeout(Duration::from_secs(20), &mut log_task).await,
Ok(Ok(true))
);
if !collected {
log_task.abort();
}
let applied = store.update_status(&run_id, status, Some(now_ms()), None)?;
Expand All @@ -1470,6 +1474,9 @@ async fn run_slurm(
}
}
}
if collected {
queue_remote_cleanup(&store, &run_id);
}
eprintln!("supervise {run_id}: finished ({status})");
return Ok(());
}
Expand All @@ -1483,6 +1490,14 @@ async fn run_slurm(
}
}

/// Queues the remote run dir once logs are local; `orx up` removes it when it falls past its
/// project's newest few, unless the target keeps results.
fn queue_remote_cleanup(store: &Store, run_id: &str) {
if let Err(err) = store.queue_finished_remote_cleanup(run_id) {
eprintln!("supervise {run_id}: could not queue remote cleanup: {err}");
}
}

async fn cancel_slurm(host: &str, job_id: &str, run_id: &str, cancel_sent: &mut bool) {
eprintln!("supervise {run_id}: cancel requested — scancel {job_id}");
match slurm::cancel_job(host, run_id, job_id).await {
Expand Down
Loading
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.