Skip to content

Commit

Permalink
[RPC] Virtualize resources in each Worker using the RPC backend.
Browse files Browse the repository at this point in the history
  • Loading branch information
sukritkalra committed Feb 21, 2024
1 parent 3142d1d commit d19536b
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion rpc/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,21 @@
10,
"The initial number of executors that are requested by each application.",
)
flags.DEFINE_integer(
"virtualized_cores",
500,
"The number of virtualized cores that must be created in each Worker on the "
"framework. This allows us to spawn a higher number of executors than the number "
"possible with actual available resources. Thus, we can spawn the executors for "
"each application, and only selectively activate them according to the actual "
"available resources.",
)
flags.DEFINE_integer(
"virtualized_memory",
500,
"The amount of virtualized memory (in GB) that must be created in each Worker on "
"the framework. Refer to the `virtualized_cores` flag for more information.",
)


# Implement the service.
Expand Down Expand Up @@ -548,7 +563,10 @@ async def RegisterWorker(self, request, context):
await self.run_scheduler()

return erdos_scheduler_pb2.RegisterWorkerResponse(
success=True, message=f"Worker {request.name} registered successfully!"
success=True,
message=f"Worker {request.name} registered successfully!",
cores=FLAGS.virtualized_cores,
memory=FLAGS.virtualized_memory * 1024,
)

async def NotifyTaskCompletion(self, request, context):
Expand Down

0 comments on commit d19536b

Please sign in to comment.