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

feat(framework) Enable installation of FAB in ClientApp process #4044

Merged
merged 34 commits into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from 32 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
3124d91
rename
jafermarq Aug 17, 2024
fb254e7
format
jafermarq Aug 17, 2024
aa51b95
renamed process.py to app.py
jafermarq Aug 17, 2024
2e0848c
init
jafermarq Aug 17, 2024
31ef0a6
test fix
jafermarq Aug 17, 2024
c085b86
Merge branch 'rename-process-to-clientapp' into refactor-flwrapp-cli-…
jafermarq Aug 17, 2024
634b548
init
jafermarq Aug 17, 2024
f9474f4
set_token() method
jafermarq Aug 17, 2024
08e2708
using `get_token` functionality
jafermarq Aug 17, 2024
4fbf3ff
tweakw
jafermarq Aug 17, 2024
03a1952
Merge branch 'main' into add-get-token-message
jafermarq Aug 17, 2024
77a85f3
Merge branch 'add-get-token-message' into use-get-token
jafermarq Aug 17, 2024
8ac40bd
init
jafermarq Aug 17, 2024
5255db7
Merge branch 'main' into add-get-token-message
jafermarq Aug 17, 2024
003b415
removed set_tooken
jafermarq Aug 17, 2024
50fc61e
Merge branch 'add-get-token-message' into use-get-token
jafermarq Aug 17, 2024
4ef1752
removed set_token func
jafermarq Aug 17, 2024
f96a553
merged w/ use-get-token
jafermarq Aug 17, 2024
ebfb566
merge w/ main
jafermarq Aug 19, 2024
540657f
w/ previous
jafermarq Aug 19, 2024
0bec668
fix to merge
jafermarq Aug 19, 2024
df0760e
format
jafermarq Aug 19, 2024
2b2d061
Merge branch 'main' into add-get-fab-message
jafermarq Aug 19, 2024
081b25d
Merge branch 'main' into add-get-fab-message
jafermarq Aug 19, 2024
eba5e7a
comm fab via clientappinputs dataclass
jafermarq Aug 19, 2024
a0bef7a
format
jafermarq Aug 19, 2024
60fd344
fab delivery optional
jafermarq Aug 19, 2024
68e26f7
init
jafermarq Aug 19, 2024
dbddf81
Merge branch 'main' into install-fab-in-flwrclientapp
danieljanes Aug 19, 2024
44f34b3
Update src/py/flwr/client/clientapp/app.py
danieljanes Aug 19, 2024
0f7bc39
Update src/py/flwr/client/app.py
danieljanes Aug 19, 2024
e8383ce
Update src/py/flwr/client/app.py
danieljanes Aug 19, 2024
581ee20
Update src/py/flwr/client/app.py
danieljanes Aug 19, 2024
307fc5f
Update src/py/flwr/client/app.py
danieljanes Aug 19, 2024
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
5 changes: 4 additions & 1 deletion src/py/flwr/client/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,10 @@ def _on_backoff(retry_state: RetryState) -> None:
run: Run = runs[run_id]
if get_fab is not None and run.fab_hash:
fab = get_fab(run.fab_hash)
install_from_fab(fab.content, flwr_path, True)
if isolation is None or isolation == ISOLATION_MODE_SUBPROCESS:
# If `ClientApp` runs in the same process, or a
# subprocess, install the FAB
install_from_fab(fab.content, flwr_path, True)
danieljanes marked this conversation as resolved.
Show resolved Hide resolved
fab_id, fab_version = get_fab_metadata(fab.content)
else:
fab = None
Expand Down
10 changes: 8 additions & 2 deletions src/py/flwr/client/clientapp/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

import grpc

from flwr.cli.install import install_from_fab
from flwr.client.client_app import ClientApp, LoadClientAppError
from flwr.common import Context, Message
from flwr.common.constant import ErrorCode
Expand Down Expand Up @@ -115,8 +116,13 @@ def run_clientapp( # pylint: disable=R0914
token = get_token(stub)
time.sleep(1)

# Pull Message, Context, and Run from SuperNode
message, context, run, _ = pull_message(stub=stub, token=token)
# Pull Message, Context, Run and (optional) FAB from SuperNode
message, context, run, fab = pull_message(stub=stub, token=token)

# Install FAB, if provided
if fab:
log(DEBUG, "Flower ClientApp starts FAB installation.")
install_from_fab(fab.content, flwr_dir=None, skip_prompt=True)

load_client_app_fn = get_load_client_app_fn(
default_app_ref="",
Expand Down
Loading