From 91e869d880aad745afcbf09a13141ec7b83ca6e3 Mon Sep 17 00:00:00 2001 From: MasterPtato <23087326+MasterPtato@users.noreply.github.com> Date: Fri, 2 Aug 2024 02:34:03 +0000 Subject: [PATCH] fix: disable job migrations and reschedules (#1017) Fixes RVT-3774 ## Changes --- svc/pkg/ds/ops/server-create/src/lib.rs | 10 ++++++++++ svc/pkg/faker/ops/job-template/src/lib.rs | 10 ++++++++++ .../job-run/worker/src/workers/create/create_job.rs | 10 ++++++++++ .../mm-config/ops/version-prepare/src/prewarm_ats.rs | 10 ++++++++++ .../mm/worker/src/workers/lobby_create/nomad_job.rs | 10 ++++++++++ 5 files changed, 50 insertions(+) diff --git a/svc/pkg/ds/ops/server-create/src/lib.rs b/svc/pkg/ds/ops/server-create/src/lib.rs index c4c41f0fdb..ffcb844de7 100644 --- a/svc/pkg/ds/ops/server-create/src/lib.rs +++ b/svc/pkg/ds/ops/server-create/src/lib.rs @@ -799,6 +799,16 @@ pub async fn handle( ]), ..TaskGroup::new() }]), + // Disables migrating in the event of a node drain + migrate: Some(Box::new(MigrateStrategy { + max_parallel: Some(0), + ..MigrateStrategy::new() + })), + // Disables rescheduling in the event of a node drain + reschedule: Some(Box::new(ReschedulePolicy { + attempts: Some(0), + ..ReschedulePolicy::new() + })), ..Job::new() }; diff --git a/svc/pkg/faker/ops/job-template/src/lib.rs b/svc/pkg/faker/ops/job-template/src/lib.rs index abf5ac755c..b85f6facbb 100644 --- a/svc/pkg/faker/ops/job-template/src/lib.rs +++ b/svc/pkg/faker/ops/job-template/src/lib.rs @@ -57,6 +57,16 @@ fn gen_job( tasks: Some(vec![task]), ..TaskGroup::new() }]), + // Disables migrating in the event of a node drain + migrate: Some(Box::new(MigrateStrategy { + max_parallel: Some(0), + ..MigrateStrategy::new() + })), + // Disables rescheduling in the event of a node drain + reschedule: Some(Box::new(ReschedulePolicy { + attempts: Some(0), + ..ReschedulePolicy::new() + })), ..Job::new() }) } diff --git a/svc/pkg/job-run/worker/src/workers/create/create_job.rs b/svc/pkg/job-run/worker/src/workers/create/create_job.rs index d3ac8e95ba..b6c758460f 100644 --- a/svc/pkg/job-run/worker/src/workers/create/create_job.rs +++ b/svc/pkg/job-run/worker/src/workers/create/create_job.rs @@ -369,6 +369,16 @@ mod tests { }]), ..TaskGroup::new() }]), + // Disables migrating in the event of a node drain + migrate: Some(Box::new(MigrateStrategy { + max_parallel: Some(0), + ..MigrateStrategy::new() + })), + // Disables rescheduling in the event of a node drain + reschedule: Some(Box::new(ReschedulePolicy { + attempts: Some(0), + ..ReschedulePolicy::new() + })), ..Job::new() } } diff --git a/svc/pkg/mm-config/ops/version-prepare/src/prewarm_ats.rs b/svc/pkg/mm-config/ops/version-prepare/src/prewarm_ats.rs index 894f70c29f..105732b296 100644 --- a/svc/pkg/mm-config/ops/version-prepare/src/prewarm_ats.rs +++ b/svc/pkg/mm-config/ops/version-prepare/src/prewarm_ats.rs @@ -178,6 +178,16 @@ fn gen_prewarm_job(artifact_count: usize) -> GlobalResult