Skip to content

Commit

Permalink
Add message_handler
Browse files Browse the repository at this point in the history
  • Loading branch information
charlesbvll committed Aug 15, 2024
1 parent 32b9fb6 commit 33a9d08
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
from typing import List, Optional
from uuid import UUID

from flwr.common.serde import user_config_to_proto
from flwr.common.serde import fab_to_proto, user_config_to_proto
from flwr.common.typing import Fab
from flwr.proto.fab_pb2 import GetFabRequest, GetFabResponse # pylint: disable=E0611
from flwr.proto.fleet_pb2 import ( # pylint: disable=E0611
CreateNodeRequest,
CreateNodeResponse,
Expand All @@ -40,6 +42,7 @@
Run,
)
from flwr.proto.task_pb2 import TaskIns, TaskRes # pylint: disable=E0611
from flwr.server.superlink.ffs.ffs import Ffs
from flwr.server.superlink.state import State


Expand Down Expand Up @@ -124,5 +127,14 @@ def get_run(
fab_id=run.fab_id,
fab_version=run.fab_version,
override_config=user_config_to_proto(run.override_config),
fab_hash=run.fab_hash,
)
)


def get_fab(
request: GetFabRequest, ffs: Ffs # pylint: disable=W0613
) -> GetFabResponse:
"""Get FAB."""
fab = Fab(request.hash_str, ffs.get(request.hash_str)[0])
return GetFabResponse(fab=fab_to_proto(fab))

0 comments on commit 33a9d08

Please sign in to comment.