From 3ce06fff5f529b285c65c4062cc8d25c12ba608a Mon Sep 17 00:00:00 2001 From: Sanghun Lee Date: Tue, 26 Nov 2024 16:44:37 +0900 Subject: [PATCH] remove not used manager event --- src/ai/backend/manager/api/__init__.py | 1 - src/ai/backend/manager/api/manager.py | 2 +- src/ai/backend/manager/scheduler/dispatcher.py | 4 ++-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/ai/backend/manager/api/__init__.py b/src/ai/backend/manager/api/__init__.py index 4b44ae98b8..f1f0838c75 100644 --- a/src/ai/backend/manager/api/__init__.py +++ b/src/ai/backend/manager/api/__init__.py @@ -10,7 +10,6 @@ class ManagerStatus(enum.StrEnum): class SchedulerEvent(enum.StrEnum): SCHEDULE = "schedule" - PREPARE = "prepare" CHECK_PRECOND = "check_precondition" START_SESSION = "start_session" SCALE_SERVICES = "scale_services" diff --git a/src/ai/backend/manager/api/manager.py b/src/ai/backend/manager/api/manager.py index 07744ce4ee..3454397bdb 100644 --- a/src/ai/backend/manager/api/manager.py +++ b/src/ai/backend/manager/api/manager.py @@ -281,7 +281,7 @@ async def scheduler_trigger(request: web.Request, params: Any) -> web.Response: match params["event"]: case SchedulerEvent.SCHEDULE: await root_ctx.event_producer.produce_event(DoScheduleEvent()) - case SchedulerEvent.PREPARE | SchedulerEvent.CHECK_PRECOND: + case SchedulerEvent.CHECK_PRECOND: await root_ctx.event_producer.produce_event(DoCheckPrecondEvent()) case SchedulerEvent.START_SESSION: await root_ctx.event_producer.produce_event(DoStartSessionEvent()) diff --git a/src/ai/backend/manager/scheduler/dispatcher.py b/src/ai/backend/manager/scheduler/dispatcher.py index 77ed6afa80..8852c658b7 100644 --- a/src/ai/backend/manager/scheduler/dispatcher.py +++ b/src/ai/backend/manager/scheduler/dispatcher.py @@ -12,7 +12,7 @@ Sequence, ) from contextvars import ContextVar -from datetime import datetime, timedelta +from datetime import datetime, timedelta, timezone from decimal import Decimal from functools import partial from typing import ( @@ -1289,7 +1289,7 @@ def _pipeline(r: Redis) -> RedisPipeline: ) try: async with self.lock_factory(LockID.LOCKID_START_TIMER, 600): - now = datetime.now(tzutc()) + now = datetime.now(timezone.utc) known_slot_types = await self.shared_config.get_resource_slots() sched_ctx = SchedulingContext( self.registry,