Skip to content

Commit

Permalink
Add flwr_dir argument
Browse files Browse the repository at this point in the history
  • Loading branch information
charlesbvll committed Jul 12, 2024
1 parent de95acf commit 8fd8a95
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/py/flwr/superexec/deployment.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,15 @@ class DeploymentEngine(Executor):
root_certificates: Optional[str] (Default: None)
Specifies the path to the PEM-encoded root certificate file for
establishing secure HTTPS connections.
flwr_dir: Optional[str] (Default: None)
The path containing installed Flower Apps.
"""

def __init__(
self,
superlink: str = DEFAULT_SERVER_ADDRESS_DRIVER,
cert_path: Optional[str] = None,
flwr_dir: Optional[str] = None,
) -> None:
self.superlink = superlink
if cert_path is None:
Expand All @@ -55,6 +58,7 @@ def __init__(
else:
self.cert_path = cert_path
self.root_certificates = Path(cert_path).read_bytes()
self.flwr_dir = flwr_dir
self.stub: Optional[DriverStub] = None

def _connect(self) -> None:
Expand Down Expand Up @@ -96,8 +100,12 @@ def start_run(
if config:
if superlink_address := config.get("superlink"):
self.superlink = superlink_address
if cert_path := config.get("root-certificates"):
if cert_path := config.get(
"root-certificates", config.get("root_certificates")
):
self.cert_path = cert_path
if flwr_dir := config.get("flwr-dir", config.get("flwr_dir")):
self.flwr_dir = flwr_dir

try:
# Install FAB to flwr dir
Expand All @@ -121,6 +129,7 @@ def start_run(
"flower-server-app",
"--run-id",
str(run_id),
f"--flwr-dir {self.flwr_dir}" if self.flwr_dir else "",
"--superlink",
self.superlink,
(
Expand Down

0 comments on commit 8fd8a95

Please sign in to comment.