Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
jafermarq committed Feb 3, 2025
1 parent 41fe9fc commit 9190cc9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
1 change: 1 addition & 0 deletions src/py/flwr/common/constant.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
EXEC_API_DEFAULT_SERVER_ADDRESS = f"{SERVER_OCTET}:{EXEC_API_PORT}"
SIMULATIONIO_API_DEFAULT_SERVER_ADDRESS = f"{SERVER_OCTET}:{SIMULATIONIO_PORT}"
SIMULATIONIO_API_DEFAULT_CLIENT_ADDRESS = f"{CLIENT_OCTET}:{SIMULATIONIO_PORT}"
DEFAULT_LINKSTATE_TYPE = ":memory:"

# Constants for ping
PING_DEFAULT_INTERVAL = 30
Expand Down
13 changes: 6 additions & 7 deletions src/py/flwr/server/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
from flwr.common.constant import (
AUTH_TYPE_KEY,
CLIENT_OCTET,
DEFAULT_LINKSTATE_TYPE,
EXEC_API_DEFAULT_SERVER_ADDRESS,
FLEET_API_GRPC_BIDI_DEFAULT_ADDRESS,
FLEET_API_GRPC_RERE_DEFAULT_ADDRESS,
Expand Down Expand Up @@ -85,7 +86,6 @@
from .superlink.linkstate import LinkStateFactory
from .superlink.simulation.simulationio_grpc import run_simulationio_api_grpc

DATABASE = ":flwr-in-memory-state:"
BASE_DIR = get_flwr_dir() / "superlink" / "ffs"


Expand Down Expand Up @@ -758,12 +758,11 @@ def _add_args_common(parser: argparse.ArgumentParser) -> None:
)
parser.add_argument(
"--database",
help="A string representing the path to the database "
"file that will be opened. Note that passing ':memory:' "
"will open a connection to a database that is in RAM, "
"instead of on disk. If nothing is provided, "
"Flower will just create a state in memory.",
default=DATABASE,
help="LinkState implementation. A string representing the path to the database "
"file that will be opened. If nothing is provided, Flower will create an "
'in-memory SQLite database. Pass ":flwr-in-memory-state:" to configure an '
"in-memory dictionary-based LinkState instead.",
default=DEFAULT_LINKSTATE_TYPE,
)
parser.add_argument(
"--storage-dir",
Expand Down
4 changes: 2 additions & 2 deletions src/py/flwr/server/superlink/linkstate/linkstate_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ def state(self) -> LinkState:
if self.database == ":flwr-in-memory-state:":
if self.state_instance is None:
self.state_instance = InMemoryLinkState()
log(DEBUG, "Using InMemoryState")
log(DEBUG, "Using InMemoryLinkState")
return self.state_instance

# SqliteState
state = SqliteLinkState(self.database)
state.initialize()
log(DEBUG, "Using SqliteState")
log(DEBUG, "Using SqliteLinkState (%s)", self.database)
return state

0 comments on commit 9190cc9

Please sign in to comment.