flwr-nightly 1.21.0.dev20250819__py3-none-any.whl → 1.21.0.dev20250820__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/common/exit/exit.py +4 -1
- flwr/common/exit/exit_code.py +4 -10
- flwr/server/app.py +33 -21
- flwr/server/grid/grpc_grid.py +1 -0
- flwr/server/grid/inmemory_grid.py +1 -0
- flwr/server/serverapp/app.py +115 -139
- flwr/server/superlink/serverappio/serverappio_grpc.py +1 -1
- flwr/simulation/app.py +127 -154
- flwr/supercore/app_utils.py +0 -31
- flwr/supercore/cli/flower_superexec.py +6 -0
- flwr/superlink/servicer/control/control_grpc.py +4 -9
- flwr/superlink/servicer/control/control_servicer.py +52 -14
- flwr/supernode/start_client_internal.py +1 -1
- {flwr_nightly-1.21.0.dev20250819.dist-info → flwr_nightly-1.21.0.dev20250820.dist-info}/METADATA +1 -1
- {flwr_nightly-1.21.0.dev20250819.dist-info → flwr_nightly-1.21.0.dev20250820.dist-info}/RECORD +17 -25
- flwr/superexec/__init__.py +0 -15
- flwr/superexec/deployment.py +0 -20
- flwr/superexec/simulation.py +0 -20
- flwr/superlink/executor/__init__.py +0 -28
- flwr/superlink/executor/app.py +0 -45
- flwr/superlink/executor/deployment.py +0 -188
- flwr/superlink/executor/executor.py +0 -100
- flwr/superlink/executor/simulation.py +0 -126
- {flwr_nightly-1.21.0.dev20250819.dist-info → flwr_nightly-1.21.0.dev20250820.dist-info}/WHEEL +0 -0
- {flwr_nightly-1.21.0.dev20250819.dist-info → flwr_nightly-1.21.0.dev20250820.dist-info}/entry_points.txt +0 -0
{flwr_nightly-1.21.0.dev20250819.dist-info → flwr_nightly-1.21.0.dev20250820.dist-info}/RECORD
RENAMED
@@ -117,8 +117,8 @@ flwr/common/dp.py,sha256=ftqWheOICK5N_zPaofnbFb474lMb5w9lclwxf5DKY0w,1978
|
|
117
117
|
flwr/common/event_log_plugin/__init__.py,sha256=ts3VAL3Fk6Grp1EK_1Qg_V-BfOof9F86iBx4rbrEkyo,838
|
118
118
|
flwr/common/event_log_plugin/event_log_plugin.py,sha256=4SkVa1Ic-sPlICJShBuggXmXDcQtWQ1KDby4kthFNF0,2064
|
119
119
|
flwr/common/exit/__init__.py,sha256=-ZOJYLaNnR729a7VzZiFsLiqngzKQh3xc27svYStZ_Q,826
|
120
|
-
flwr/common/exit/exit.py,sha256=
|
121
|
-
flwr/common/exit/exit_code.py,sha256=
|
120
|
+
flwr/common/exit/exit.py,sha256=dWZgznSZkg8Tr_Bh9jRHGUhlWk2228q5XFIK98Zr4Tc,3531
|
121
|
+
flwr/common/exit/exit_code.py,sha256=oFsMThjzOipMZ842BxaQbnlPbK1Do8hjzd-DIdKs0ig,4151
|
122
122
|
flwr/common/exit_handlers.py,sha256=IaqJ60fXZuu7McaRYnoYKtlbH9t4Yl9goNExKqtmQbs,4304
|
123
123
|
flwr/common/grpc.py,sha256=y70hUFvXkIf3l03xOhlb7qhS6W1UJZRSZqCdB0ir0v8,10381
|
124
124
|
flwr/common/heartbeat.py,sha256=SyEpNDnmJ0lni0cWO67rcoJVKasCLmkNHm3dKLeNrLU,5749
|
@@ -230,7 +230,7 @@ flwr/proto/transport_pb2_grpc.py,sha256=vLN3EHtx2aEEMCO4f1Upu-l27BPzd3-5pV-u8wPc
|
|
230
230
|
flwr/proto/transport_pb2_grpc.pyi,sha256=AGXf8RiIiW2J5IKMlm_3qT3AzcDa4F3P5IqUjve_esA,766
|
231
231
|
flwr/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
232
232
|
flwr/server/__init__.py,sha256=LQQHiuL2jy7TpNaKastRdGsexlxSt5ZWAQNVqitDnrY,1598
|
233
|
-
flwr/server/app.py,sha256=
|
233
|
+
flwr/server/app.py,sha256=vAm_K4U54qcE4QeefNsFXL6A_M2M2YKCk_TVzrMIXIE,28841
|
234
234
|
flwr/server/client_manager.py,sha256=5jCGavVli7XdupvWWo7ru3PdFTlRU8IGvHFSSoUVLRs,6227
|
235
235
|
flwr/server/client_proxy.py,sha256=sv0E9AldBYOvc3pusqFh-GnyreeMfsXQ1cuTtxTq_wY,2399
|
236
236
|
flwr/server/compat/__init__.py,sha256=0IsttWvY15qO98_1GyzVC-vR1e_ZPXOdu2qUlOkYMPE,886
|
@@ -242,15 +242,15 @@ flwr/server/criterion.py,sha256=G4e-6B48Pc7d5rmGVUpIzNKb6UF88O3VmTRuUltgjzM,1061
|
|
242
242
|
flwr/server/fleet_event_log_interceptor.py,sha256=gtVPr2yQp3U2GnabIdFnuok18VerEcidKj1lKmDYGoY,3950
|
243
243
|
flwr/server/grid/__init__.py,sha256=aWZHezoR2UGMJISB_gPMCm2N_2GSbm97A3lAp7ruhRQ,888
|
244
244
|
flwr/server/grid/grid.py,sha256=naGCYt5J6dnmUvrcGkdNyKPe3MBd-0awGm1ALmgahqY,6625
|
245
|
-
flwr/server/grid/grpc_grid.py,sha256=
|
246
|
-
flwr/server/grid/inmemory_grid.py,sha256=
|
245
|
+
flwr/server/grid/grpc_grid.py,sha256=lFzDmray2pLoeI0AfLWMp7FGWqen1iLuA1DlA4sMVQI,15319
|
246
|
+
flwr/server/grid/inmemory_grid.py,sha256=qVpTzM3yhJRIRlESWWN7RndVXYZmnbaBOeGqLsUVfo8,6189
|
247
247
|
flwr/server/history.py,sha256=cCkFhBN4GoHsYYNk5GG1Y089eKJh2DH_ZJbYPwLaGyk,5026
|
248
248
|
flwr/server/run_serverapp.py,sha256=v0p6jXj2dFxlRUdoEeF1mnaFd9XRQi6dZCflPY6d3qI,2063
|
249
249
|
flwr/server/server.py,sha256=39m4FSN2T-uVA-no9nstN0eWW0co-IUUAIMmpd3V7Jc,17893
|
250
250
|
flwr/server/server_app.py,sha256=8uagoZX-3CY3tazPqkIV9jY-cN0YrRRrDmVe23o0AV0,9515
|
251
251
|
flwr/server/server_config.py,sha256=e_6ddh0riwOJsdNn2BFev344uMWfDk9n7dyjNpPgm1w,1349
|
252
252
|
flwr/server/serverapp/__init__.py,sha256=xcC0T_MQSMS9cicUzUUpMNCOsF2d8Oh_8jvnoBLuZvo,800
|
253
|
-
flwr/server/serverapp/app.py,sha256=
|
253
|
+
flwr/server/serverapp/app.py,sha256=4wC6vpwSct3NImp4R_K1X7ROEtp8GJzSvIX6kUjmZvU,9372
|
254
254
|
flwr/server/serverapp_components.py,sha256=dfSqmrsVy3arKXpl3ZIBQWdV8rehfIms8aJooyzdmEM,2118
|
255
255
|
flwr/server/strategy/__init__.py,sha256=HhsSWMWaC7oCb2g7Kqn1MBKdrfvgi8VxACy9ZL706Q0,2836
|
256
256
|
flwr/server/strategy/aggregate.py,sha256=smlKKy-uFUuuFR12vlclucnwSQWRz78R79-Km4RWqbw,13978
|
@@ -304,7 +304,7 @@ flwr/server/superlink/linkstate/linkstate_factory.py,sha256=8RlosqSpKOoD_vhUUQPY
|
|
304
304
|
flwr/server/superlink/linkstate/sqlite_linkstate.py,sha256=NIJ1BDcj54TUpNaeb23af38wQE-TM6rnYVMJncJVKQ0,45503
|
305
305
|
flwr/server/superlink/linkstate/utils.py,sha256=IeLh7iGRCHU5MEWOl7iriaSE4L__8GWOa2OleXadK5M,15444
|
306
306
|
flwr/server/superlink/serverappio/__init__.py,sha256=Fy4zJuoccZe5mZSEIpOmQvU6YeXFBa1M4eZuXXmJcn8,717
|
307
|
-
flwr/server/superlink/serverappio/serverappio_grpc.py,sha256
|
307
|
+
flwr/server/superlink/serverappio/serverappio_grpc.py,sha256=-I7kBbr4w4ZVYwBZoAIle-xHKthFnZrsVfxa6WR8uxA,2310
|
308
308
|
flwr/server/superlink/serverappio/serverappio_servicer.py,sha256=3C_0boRbYuY1Vlf0DRGzBvTUX-D5UUzxYkFihSMZf-A,20094
|
309
309
|
flwr/server/superlink/simulation/__init__.py,sha256=Ry8DrNaZCMcQXvUc4FoCN2m3dvUQgWjasfp015o3Ec4,718
|
310
310
|
flwr/server/superlink/simulation/simulationio_grpc.py,sha256=VqWKxjpd4bCgPFKsgtIZPk9YcG0kc1EEmr5k20EKty4,2205
|
@@ -322,7 +322,7 @@ flwr/server/workflow/secure_aggregation/secagg_workflow.py,sha256=b_pKk7gmbahwyj
|
|
322
322
|
flwr/server/workflow/secure_aggregation/secaggplus_workflow.py,sha256=DkayCsnlAya6Y2PZsueLgoUCMRtV-GbnW08RfWx_SXM,29460
|
323
323
|
flwr/serverapp/__init__.py,sha256=HPvC_ZvMS7GCM7ALVrG_Wwm4bSDr4DZETeC561v3T9w,719
|
324
324
|
flwr/simulation/__init__.py,sha256=Gg6OsP1Z-ixc3-xxzvl7j7rz2Fijy9rzyEPpxgAQCeM,1556
|
325
|
-
flwr/simulation/app.py,sha256=
|
325
|
+
flwr/simulation/app.py,sha256=LbGLMvN9Ap119yBqsUcNNmVLRnCySnr4VechqcQ1hpA,10401
|
326
326
|
flwr/simulation/legacy_app.py,sha256=nMISQqW0otJL1-2Kfd94O6BLlGS2IEmEPKTM2WGKrIs,15861
|
327
327
|
flwr/simulation/ray_transport/__init__.py,sha256=ogd-0AMv2U-wBZ1r3sHWaDIOIrVqr88Xi6C8o4Dviy0,734
|
328
328
|
flwr/simulation/ray_transport/ray_actor.py,sha256=JN3xTqFIr5Z750k92CcA_uavzOHhSWDwE2WCaecvpks,19147
|
@@ -331,9 +331,9 @@ flwr/simulation/ray_transport/utils.py,sha256=KrexpWYCF-dAF3UHc9yDbPQWO-ahMT-BbD
|
|
331
331
|
flwr/simulation/run_simulation.py,sha256=-sp3dNZcp7MCAH0BlmZpVcFAGvozRdYXRdDYcH_2Zxk,20838
|
332
332
|
flwr/simulation/simulationio_connection.py,sha256=mzS1C6EEREwQDPceDo30anAasmTDLb9qqV2tXlBhOUA,3494
|
333
333
|
flwr/supercore/__init__.py,sha256=pqkFoow_E6UhbBlhmoD1gmTH-33yJRhBsIZqxRPFZ7U,755
|
334
|
-
flwr/supercore/app_utils.py,sha256=
|
334
|
+
flwr/supercore/app_utils.py,sha256=K76Zt6R670b1hUmxOsNc1WUCVYvF7lejXPcCO9K0Q0g,1753
|
335
335
|
flwr/supercore/cli/__init__.py,sha256=EDl2aO-fuQfxSbL-T1W9RAfA2N0hpWHmqX_GSwblJbQ,845
|
336
|
-
flwr/supercore/cli/flower_superexec.py,sha256=
|
336
|
+
flwr/supercore/cli/flower_superexec.py,sha256=UeiizyoA6wAjBAixELZFALn261rs71MdkSj3h3vxUpc,4084
|
337
337
|
flwr/supercore/corestate/__init__.py,sha256=Vau6-L_JG5QzNqtCTa9xCKGGljc09wY8avZmIjSJemg,774
|
338
338
|
flwr/supercore/corestate/corestate.py,sha256=rDAWWeG5DcpCyQso9Z3RhwL4zr2IroPlRMcDzqoSu8s,2328
|
339
339
|
flwr/supercore/ffs/__init__.py,sha256=U3KXwG_SplEvchat27K0LYPoPHzh-cwwT_NHsGlYMt8,908
|
@@ -358,21 +358,13 @@ flwr/supercore/superexec/plugin/serverapp_exec_plugin.py,sha256=IwRzdPV-cSKwrP2k
|
|
358
358
|
flwr/supercore/superexec/plugin/simulation_exec_plugin.py,sha256=upn5zE-YKkl_jTw8RzmeyQ58PU_UAlQ7CqnBXXdng8I,1060
|
359
359
|
flwr/supercore/superexec/run_superexec.py,sha256=6bzP9xzP8MrWwiN9xyizoU4rmY0ZkwLn_liVmvrKy6E,6058
|
360
360
|
flwr/supercore/utils.py,sha256=ebuHMbeA8eXisX0oMPqBK3hk7uVnIE_yiqWVz8YbkpQ,1324
|
361
|
-
flwr/superexec/__init__.py,sha256=YFqER0IJc1XEWfsX6AxZ9LSRq0sawPYrNYki-brvTIc,715
|
362
|
-
flwr/superexec/deployment.py,sha256=CEgWfkN_lH6Vci03RjwKLENw2z6kxNvUdVEErPbqYDY,830
|
363
|
-
flwr/superexec/simulation.py,sha256=wR3ERp_UdWJCkkLdJD7Rk5uVpWJtOqHuyhbq7Sm2tGE,830
|
364
361
|
flwr/superlink/__init__.py,sha256=GNSuJ4-N6Z8wun2iZNlXqENt5beUyzC0Gi_tN396bbM,707
|
365
|
-
flwr/superlink/executor/__init__.py,sha256=0efHPvuqEKvEmwsUc5sp5bqKX4asL3yioJ_ObwKePBU,961
|
366
|
-
flwr/superlink/executor/app.py,sha256=AALlkJKgGTeGOARf8G6TBEmO_WdOpmL4dHYpcGWX-Hc,1474
|
367
|
-
flwr/superlink/executor/deployment.py,sha256=whB1k_DE37SqplisFt0nu190BtoqPKRX9Xz86fqm3FU,6765
|
368
|
-
flwr/superlink/executor/executor.py,sha256=LaErHRJvNggjWV6FI6eajgKfnwOvSv2UqzFH253yDro,3265
|
369
|
-
flwr/superlink/executor/simulation.py,sha256=fLy18Bdsfxpxu41vAtBzTy1QLl0iJAdW7UmicBUnRJQ,4124
|
370
362
|
flwr/superlink/servicer/__init__.py,sha256=ZC-kILcUGeh6IxJsfu24cTzUqIGXmQfEKsGfhsnhBpM,717
|
371
363
|
flwr/superlink/servicer/control/__init__.py,sha256=qhUTMt_Mg4lxslCJYn5hDSrA-lXf5ya3617BT8kR-2Y,803
|
372
364
|
flwr/superlink/servicer/control/control_event_log_interceptor.py,sha256=HauUd7Xq-b1TFZmZVl9wpBITfDttn8-1_KhlEq-HJ8M,5966
|
373
|
-
flwr/superlink/servicer/control/control_grpc.py,sha256=
|
365
|
+
flwr/superlink/servicer/control/control_grpc.py,sha256=DUGArJvH3oZasutEU55NtYm0ZukPEO92UKhzOGu3qu8,4079
|
374
366
|
flwr/superlink/servicer/control/control_license_interceptor.py,sha256=T3AzmRt-PPwyTq3hrdpmZHQd5_CpPOk7TtnFZrB-JRY,3349
|
375
|
-
flwr/superlink/servicer/control/control_servicer.py,sha256=
|
367
|
+
flwr/superlink/servicer/control/control_servicer.py,sha256=5GMGcq5_Hvac7DpVg8TWUZbjVibS2B-yRlcSX2U6zeM,13962
|
376
368
|
flwr/superlink/servicer/control/control_user_auth_interceptor.py,sha256=9Aqhrt_UX80FXbIQVXUrqDHs5rD5CA7vEn0Bh-zPiYU,6232
|
377
369
|
flwr/supernode/__init__.py,sha256=KgeCaVvXWrU3rptNR1y0oBp4YtXbAcrnCcJAiOoWkI4,707
|
378
370
|
flwr/supernode/cli/__init__.py,sha256=JuEMr0-s9zv-PEWKuLB9tj1ocNfroSyNJ-oyv7ati9A,887
|
@@ -387,8 +379,8 @@ flwr/supernode/runtime/run_clientapp.py,sha256=2vknOFxmexCv0vsIsymrtRcvvgmk1tHM5
|
|
387
379
|
flwr/supernode/servicer/__init__.py,sha256=lucTzre5WPK7G1YLCfaqg3rbFWdNSb7ZTt-ca8gxdEo,717
|
388
380
|
flwr/supernode/servicer/clientappio/__init__.py,sha256=7Oy62Y_oijqF7Dxi6tpcUQyOpLc_QpIRZ83NvwmB0Yg,813
|
389
381
|
flwr/supernode/servicer/clientappio/clientappio_servicer.py,sha256=nIHRu38EWK-rpNOkcgBRAAKwYQQWFeCwu0lkO7OPZGQ,10239
|
390
|
-
flwr/supernode/start_client_internal.py,sha256=
|
391
|
-
flwr_nightly-1.21.0.
|
392
|
-
flwr_nightly-1.21.0.
|
393
|
-
flwr_nightly-1.21.0.
|
394
|
-
flwr_nightly-1.21.0.
|
382
|
+
flwr/supernode/start_client_internal.py,sha256=ftS8GOyT9M1tOWpbobN_Xrz4xwPAPOvsTGiWSfzhheE,20269
|
383
|
+
flwr_nightly-1.21.0.dev20250820.dist-info/METADATA,sha256=bEGyb5R0jq_4pTKtbZEw1ePD2R9ZF-9W6OWbXRYV1ec,15967
|
384
|
+
flwr_nightly-1.21.0.dev20250820.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
385
|
+
flwr_nightly-1.21.0.dev20250820.dist-info/entry_points.txt,sha256=hxHD2ixb_vJFDOlZV-zB4Ao32_BQlL34ftsDh1GXv14,420
|
386
|
+
flwr_nightly-1.21.0.dev20250820.dist-info/RECORD,,
|
flwr/superexec/__init__.py
DELETED
@@ -1,15 +0,0 @@
|
|
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 SuperExec service."""
|
flwr/superexec/deployment.py
DELETED
@@ -1,20 +0,0 @@
|
|
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
|
-
"""Deployment engine executor for backward compatibility."""
|
16
|
-
|
17
|
-
|
18
|
-
from flwr.superlink.executor import DeploymentEngine
|
19
|
-
|
20
|
-
executor = DeploymentEngine()
|
flwr/superexec/simulation.py
DELETED
@@ -1,20 +0,0 @@
|
|
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
|
-
"""Simulation engine executor for backward compatibility."""
|
16
|
-
|
17
|
-
|
18
|
-
from flwr.superlink.executor import SimulationEngine
|
19
|
-
|
20
|
-
executor = SimulationEngine()
|
@@ -1,28 +0,0 @@
|
|
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
|
-
"""Executor for Control API."""
|
16
|
-
|
17
|
-
|
18
|
-
from .app import load_executor
|
19
|
-
from .deployment import DeploymentEngine
|
20
|
-
from .executor import Executor
|
21
|
-
from .simulation import SimulationEngine
|
22
|
-
|
23
|
-
__all__ = [
|
24
|
-
"DeploymentEngine",
|
25
|
-
"Executor",
|
26
|
-
"SimulationEngine",
|
27
|
-
"load_executor",
|
28
|
-
]
|
flwr/superlink/executor/app.py
DELETED
@@ -1,45 +0,0 @@
|
|
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
|
-
"""Function for loading executor."""
|
16
|
-
|
17
|
-
|
18
|
-
import argparse
|
19
|
-
|
20
|
-
from flwr.common.object_ref import load_app, validate
|
21
|
-
|
22
|
-
from .executor import Executor
|
23
|
-
|
24
|
-
|
25
|
-
def load_executor(
|
26
|
-
args: argparse.Namespace,
|
27
|
-
) -> Executor:
|
28
|
-
"""Get the executor plugin."""
|
29
|
-
executor_ref: str = args.executor
|
30
|
-
valid, error_msg = validate(executor_ref, project_dir=args.executor_dir)
|
31
|
-
if not valid and error_msg:
|
32
|
-
raise LoadExecutorError(error_msg) from None
|
33
|
-
|
34
|
-
executor = load_app(executor_ref, LoadExecutorError, args.executor_dir)
|
35
|
-
|
36
|
-
if not isinstance(executor, Executor):
|
37
|
-
raise LoadExecutorError(
|
38
|
-
f"Attribute {executor_ref} is not of type {Executor}",
|
39
|
-
) from None
|
40
|
-
|
41
|
-
return executor
|
42
|
-
|
43
|
-
|
44
|
-
class LoadExecutorError(Exception):
|
45
|
-
"""Error when trying to load `Executor`."""
|
@@ -1,188 +0,0 @@
|
|
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
|
-
"""Deployment engine executor."""
|
16
|
-
|
17
|
-
|
18
|
-
import hashlib
|
19
|
-
from logging import ERROR, INFO
|
20
|
-
from pathlib import Path
|
21
|
-
from typing import Optional
|
22
|
-
|
23
|
-
from typing_extensions import override
|
24
|
-
|
25
|
-
from flwr.cli.config_utils import get_fab_metadata
|
26
|
-
from flwr.common import ConfigRecord, Context, RecordDict
|
27
|
-
from flwr.common.constant import (
|
28
|
-
SERVERAPPIO_API_DEFAULT_CLIENT_ADDRESS,
|
29
|
-
Status,
|
30
|
-
SubStatus,
|
31
|
-
)
|
32
|
-
from flwr.common.logger import log
|
33
|
-
from flwr.common.typing import Fab, RunStatus, UserConfig
|
34
|
-
from flwr.server.superlink.linkstate import LinkState, LinkStateFactory
|
35
|
-
from flwr.supercore.ffs import Ffs, FfsFactory
|
36
|
-
|
37
|
-
from .executor import Executor
|
38
|
-
|
39
|
-
|
40
|
-
class DeploymentEngine(Executor):
|
41
|
-
"""Deployment engine executor.
|
42
|
-
|
43
|
-
Parameters
|
44
|
-
----------
|
45
|
-
serverappio_api_address: str (default: "127.0.0.1:9091")
|
46
|
-
Address of the SuperLink to connect to.
|
47
|
-
root_certificates: Optional[str] (default: None)
|
48
|
-
Specifies the path to the PEM-encoded root certificate file for
|
49
|
-
establishing secure HTTPS connections.
|
50
|
-
flwr_dir: Optional[str] (default: None)
|
51
|
-
The path containing installed Flower Apps.
|
52
|
-
"""
|
53
|
-
|
54
|
-
def __init__(
|
55
|
-
self,
|
56
|
-
serverappio_api_address: str = SERVERAPPIO_API_DEFAULT_CLIENT_ADDRESS,
|
57
|
-
root_certificates: Optional[str] = None,
|
58
|
-
flwr_dir: Optional[str] = None,
|
59
|
-
) -> None:
|
60
|
-
self.serverappio_api_address = serverappio_api_address
|
61
|
-
if root_certificates is None:
|
62
|
-
self.root_certificates = None
|
63
|
-
self.root_certificates_bytes = None
|
64
|
-
else:
|
65
|
-
self.root_certificates = root_certificates
|
66
|
-
self.root_certificates_bytes = Path(root_certificates).read_bytes()
|
67
|
-
self.flwr_dir = flwr_dir
|
68
|
-
self.linkstate_factory: Optional[LinkStateFactory] = None
|
69
|
-
self.ffs_factory: Optional[FfsFactory] = None
|
70
|
-
|
71
|
-
@override
|
72
|
-
def initialize(
|
73
|
-
self, linkstate_factory: LinkStateFactory, ffs_factory: FfsFactory
|
74
|
-
) -> None:
|
75
|
-
"""Initialize the executor with the necessary factories."""
|
76
|
-
self.linkstate_factory = linkstate_factory
|
77
|
-
self.ffs_factory = ffs_factory
|
78
|
-
|
79
|
-
@property
|
80
|
-
def linkstate(self) -> LinkState:
|
81
|
-
"""Return the LinkState."""
|
82
|
-
if self.linkstate_factory is None:
|
83
|
-
raise RuntimeError("Executor is not initialized.")
|
84
|
-
return self.linkstate_factory.state()
|
85
|
-
|
86
|
-
@property
|
87
|
-
def ffs(self) -> Ffs:
|
88
|
-
"""Return the Flower File Storage (FFS)."""
|
89
|
-
if self.ffs_factory is None:
|
90
|
-
raise RuntimeError("Executor is not initialized.")
|
91
|
-
return self.ffs_factory.ffs()
|
92
|
-
|
93
|
-
@override
|
94
|
-
def set_config(
|
95
|
-
self,
|
96
|
-
config: UserConfig,
|
97
|
-
) -> None:
|
98
|
-
"""Set executor config arguments.
|
99
|
-
|
100
|
-
Parameters
|
101
|
-
----------
|
102
|
-
config : UserConfig
|
103
|
-
A dictionary for configuration values.
|
104
|
-
Supported configuration key/value pairs:
|
105
|
-
- "superlink": str
|
106
|
-
The address of the SuperLink ServerAppIo API.
|
107
|
-
- "root-certificates": str
|
108
|
-
The path to the root certificates.
|
109
|
-
- "flwr-dir": str
|
110
|
-
The path to the Flower directory.
|
111
|
-
"""
|
112
|
-
if not config:
|
113
|
-
return
|
114
|
-
if superlink_address := config.get("superlink"):
|
115
|
-
if not isinstance(superlink_address, str):
|
116
|
-
raise ValueError("The `superlink` value should be of type `str`.")
|
117
|
-
self.serverappio_api_address = superlink_address
|
118
|
-
if root_certificates := config.get("root-certificates"):
|
119
|
-
if not isinstance(root_certificates, str):
|
120
|
-
raise ValueError(
|
121
|
-
"The `root-certificates` value should be of type `str`."
|
122
|
-
)
|
123
|
-
self.root_certificates = root_certificates
|
124
|
-
self.root_certificates_bytes = Path(str(root_certificates)).read_bytes()
|
125
|
-
if flwr_dir := config.get("flwr-dir"):
|
126
|
-
if not isinstance(flwr_dir, str):
|
127
|
-
raise ValueError("The `flwr-dir` value should be of type `str`.")
|
128
|
-
self.flwr_dir = str(flwr_dir)
|
129
|
-
|
130
|
-
def _create_run(
|
131
|
-
self,
|
132
|
-
fab: Fab,
|
133
|
-
override_config: UserConfig,
|
134
|
-
flwr_aid: Optional[str],
|
135
|
-
) -> int:
|
136
|
-
fab_hash = self.ffs.put(fab.content, {})
|
137
|
-
if fab_hash != fab.hash_str:
|
138
|
-
raise RuntimeError(
|
139
|
-
f"FAB ({fab.hash_str}) hash from request doesn't match contents"
|
140
|
-
)
|
141
|
-
fab_id, fab_version = get_fab_metadata(fab.content)
|
142
|
-
|
143
|
-
run_id = self.linkstate.create_run(
|
144
|
-
fab_id, fab_version, fab_hash, override_config, ConfigRecord(), flwr_aid
|
145
|
-
)
|
146
|
-
return run_id
|
147
|
-
|
148
|
-
def _create_context(self, run_id: int) -> None:
|
149
|
-
"""Register a Context for a Run."""
|
150
|
-
# Create an empty context for the Run
|
151
|
-
context = Context(
|
152
|
-
run_id=run_id, node_id=0, node_config={}, state=RecordDict(), run_config={}
|
153
|
-
)
|
154
|
-
|
155
|
-
# Register the context at the LinkState
|
156
|
-
self.linkstate.set_serverapp_context(run_id=run_id, context=context)
|
157
|
-
|
158
|
-
@override
|
159
|
-
def start_run(
|
160
|
-
self,
|
161
|
-
fab_file: bytes,
|
162
|
-
override_config: UserConfig,
|
163
|
-
federation_options: ConfigRecord,
|
164
|
-
flwr_aid: Optional[str],
|
165
|
-
) -> Optional[int]:
|
166
|
-
"""Start run using the Flower Deployment Engine."""
|
167
|
-
run_id = None
|
168
|
-
try:
|
169
|
-
|
170
|
-
# Call SuperLink to create run
|
171
|
-
run_id = self._create_run(
|
172
|
-
Fab(hashlib.sha256(fab_file).hexdigest(), fab_file),
|
173
|
-
override_config,
|
174
|
-
flwr_aid,
|
175
|
-
)
|
176
|
-
|
177
|
-
# Register context for the Run
|
178
|
-
self._create_context(run_id=run_id)
|
179
|
-
log(INFO, "Created run %s", str(run_id))
|
180
|
-
|
181
|
-
return run_id
|
182
|
-
# pylint: disable-next=broad-except
|
183
|
-
except Exception as e:
|
184
|
-
log(ERROR, "Could not start run: %s", str(e))
|
185
|
-
if run_id:
|
186
|
-
run_status = RunStatus(Status.FINISHED, SubStatus.FAILED, str(e))
|
187
|
-
self.linkstate.update_run_status(run_id, new_status=run_status)
|
188
|
-
return None
|
@@ -1,100 +0,0 @@
|
|
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
|
-
"""Execute and monitor a Flower run."""
|
16
|
-
|
17
|
-
|
18
|
-
from abc import ABC, abstractmethod
|
19
|
-
from dataclasses import dataclass, field
|
20
|
-
from subprocess import Popen
|
21
|
-
from typing import Optional
|
22
|
-
|
23
|
-
from flwr.common import ConfigRecord
|
24
|
-
from flwr.common.typing import UserConfig
|
25
|
-
from flwr.server.superlink.linkstate import LinkStateFactory
|
26
|
-
from flwr.supercore.ffs import FfsFactory
|
27
|
-
|
28
|
-
|
29
|
-
@dataclass
|
30
|
-
class RunTracker:
|
31
|
-
"""Track a Flower run (composed of a run_id and the associated process)."""
|
32
|
-
|
33
|
-
run_id: int
|
34
|
-
proc: Popen # type: ignore
|
35
|
-
logs: list[str] = field(default_factory=list)
|
36
|
-
|
37
|
-
|
38
|
-
class Executor(ABC):
|
39
|
-
"""Execute and monitor a Flower run."""
|
40
|
-
|
41
|
-
@abstractmethod
|
42
|
-
def initialize(
|
43
|
-
self, linkstate_factory: LinkStateFactory, ffs_factory: FfsFactory
|
44
|
-
) -> None:
|
45
|
-
"""Initialize the executor with the necessary factories.
|
46
|
-
|
47
|
-
This method sets up the executor by providing it with the factories required
|
48
|
-
to access the LinkState and the Flower File Storage (FFS) in the SuperLink.
|
49
|
-
|
50
|
-
Parameters
|
51
|
-
----------
|
52
|
-
linkstate_factory : LinkStateFactory
|
53
|
-
The factory to create access to the LinkState.
|
54
|
-
ffs_factory : FfsFactory
|
55
|
-
The factory to create access to the Flower File Storage (FFS).
|
56
|
-
"""
|
57
|
-
|
58
|
-
@abstractmethod
|
59
|
-
def set_config(
|
60
|
-
self,
|
61
|
-
config: UserConfig,
|
62
|
-
) -> None:
|
63
|
-
"""Register provided config as class attributes.
|
64
|
-
|
65
|
-
Parameters
|
66
|
-
----------
|
67
|
-
config : UserConfig
|
68
|
-
A dictionary for configuration values.
|
69
|
-
"""
|
70
|
-
|
71
|
-
@abstractmethod
|
72
|
-
def start_run(
|
73
|
-
self,
|
74
|
-
fab_file: bytes,
|
75
|
-
override_config: UserConfig,
|
76
|
-
federation_options: ConfigRecord,
|
77
|
-
flwr_aid: Optional[str],
|
78
|
-
) -> Optional[int]:
|
79
|
-
"""Start a run using the given Flower FAB ID and version.
|
80
|
-
|
81
|
-
This method creates a new run on the SuperLink, returns its run_id
|
82
|
-
and also starts the run execution.
|
83
|
-
|
84
|
-
Parameters
|
85
|
-
----------
|
86
|
-
fab_file : bytes
|
87
|
-
The Flower App Bundle file bytes.
|
88
|
-
override_config: UserConfig
|
89
|
-
The config overrides dict sent by the user (using `flwr run`).
|
90
|
-
federation_options: ConfigRecord
|
91
|
-
The federation options sent by the user (using `flwr run`).
|
92
|
-
flwr_aid : Optional[str]
|
93
|
-
The Flower Account ID of the user starting the run, if authentication is
|
94
|
-
enabled.
|
95
|
-
|
96
|
-
Returns
|
97
|
-
-------
|
98
|
-
run_id : Optional[int]
|
99
|
-
The run_id of the run created by the SuperLink, or `None` if it fails.
|
100
|
-
"""
|
@@ -1,126 +0,0 @@
|
|
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
|
-
"""Simulation engine executor."""
|
16
|
-
|
17
|
-
|
18
|
-
import hashlib
|
19
|
-
from logging import ERROR, INFO
|
20
|
-
from typing import Optional
|
21
|
-
|
22
|
-
from typing_extensions import override
|
23
|
-
|
24
|
-
from flwr.cli.config_utils import get_fab_metadata
|
25
|
-
from flwr.common import ConfigRecord, Context, RecordDict
|
26
|
-
from flwr.common.logger import log
|
27
|
-
from flwr.common.typing import Fab, UserConfig
|
28
|
-
from flwr.server.superlink.linkstate import LinkState, LinkStateFactory
|
29
|
-
from flwr.supercore.ffs import Ffs, FfsFactory
|
30
|
-
|
31
|
-
from .executor import Executor
|
32
|
-
|
33
|
-
|
34
|
-
class SimulationEngine(Executor):
|
35
|
-
"""Simulation engine executor."""
|
36
|
-
|
37
|
-
def __init__(
|
38
|
-
self,
|
39
|
-
) -> None:
|
40
|
-
self.linkstate_factory: Optional[LinkStateFactory] = None
|
41
|
-
self.ffs_factory: Optional[FfsFactory] = None
|
42
|
-
|
43
|
-
@override
|
44
|
-
def initialize(
|
45
|
-
self, linkstate_factory: LinkStateFactory, ffs_factory: FfsFactory
|
46
|
-
) -> None:
|
47
|
-
"""Initialize the executor with the necessary factories."""
|
48
|
-
self.linkstate_factory = linkstate_factory
|
49
|
-
self.ffs_factory = ffs_factory
|
50
|
-
|
51
|
-
@property
|
52
|
-
def linkstate(self) -> LinkState:
|
53
|
-
"""Return the LinkState."""
|
54
|
-
if self.linkstate_factory is None:
|
55
|
-
raise RuntimeError("Executor is not initialized.")
|
56
|
-
return self.linkstate_factory.state()
|
57
|
-
|
58
|
-
@property
|
59
|
-
def ffs(self) -> Ffs:
|
60
|
-
"""Return the Flower File Storage (FFS)."""
|
61
|
-
if self.ffs_factory is None:
|
62
|
-
raise RuntimeError("Executor is not initialized.")
|
63
|
-
return self.ffs_factory.ffs()
|
64
|
-
|
65
|
-
@override
|
66
|
-
def set_config(
|
67
|
-
self,
|
68
|
-
config: UserConfig,
|
69
|
-
) -> None:
|
70
|
-
"""Set executor config arguments."""
|
71
|
-
|
72
|
-
# pylint: disable=too-many-locals
|
73
|
-
@override
|
74
|
-
def start_run(
|
75
|
-
self,
|
76
|
-
fab_file: bytes,
|
77
|
-
override_config: UserConfig,
|
78
|
-
federation_options: ConfigRecord,
|
79
|
-
flwr_aid: Optional[str],
|
80
|
-
) -> Optional[int]:
|
81
|
-
"""Start run using the Flower Simulation Engine."""
|
82
|
-
try:
|
83
|
-
# Check that num-supernodes is set
|
84
|
-
if "num-supernodes" not in federation_options:
|
85
|
-
raise ValueError(
|
86
|
-
"Federation options doesn't contain key `num-supernodes`."
|
87
|
-
)
|
88
|
-
|
89
|
-
# Create run
|
90
|
-
fab = Fab(hashlib.sha256(fab_file).hexdigest(), fab_file)
|
91
|
-
fab_hash = self.ffs.put(fab.content, {})
|
92
|
-
if fab_hash != fab.hash_str:
|
93
|
-
raise RuntimeError(
|
94
|
-
f"FAB ({fab.hash_str}) hash from request doesn't match contents"
|
95
|
-
)
|
96
|
-
fab_id, fab_version = get_fab_metadata(fab.content)
|
97
|
-
|
98
|
-
run_id = self.linkstate.create_run(
|
99
|
-
fab_id,
|
100
|
-
fab_version,
|
101
|
-
fab_hash,
|
102
|
-
override_config,
|
103
|
-
federation_options,
|
104
|
-
flwr_aid,
|
105
|
-
)
|
106
|
-
|
107
|
-
# Create an empty context for the Run
|
108
|
-
context = Context(
|
109
|
-
run_id=run_id,
|
110
|
-
node_id=0,
|
111
|
-
node_config={},
|
112
|
-
state=RecordDict(),
|
113
|
-
run_config={},
|
114
|
-
)
|
115
|
-
|
116
|
-
# Register the context at the LinkState
|
117
|
-
self.linkstate.set_serverapp_context(run_id=run_id, context=context)
|
118
|
-
|
119
|
-
log(INFO, "Created run %s", str(run_id))
|
120
|
-
|
121
|
-
return run_id
|
122
|
-
|
123
|
-
# pylint: disable-next=broad-except
|
124
|
-
except Exception as e:
|
125
|
-
log(ERROR, "Could not start run: %s", str(e))
|
126
|
-
return None
|
{flwr_nightly-1.21.0.dev20250819.dist-info → flwr_nightly-1.21.0.dev20250820.dist-info}/WHEEL
RENAMED
File without changes
|
File without changes
|