flwr-nightly 1.19.0.dev20250601__py3-none-any.whl → 1.19.0.dev20250602__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- flwr/client/clientapp/__init__.py +0 -7
- flwr/common/inflatable_grpc_utils.py +6 -3
- flwr/common/record/configrecord.py +9 -8
- flwr/common/record/metricrecord.py +5 -4
- flwr/common/serde.py +39 -28
- flwr/common/serde_utils.py +2 -0
- flwr/proto/message_pb2.py +8 -8
- flwr/proto/message_pb2.pyi +13 -2
- flwr/proto/recorddict_pb2.py +16 -28
- flwr/proto/recorddict_pb2.pyi +46 -64
- flwr/server/superlink/fleet/rest_rere/rest_api.py +2 -2
- flwr/supernode/cli/__init__.py +5 -1
- flwr/supernode/cli/flwr_clientapp.py +73 -0
- flwr/supernode/nodestate/in_memory_nodestate.py +112 -0
- flwr/supernode/nodestate/nodestate.py +132 -6
- flwr/supernode/runtime/__init__.py +15 -0
- flwr/{client/clientapp/app.py → supernode/runtime/run_clientapp.py} +2 -54
- flwr/supernode/servicer/__init__.py +15 -0
- flwr/supernode/servicer/clientappio/__init__.py +24 -0
- flwr/supernode/start_client_internal.py +2 -5
- {flwr_nightly-1.19.0.dev20250601.dist-info → flwr_nightly-1.19.0.dev20250602.dist-info}/METADATA +1 -1
- {flwr_nightly-1.19.0.dev20250601.dist-info → flwr_nightly-1.19.0.dev20250602.dist-info}/RECORD +25 -21
- {flwr_nightly-1.19.0.dev20250601.dist-info → flwr_nightly-1.19.0.dev20250602.dist-info}/entry_points.txt +1 -1
- /flwr/{client/clientapp → supernode/servicer/clientappio}/clientappio_servicer.py +0 -0
- {flwr_nightly-1.19.0.dev20250601.dist-info → flwr_nightly-1.19.0.dev20250602.dist-info}/WHEEL +0 -0
@@ -0,0 +1,73 @@
|
|
1
|
+
# Copyright 2025 Flower Labs GmbH. All Rights Reserved.
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
# ==============================================================================
|
15
|
+
"""`flwr-clientapp` command."""
|
16
|
+
|
17
|
+
|
18
|
+
import argparse
|
19
|
+
from logging import DEBUG, INFO
|
20
|
+
|
21
|
+
from flwr.common.args import add_args_flwr_app_common
|
22
|
+
from flwr.common.constant import CLIENTAPPIO_API_DEFAULT_CLIENT_ADDRESS
|
23
|
+
from flwr.common.exit import ExitCode, flwr_exit
|
24
|
+
from flwr.common.logger import log
|
25
|
+
from flwr.supernode.runtime.run_clientapp import run_clientapp
|
26
|
+
|
27
|
+
|
28
|
+
def flwr_clientapp() -> None:
|
29
|
+
"""Run process-isolated Flower ClientApp."""
|
30
|
+
args = _parse_args_run_flwr_clientapp().parse_args()
|
31
|
+
if not args.insecure:
|
32
|
+
flwr_exit(
|
33
|
+
ExitCode.COMMON_TLS_NOT_SUPPORTED,
|
34
|
+
"flwr-clientapp does not support TLS yet.",
|
35
|
+
)
|
36
|
+
|
37
|
+
log(INFO, "Start `flwr-clientapp` process")
|
38
|
+
log(
|
39
|
+
DEBUG,
|
40
|
+
"`flwr-clientapp` will attempt to connect to SuperNode's "
|
41
|
+
"ClientAppIo API at %s with token %s",
|
42
|
+
args.clientappio_api_address,
|
43
|
+
args.token,
|
44
|
+
)
|
45
|
+
run_clientapp(
|
46
|
+
clientappio_api_address=args.clientappio_api_address,
|
47
|
+
run_once=(args.token is not None),
|
48
|
+
token=args.token,
|
49
|
+
flwr_dir=args.flwr_dir,
|
50
|
+
certificates=None,
|
51
|
+
)
|
52
|
+
|
53
|
+
|
54
|
+
def _parse_args_run_flwr_clientapp() -> argparse.ArgumentParser:
|
55
|
+
"""Parse flwr-clientapp command line arguments."""
|
56
|
+
parser = argparse.ArgumentParser(
|
57
|
+
description="Run a Flower ClientApp",
|
58
|
+
)
|
59
|
+
parser.add_argument(
|
60
|
+
"--clientappio-api-address",
|
61
|
+
default=CLIENTAPPIO_API_DEFAULT_CLIENT_ADDRESS,
|
62
|
+
type=str,
|
63
|
+
help="Address of SuperNode's ClientAppIo API (IPv4, IPv6, or a domain name)."
|
64
|
+
f"By default, it is set to {CLIENTAPPIO_API_DEFAULT_CLIENT_ADDRESS}.",
|
65
|
+
)
|
66
|
+
parser.add_argument(
|
67
|
+
"--token",
|
68
|
+
type=int,
|
69
|
+
required=False,
|
70
|
+
help="Unique token generated by SuperNode for each ClientApp execution",
|
71
|
+
)
|
72
|
+
add_args_flwr_app_common(parser=parser)
|
73
|
+
return parser
|
@@ -15,17 +15,40 @@
|
|
15
15
|
"""In-memory NodeState implementation."""
|
16
16
|
|
17
17
|
|
18
|
+
from collections.abc import Sequence
|
19
|
+
from dataclasses import dataclass
|
20
|
+
from threading import Lock
|
18
21
|
from typing import Optional
|
19
22
|
|
23
|
+
from flwr.common import Context, Message
|
24
|
+
from flwr.common.typing import Run
|
25
|
+
|
20
26
|
from .nodestate import NodeState
|
21
27
|
|
22
28
|
|
29
|
+
@dataclass
|
30
|
+
class MessageEntry:
|
31
|
+
"""Data class to represent a message entry."""
|
32
|
+
|
33
|
+
message: Message
|
34
|
+
is_retrieved: bool = False
|
35
|
+
|
36
|
+
|
23
37
|
class InMemoryNodeState(NodeState):
|
24
38
|
"""In-memory NodeState implementation."""
|
25
39
|
|
26
40
|
def __init__(self) -> None:
|
27
41
|
# Store node_id
|
28
42
|
self.node_id: Optional[int] = None
|
43
|
+
# Store Object ID to MessageEntry mapping
|
44
|
+
self.msg_store: dict[str, MessageEntry] = {}
|
45
|
+
self.lock_msg_store = Lock()
|
46
|
+
# Store run ID to Run mapping
|
47
|
+
self.run_store: dict[int, Run] = {}
|
48
|
+
self.lock_run_store = Lock()
|
49
|
+
# Store run ID to Context mapping
|
50
|
+
self.ctx_store: dict[int, Context] = {}
|
51
|
+
self.lock_ctx_store = Lock()
|
29
52
|
|
30
53
|
def set_node_id(self, node_id: Optional[int]) -> None:
|
31
54
|
"""Set the node ID."""
|
@@ -36,3 +59,92 @@ class InMemoryNodeState(NodeState):
|
|
36
59
|
if self.node_id is None:
|
37
60
|
raise ValueError("Node ID not set")
|
38
61
|
return self.node_id
|
62
|
+
|
63
|
+
def store_message(self, message: Message) -> Optional[str]:
|
64
|
+
"""Store a message."""
|
65
|
+
with self.lock_msg_store:
|
66
|
+
msg_id = message.metadata.message_id
|
67
|
+
if msg_id == "" or msg_id in self.msg_store:
|
68
|
+
return None
|
69
|
+
self.msg_store[msg_id] = MessageEntry(message=message)
|
70
|
+
return msg_id
|
71
|
+
|
72
|
+
def get_messages(
|
73
|
+
self,
|
74
|
+
*,
|
75
|
+
run_ids: Optional[Sequence[int]] = None,
|
76
|
+
is_reply: Optional[bool] = None,
|
77
|
+
limit: Optional[int] = None,
|
78
|
+
) -> Sequence[Message]:
|
79
|
+
"""Retrieve messages based on the specified filters."""
|
80
|
+
selected_messages: list[Message] = []
|
81
|
+
|
82
|
+
with self.lock_msg_store:
|
83
|
+
# Iterate through all messages in the store
|
84
|
+
for object_id in list(self.msg_store.keys()):
|
85
|
+
entry = self.msg_store[object_id]
|
86
|
+
message = entry.message
|
87
|
+
|
88
|
+
# Skip messages that have already been retrieved
|
89
|
+
if entry.is_retrieved:
|
90
|
+
continue
|
91
|
+
|
92
|
+
# Skip messages whose run_id doesn't match the filter
|
93
|
+
if run_ids is not None:
|
94
|
+
if message.metadata.run_id not in run_ids:
|
95
|
+
continue
|
96
|
+
|
97
|
+
# If is_reply filter is set, filter for reply/non-reply messages
|
98
|
+
if is_reply is not None:
|
99
|
+
is_reply_message = message.metadata.reply_to_message_id != ""
|
100
|
+
# XOR logic to filter mismatched types (reply vs non-reply)
|
101
|
+
if is_reply ^ is_reply_message:
|
102
|
+
continue
|
103
|
+
|
104
|
+
# Add the message to the result set
|
105
|
+
selected_messages.append(message)
|
106
|
+
|
107
|
+
# Mark the message as retrieved
|
108
|
+
entry.is_retrieved = True
|
109
|
+
|
110
|
+
# Stop if the number of collected messages reaches the limit
|
111
|
+
if limit is not None and len(selected_messages) >= limit:
|
112
|
+
break
|
113
|
+
|
114
|
+
return selected_messages
|
115
|
+
|
116
|
+
def delete_messages(
|
117
|
+
self,
|
118
|
+
*,
|
119
|
+
message_ids: Optional[Sequence[str]] = None,
|
120
|
+
) -> None:
|
121
|
+
"""Delete messages based on the specified filters."""
|
122
|
+
with self.lock_msg_store:
|
123
|
+
if message_ids is None:
|
124
|
+
# If no message IDs are provided, clear the entire store
|
125
|
+
self.msg_store.clear()
|
126
|
+
return
|
127
|
+
|
128
|
+
# Remove specified messages from the store
|
129
|
+
for msg_id in message_ids:
|
130
|
+
self.msg_store.pop(msg_id, None)
|
131
|
+
|
132
|
+
def store_run(self, run: Run) -> None:
|
133
|
+
"""Store a run."""
|
134
|
+
with self.lock_run_store:
|
135
|
+
self.run_store[run.run_id] = run
|
136
|
+
|
137
|
+
def get_run(self, run_id: int) -> Optional[Run]:
|
138
|
+
"""Retrieve a run by its ID."""
|
139
|
+
with self.lock_run_store:
|
140
|
+
return self.run_store.get(run_id)
|
141
|
+
|
142
|
+
def store_context(self, context: Context) -> None:
|
143
|
+
"""Store a context."""
|
144
|
+
with self.lock_ctx_store:
|
145
|
+
self.ctx_store[context.run_id] = context
|
146
|
+
|
147
|
+
def get_context(self, run_id: int) -> Optional[Context]:
|
148
|
+
"""Retrieve a context by its run ID."""
|
149
|
+
with self.lock_ctx_store:
|
150
|
+
return self.ctx_store.get(run_id)
|
@@ -15,17 +15,143 @@
|
|
15
15
|
"""Abstract base class NodeState."""
|
16
16
|
|
17
17
|
|
18
|
-
import
|
18
|
+
from abc import ABC, abstractmethod
|
19
|
+
from collections.abc import Sequence
|
19
20
|
from typing import Optional
|
20
21
|
|
22
|
+
from flwr.common import Context, Message
|
23
|
+
from flwr.common.typing import Run
|
21
24
|
|
22
|
-
class NodeState(abc.ABC):
|
23
|
-
"""Abstract NodeState."""
|
24
25
|
|
25
|
-
|
26
|
-
|
26
|
+
class NodeState(ABC):
|
27
|
+
"""Abstract base class for node state."""
|
28
|
+
|
29
|
+
@abstractmethod
|
30
|
+
def set_node_id(self, node_id: int) -> None:
|
27
31
|
"""Set the node ID."""
|
28
32
|
|
29
|
-
@
|
33
|
+
@abstractmethod
|
30
34
|
def get_node_id(self) -> int:
|
31
35
|
"""Get the node ID."""
|
36
|
+
|
37
|
+
@abstractmethod
|
38
|
+
def store_message(self, message: Message) -> Optional[str]:
|
39
|
+
"""Store a message.
|
40
|
+
|
41
|
+
Parameters
|
42
|
+
----------
|
43
|
+
message : Message
|
44
|
+
The message to store.
|
45
|
+
|
46
|
+
Returns
|
47
|
+
-------
|
48
|
+
Optional[str]
|
49
|
+
The object ID of the stored message, or None if storage failed.
|
50
|
+
"""
|
51
|
+
|
52
|
+
@abstractmethod
|
53
|
+
def get_messages(
|
54
|
+
self,
|
55
|
+
*,
|
56
|
+
run_ids: Optional[Sequence[int]] = None,
|
57
|
+
is_reply: Optional[bool] = None,
|
58
|
+
limit: Optional[int] = None,
|
59
|
+
) -> Sequence[Message]:
|
60
|
+
"""Retrieve messages based on the specified filters.
|
61
|
+
|
62
|
+
If a filter is set to None, it is ignored.
|
63
|
+
If multiple filters are provided, they are combined using AND logic.
|
64
|
+
|
65
|
+
Parameters
|
66
|
+
----------
|
67
|
+
run_ids : Optional[Sequence[int]] (default: None)
|
68
|
+
Sequence of run IDs to filter by. If a sequence is provided,
|
69
|
+
it is treated as an OR condition.
|
70
|
+
is_reply : Optional[bool] (default: None)
|
71
|
+
If True, filter for reply messages; if False, filter for non-reply
|
72
|
+
(instruction) messages.
|
73
|
+
limit : Optional[int] (default: None)
|
74
|
+
Maximum number of messages to return. If None, no limit is applied.
|
75
|
+
|
76
|
+
Returns
|
77
|
+
-------
|
78
|
+
Sequence[Message]
|
79
|
+
A sequence of messages matching the specified filters.
|
80
|
+
|
81
|
+
Notes
|
82
|
+
-----
|
83
|
+
**IMPORTANT:** Retrieved messages will **NOT** be returned again by subsequent
|
84
|
+
calls to this method, even if the filters match them.
|
85
|
+
"""
|
86
|
+
|
87
|
+
@abstractmethod
|
88
|
+
def delete_messages(
|
89
|
+
self,
|
90
|
+
*,
|
91
|
+
message_ids: Optional[Sequence[str]] = None,
|
92
|
+
) -> None:
|
93
|
+
"""Delete messages based on the specified filters.
|
94
|
+
|
95
|
+
If a filter is set to None, it is ignored.
|
96
|
+
If multiple filters are provided, they are combined using AND logic.
|
97
|
+
|
98
|
+
Parameters
|
99
|
+
----------
|
100
|
+
message_ids : Optional[Sequence[str]] (default: None)
|
101
|
+
Sequence of message (object) IDs to filter by. If a sequence is provided,
|
102
|
+
it is treated as an OR condition.
|
103
|
+
|
104
|
+
Notes
|
105
|
+
-----
|
106
|
+
**IMPORTANT:** **All messages** will be deleted if no filters are provided.
|
107
|
+
"""
|
108
|
+
|
109
|
+
@abstractmethod
|
110
|
+
def store_run(self, run: Run) -> None:
|
111
|
+
"""Store a run.
|
112
|
+
|
113
|
+
Parameters
|
114
|
+
----------
|
115
|
+
run : Run
|
116
|
+
The `Run` instance to store.
|
117
|
+
"""
|
118
|
+
|
119
|
+
@abstractmethod
|
120
|
+
def get_run(self, run_id: int) -> Optional[Run]:
|
121
|
+
"""Retrieve a run by its ID.
|
122
|
+
|
123
|
+
Parameters
|
124
|
+
----------
|
125
|
+
run_id : int
|
126
|
+
The ID of the run to retrieve.
|
127
|
+
|
128
|
+
Returns
|
129
|
+
-------
|
130
|
+
Optional[Run]
|
131
|
+
The `Run` instance if found, otherwise None.
|
132
|
+
"""
|
133
|
+
|
134
|
+
@abstractmethod
|
135
|
+
def store_context(self, context: Context) -> None:
|
136
|
+
"""Store a context.
|
137
|
+
|
138
|
+
Parameters
|
139
|
+
----------
|
140
|
+
context : Context
|
141
|
+
The context to store.
|
142
|
+
"""
|
143
|
+
|
144
|
+
@abstractmethod
|
145
|
+
def get_context(self, run_id: int) -> Optional[Context]:
|
146
|
+
"""Retrieve a context by its run ID.
|
147
|
+
|
148
|
+
Parameters
|
149
|
+
----------
|
150
|
+
run_id : int
|
151
|
+
The ID of the run with which the context is associated.
|
152
|
+
|
153
|
+
Returns
|
154
|
+
-------
|
155
|
+
Optional[Context]
|
156
|
+
The `Context` instance if found, otherwise None.
|
157
|
+
"""
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# Copyright 2025 Flower Labs GmbH. All Rights Reserved.
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
# ==============================================================================
|
15
|
+
"""Flower SuperNode components."""
|
@@ -15,7 +15,6 @@
|
|
15
15
|
"""Flower ClientApp process."""
|
16
16
|
|
17
17
|
|
18
|
-
import argparse
|
19
18
|
import gc
|
20
19
|
import time
|
21
20
|
from logging import DEBUG, ERROR, INFO
|
@@ -26,11 +25,10 @@ import grpc
|
|
26
25
|
from flwr.app.error import Error
|
27
26
|
from flwr.cli.install import install_from_fab
|
28
27
|
from flwr.client.client_app import ClientApp, LoadClientAppError
|
28
|
+
from flwr.client.clientapp.utils import get_load_client_app_fn
|
29
29
|
from flwr.common import Context, Message
|
30
|
-
from flwr.common.args import add_args_flwr_app_common
|
31
30
|
from flwr.common.config import get_flwr_dir
|
32
|
-
from flwr.common.constant import
|
33
|
-
from flwr.common.exit import ExitCode, flwr_exit
|
31
|
+
from flwr.common.constant import ErrorCode
|
34
32
|
from flwr.common.grpc import create_channel, on_channel_state_change
|
35
33
|
from flwr.common.logger import log
|
36
34
|
from flwr.common.retry_invoker import _make_simple_grpc_retry_invoker, _wrap_stub
|
@@ -55,34 +53,6 @@ from flwr.proto.clientappio_pb2 import (
|
|
55
53
|
)
|
56
54
|
from flwr.proto.clientappio_pb2_grpc import ClientAppIoStub
|
57
55
|
|
58
|
-
from .utils import get_load_client_app_fn
|
59
|
-
|
60
|
-
|
61
|
-
def flwr_clientapp() -> None:
|
62
|
-
"""Run process-isolated Flower ClientApp."""
|
63
|
-
args = _parse_args_run_flwr_clientapp().parse_args()
|
64
|
-
if not args.insecure:
|
65
|
-
flwr_exit(
|
66
|
-
ExitCode.COMMON_TLS_NOT_SUPPORTED,
|
67
|
-
"flwr-clientapp does not support TLS yet.",
|
68
|
-
)
|
69
|
-
|
70
|
-
log(INFO, "Start `flwr-clientapp` process")
|
71
|
-
log(
|
72
|
-
DEBUG,
|
73
|
-
"`flwr-clientapp` will attempt to connect to SuperNode's "
|
74
|
-
"ClientAppIo API at %s with token %s",
|
75
|
-
args.clientappio_api_address,
|
76
|
-
args.token,
|
77
|
-
)
|
78
|
-
run_clientapp(
|
79
|
-
clientappio_api_address=args.clientappio_api_address,
|
80
|
-
run_once=(args.token is not None),
|
81
|
-
token=args.token,
|
82
|
-
flwr_dir=args.flwr_dir,
|
83
|
-
certificates=None,
|
84
|
-
)
|
85
|
-
|
86
56
|
|
87
57
|
def run_clientapp( # pylint: disable=R0914
|
88
58
|
clientappio_api_address: str,
|
@@ -233,25 +203,3 @@ def push_clientappoutputs(
|
|
233
203
|
except grpc.RpcError as e:
|
234
204
|
log(ERROR, "[PushClientAppOutputs] gRPC error occurred: %s", str(e))
|
235
205
|
raise e
|
236
|
-
|
237
|
-
|
238
|
-
def _parse_args_run_flwr_clientapp() -> argparse.ArgumentParser:
|
239
|
-
"""Parse flwr-clientapp command line arguments."""
|
240
|
-
parser = argparse.ArgumentParser(
|
241
|
-
description="Run a Flower ClientApp",
|
242
|
-
)
|
243
|
-
parser.add_argument(
|
244
|
-
"--clientappio-api-address",
|
245
|
-
default=CLIENTAPPIO_API_DEFAULT_CLIENT_ADDRESS,
|
246
|
-
type=str,
|
247
|
-
help="Address of SuperNode's ClientAppIo API (IPv4, IPv6, or a domain name)."
|
248
|
-
f"By default, it is set to {CLIENTAPPIO_API_DEFAULT_CLIENT_ADDRESS}.",
|
249
|
-
)
|
250
|
-
parser.add_argument(
|
251
|
-
"--token",
|
252
|
-
type=int,
|
253
|
-
required=False,
|
254
|
-
help="Unique token generated by SuperNode for each ClientApp execution",
|
255
|
-
)
|
256
|
-
add_args_flwr_app_common(parser=parser)
|
257
|
-
return parser
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# Copyright 2025 Flower Labs GmbH. All Rights Reserved.
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
# ==============================================================================
|
15
|
+
"""Flower SuperNode servicers."""
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# Copyright 2025 Flower Labs GmbH. All Rights Reserved.
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
# ==============================================================================
|
15
|
+
"""ClientAppIo API Servicer."""
|
16
|
+
|
17
|
+
|
18
|
+
from .clientappio_servicer import ClientAppInputs, ClientAppIoServicer, ClientAppOutputs
|
19
|
+
|
20
|
+
__all__ = [
|
21
|
+
"ClientAppInputs",
|
22
|
+
"ClientAppIoServicer",
|
23
|
+
"ClientAppOutputs",
|
24
|
+
]
|
@@ -33,11 +33,6 @@ from grpc import RpcError
|
|
33
33
|
|
34
34
|
from flwr.app.error import Error
|
35
35
|
from flwr.cli.config_utils import get_fab_metadata
|
36
|
-
from flwr.client.clientapp.app import flwr_clientapp
|
37
|
-
from flwr.client.clientapp.clientappio_servicer import (
|
38
|
-
ClientAppInputs,
|
39
|
-
ClientAppIoServicer,
|
40
|
-
)
|
41
36
|
from flwr.client.grpc_adapter_client.connection import grpc_adapter
|
42
37
|
from flwr.client.grpc_rere_client.connection import grpc_request_response
|
43
38
|
from flwr.client.run_info_store import DeprecatedRunInfoStore
|
@@ -62,7 +57,9 @@ from flwr.common.logger import log
|
|
62
57
|
from flwr.common.retry_invoker import RetryInvoker, RetryState, exponential
|
63
58
|
from flwr.common.typing import Fab, Run, RunNotRunningException, UserConfig
|
64
59
|
from flwr.proto.clientappio_pb2_grpc import add_ClientAppIoServicer_to_server
|
60
|
+
from flwr.supernode.cli.flwr_clientapp import flwr_clientapp
|
65
61
|
from flwr.supernode.nodestate import NodeStateFactory
|
62
|
+
from flwr.supernode.servicer.clientappio import ClientAppInputs, ClientAppIoServicer
|
66
63
|
|
67
64
|
|
68
65
|
# pylint: disable=import-outside-toplevel
|
{flwr_nightly-1.19.0.dev20250601.dist-info → flwr_nightly-1.19.0.dev20250602.dist-info}/METADATA
RENAMED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: flwr-nightly
|
3
|
-
Version: 1.19.0.
|
3
|
+
Version: 1.19.0.dev20250602
|
4
4
|
Summary: Flower: A Friendly Federated AI Framework
|
5
5
|
License: Apache-2.0
|
6
6
|
Keywords: Artificial Intelligence,Federated AI,Federated Analytics,Federated Evaluation,Federated Learning,Flower,Machine Learning
|
{flwr_nightly-1.19.0.dev20250601.dist-info → flwr_nightly-1.19.0.dev20250602.dist-info}/RECORD
RENAMED
@@ -77,9 +77,7 @@ flwr/cli/utils.py,sha256=brzc0HPhFxJDi4ctfyQi9lW35uOyvQzoOJ8XHeMDIfE,11575
|
|
77
77
|
flwr/client/__init__.py,sha256=boIhKaK6I977zrILmoTutNx94x5jB0e6F1gnAjaRJnI,1250
|
78
78
|
flwr/client/client.py,sha256=3HAchxvknKG9jYbB7swNyDj-e5vUWDuMKoLvbT7jCVM,7895
|
79
79
|
flwr/client/client_app.py,sha256=zVhi-l3chAb06ozFsKwix3hU_RpOLjST13Ha50AVIPE,16918
|
80
|
-
flwr/client/clientapp/__init__.py,sha256=
|
81
|
-
flwr/client/clientapp/app.py,sha256=N1nd4PnwWzzZc3kn1g01SULXVMriCstCnfDYV_KERqc,9057
|
82
|
-
flwr/client/clientapp/clientappio_servicer.py,sha256=LmzkxtNQBn5vVrHc0Bhq2WqaK6-LM2v4kfLBN0PiNNM,8522
|
80
|
+
flwr/client/clientapp/__init__.py,sha256=Zw9qP5nHFnJ9K1dcR4cdY0fRqN-FaMYFSHJFXoFpUvo,711
|
83
81
|
flwr/client/clientapp/utils.py,sha256=LsiW1OL2VPcjom3xN29pgBQC0UrttQ-xWL_GF1fkKDo,4344
|
84
82
|
flwr/client/dpfedavg_numpy_client.py,sha256=3hul067cT2E9jBhzp7bFnFAZ_D2nWcIUEdHYE05FpzU,7404
|
85
83
|
flwr/client/grpc_adapter_client/__init__.py,sha256=RQWP5mFPROLHKgombiRvPXVWSoVrQ81wvZm0-lOuuBA,742
|
@@ -125,7 +123,7 @@ flwr/common/exit_handlers.py,sha256=IaqJ60fXZuu7McaRYnoYKtlbH9t4Yl9goNExKqtmQbs,
|
|
125
123
|
flwr/common/grpc.py,sha256=manTaHaPiyYngUq1ErZvvV2B2GxlXUUUGRy3jc3TBIQ,9798
|
126
124
|
flwr/common/heartbeat.py,sha256=SyEpNDnmJ0lni0cWO67rcoJVKasCLmkNHm3dKLeNrLU,5749
|
127
125
|
flwr/common/inflatable.py,sha256=vBDlaJlgF6sryjglhFcr22zylROmPFwM7QLjVV7XbtU,6837
|
128
|
-
flwr/common/inflatable_grpc_utils.py,sha256=
|
126
|
+
flwr/common/inflatable_grpc_utils.py,sha256=e8uoQyuuhPlJiW359AuWrqcyRUtVRCP-v8M2hH-_U6U,4069
|
129
127
|
flwr/common/logger.py,sha256=JbRf6E2vQxXzpDBq1T8IDUJo_usu3gjWEBPQ6uKcmdg,13049
|
130
128
|
flwr/common/message.py,sha256=HfSeqxwXgf90ilbMlM0vrF4cJWqJVx3jJ0gNmTfgdFw,19628
|
131
129
|
flwr/common/object_ref.py,sha256=p3SfTeqo3Aj16SkB-vsnNn01zswOPdGNBitcbRnqmUk,9134
|
@@ -134,9 +132,9 @@ flwr/common/pyproject.py,sha256=2SU6yJW7059SbMXgzjOdK1GZRWO6AixDH7BmdxbMvHI,1386
|
|
134
132
|
flwr/common/record/__init__.py,sha256=cNGccdDoxttqgnUgyKRIqLWULjW-NaSmOufVxtXq-sw,1197
|
135
133
|
flwr/common/record/array.py,sha256=3K01tAf_jedub2r2-vkRshbsjBSiKErAO4KqDgdDaSo,11776
|
136
134
|
flwr/common/record/arrayrecord.py,sha256=CpoqYXM6Iv4XEc9SryCMYmw-bIvP8ut6xWJzRwYJzdU,18008
|
137
|
-
flwr/common/record/configrecord.py,sha256=
|
135
|
+
flwr/common/record/configrecord.py,sha256=G7U0q39kB0Kyi0zMxFmPxcVemL9NgwVS1qjvI4BRQuU,9763
|
138
136
|
flwr/common/record/conversion_utils.py,sha256=wbNCzy7oAqaA3-arhls_EqRZYXRC4YrWIoE-Gy82fJ0,1191
|
139
|
-
flwr/common/record/metricrecord.py,sha256=
|
137
|
+
flwr/common/record/metricrecord.py,sha256=XBPnIclQBRV_vHuvMk2sEdPjeyX5_Y00nuOHy8rASW8,8966
|
140
138
|
flwr/common/record/recorddict.py,sha256=p7hBimFpKM1XKUe6OAkR_7pYGzGL_EwUJUvJ8odZEcY,14986
|
141
139
|
flwr/common/record/typeddict.py,sha256=dDKgUThs2BscYUNcgP82KP8-qfAYXYftDrf2LszAC_o,3599
|
142
140
|
flwr/common/recorddict_compat.py,sha256=D5SqXWkqBddn5b6K_5UoH7aZ11UaN3lDTlzvHx3-rqk,14119
|
@@ -149,8 +147,8 @@ flwr/common/secure_aggregation/ndarrays_arithmetic.py,sha256=TrggOlizlny3V2KS7-3
|
|
149
147
|
flwr/common/secure_aggregation/quantization.py,sha256=ssFZpiRyj9ltIh0Ai3vGkDqWFO4SoqgoD1mDU9XqMEM,2400
|
150
148
|
flwr/common/secure_aggregation/secaggplus_constants.py,sha256=dGYhWOBMMDJcQH4_tQNC8-Efqm-ecEUNN9ANz59UnCk,2182
|
151
149
|
flwr/common/secure_aggregation/secaggplus_utils.py,sha256=E_xU-Zd45daO1em7M6C2wOjFXVtJf-6tl7fp-7xq1wo,3214
|
152
|
-
flwr/common/serde.py,sha256=
|
153
|
-
flwr/common/serde_utils.py,sha256=
|
150
|
+
flwr/common/serde.py,sha256=hHqXbAF-MtSRWsROz4v-P_C4dMDSIt1XJ3Hecxp8os0,23020
|
151
|
+
flwr/common/serde_utils.py,sha256=krx2C_W31KpfmDqnDCtULoTkT8WKweWTJ7FHYWtF1r4,5815
|
154
152
|
flwr/common/telemetry.py,sha256=jF47v0SbnBd43XamHtl3wKxs3knFUY2p77cm_2lzZ8M,8762
|
155
153
|
flwr/common/typing.py,sha256=97QRfRRS7sQnjkAI5FDZ01-38oQUSz4i1qqewQmBWRg,6886
|
156
154
|
flwr/common/version.py,sha256=7GAGzPn73Mkh09qhrjbmjZQtcqVhBuzhFBaK4Mk4VRk,1325
|
@@ -196,16 +194,16 @@ flwr/proto/log_pb2.py,sha256=iKaS3MVn1BS4xHu8uGPFCOi1KWtvVx-H9V4jCUIJghs,1393
|
|
196
194
|
flwr/proto/log_pb2.pyi,sha256=ipuhgo40sAHTcRzCsGI1HwIstr5q0THPNk_cf62YyME,1448
|
197
195
|
flwr/proto/log_pb2_grpc.py,sha256=1oboBPFxaTEXt9Aw7EAj8gXHDCNMhZD2VXqocC9l_gk,159
|
198
196
|
flwr/proto/log_pb2_grpc.pyi,sha256=ff2TSiLVnG6IVQcTGzb2DIH3XRSoAvAo_RMcvbMFyc0,76
|
199
|
-
flwr/proto/message_pb2.py,sha256=
|
200
|
-
flwr/proto/message_pb2.pyi,sha256=
|
197
|
+
flwr/proto/message_pb2.py,sha256=0gwIorik6s5o7UF603mtRecDlQclPFwiDSlvkMxqzc0,4388
|
198
|
+
flwr/proto/message_pb2.pyi,sha256=J1Y7Ok546KJXyvpShElhWLWNusfqww-K_7D6u0fFZbA,9072
|
201
199
|
flwr/proto/message_pb2_grpc.py,sha256=1oboBPFxaTEXt9Aw7EAj8gXHDCNMhZD2VXqocC9l_gk,159
|
202
200
|
flwr/proto/message_pb2_grpc.pyi,sha256=ff2TSiLVnG6IVQcTGzb2DIH3XRSoAvAo_RMcvbMFyc0,76
|
203
201
|
flwr/proto/node_pb2.py,sha256=BzZfAWIX7lV62bZr9f7x16lUZcpg-EImxnwxQXgCbYg,1045
|
204
202
|
flwr/proto/node_pb2.pyi,sha256=CPMeIPzUeI5-Csw9sHktV9UBH4GbqiGuYzGQQKftm6Q,616
|
205
203
|
flwr/proto/node_pb2_grpc.py,sha256=1oboBPFxaTEXt9Aw7EAj8gXHDCNMhZD2VXqocC9l_gk,159
|
206
204
|
flwr/proto/node_pb2_grpc.pyi,sha256=ff2TSiLVnG6IVQcTGzb2DIH3XRSoAvAo_RMcvbMFyc0,76
|
207
|
-
flwr/proto/recorddict_pb2.py,sha256=
|
208
|
-
flwr/proto/recorddict_pb2.pyi,sha256=
|
205
|
+
flwr/proto/recorddict_pb2.py,sha256=eVkcnxMTFa3rvknRNiFuJ8z8xxPqgw7bV04aFiTe1j4,5290
|
206
|
+
flwr/proto/recorddict_pb2.pyi,sha256=xHRSK_GWlIynXDQxWNNmmidsj4OjZzVYqosRB6EonmE,14544
|
209
207
|
flwr/proto/recorddict_pb2_grpc.py,sha256=1oboBPFxaTEXt9Aw7EAj8gXHDCNMhZD2VXqocC9l_gk,159
|
210
208
|
flwr/proto/recorddict_pb2_grpc.pyi,sha256=ff2TSiLVnG6IVQcTGzb2DIH3XRSoAvAo_RMcvbMFyc0,76
|
211
209
|
flwr/proto/run_pb2.py,sha256=SWpc2yDTprm7DaabMQne43q_7_NWQN3I66y-d_PpcGg,4727
|
@@ -291,7 +289,7 @@ flwr/server/superlink/fleet/grpc_rere/server_interceptor.py,sha256=DrHubsaLgJCwC
|
|
291
289
|
flwr/server/superlink/fleet/message_handler/__init__.py,sha256=fHsRV0KvJ8HtgSA4_YBsEzuhJLjO8p6xx4aCY2oE1p4,731
|
292
290
|
flwr/server/superlink/fleet/message_handler/message_handler.py,sha256=P43PapLZJKbZ0Oo0kP_KcO5zSMvO53SakQgPMiR5d1M,6500
|
293
291
|
flwr/server/superlink/fleet/rest_rere/__init__.py,sha256=Lzc93nA7tDqoy-zRUaPG316oqFiZX1HUCL5ELaXY_xw,735
|
294
|
-
flwr/server/superlink/fleet/rest_rere/rest_api.py,sha256=
|
292
|
+
flwr/server/superlink/fleet/rest_rere/rest_api.py,sha256=jIljUNMvZ8dDvSlkyn1c2y9sDAf_QoBr-q_o3BWxJ7o,7199
|
295
293
|
flwr/server/superlink/fleet/vce/__init__.py,sha256=XOKbAWOzlCqEOQ3M2cBYkH7HKA7PxlbCJMunt-ty-DY,784
|
296
294
|
flwr/server/superlink/fleet/vce/backend/__init__.py,sha256=PPH89Yqd1XKm-sRJN6R0WQlKT_b4v54Kzl2yzHAFzM8,1437
|
297
295
|
flwr/server/superlink/fleet/vce/backend/backend.py,sha256=-wDHjgAy5mrfEgXj0GxkJI7lhEbgSUyPwmNAf9ZcDzc,2193
|
@@ -346,14 +344,20 @@ flwr/superexec/executor.py,sha256=M5ucqSE53jfRtuCNf59WFLqQvA1Mln4741TySeZE7qQ,31
|
|
346
344
|
flwr/superexec/simulation.py,sha256=j6YwUvBN7EQ09ID7MYOCVZ70PGbuyBy8f9bXU0EszEM,4088
|
347
345
|
flwr/superlink/__init__.py,sha256=GNSuJ4-N6Z8wun2iZNlXqENt5beUyzC0Gi_tN396bbM,707
|
348
346
|
flwr/supernode/__init__.py,sha256=KgeCaVvXWrU3rptNR1y0oBp4YtXbAcrnCcJAiOoWkI4,707
|
349
|
-
flwr/supernode/cli/__init__.py,sha256=
|
347
|
+
flwr/supernode/cli/__init__.py,sha256=JuEMr0-s9zv-PEWKuLB9tj1ocNfroSyNJ-oyv7ati9A,887
|
350
348
|
flwr/supernode/cli/flower_supernode.py,sha256=pr16i1xWDzxxB5lcRTaSd4DVQvVOC3G0zwLliS9jSZ0,8766
|
349
|
+
flwr/supernode/cli/flwr_clientapp.py,sha256=ORsNxviXOKGzZdcp5DEiHIuj4RycgB2OaPDaTTJJWz4,2555
|
351
350
|
flwr/supernode/nodestate/__init__.py,sha256=CyLLObbmmVgfRO88UCM0VMait1dL57mUauUDfuSHsbU,976
|
352
|
-
flwr/supernode/nodestate/in_memory_nodestate.py,sha256=
|
353
|
-
flwr/supernode/nodestate/nodestate.py,sha256
|
351
|
+
flwr/supernode/nodestate/in_memory_nodestate.py,sha256=4ZiLA45fMi2bJgmfDNLtiv-gVNru95Bi48xBy7xtatA,5212
|
352
|
+
flwr/supernode/nodestate/nodestate.py,sha256=SgblnKtqzTHRiODwg4QUREw1-uYPQrLzoeTBlROHf_0,4571
|
354
353
|
flwr/supernode/nodestate/nodestate_factory.py,sha256=UYTDCcwK_baHUmkzkJDxL0UEqvtTfOMlQRrROMCd0Xo,1430
|
355
|
-
flwr/supernode/
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
354
|
+
flwr/supernode/runtime/__init__.py,sha256=JQdqd2EMTn-ORMeTvewYYh52ls0YKP68jrps1qioxu4,718
|
355
|
+
flwr/supernode/runtime/run_clientapp.py,sha256=sEmrN1F-tV2YAzw06Dk4RM696yyP4xqm2gFLkp53Y6k,7402
|
356
|
+
flwr/supernode/servicer/__init__.py,sha256=lucTzre5WPK7G1YLCfaqg3rbFWdNSb7ZTt-ca8gxdEo,717
|
357
|
+
flwr/supernode/servicer/clientappio/__init__.py,sha256=vJyOjO2FXZ2URbnthmdsgs6948wbYfdq1L1V8Um-Lr8,895
|
358
|
+
flwr/supernode/servicer/clientappio/clientappio_servicer.py,sha256=LmzkxtNQBn5vVrHc0Bhq2WqaK6-LM2v4kfLBN0PiNNM,8522
|
359
|
+
flwr/supernode/start_client_internal.py,sha256=n8xmASWkJB1SngirdvpohjO2RCrGeasKwiLrOMjN4X8,17366
|
360
|
+
flwr_nightly-1.19.0.dev20250602.dist-info/METADATA,sha256=csDAUbHgOviQ9Y9bb0VKlKRsI6i_wNi_SfUORnqWDr0,15910
|
361
|
+
flwr_nightly-1.19.0.dev20250602.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
362
|
+
flwr_nightly-1.19.0.dev20250602.dist-info/entry_points.txt,sha256=jNpDXGBGgs21RqUxelF_jwGaxtqFwm-MQyfz-ZqSjrA,367
|
363
|
+
flwr_nightly-1.19.0.dev20250602.dist-info/RECORD,,
|
@@ -3,7 +3,7 @@ flower-simulation=flwr.simulation.run_simulation:run_simulation_from_cli
|
|
3
3
|
flower-superlink=flwr.server.app:run_superlink
|
4
4
|
flower-supernode=flwr.supernode.cli:flower_supernode
|
5
5
|
flwr=flwr.cli.app:app
|
6
|
-
flwr-clientapp=flwr.
|
6
|
+
flwr-clientapp=flwr.supernode.cli:flwr_clientapp
|
7
7
|
flwr-serverapp=flwr.server.serverapp:flwr_serverapp
|
8
8
|
flwr-simulation=flwr.simulation.app:flwr_simulation
|
9
9
|
|
File without changes
|
{flwr_nightly-1.19.0.dev20250601.dist-info → flwr_nightly-1.19.0.dev20250602.dist-info}/WHEEL
RENAMED
File without changes
|