Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(framework) Fix end-to-end FAB delivery #4029

Merged
merged 2 commits into from
Aug 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/py/flwr/cli/config_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,13 @@ def get_fab_metadata(fab_file: Union[Path, bytes]) -> Tuple[str, str]:
Returns
-------
Tuple[str, str]
The `fab_version` and `fab_id` of the given Flower App Bundle.
The `fab_id` and `fab_version` of the given Flower App Bundle.
"""
conf = get_fab_config(fab_file)

return (
conf["project"]["version"],
f"{conf['tool']['flwr']['app']['publisher']}/{conf['project']['name']}",
conf["project"]["version"],
)


Expand Down
16 changes: 11 additions & 5 deletions src/py/flwr/server/superlink/driver/driver_servicer.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,12 @@
import grpc

from flwr.common.logger import log
from flwr.common.serde import fab_to_proto, user_config_from_proto, user_config_to_proto
from flwr.common.serde import (
fab_from_proto,
fab_to_proto,
user_config_from_proto,
user_config_to_proto,
)
from flwr.common.typing import Fab
from flwr.proto import driver_pb2_grpc # pylint: disable=E0611
from flwr.proto.driver_pb2 import ( # pylint: disable=E0611
Expand Down Expand Up @@ -75,12 +80,13 @@ def CreateRun(
"""Create run ID."""
log(DEBUG, "DriverServicer.CreateRun")
state: State = self.state_factory.state()
if request.HasField("fab") and request.fab.HasField("content"):
if request.HasField("fab"):
fab = fab_from_proto(request.fab)
ffs: Ffs = self.ffs_factory.ffs()
fab_hash = ffs.put(request.fab.content, {})
fab_hash = ffs.put(fab.content, {})
_raise_if(
fab_hash != request.fab.hash_str,
f"FAB ({request.fab}) hash from request doesn't match contents",
fab_hash != fab.hash_str,
f"FAB ({fab.hash_str}) hash from request doesn't match contents",
)
else:
fab_hash = ""
Expand Down