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

Rename constant #1638

Merged
merged 2 commits into from
Feb 5, 2023
Merged
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
16 changes: 8 additions & 8 deletions src/py/flwr/server/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@
from flwr.server.state.state import DriverState
from flwr.server.strategy import FedAvg, Strategy

DEFAULT_ADDRESS_DRIVER_API = "[::]:9091"
DEFAULT_ADDRESS_FLEET_API = "[::]:9092"
ADDRESS_DRIVER_API = "[::]:9091"
ADDRESS_FLEET_API_GRPC = "[::]:9092"


@dataclass
Expand All @@ -60,7 +60,7 @@ class ServerConfig:

def start_server( # pylint: disable=too-many-arguments
*,
server_address: str = DEFAULT_ADDRESS_FLEET_API,
server_address: str = ADDRESS_FLEET_API_GRPC,
server: Optional[Server] = None,
config: Optional[ServerConfig] = None,
strategy: Optional[Strategy] = None,
Expand Down Expand Up @@ -281,7 +281,7 @@ def _run_driver_api_grpc(
"""Run Driver API (gRPC, request-response)."""

# Create Driver API gRPC server
driver_servicer = DriverServicer(
driver_servicer: grpc.Server = DriverServicer(
driver_state=driver_state,
)
driver_add_servicer_to_server_fn = add_DriverServicer_to_server
Expand Down Expand Up @@ -329,15 +329,15 @@ def _parse_args() -> argparse.Namespace:
# Driver API
parser.add_argument(
"--driver-api-address",
help=f"Driver API gRPC server address. Default:'{DEFAULT_ADDRESS_DRIVER_API}'",
default=DEFAULT_ADDRESS_DRIVER_API,
help=f"Driver API gRPC server address. Default: {ADDRESS_DRIVER_API}",
default=ADDRESS_DRIVER_API,
)

# Fleet API
parser.add_argument(
"--fleet-api-address",
help=f"Fleet API gRPC server address. Default:'{DEFAULT_ADDRESS_FLEET_API}'",
default=DEFAULT_ADDRESS_FLEET_API,
help=f"Fleet API gRPC server address. Default: {ADDRESS_FLEET_API_GRPC}",
default=ADDRESS_FLEET_API_GRPC,
)

return parser.parse_args()