From 68746143a21a405ef27350fff5146a44451e2e34 Mon Sep 17 00:00:00 2001 From: Steed <93139780+steed924@users.noreply.github.com> Date: Wed, 29 Nov 2023 03:59:30 -0500 Subject: [PATCH] Remove the unnecessary scheduler.rs file (#431) --- native-link-scheduler/BUILD.bazel | 1 - native-link-scheduler/src/scheduler.rs | 88 -------------------------- 2 files changed, 89 deletions(-) delete mode 100644 native-link-scheduler/src/scheduler.rs diff --git a/native-link-scheduler/BUILD.bazel b/native-link-scheduler/BUILD.bazel index 3dda4ae10..7935f5d49 100644 --- a/native-link-scheduler/BUILD.bazel +++ b/native-link-scheduler/BUILD.bazel @@ -16,7 +16,6 @@ rust_library( "src/lib.rs", "src/platform_property_manager.rs", "src/property_modifier_scheduler.rs", - "src/scheduler.rs", "src/simple_scheduler.rs", "src/worker.rs", "src/worker_scheduler.rs", diff --git a/native-link-scheduler/src/scheduler.rs b/native-link-scheduler/src/scheduler.rs deleted file mode 100644 index c8bf28a97..000000000 --- a/native-link-scheduler/src/scheduler.rs +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright 2023 The Native Link Authors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -use std::sync::Arc; - -use async_trait::async_trait; -use tokio::sync::watch; - -use crate::error::Error; -use crate::scheduler::action_messages::{ActionInfo, ActionInfoHashKey, ActionStage, ActionState}; -use crate::scheduler::platform_property_manager::PlatformPropertyManager; -use crate::scheduler::worker::{Worker, WorkerId, WorkerTimestamp}; -use crate::util::metrics_utils::Registry; - -/// ActionScheduler interface is responsible for interactions between the scheduler -/// and action related operations. -#[async_trait] -pub trait ActionScheduler: Sync + Send + Unpin { - /// Returns the platform property manager. - async fn get_platform_property_manager(&self, instance_name: &str) -> Result, Error>; - - /// Adds an action to the scheduler for remote execution. - async fn add_action(&self, action_info: ActionInfo) -> Result>, Error>; - - /// Find an existing action by its name. - async fn find_existing_action( - &self, - unique_qualifier: &ActionInfoHashKey, - ) -> Option>>; - - /// Cleans up the cache of recently completed actions. - async fn clean_recently_completed_actions(&self); - - /// Register the metrics for the action scheduler. - fn register_metrics(self: Arc, _registry: &mut Registry) {} -} - -/// WorkerScheduler interface is responsible for interactions between the scheduler -/// and worker related operations. -#[async_trait] -pub trait WorkerScheduler: Sync + Send + Unpin { - /// Returns the platform property manager. - fn get_platform_property_manager(&self) -> &PlatformPropertyManager; - - /// Adds a worker to the scheduler and begin using it to execute actions (when able). - async fn add_worker(&self, worker: Worker) -> Result<(), Error>; - - /// Similar to `update_action()`, but called when there was an error that is not - /// related to the task, but rather the worker itself. - async fn update_action_with_internal_error( - &self, - worker_id: &WorkerId, - action_info_hash_key: &ActionInfoHashKey, - err: Error, - ); - - /// Updates the status of an action to the scheduler from the worker. - async fn update_action( - &self, - worker_id: &WorkerId, - action_info_hash_key: &ActionInfoHashKey, - action_stage: ActionStage, - ) -> Result<(), Error>; - - /// Event for when the keep alive message was received from the worker. - async fn worker_keep_alive_received(&self, worker_id: &WorkerId, timestamp: WorkerTimestamp) -> Result<(), Error>; - - /// Removes worker from pool and reschedule any tasks that might be running on it. - async fn remove_worker(&self, worker_id: WorkerId); - - /// Removes timed out workers from the pool. This is called periodically by an - /// external source. - async fn remove_timedout_workers(&self, now_timestamp: WorkerTimestamp) -> Result<(), Error>; - - /// Register the metrics for the worker scheduler. - fn register_metrics(self: Arc, _registry: &mut Registry) {} -}