diff options
| author | jbordalo <[email protected]> | 2026-02-11 13:59:59 +0000 |
|---|---|---|
| committer | jbordalo <[email protected]> | 2026-02-11 13:59:59 +0000 |
| commit | 5e5448bdd899ba9ba263200616a348acda5eb0ed (patch) | |
| tree | 08f273d3f7dedc1f044ad7017119718f6b10bfb5 /src/main.rs | |
| parent | 62e24e5a18b7041717668dff780bd923d0506c47 (diff) | |
Add support for differing username between cluster and local machine
Diffstat (limited to 'src/main.rs')
| -rw-r--r-- | src/main.rs | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/main.rs b/src/main.rs index 972f1bb..64b2b1f 100644 --- a/src/main.rs +++ b/src/main.rs | |||
| @@ -57,6 +57,11 @@ struct Common { | |||
| 57 | /// i.e. `ssh <frontend-hostname>` should work. | 57 | /// i.e. `ssh <frontend-hostname>` should work. |
| 58 | #[clap(long, env = "FRONTEND_HOSTNAME")] | 58 | #[clap(long, env = "FRONTEND_HOSTNAME")] |
| 59 | frontend_hostname: Option<String>, | 59 | frontend_hostname: Option<String>, |
| 60 | |||
| 61 | /// cluster username, needed if running locally with differing usernames | ||
| 62 | #[clap(long, env = "CLUSTER_USERNAME")] | ||
| 63 | cluster_username: Option<String>, | ||
| 64 | |||
| 60 | } | 65 | } |
| 61 | 66 | ||
| 62 | #[derive(Debug, Subcommand)] | 67 | #[derive(Debug, Subcommand)] |
| @@ -240,12 +245,13 @@ async fn context_from_common(common: &Common) -> Result<Context> { | |||
| 240 | common.job_id, | 245 | common.job_id, |
| 241 | common.infer_job_id, | 246 | common.infer_job_id, |
| 242 | common.frontend_hostname.clone(), | 247 | common.frontend_hostname.clone(), |
| 248 | common.cluster_username.clone() | ||
| 243 | ) | 249 | ) |
| 244 | .await?; | 250 | .await?; |
| 245 | 251 | ||
| 246 | if let ExecutionNode::Machine(_) = ctx.node { | 252 | if let ExecutionNode::Machine(_) = ctx.node { |
| 247 | tracing::warn!( | 253 | tracing::warn!( |
| 248 | "executing oar-p2p from a job machine is not currently support, run from the frontend or your own machine" | 254 | "executing oar-p2p from a job machine is not currently supported, run from the frontend or your own machine" |
| 249 | ); | 255 | ); |
| 250 | } | 256 | } |
| 251 | 257 | ||
| @@ -261,7 +267,7 @@ async fn cmd_net_up(args: NetUpArgs) -> Result<()> { | |||
| 261 | ); | 267 | ); |
| 262 | let matrix_content = tokio::fs::read_to_string(&args.latency_matrix) | 268 | let matrix_content = tokio::fs::read_to_string(&args.latency_matrix) |
| 263 | .await | 269 | .await |
| 264 | .context("reading latecy matrix")?; | 270 | .context("reading latency matrix")?; |
| 265 | 271 | ||
| 266 | tracing::debug!("parsing latency matrix"); | 272 | tracing::debug!("parsing latency matrix"); |
| 267 | let matrix = LatencyMatrix::parse(&matrix_content, latency_matrix::TimeUnit::Milliseconds) | 273 | let matrix = LatencyMatrix::parse(&matrix_content, latency_matrix::TimeUnit::Milliseconds) |
| @@ -821,6 +827,10 @@ async fn machine_run( | |||
| 821 | arguments.extend(ssh_common); | 827 | arguments.extend(ssh_common); |
| 822 | arguments.push("-J"); | 828 | arguments.push("-J"); |
| 823 | arguments.push(frontend); | 829 | arguments.push(frontend); |
| 830 | if ctx.cluster_username().is_ok() { | ||
| 831 | arguments.push("-l"); | ||
| 832 | arguments.push(ctx.cluster_username()?); | ||
| 833 | } | ||
| 824 | arguments.push(machine.hostname()); | 834 | arguments.push(machine.hostname()); |
| 825 | arguments | 835 | arguments |
| 826 | } | 836 | } |
