diff --git a/src/bin/scheduler/setup/steps/directories.rs b/src/bin/scheduler/setup/steps/directories.rs index 6003fd5b..ce7f7f31 100644 --- a/src/bin/scheduler/setup/steps/directories.rs +++ b/src/bin/scheduler/setup/steps/directories.rs @@ -1,5 +1,7 @@ use super::api::{self, skip, SetupStep, StepWithPlans}; -use super::{partition_into_rcc_and_system_plans, plans_by_sessions}; +use super::{ + partition_into_rcc_and_system_plans, plans_by_sessions, rcc_working_directory_for_session, +}; use crate::internal_config::{GlobalConfig, Plan, Source}; #[cfg(windows)] @@ -176,7 +178,10 @@ pub fn gather_rcc_working_per_user(config: &GlobalConfig, plans: Vec) -> V for (session, plans_in_session) in plans_by_sessions(rcc_plans) { setup_steps.push(( Box::new(StepCreateWithAccess { - target: config.working_directory_rcc_setup_steps.join(session.id()), + target: rcc_working_directory_for_session( + &config.working_directory_rcc_setup_steps, + &session, + ), session, }), plans_in_session, @@ -196,9 +201,10 @@ pub fn gather_rcc_longpath_directory( vec![ ( Box::new(StepCreate { - target: config - .working_directory_rcc_setup_steps - .join(CurrentSession {}.id()), + target: rcc_working_directory_for_session( + &config.working_directory_rcc_setup_steps, + &Session::Current(CurrentSession {}), + ), }), rcc_plans, ), diff --git a/src/bin/scheduler/setup/steps/mod.rs b/src/bin/scheduler/setup/steps/mod.rs index ce25d2f0..302aded8 100644 --- a/src/bin/scheduler/setup/steps/mod.rs +++ b/src/bin/scheduler/setup/steps/mod.rs @@ -5,6 +5,7 @@ pub mod run; use crate::internal_config::Plan; +use camino::{Utf8Path, Utf8PathBuf}; use robotmk::environment::Environment; use robotmk::session::Session; use std::collections::HashMap; @@ -25,3 +26,10 @@ fn partition_into_rcc_and_system_plans(plans: Vec) -> (Vec, Vec Utf8PathBuf { + working_directory_rcc_setup_steps.join(session.id()) +} diff --git a/src/bin/scheduler/setup/steps/rcc.rs b/src/bin/scheduler/setup/steps/rcc.rs index 7eba7dd1..4f5ec4f6 100644 --- a/src/bin/scheduler/setup/steps/rcc.rs +++ b/src/bin/scheduler/setup/steps/rcc.rs @@ -1,5 +1,7 @@ use super::api::{self, skip, SetupStep, StepWithPlans}; -use super::{partition_into_rcc_and_system_plans, plans_by_sessions}; +use super::{ + partition_into_rcc_and_system_plans, plans_by_sessions, rcc_working_directory_for_session, +}; use crate::internal_config::{GlobalConfig, Plan}; use crate::logging::log_and_return_error; @@ -99,10 +101,11 @@ impl SetupStep for StepRCCCommand { let run_spec = RunSpec { id: &format!("robotmk_{}", self.id), command_spec: &command_spec, - runtime_base_path: &self - .working_directory - .join(self.session.id()) - .join(&self.id), + runtime_base_path: &rcc_working_directory_for_session( + &self.working_directory, + &self.session, + ) + .join(&self.id), timeout: 120, cancellation_token: &self.cancellation_token, }; @@ -190,7 +193,11 @@ impl SetupStep for StepDisableSharedHolotree { let run_spec = &RunSpec { id: &format!("robotmk_{name}_{}", self.session.id()), command_spec: &command_spec, - runtime_base_path: &self.working_directory.join(self.session.id()).join(name), + runtime_base_path: &rcc_working_directory_for_session( + &self.working_directory, + &self.session, + ) + .join(name), timeout: 120, cancellation_token: &self.cancellation_token, };