Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix when reporting that scheduler is in setup phase #439

Merged
merged 3 commits into from
Nov 15, 2023
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
22 changes: 12 additions & 10 deletions v2/robotmk/src/bin/scheduler/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,19 @@ fn run() -> Result<()> {
bail!("Terminated")
}

write_state(&results::SchedulerState::Setup, &global_config)?;
let suites = setup::setup(&global_config, suites)?;
debug!("Setup completed");
setup::general::setup(&global_config, &suites).context("General setup failed")?;
debug!("General setup completed");
write_phase(&results::SchedulerPhase::RCCSetup, &global_config)?;
let suites = setup::rcc::setup(&global_config, suites).context("RCC-specific setup failed")?;
debug!("RCC-specific setup completed");

if global_config.termination_flag.should_terminate() {
bail!("Terminated")
}

info!("Starting environment building");
write_state(
&results::SchedulerState::EnvironmentBuilding,
write_phase(
&results::SchedulerPhase::EnvironmentBuilding,
&global_config,
)?;
let suites = environment::build_environments(&global_config, suites)?;
Expand All @@ -67,16 +69,16 @@ fn run() -> Result<()> {
}

info!("Starting suite scheduling");
write_state(&results::SchedulerState::Scheduling, &global_config)?;
write_phase(&results::SchedulerPhase::Scheduling, &global_config)?;
scheduling::scheduler::run_suites_and_cleanup(&global_config, &suites)
}

fn write_state(
state: &results::SchedulerState,
fn write_phase(
phase: &results::SchedulerPhase,
global_config: &internal_config::GlobalConfig,
) -> Result<()> {
state.write(
global_config.results_directory.join("scheduler_state.json"),
phase.write(
global_config.results_directory.join("scheduler_phase.json"),
&global_config.results_directory_locker,
)
}
8 changes: 4 additions & 4 deletions v2/robotmk/src/bin/scheduler/results.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ pub fn suite_results_directory(results_directory: &Utf8Path) -> Utf8PathBuf {
}

#[derive(Serialize)]
pub enum SchedulerState {
Setup,
pub enum SchedulerPhase {
RCCSetup,
EnvironmentBuilding,
Scheduling,
}

impl WriteSection for SchedulerState {
impl WriteSection for SchedulerPhase {
fn name() -> &'static str {
"robotmk_scheduler_state"
"robotmk_scheduler_phase"
}
}

Expand Down
3 changes: 3 additions & 0 deletions v2/robotmk/src/bin/scheduler/setup.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pub mod general;
mod icacls;
pub mod rcc;
16 changes: 0 additions & 16 deletions v2/robotmk/src/bin/scheduler/setup/mod.rs

This file was deleted.

Loading