flwr-nightly 1.7.0.dev20240130__py3-none-any.whl → 1.7.0.dev20240131__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
flwr/client/app.py CHANGED
@@ -88,7 +88,7 @@ def run_client() -> None:
88
88
  _start_client_internal(
89
89
  server_address=args.server,
90
90
  load_flower_callable_fn=_load,
91
- transport="grpc-rere", # Only
91
+ transport="rest" if args.rest else "grpc-rere",
92
92
  root_certificates=root_certificates,
93
93
  insecure=args.insecure,
94
94
  )
@@ -111,6 +111,11 @@ def _parse_args_client() -> argparse.ArgumentParser:
111
111
  help="Run the client without HTTPS. By default, the client runs with "
112
112
  "HTTPS enabled. Use this flag only if you understand the risks.",
113
113
  )
114
+ parser.add_argument(
115
+ "--rest",
116
+ action="store_true",
117
+ help="Use REST as a transport layer for the client.",
118
+ )
114
119
  parser.add_argument(
115
120
  "--root-certificates",
116
121
  metavar="ROOT_CERT",
flwr/server/app.py CHANGED
@@ -532,7 +532,7 @@ def _run_fleet_api_grpc_rere(
532
532
  """Run Fleet API (gRPC, request-response)."""
533
533
  # Create Fleet API gRPC server
534
534
  fleet_servicer = FleetServicer(
535
- state=state_factory.state(),
535
+ state_factory=state_factory,
536
536
  )
537
537
  fleet_add_servicer_to_server_fn = add_FleetServicer_to_server
538
538
  fleet_grpc_server = generic_create_grpc_server(
@@ -32,14 +32,14 @@ from flwr.proto.fleet_pb2 import ( # pylint: disable=E0611
32
32
  PushTaskResResponse,
33
33
  )
34
34
  from flwr.server.fleet.message_handler import message_handler
35
- from flwr.server.state import State
35
+ from flwr.server.state import StateFactory
36
36
 
37
37
 
38
38
  class FleetServicer(fleet_pb2_grpc.FleetServicer):
39
39
  """Fleet API servicer."""
40
40
 
41
- def __init__(self, state: State) -> None:
42
- self.state = state
41
+ def __init__(self, state_factory: StateFactory) -> None:
42
+ self.state_factory = state_factory
43
43
 
44
44
  def CreateNode(
45
45
  self, request: CreateNodeRequest, context: grpc.ServicerContext
@@ -48,7 +48,7 @@ class FleetServicer(fleet_pb2_grpc.FleetServicer):
48
48
  log(INFO, "FleetServicer.CreateNode")
49
49
  return message_handler.create_node(
50
50
  request=request,
51
- state=self.state,
51
+ state=self.state_factory.state(),
52
52
  )
53
53
 
54
54
  def DeleteNode(
@@ -58,7 +58,7 @@ class FleetServicer(fleet_pb2_grpc.FleetServicer):
58
58
  log(INFO, "FleetServicer.DeleteNode")
59
59
  return message_handler.delete_node(
60
60
  request=request,
61
- state=self.state,
61
+ state=self.state_factory.state(),
62
62
  )
63
63
 
64
64
  def PullTaskIns(
@@ -68,7 +68,7 @@ class FleetServicer(fleet_pb2_grpc.FleetServicer):
68
68
  log(INFO, "FleetServicer.PullTaskIns")
69
69
  return message_handler.pull_task_ins(
70
70
  request=request,
71
- state=self.state,
71
+ state=self.state_factory.state(),
72
72
  )
73
73
 
74
74
  def PushTaskRes(
@@ -78,5 +78,5 @@ class FleetServicer(fleet_pb2_grpc.FleetServicer):
78
78
  log(INFO, "FleetServicer.PushTaskRes")
79
79
  return message_handler.push_task_res(
80
80
  request=request,
81
- state=self.state,
81
+ state=self.state_factory.state(),
82
82
  )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: flwr-nightly
3
- Version: 1.7.0.dev20240130
3
+ Version: 1.7.0.dev20240131
4
4
  Summary: Flower: A Friendly Federated Learning Framework
5
5
  Home-page: https://flower.dev
6
6
  License: Apache-2.0
@@ -1,6 +1,6 @@
1
1
  flwr/__init__.py,sha256=6zbcS7z2q-VUdmpFppLH6BacsE-ZFmfq6OvtKNOyYE0,981
2
2
  flwr/client/__init__.py,sha256=2T4enmlE4PsoKiGTvXwBKSlhOjZ7MXRy5oCGNf0UH9Y,1111
3
- flwr/client/app.py,sha256=eBZocV3uFm1w0H6Vp6DmelojSzIHKlcXHVOZzHowE7c,19483
3
+ flwr/client/app.py,sha256=UqVqw4nGczv-3Y7ooAGw-bacIS9L4tdBa9CVoNe0wog,19640
4
4
  flwr/client/client.py,sha256=ATcsqAMS9zpMBJ9ZUbBeB7BEPWX_VWISONy0p6Wxl5g,8210
5
5
  flwr/client/dpfedavg_numpy_client.py,sha256=0XryFdCMM_RLiNLCr6evLp-6R7ZjeMmRUROIgzRmtmc,7215
6
6
  flwr/client/flower.py,sha256=QKWBjB8YbzlKfC1EPVpxLfiYRL078C7BL5hPaX_rUMY,4211
@@ -83,7 +83,7 @@ flwr/proto/transport_pb2_grpc.py,sha256=vLN3EHtx2aEEMCO4f1Upu-l27BPzd3-5pV-u8wPc
83
83
  flwr/proto/transport_pb2_grpc.pyi,sha256=AGXf8RiIiW2J5IKMlm_3qT3AzcDa4F3P5IqUjve_esA,766
84
84
  flwr/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
85
85
  flwr/server/__init__.py,sha256=SG7XJWnskPZu30VfY5WmXbfYKeb8UFrths4qprAb0yg,1377
86
- flwr/server/app.py,sha256=KeRcABvbNnTXHdsz-WPMjNcgLRrdZR6MLNTX8bIK83Y,25619
86
+ flwr/server/app.py,sha256=WYAyWQZksetbzR8Gos_LSQOTzzhzapuRhjXdks6K9xM,25619
87
87
  flwr/server/client_manager.py,sha256=T8UDSRJBVD3fyIDI7NTAA-NA7GPrMNNgH2OAF54RRxE,6127
88
88
  flwr/server/client_proxy.py,sha256=8ScGDvP3jHbl8DV3hyFID5N5VEVlXn8ZTQXtkdOfssI,2234
89
89
  flwr/server/criterion.py,sha256=ypbAexbztzGUxNen9RCHF91QeqiEQix4t4Ih3E-42MM,1061
@@ -96,7 +96,7 @@ flwr/server/fleet/grpc_bidi/grpc_bridge.py,sha256=LSOmabFXAQxKycQOliplKmigbmVwdm
96
96
  flwr/server/fleet/grpc_bidi/grpc_client_proxy.py,sha256=MubuEEAZAcKzx9LYAB87B2sjvZWWyQS3RPAJJm1GS4I,4695
97
97
  flwr/server/fleet/grpc_bidi/grpc_server.py,sha256=TY_Z8ComreNNOOKveeUO6eE5hoSuTvx_EWqQl0zRADQ,11779
98
98
  flwr/server/fleet/grpc_rere/__init__.py,sha256=bEJOMWbSlqkw-y5ZHtEXczhoSlAxErcRYffmTMQAV8M,758
99
- flwr/server/fleet/grpc_rere/fleet_servicer.py,sha256=tG_t9_Fpbs-K1uT5B6GeLdrQCVcOXAdtqBGg_f7ZVVw,2603
99
+ flwr/server/fleet/grpc_rere/fleet_servicer.py,sha256=I6-mfOIKjxiGgHuL2AeiKqYnXDY_qBN1YXDJw1cttcA,2705
100
100
  flwr/server/fleet/message_handler/__init__.py,sha256=hEY0l61ojH8Iz30_K1btm1HJ6J49iZJSFUsVYqUTw3A,731
101
101
  flwr/server/fleet/message_handler/message_handler.py,sha256=_SauWQUO6VCMRRNXDfg3gv2h1FKG7e7p8F-Nj4aY6OM,2823
102
102
  flwr/server/fleet/rest_rere/__init__.py,sha256=VKDvDq5H8koOUztpmQacVzGJXPLEEkL1Vmolxt3mvnY,735
@@ -139,8 +139,8 @@ flwr/simulation/ray_transport/__init__.py,sha256=FsaAnzC4cw4DqoouBCix6496k29jACk
139
139
  flwr/simulation/ray_transport/ray_actor.py,sha256=G_g50ISt3Knf0zuX1wmw39gsDXSoMI5f3rmYZWGrUh4,17062
140
140
  flwr/simulation/ray_transport/ray_client_proxy.py,sha256=UxQEzWmklp3WO2V7LH5vNyAgYL7KYFFZQa1HTUSgEqY,9429
141
141
  flwr/simulation/ray_transport/utils.py,sha256=5dwzUppfJP8lrpBU1rvhzfPZqAeGo8wx-hOm8wy_HmA,3376
142
- flwr_nightly-1.7.0.dev20240130.dist-info/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
143
- flwr_nightly-1.7.0.dev20240130.dist-info/METADATA,sha256=clCdgXSkrZfi3u8GQhP0L2Hf3uuxexRQCfU5WPAWwAk,13584
144
- flwr_nightly-1.7.0.dev20240130.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
145
- flwr_nightly-1.7.0.dev20240130.dist-info/entry_points.txt,sha256=1uLlD5tIunkzALMfMWnqjdE_D5hRUX_I1iMmOMv6tZI,181
146
- flwr_nightly-1.7.0.dev20240130.dist-info/RECORD,,
142
+ flwr_nightly-1.7.0.dev20240131.dist-info/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
143
+ flwr_nightly-1.7.0.dev20240131.dist-info/METADATA,sha256=L5r5opQRH4mdJw1FOoLWHg1ArY9Ic-9Es9ZrQbWZvuI,13584
144
+ flwr_nightly-1.7.0.dev20240131.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
145
+ flwr_nightly-1.7.0.dev20240131.dist-info/entry_points.txt,sha256=1uLlD5tIunkzALMfMWnqjdE_D5hRUX_I1iMmOMv6tZI,181
146
+ flwr_nightly-1.7.0.dev20240131.dist-info/RECORD,,