Skip to content

Commit

Permalink
override flags in service
Browse files Browse the repository at this point in the history
  • Loading branch information
1ntEgr8 committed Nov 27, 2024
1 parent cca24d8 commit 7387b06
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions rpc/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,15 @@ def canonical_task_id(self, stage_id: int):

class Servicer(erdos_scheduler_pb2_grpc.SchedulerServiceServicer):
def __init__(self) -> None:
# Override some flags

# Enable orchestrated mode
FLAGS.orchestrated = True
# Set minimum placement push duration to 1s
FLAGS.min_placement_push_duration = 1_000_000
# Set scheduler runtime to zero
FLAGS.scheduler_runtime = 0

self._logger = setup_logging(
name=__name__,
log_dir=FLAGS.log_dir,
Expand Down Expand Up @@ -251,10 +260,6 @@ async def RegisterFramework(self, request, context):
)
self._workload_loader = WorkloadLoader(FLAGS)

# Enable orchestrated mode
FLAGS.orchestrated = True
# Set minimum placement push duration to 1s
FLAGS.min_placement_push_duration = 1_000_000
self._simulator = Simulator(
scheduler=self._scheduler,
worker_pools=WorkerPools(
Expand Down Expand Up @@ -583,6 +588,7 @@ async def GetPlacements(self, request, context):
for placement in sim_placements:
# Ignore virtual placements
if placement.task.state < TaskState.RELEASED:
self._logger.debug("[{stime}] Skipping placement: {placement}")
continue

worker_id = (
Expand Down

0 comments on commit 7387b06

Please sign in to comment.