flwr-nightly 1.14.0.dev20241204__py3-none-any.whl → 1.14.0.dev20241214__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.

Potentially problematic release.


This version of flwr-nightly might be problematic. Click here for more details.

Files changed (100) hide show
  1. flwr/cli/app.py +5 -0
  2. flwr/cli/build.py +1 -0
  3. flwr/cli/cli_user_auth_interceptor.py +86 -0
  4. flwr/cli/config_utils.py +19 -2
  5. flwr/cli/example.py +1 -0
  6. flwr/cli/install.py +1 -0
  7. flwr/cli/log.py +11 -31
  8. flwr/cli/login/__init__.py +22 -0
  9. flwr/cli/login/login.py +83 -0
  10. flwr/cli/ls.py +10 -40
  11. flwr/cli/new/__init__.py +1 -0
  12. flwr/cli/new/new.py +2 -1
  13. flwr/cli/new/templates/app/pyproject.flowertune.toml.tpl +2 -2
  14. flwr/cli/new/templates/app/pyproject.mlx.toml.tpl +1 -2
  15. flwr/cli/run/__init__.py +1 -0
  16. flwr/cli/run/run.py +15 -25
  17. flwr/cli/stop.py +91 -0
  18. flwr/cli/utils.py +109 -1
  19. flwr/client/app.py +3 -2
  20. flwr/client/client.py +1 -0
  21. flwr/client/clientapp/app.py +1 -0
  22. flwr/client/clientapp/utils.py +1 -0
  23. flwr/client/grpc_adapter_client/connection.py +1 -1
  24. flwr/client/grpc_client/connection.py +1 -1
  25. flwr/client/grpc_rere_client/connection.py +3 -3
  26. flwr/client/message_handler/message_handler.py +1 -0
  27. flwr/client/mod/comms_mods.py +1 -0
  28. flwr/client/mod/localdp_mod.py +1 -1
  29. flwr/client/nodestate/__init__.py +1 -0
  30. flwr/client/nodestate/nodestate.py +1 -0
  31. flwr/client/nodestate/nodestate_factory.py +1 -0
  32. flwr/client/rest_client/connection.py +3 -3
  33. flwr/client/supernode/app.py +1 -0
  34. flwr/common/address.py +1 -0
  35. flwr/common/args.py +1 -0
  36. flwr/common/auth_plugin/__init__.py +24 -0
  37. flwr/common/auth_plugin/auth_plugin.py +111 -0
  38. flwr/common/config.py +3 -1
  39. flwr/common/constant.py +6 -1
  40. flwr/common/logger.py +1 -0
  41. flwr/common/message.py +1 -0
  42. flwr/common/object_ref.py +57 -54
  43. flwr/common/pyproject.py +1 -0
  44. flwr/common/record/__init__.py +1 -0
  45. flwr/common/record/parametersrecord.py +1 -0
  46. flwr/common/retry_invoker.py +75 -0
  47. flwr/common/secure_aggregation/secaggplus_utils.py +2 -2
  48. flwr/common/telemetry.py +2 -1
  49. flwr/common/typing.py +12 -0
  50. flwr/common/version.py +1 -0
  51. flwr/proto/exec_pb2.py +27 -3
  52. flwr/proto/exec_pb2.pyi +103 -0
  53. flwr/proto/exec_pb2_grpc.py +102 -0
  54. flwr/proto/exec_pb2_grpc.pyi +39 -0
  55. flwr/proto/fab_pb2.py +4 -4
  56. flwr/proto/fab_pb2.pyi +4 -1
  57. flwr/proto/serverappio_pb2.py +18 -18
  58. flwr/proto/serverappio_pb2.pyi +8 -2
  59. flwr/proto/serverappio_pb2_grpc.py +34 -0
  60. flwr/proto/serverappio_pb2_grpc.pyi +13 -0
  61. flwr/proto/simulationio_pb2.py +2 -2
  62. flwr/proto/simulationio_pb2_grpc.py +34 -0
  63. flwr/proto/simulationio_pb2_grpc.pyi +13 -0
  64. flwr/server/app.py +53 -1
  65. flwr/server/compat/app_utils.py +7 -1
  66. flwr/server/driver/grpc_driver.py +11 -63
  67. flwr/server/driver/inmemory_driver.py +5 -1
  68. flwr/server/serverapp/app.py +9 -2
  69. flwr/server/strategy/dpfedavg_fixed.py +1 -0
  70. flwr/server/superlink/driver/serverappio_grpc.py +1 -0
  71. flwr/server/superlink/driver/serverappio_servicer.py +72 -22
  72. flwr/server/superlink/ffs/disk_ffs.py +1 -0
  73. flwr/server/superlink/fleet/grpc_adapter/grpc_adapter_servicer.py +1 -0
  74. flwr/server/superlink/fleet/grpc_bidi/flower_service_servicer.py +1 -0
  75. flwr/server/superlink/fleet/grpc_rere/fleet_servicer.py +32 -12
  76. flwr/server/superlink/fleet/message_handler/message_handler.py +31 -2
  77. flwr/server/superlink/fleet/rest_rere/rest_api.py +4 -1
  78. flwr/server/superlink/fleet/vce/__init__.py +1 -0
  79. flwr/server/superlink/fleet/vce/backend/__init__.py +1 -0
  80. flwr/server/superlink/fleet/vce/backend/raybackend.py +1 -0
  81. flwr/server/superlink/linkstate/in_memory_linkstate.py +14 -30
  82. flwr/server/superlink/linkstate/linkstate.py +13 -2
  83. flwr/server/superlink/linkstate/sqlite_linkstate.py +24 -44
  84. flwr/server/superlink/simulation/simulationio_servicer.py +20 -0
  85. flwr/server/superlink/utils.py +65 -0
  86. flwr/simulation/app.py +1 -0
  87. flwr/simulation/ray_transport/ray_actor.py +1 -0
  88. flwr/simulation/ray_transport/utils.py +1 -0
  89. flwr/simulation/run_simulation.py +1 -0
  90. flwr/superexec/app.py +1 -0
  91. flwr/superexec/deployment.py +1 -0
  92. flwr/superexec/exec_grpc.py +19 -1
  93. flwr/superexec/exec_servicer.py +76 -2
  94. flwr/superexec/exec_user_auth_interceptor.py +101 -0
  95. flwr/superexec/executor.py +1 -0
  96. {flwr_nightly-1.14.0.dev20241204.dist-info → flwr_nightly-1.14.0.dev20241214.dist-info}/METADATA +8 -7
  97. {flwr_nightly-1.14.0.dev20241204.dist-info → flwr_nightly-1.14.0.dev20241214.dist-info}/RECORD +100 -92
  98. {flwr_nightly-1.14.0.dev20241204.dist-info → flwr_nightly-1.14.0.dev20241214.dist-info}/LICENSE +0 -0
  99. {flwr_nightly-1.14.0.dev20241204.dist-info → flwr_nightly-1.14.0.dev20241214.dist-info}/WHEEL +0 -0
  100. {flwr_nightly-1.14.0.dev20241204.dist-info → flwr_nightly-1.14.0.dev20241214.dist-info}/entry_points.txt +0 -0
flwr/common/object_ref.py CHANGED
@@ -21,6 +21,7 @@ import sys
21
21
  from importlib.util import find_spec
22
22
  from logging import WARN
23
23
  from pathlib import Path
24
+ from threading import Lock
24
25
  from typing import Any, Optional, Union
25
26
 
26
27
  from .logger import log
@@ -34,6 +35,7 @@ attribute.
34
35
 
35
36
 
36
37
  _current_sys_path: Optional[str] = None
38
+ _import_lock = Lock()
37
39
 
38
40
 
39
41
  def validate(
@@ -146,60 +148,61 @@ def load_app( # pylint: disable= too-many-branches
146
148
  - This function will modify `sys.path` by inserting the provided `project_dir`
147
149
  and removing the previously inserted `project_dir`.
148
150
  """
149
- valid, error_msg = validate(module_attribute_str, check_module=False)
150
- if not valid and error_msg:
151
- raise error_type(error_msg) from None
152
-
153
- module_str, _, attributes_str = module_attribute_str.partition(":")
154
-
155
- try:
156
- # Initialize project path
157
- if project_dir is None:
158
- project_dir = Path.cwd()
159
- project_dir = Path(project_dir).absolute()
160
-
161
- # Unload modules if the project directory has changed
162
- if _current_sys_path and _current_sys_path != str(project_dir):
163
- _unload_modules(Path(_current_sys_path))
164
-
165
- # Set the system path
166
- _set_sys_path(project_dir)
167
-
168
- # Import the module
169
- if module_str not in sys.modules:
170
- module = importlib.import_module(module_str)
171
- # Hack: `tabnet` does not work with `importlib.reload`
172
- elif "tabnet" in sys.modules:
173
- log(
174
- WARN,
175
- "Cannot reload module `%s` from disk due to compatibility issues "
176
- "with the `tabnet` library. The module will be loaded from the "
177
- "cache instead. If you experience issues, consider restarting "
178
- "the application.",
179
- module_str,
180
- )
181
- module = sys.modules[module_str]
182
- else:
183
- module = sys.modules[module_str]
184
- _reload_modules(project_dir)
185
-
186
- except ModuleNotFoundError as err:
187
- raise error_type(
188
- f"Unable to load module {module_str}{OBJECT_REF_HELP_STR}",
189
- ) from err
190
-
191
- # Recursively load attribute
192
- attribute = module
193
- try:
194
- for attribute_str in attributes_str.split("."):
195
- attribute = getattr(attribute, attribute_str)
196
- except AttributeError as err:
197
- raise error_type(
198
- f"Unable to load attribute {attributes_str} from module {module_str}"
199
- f"{OBJECT_REF_HELP_STR}",
200
- ) from err
201
-
202
- return attribute
151
+ with _import_lock:
152
+ valid, error_msg = validate(module_attribute_str, check_module=False)
153
+ if not valid and error_msg:
154
+ raise error_type(error_msg) from None
155
+
156
+ module_str, _, attributes_str = module_attribute_str.partition(":")
157
+
158
+ try:
159
+ # Initialize project path
160
+ if project_dir is None:
161
+ project_dir = Path.cwd()
162
+ project_dir = Path(project_dir).absolute()
163
+
164
+ # Unload modules if the project directory has changed
165
+ if _current_sys_path and _current_sys_path != str(project_dir):
166
+ _unload_modules(Path(_current_sys_path))
167
+
168
+ # Set the system path
169
+ _set_sys_path(project_dir)
170
+
171
+ # Import the module
172
+ if module_str not in sys.modules:
173
+ module = importlib.import_module(module_str)
174
+ # Hack: `tabnet` does not work with `importlib.reload`
175
+ elif "tabnet" in sys.modules:
176
+ log(
177
+ WARN,
178
+ "Cannot reload module `%s` from disk due to compatibility issues "
179
+ "with the `tabnet` library. The module will be loaded from the "
180
+ "cache instead. If you experience issues, consider restarting "
181
+ "the application.",
182
+ module_str,
183
+ )
184
+ module = sys.modules[module_str]
185
+ else:
186
+ module = sys.modules[module_str]
187
+ _reload_modules(project_dir)
188
+
189
+ except ModuleNotFoundError as err:
190
+ raise error_type(
191
+ f"Unable to load module {module_str}{OBJECT_REF_HELP_STR}",
192
+ ) from err
193
+
194
+ # Recursively load attribute
195
+ attribute = module
196
+ try:
197
+ for attribute_str in attributes_str.split("."):
198
+ attribute = getattr(attribute, attribute_str)
199
+ except AttributeError as err:
200
+ raise error_type(
201
+ f"Unable to load attribute {attributes_str} from module {module_str}"
202
+ f"{OBJECT_REF_HELP_STR}",
203
+ ) from err
204
+
205
+ return attribute
203
206
 
204
207
 
205
208
  def _unload_modules(project_dir: Path) -> None:
flwr/common/pyproject.py CHANGED
@@ -14,6 +14,7 @@
14
14
  # ==============================================================================
15
15
  """Validates the project's name property."""
16
16
 
17
+
17
18
  import re
18
19
 
19
20
 
@@ -14,6 +14,7 @@
14
14
  # ==============================================================================
15
15
  """Record APIs."""
16
16
 
17
+
17
18
  from .configsrecord import ConfigsRecord
18
19
  from .conversion_utils import array_from_numpy
19
20
  from .metricsrecord import MetricsRecord
@@ -14,6 +14,7 @@
14
14
  # ==============================================================================
15
15
  """ParametersRecord and Array."""
16
16
 
17
+
17
18
  from collections import OrderedDict
18
19
  from dataclasses import dataclass
19
20
  from io import BytesIO
@@ -20,8 +20,17 @@ import random
20
20
  import time
21
21
  from collections.abc import Generator, Iterable
22
22
  from dataclasses import dataclass
23
+ from logging import INFO, WARN
23
24
  from typing import Any, Callable, Optional, Union, cast
24
25
 
26
+ import grpc
27
+
28
+ from flwr.common.constant import MAX_RETRY_DELAY
29
+ from flwr.common.logger import log
30
+ from flwr.common.typing import RunNotRunningException
31
+ from flwr.proto.clientappio_pb2_grpc import ClientAppIoStub
32
+ from flwr.proto.serverappio_pb2_grpc import ServerAppIoStub
33
+
25
34
 
26
35
  def exponential(
27
36
  base_delay: float = 1,
@@ -303,3 +312,69 @@ class RetryInvoker:
303
312
  # Trigger success event
304
313
  try_call_event_handler(self.on_success)
305
314
  return ret
315
+
316
+
317
+ def _make_simple_grpc_retry_invoker() -> RetryInvoker:
318
+ """Create a simple gRPC retry invoker."""
319
+
320
+ def _on_sucess(retry_state: RetryState) -> None:
321
+ if retry_state.tries > 1:
322
+ log(
323
+ INFO,
324
+ "Connection successful after %.2f seconds and %s tries.",
325
+ retry_state.elapsed_time,
326
+ retry_state.tries,
327
+ )
328
+
329
+ def _on_backoff(retry_state: RetryState) -> None:
330
+ if retry_state.tries == 1:
331
+ log(WARN, "Connection attempt failed, retrying...")
332
+ else:
333
+ log(
334
+ WARN,
335
+ "Connection attempt failed, retrying in %.2f seconds",
336
+ retry_state.actual_wait,
337
+ )
338
+
339
+ def _on_giveup(retry_state: RetryState) -> None:
340
+ if retry_state.tries > 1:
341
+ log(
342
+ WARN,
343
+ "Giving up reconnection after %.2f seconds and %s tries.",
344
+ retry_state.elapsed_time,
345
+ retry_state.tries,
346
+ )
347
+
348
+ def _should_giveup_fn(e: Exception) -> bool:
349
+ if e.code() == grpc.StatusCode.PERMISSION_DENIED: # type: ignore
350
+ raise RunNotRunningException
351
+ if e.code() == grpc.StatusCode.UNAVAILABLE: # type: ignore
352
+ return False
353
+ return True
354
+
355
+ return RetryInvoker(
356
+ wait_gen_factory=lambda: exponential(max_delay=MAX_RETRY_DELAY),
357
+ recoverable_exceptions=grpc.RpcError,
358
+ max_tries=None,
359
+ max_time=None,
360
+ on_success=_on_sucess,
361
+ on_backoff=_on_backoff,
362
+ on_giveup=_on_giveup,
363
+ should_giveup=_should_giveup_fn,
364
+ )
365
+
366
+
367
+ def _wrap_stub(
368
+ stub: Union[ServerAppIoStub, ClientAppIoStub], retry_invoker: RetryInvoker
369
+ ) -> None:
370
+ """Wrap a gRPC stub with a retry invoker."""
371
+
372
+ def make_lambda(original_method: Any) -> Any:
373
+ return lambda *args, **kwargs: retry_invoker.invoke(
374
+ original_method, *args, **kwargs
375
+ )
376
+
377
+ for method_name in vars(stub):
378
+ method = getattr(stub, method_name)
379
+ if callable(method):
380
+ setattr(stub, method_name, make_lambda(method))
@@ -93,8 +93,8 @@ def pseudo_rand_gen(
93
93
  output = []
94
94
  for dimension in dimensions_list:
95
95
  if len(dimension) == 0:
96
- arr = np.array(gen.randint(0, num_range - 1), dtype=int)
96
+ arr = np.array(gen.randint(0, num_range - 1), dtype=np.int64)
97
97
  else:
98
- arr = gen.randint(0, num_range - 1, dimension)
98
+ arr = gen.randint(0, num_range - 1, dimension, dtype=np.int64)
99
99
  output.append(arr)
100
100
  return output
flwr/common/telemetry.py CHANGED
@@ -27,6 +27,7 @@ from enum import Enum, auto
27
27
  from pathlib import Path
28
28
  from typing import Any, Optional, Union, cast
29
29
 
30
+ from flwr.common.constant import FLWR_DIR
30
31
  from flwr.common.version import package_name, package_version
31
32
 
32
33
  FLWR_TELEMETRY_ENABLED = os.getenv("FLWR_TELEMETRY_ENABLED", "1")
@@ -86,7 +87,7 @@ def _get_source_id() -> str:
86
87
  # If the home directory can’t be resolved, RuntimeError is raised.
87
88
  return source_id
88
89
 
89
- flwr_dir = home.joinpath(".flwr")
90
+ flwr_dir = home.joinpath(FLWR_DIR)
90
91
  # Create .flwr directory if it does not exist yet.
91
92
  try:
92
93
  flwr_dir.mkdir(parents=True, exist_ok=True)
flwr/common/typing.py CHANGED
@@ -254,3 +254,15 @@ class Fab:
254
254
 
255
255
  hash_str: str
256
256
  content: bytes
257
+
258
+
259
+ class RunNotRunningException(BaseException):
260
+ """Raised when a run is not running."""
261
+
262
+
263
+ class InvalidRunStatusException(BaseException):
264
+ """Raised when an RPC is invalidated by the RunStatus."""
265
+
266
+ def __init__(self, message: str) -> None:
267
+ super().__init__(message)
268
+ self.message = message
flwr/common/version.py CHANGED
@@ -14,6 +14,7 @@
14
14
  # ==============================================================================
15
15
  """Flower package version helper."""
16
16
 
17
+
17
18
  import importlib.metadata as importlib_metadata
18
19
 
19
20
 
flwr/proto/exec_pb2.py CHANGED
@@ -18,7 +18,7 @@ from flwr.proto import recordset_pb2 as flwr_dot_proto_dot_recordset__pb2
18
18
  from flwr.proto import run_pb2 as flwr_dot_proto_dot_run__pb2
19
19
 
20
20
 
21
- DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x15\x66lwr/proto/exec.proto\x12\nflwr.proto\x1a\x14\x66lwr/proto/fab.proto\x1a\x1a\x66lwr/proto/transport.proto\x1a\x1a\x66lwr/proto/recordset.proto\x1a\x14\x66lwr/proto/run.proto\"\xfb\x01\n\x0fStartRunRequest\x12\x1c\n\x03\x66\x61\x62\x18\x01 \x01(\x0b\x32\x0f.flwr.proto.Fab\x12H\n\x0foverride_config\x18\x02 \x03(\x0b\x32/.flwr.proto.StartRunRequest.OverrideConfigEntry\x12\x35\n\x12\x66\x65\x64\x65ration_options\x18\x03 \x01(\x0b\x32\x19.flwr.proto.ConfigsRecord\x1aI\n\x13OverrideConfigEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12!\n\x05value\x18\x02 \x01(\x0b\x32\x12.flwr.proto.Scalar:\x02\x38\x01\"2\n\x10StartRunResponse\x12\x13\n\x06run_id\x18\x01 \x01(\x04H\x00\x88\x01\x01\x42\t\n\x07_run_id\"<\n\x11StreamLogsRequest\x12\x0e\n\x06run_id\x18\x01 \x01(\x04\x12\x17\n\x0f\x61\x66ter_timestamp\x18\x02 \x01(\x01\"B\n\x12StreamLogsResponse\x12\x12\n\nlog_output\x18\x01 \x01(\t\x12\x18\n\x10latest_timestamp\x18\x02 \x01(\x01\"1\n\x0fListRunsRequest\x12\x13\n\x06run_id\x18\x01 \x01(\x04H\x00\x88\x01\x01\x42\t\n\x07_run_id\"\x9d\x01\n\x10ListRunsResponse\x12;\n\x08run_dict\x18\x01 \x03(\x0b\x32).flwr.proto.ListRunsResponse.RunDictEntry\x12\x0b\n\x03now\x18\x02 \x01(\t\x1a?\n\x0cRunDictEntry\x12\x0b\n\x03key\x18\x01 \x01(\x04\x12\x1e\n\x05value\x18\x02 \x01(\x0b\x32\x0f.flwr.proto.Run:\x02\x38\x01\x32\xe9\x01\n\x04\x45xec\x12G\n\x08StartRun\x12\x1b.flwr.proto.StartRunRequest\x1a\x1c.flwr.proto.StartRunResponse\"\x00\x12O\n\nStreamLogs\x12\x1d.flwr.proto.StreamLogsRequest\x1a\x1e.flwr.proto.StreamLogsResponse\"\x00\x30\x01\x12G\n\x08ListRuns\x12\x1b.flwr.proto.ListRunsRequest\x1a\x1c.flwr.proto.ListRunsResponse\"\x00\x62\x06proto3')
21
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x15\x66lwr/proto/exec.proto\x12\nflwr.proto\x1a\x14\x66lwr/proto/fab.proto\x1a\x1a\x66lwr/proto/transport.proto\x1a\x1a\x66lwr/proto/recordset.proto\x1a\x14\x66lwr/proto/run.proto\"\xfb\x01\n\x0fStartRunRequest\x12\x1c\n\x03\x66\x61\x62\x18\x01 \x01(\x0b\x32\x0f.flwr.proto.Fab\x12H\n\x0foverride_config\x18\x02 \x03(\x0b\x32/.flwr.proto.StartRunRequest.OverrideConfigEntry\x12\x35\n\x12\x66\x65\x64\x65ration_options\x18\x03 \x01(\x0b\x32\x19.flwr.proto.ConfigsRecord\x1aI\n\x13OverrideConfigEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12!\n\x05value\x18\x02 \x01(\x0b\x32\x12.flwr.proto.Scalar:\x02\x38\x01\"2\n\x10StartRunResponse\x12\x13\n\x06run_id\x18\x01 \x01(\x04H\x00\x88\x01\x01\x42\t\n\x07_run_id\"<\n\x11StreamLogsRequest\x12\x0e\n\x06run_id\x18\x01 \x01(\x04\x12\x17\n\x0f\x61\x66ter_timestamp\x18\x02 \x01(\x01\"B\n\x12StreamLogsResponse\x12\x12\n\nlog_output\x18\x01 \x01(\t\x12\x18\n\x10latest_timestamp\x18\x02 \x01(\x01\"1\n\x0fListRunsRequest\x12\x13\n\x06run_id\x18\x01 \x01(\x04H\x00\x88\x01\x01\x42\t\n\x07_run_id\"\x9d\x01\n\x10ListRunsResponse\x12;\n\x08run_dict\x18\x01 \x03(\x0b\x32).flwr.proto.ListRunsResponse.RunDictEntry\x12\x0b\n\x03now\x18\x02 \x01(\t\x1a?\n\x0cRunDictEntry\x12\x0b\n\x03key\x18\x01 \x01(\x04\x12\x1e\n\x05value\x18\x02 \x01(\x0b\x32\x0f.flwr.proto.Run:\x02\x38\x01\"\x18\n\x16GetLoginDetailsRequest\"\x9c\x01\n\x17GetLoginDetailsResponse\x12L\n\rlogin_details\x18\x01 \x03(\x0b\x32\x35.flwr.proto.GetLoginDetailsResponse.LoginDetailsEntry\x1a\x33\n\x11LoginDetailsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x93\x01\n\x14GetAuthTokensRequest\x12G\n\x0c\x61uth_details\x18\x01 \x03(\x0b\x32\x31.flwr.proto.GetAuthTokensRequest.AuthDetailsEntry\x1a\x32\n\x10\x41uthDetailsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x92\x01\n\x15GetAuthTokensResponse\x12\x46\n\x0b\x61uth_tokens\x18\x01 \x03(\x0b\x32\x31.flwr.proto.GetAuthTokensResponse.AuthTokensEntry\x1a\x31\n\x0f\x41uthTokensEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\" \n\x0eStopRunRequest\x12\x0e\n\x06run_id\x18\x01 \x01(\x04\"\"\n\x0fStopRunResponse\x12\x0f\n\x07success\x18\x01 \x01(\x08\x32\xe5\x03\n\x04\x45xec\x12G\n\x08StartRun\x12\x1b.flwr.proto.StartRunRequest\x1a\x1c.flwr.proto.StartRunResponse\"\x00\x12\x44\n\x07StopRun\x12\x1a.flwr.proto.StopRunRequest\x1a\x1b.flwr.proto.StopRunResponse\"\x00\x12O\n\nStreamLogs\x12\x1d.flwr.proto.StreamLogsRequest\x1a\x1e.flwr.proto.StreamLogsResponse\"\x00\x30\x01\x12G\n\x08ListRuns\x12\x1b.flwr.proto.ListRunsRequest\x1a\x1c.flwr.proto.ListRunsResponse\"\x00\x12\\\n\x0fGetLoginDetails\x12\".flwr.proto.GetLoginDetailsRequest\x1a#.flwr.proto.GetLoginDetailsResponse\"\x00\x12V\n\rGetAuthTokens\x12 .flwr.proto.GetAuthTokensRequest\x1a!.flwr.proto.GetAuthTokensResponse\"\x00\x62\x06proto3')
22
22
 
23
23
  _globals = globals()
24
24
  _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
@@ -29,6 +29,12 @@ if _descriptor._USE_C_DESCRIPTORS == False:
29
29
  _globals['_STARTRUNREQUEST_OVERRIDECONFIGENTRY']._serialized_options = b'8\001'
30
30
  _globals['_LISTRUNSRESPONSE_RUNDICTENTRY']._options = None
31
31
  _globals['_LISTRUNSRESPONSE_RUNDICTENTRY']._serialized_options = b'8\001'
32
+ _globals['_GETLOGINDETAILSRESPONSE_LOGINDETAILSENTRY']._options = None
33
+ _globals['_GETLOGINDETAILSRESPONSE_LOGINDETAILSENTRY']._serialized_options = b'8\001'
34
+ _globals['_GETAUTHTOKENSREQUEST_AUTHDETAILSENTRY']._options = None
35
+ _globals['_GETAUTHTOKENSREQUEST_AUTHDETAILSENTRY']._serialized_options = b'8\001'
36
+ _globals['_GETAUTHTOKENSRESPONSE_AUTHTOKENSENTRY']._options = None
37
+ _globals['_GETAUTHTOKENSRESPONSE_AUTHTOKENSENTRY']._serialized_options = b'8\001'
32
38
  _globals['_STARTRUNREQUEST']._serialized_start=138
33
39
  _globals['_STARTRUNREQUEST']._serialized_end=389
34
40
  _globals['_STARTRUNREQUEST_OVERRIDECONFIGENTRY']._serialized_start=316
@@ -45,6 +51,24 @@ if _descriptor._USE_C_DESCRIPTORS == False:
45
51
  _globals['_LISTRUNSRESPONSE']._serialized_end=782
46
52
  _globals['_LISTRUNSRESPONSE_RUNDICTENTRY']._serialized_start=719
47
53
  _globals['_LISTRUNSRESPONSE_RUNDICTENTRY']._serialized_end=782
48
- _globals['_EXEC']._serialized_start=785
49
- _globals['_EXEC']._serialized_end=1018
54
+ _globals['_GETLOGINDETAILSREQUEST']._serialized_start=784
55
+ _globals['_GETLOGINDETAILSREQUEST']._serialized_end=808
56
+ _globals['_GETLOGINDETAILSRESPONSE']._serialized_start=811
57
+ _globals['_GETLOGINDETAILSRESPONSE']._serialized_end=967
58
+ _globals['_GETLOGINDETAILSRESPONSE_LOGINDETAILSENTRY']._serialized_start=916
59
+ _globals['_GETLOGINDETAILSRESPONSE_LOGINDETAILSENTRY']._serialized_end=967
60
+ _globals['_GETAUTHTOKENSREQUEST']._serialized_start=970
61
+ _globals['_GETAUTHTOKENSREQUEST']._serialized_end=1117
62
+ _globals['_GETAUTHTOKENSREQUEST_AUTHDETAILSENTRY']._serialized_start=1067
63
+ _globals['_GETAUTHTOKENSREQUEST_AUTHDETAILSENTRY']._serialized_end=1117
64
+ _globals['_GETAUTHTOKENSRESPONSE']._serialized_start=1120
65
+ _globals['_GETAUTHTOKENSRESPONSE']._serialized_end=1266
66
+ _globals['_GETAUTHTOKENSRESPONSE_AUTHTOKENSENTRY']._serialized_start=1217
67
+ _globals['_GETAUTHTOKENSRESPONSE_AUTHTOKENSENTRY']._serialized_end=1266
68
+ _globals['_STOPRUNREQUEST']._serialized_start=1268
69
+ _globals['_STOPRUNREQUEST']._serialized_end=1300
70
+ _globals['_STOPRUNRESPONSE']._serialized_start=1302
71
+ _globals['_STOPRUNRESPONSE']._serialized_end=1336
72
+ _globals['_EXEC']._serialized_start=1339
73
+ _globals['_EXEC']._serialized_end=1824
50
74
  # @@protoc_insertion_point(module_scope)
flwr/proto/exec_pb2.pyi CHANGED
@@ -134,3 +134,106 @@ class ListRunsResponse(google.protobuf.message.Message):
134
134
  ) -> None: ...
135
135
  def ClearField(self, field_name: typing_extensions.Literal["now",b"now","run_dict",b"run_dict"]) -> None: ...
136
136
  global___ListRunsResponse = ListRunsResponse
137
+
138
+ class GetLoginDetailsRequest(google.protobuf.message.Message):
139
+ DESCRIPTOR: google.protobuf.descriptor.Descriptor
140
+ def __init__(self,
141
+ ) -> None: ...
142
+ global___GetLoginDetailsRequest = GetLoginDetailsRequest
143
+
144
+ class GetLoginDetailsResponse(google.protobuf.message.Message):
145
+ DESCRIPTOR: google.protobuf.descriptor.Descriptor
146
+ class LoginDetailsEntry(google.protobuf.message.Message):
147
+ DESCRIPTOR: google.protobuf.descriptor.Descriptor
148
+ KEY_FIELD_NUMBER: builtins.int
149
+ VALUE_FIELD_NUMBER: builtins.int
150
+ key: typing.Text
151
+ value: typing.Text
152
+ def __init__(self,
153
+ *,
154
+ key: typing.Text = ...,
155
+ value: typing.Text = ...,
156
+ ) -> None: ...
157
+ def ClearField(self, field_name: typing_extensions.Literal["key",b"key","value",b"value"]) -> None: ...
158
+
159
+ LOGIN_DETAILS_FIELD_NUMBER: builtins.int
160
+ @property
161
+ def login_details(self) -> google.protobuf.internal.containers.ScalarMap[typing.Text, typing.Text]: ...
162
+ def __init__(self,
163
+ *,
164
+ login_details: typing.Optional[typing.Mapping[typing.Text, typing.Text]] = ...,
165
+ ) -> None: ...
166
+ def ClearField(self, field_name: typing_extensions.Literal["login_details",b"login_details"]) -> None: ...
167
+ global___GetLoginDetailsResponse = GetLoginDetailsResponse
168
+
169
+ class GetAuthTokensRequest(google.protobuf.message.Message):
170
+ DESCRIPTOR: google.protobuf.descriptor.Descriptor
171
+ class AuthDetailsEntry(google.protobuf.message.Message):
172
+ DESCRIPTOR: google.protobuf.descriptor.Descriptor
173
+ KEY_FIELD_NUMBER: builtins.int
174
+ VALUE_FIELD_NUMBER: builtins.int
175
+ key: typing.Text
176
+ value: typing.Text
177
+ def __init__(self,
178
+ *,
179
+ key: typing.Text = ...,
180
+ value: typing.Text = ...,
181
+ ) -> None: ...
182
+ def ClearField(self, field_name: typing_extensions.Literal["key",b"key","value",b"value"]) -> None: ...
183
+
184
+ AUTH_DETAILS_FIELD_NUMBER: builtins.int
185
+ @property
186
+ def auth_details(self) -> google.protobuf.internal.containers.ScalarMap[typing.Text, typing.Text]: ...
187
+ def __init__(self,
188
+ *,
189
+ auth_details: typing.Optional[typing.Mapping[typing.Text, typing.Text]] = ...,
190
+ ) -> None: ...
191
+ def ClearField(self, field_name: typing_extensions.Literal["auth_details",b"auth_details"]) -> None: ...
192
+ global___GetAuthTokensRequest = GetAuthTokensRequest
193
+
194
+ class GetAuthTokensResponse(google.protobuf.message.Message):
195
+ DESCRIPTOR: google.protobuf.descriptor.Descriptor
196
+ class AuthTokensEntry(google.protobuf.message.Message):
197
+ DESCRIPTOR: google.protobuf.descriptor.Descriptor
198
+ KEY_FIELD_NUMBER: builtins.int
199
+ VALUE_FIELD_NUMBER: builtins.int
200
+ key: typing.Text
201
+ value: typing.Text
202
+ def __init__(self,
203
+ *,
204
+ key: typing.Text = ...,
205
+ value: typing.Text = ...,
206
+ ) -> None: ...
207
+ def ClearField(self, field_name: typing_extensions.Literal["key",b"key","value",b"value"]) -> None: ...
208
+
209
+ AUTH_TOKENS_FIELD_NUMBER: builtins.int
210
+ @property
211
+ def auth_tokens(self) -> google.protobuf.internal.containers.ScalarMap[typing.Text, typing.Text]: ...
212
+ def __init__(self,
213
+ *,
214
+ auth_tokens: typing.Optional[typing.Mapping[typing.Text, typing.Text]] = ...,
215
+ ) -> None: ...
216
+ def ClearField(self, field_name: typing_extensions.Literal["auth_tokens",b"auth_tokens"]) -> None: ...
217
+ global___GetAuthTokensResponse = GetAuthTokensResponse
218
+
219
+ class StopRunRequest(google.protobuf.message.Message):
220
+ DESCRIPTOR: google.protobuf.descriptor.Descriptor
221
+ RUN_ID_FIELD_NUMBER: builtins.int
222
+ run_id: builtins.int
223
+ def __init__(self,
224
+ *,
225
+ run_id: builtins.int = ...,
226
+ ) -> None: ...
227
+ def ClearField(self, field_name: typing_extensions.Literal["run_id",b"run_id"]) -> None: ...
228
+ global___StopRunRequest = StopRunRequest
229
+
230
+ class StopRunResponse(google.protobuf.message.Message):
231
+ DESCRIPTOR: google.protobuf.descriptor.Descriptor
232
+ SUCCESS_FIELD_NUMBER: builtins.int
233
+ success: builtins.bool
234
+ def __init__(self,
235
+ *,
236
+ success: builtins.bool = ...,
237
+ ) -> None: ...
238
+ def ClearField(self, field_name: typing_extensions.Literal["success",b"success"]) -> None: ...
239
+ global___StopRunResponse = StopRunResponse
@@ -19,6 +19,11 @@ class ExecStub(object):
19
19
  request_serializer=flwr_dot_proto_dot_exec__pb2.StartRunRequest.SerializeToString,
20
20
  response_deserializer=flwr_dot_proto_dot_exec__pb2.StartRunResponse.FromString,
21
21
  )
22
+ self.StopRun = channel.unary_unary(
23
+ '/flwr.proto.Exec/StopRun',
24
+ request_serializer=flwr_dot_proto_dot_exec__pb2.StopRunRequest.SerializeToString,
25
+ response_deserializer=flwr_dot_proto_dot_exec__pb2.StopRunResponse.FromString,
26
+ )
22
27
  self.StreamLogs = channel.unary_stream(
23
28
  '/flwr.proto.Exec/StreamLogs',
24
29
  request_serializer=flwr_dot_proto_dot_exec__pb2.StreamLogsRequest.SerializeToString,
@@ -29,6 +34,16 @@ class ExecStub(object):
29
34
  request_serializer=flwr_dot_proto_dot_exec__pb2.ListRunsRequest.SerializeToString,
30
35
  response_deserializer=flwr_dot_proto_dot_exec__pb2.ListRunsResponse.FromString,
31
36
  )
37
+ self.GetLoginDetails = channel.unary_unary(
38
+ '/flwr.proto.Exec/GetLoginDetails',
39
+ request_serializer=flwr_dot_proto_dot_exec__pb2.GetLoginDetailsRequest.SerializeToString,
40
+ response_deserializer=flwr_dot_proto_dot_exec__pb2.GetLoginDetailsResponse.FromString,
41
+ )
42
+ self.GetAuthTokens = channel.unary_unary(
43
+ '/flwr.proto.Exec/GetAuthTokens',
44
+ request_serializer=flwr_dot_proto_dot_exec__pb2.GetAuthTokensRequest.SerializeToString,
45
+ response_deserializer=flwr_dot_proto_dot_exec__pb2.GetAuthTokensResponse.FromString,
46
+ )
32
47
 
33
48
 
34
49
  class ExecServicer(object):
@@ -41,6 +56,13 @@ class ExecServicer(object):
41
56
  context.set_details('Method not implemented!')
42
57
  raise NotImplementedError('Method not implemented!')
43
58
 
59
+ def StopRun(self, request, context):
60
+ """Stop run upon request
61
+ """
62
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
63
+ context.set_details('Method not implemented!')
64
+ raise NotImplementedError('Method not implemented!')
65
+
44
66
  def StreamLogs(self, request, context):
45
67
  """Start log stream upon request
46
68
  """
@@ -55,6 +77,20 @@ class ExecServicer(object):
55
77
  context.set_details('Method not implemented!')
56
78
  raise NotImplementedError('Method not implemented!')
57
79
 
80
+ def GetLoginDetails(self, request, context):
81
+ """Get login details upon request
82
+ """
83
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
84
+ context.set_details('Method not implemented!')
85
+ raise NotImplementedError('Method not implemented!')
86
+
87
+ def GetAuthTokens(self, request, context):
88
+ """Get auth tokens upon request
89
+ """
90
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
91
+ context.set_details('Method not implemented!')
92
+ raise NotImplementedError('Method not implemented!')
93
+
58
94
 
59
95
  def add_ExecServicer_to_server(servicer, server):
60
96
  rpc_method_handlers = {
@@ -63,6 +99,11 @@ def add_ExecServicer_to_server(servicer, server):
63
99
  request_deserializer=flwr_dot_proto_dot_exec__pb2.StartRunRequest.FromString,
64
100
  response_serializer=flwr_dot_proto_dot_exec__pb2.StartRunResponse.SerializeToString,
65
101
  ),
102
+ 'StopRun': grpc.unary_unary_rpc_method_handler(
103
+ servicer.StopRun,
104
+ request_deserializer=flwr_dot_proto_dot_exec__pb2.StopRunRequest.FromString,
105
+ response_serializer=flwr_dot_proto_dot_exec__pb2.StopRunResponse.SerializeToString,
106
+ ),
66
107
  'StreamLogs': grpc.unary_stream_rpc_method_handler(
67
108
  servicer.StreamLogs,
68
109
  request_deserializer=flwr_dot_proto_dot_exec__pb2.StreamLogsRequest.FromString,
@@ -73,6 +114,16 @@ def add_ExecServicer_to_server(servicer, server):
73
114
  request_deserializer=flwr_dot_proto_dot_exec__pb2.ListRunsRequest.FromString,
74
115
  response_serializer=flwr_dot_proto_dot_exec__pb2.ListRunsResponse.SerializeToString,
75
116
  ),
117
+ 'GetLoginDetails': grpc.unary_unary_rpc_method_handler(
118
+ servicer.GetLoginDetails,
119
+ request_deserializer=flwr_dot_proto_dot_exec__pb2.GetLoginDetailsRequest.FromString,
120
+ response_serializer=flwr_dot_proto_dot_exec__pb2.GetLoginDetailsResponse.SerializeToString,
121
+ ),
122
+ 'GetAuthTokens': grpc.unary_unary_rpc_method_handler(
123
+ servicer.GetAuthTokens,
124
+ request_deserializer=flwr_dot_proto_dot_exec__pb2.GetAuthTokensRequest.FromString,
125
+ response_serializer=flwr_dot_proto_dot_exec__pb2.GetAuthTokensResponse.SerializeToString,
126
+ ),
76
127
  }
77
128
  generic_handler = grpc.method_handlers_generic_handler(
78
129
  'flwr.proto.Exec', rpc_method_handlers)
@@ -100,6 +151,23 @@ class Exec(object):
100
151
  options, channel_credentials,
101
152
  insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
102
153
 
154
+ @staticmethod
155
+ def StopRun(request,
156
+ target,
157
+ options=(),
158
+ channel_credentials=None,
159
+ call_credentials=None,
160
+ insecure=False,
161
+ compression=None,
162
+ wait_for_ready=None,
163
+ timeout=None,
164
+ metadata=None):
165
+ return grpc.experimental.unary_unary(request, target, '/flwr.proto.Exec/StopRun',
166
+ flwr_dot_proto_dot_exec__pb2.StopRunRequest.SerializeToString,
167
+ flwr_dot_proto_dot_exec__pb2.StopRunResponse.FromString,
168
+ options, channel_credentials,
169
+ insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
170
+
103
171
  @staticmethod
104
172
  def StreamLogs(request,
105
173
  target,
@@ -133,3 +201,37 @@ class Exec(object):
133
201
  flwr_dot_proto_dot_exec__pb2.ListRunsResponse.FromString,
134
202
  options, channel_credentials,
135
203
  insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
204
+
205
+ @staticmethod
206
+ def GetLoginDetails(request,
207
+ target,
208
+ options=(),
209
+ channel_credentials=None,
210
+ call_credentials=None,
211
+ insecure=False,
212
+ compression=None,
213
+ wait_for_ready=None,
214
+ timeout=None,
215
+ metadata=None):
216
+ return grpc.experimental.unary_unary(request, target, '/flwr.proto.Exec/GetLoginDetails',
217
+ flwr_dot_proto_dot_exec__pb2.GetLoginDetailsRequest.SerializeToString,
218
+ flwr_dot_proto_dot_exec__pb2.GetLoginDetailsResponse.FromString,
219
+ options, channel_credentials,
220
+ insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
221
+
222
+ @staticmethod
223
+ def GetAuthTokens(request,
224
+ target,
225
+ options=(),
226
+ channel_credentials=None,
227
+ call_credentials=None,
228
+ insecure=False,
229
+ compression=None,
230
+ wait_for_ready=None,
231
+ timeout=None,
232
+ metadata=None):
233
+ return grpc.experimental.unary_unary(request, target, '/flwr.proto.Exec/GetAuthTokens',
234
+ flwr_dot_proto_dot_exec__pb2.GetAuthTokensRequest.SerializeToString,
235
+ flwr_dot_proto_dot_exec__pb2.GetAuthTokensResponse.FromString,
236
+ options, channel_credentials,
237
+ insecure, call_credentials, compression, wait_for_ready, timeout, metadata)