adp-operator 1.2.2__tar.gz → 1.2.4__tar.gz

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.
Files changed (111) hide show
  1. {adp-operator-1.2.2 → adp_operator-1.2.4}/PKG-INFO +7 -2
  2. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/c2c/handlers/file.py +15 -2
  3. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/c2c/node_context.py +33 -3
  4. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/c2c/routing.py +6 -2
  5. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/c2c/tcp_server.py +70 -15
  6. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/collect/collect.py +6 -0
  7. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/collect/executor.py +12 -1
  8. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/collect/member.py +1 -0
  9. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator.egg-info/PKG-INFO +7 -2
  10. {adp-operator-1.2.2 → adp_operator-1.2.4}/setup.py +1 -1
  11. {adp-operator-1.2.2 → adp_operator-1.2.4}/MANIFEST.in +0 -0
  12. {adp-operator-1.2.2 → adp_operator-1.2.4}/README.md +0 -0
  13. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/__init__.py +0 -0
  14. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/c2c/__init__.py +0 -0
  15. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/c2c/__main__.py +0 -0
  16. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/c2c/client.py +0 -0
  17. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/c2c/commands.py +0 -0
  18. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/c2c/config.py +0 -0
  19. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/c2c/dependent.py +0 -0
  20. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/c2c/discovery.py +0 -0
  21. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/c2c/event_bus.py +0 -0
  22. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/c2c/file_stream.py +0 -0
  23. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/c2c/handlers/__init__.py +0 -0
  24. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/c2c/handlers/data.py +0 -0
  25. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/c2c/handlers/discovery.py +0 -0
  26. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/c2c/handlers/frontend.py +0 -0
  27. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/c2c/handlers/http.py +0 -0
  28. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/c2c/handlers/identity.py +0 -0
  29. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/c2c/handlers/operator.py +0 -0
  30. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/c2c/handlers/scan.py +0 -0
  31. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/c2c/liveness.py +0 -0
  32. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/c2c/log_stream.py +0 -0
  33. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/c2c/main.py +0 -0
  34. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/c2c/operator.py +0 -0
  35. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/c2c/operator_executor.py +0 -0
  36. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/c2c/operator_frontend.py +0 -0
  37. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/c2c/operator_loader.py +0 -0
  38. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/c2c/operator_metadata.py +0 -0
  39. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/c2c/operator_service.py +0 -0
  40. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/c2c/operator_source.py +0 -0
  41. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/c2c/peer_registry.py +0 -0
  42. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/c2c/probe.py +0 -0
  43. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/c2c/protocol.py +0 -0
  44. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/c2c/reverse_connection.py +0 -0
  45. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/c2c/run_queue.py +0 -0
  46. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/c2c/runtime.py +0 -0
  47. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/c2c/service_discovery.py +0 -0
  48. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/c2c/session.py +0 -0
  49. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/c2c/socket_channel.py +0 -0
  50. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/c2c/state.py +0 -0
  51. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/cache_utils.py +0 -0
  52. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/collect/__init__.py +0 -0
  53. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/connect.py +0 -0
  54. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/core/__init__.py +0 -0
  55. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/core/constants.py +0 -0
  56. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/core/json2pdf.py +0 -0
  57. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/core/llm_config.py +0 -0
  58. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/core/llm_serving.py +0 -0
  59. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/core/models.py +0 -0
  60. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/core/my_scale_db_storeage.py +0 -0
  61. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/core/object_storage/__init__.py +0 -0
  62. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/core/object_storage/base.py +0 -0
  63. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/core/object_storage/base_stream_object.py +0 -0
  64. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/core/object_storage/minio_object_storage.py +0 -0
  65. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/core/object_storage/tos_object_storage.py +0 -0
  66. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/core/operator_init_config.py +0 -0
  67. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/core/operator_utils.py +0 -0
  68. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/core/run_and_load_node_info.py +0 -0
  69. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/dataset/__init__.py +0 -0
  70. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/dataset/cache.py +0 -0
  71. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/dataset/storage.py +0 -0
  72. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/logger.py +0 -0
  73. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/management/__init__.py +0 -0
  74. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/management/commands/__init__.py +0 -0
  75. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/management/commands/common.py +0 -0
  76. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/management/commands/login.py +0 -0
  77. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/management/commands/logs.py +0 -0
  78. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/management/commands/run.py +0 -0
  79. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/management/commands/serve.py +0 -0
  80. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/management/commands/upload.py +0 -0
  81. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/management/main.py +0 -0
  82. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/models.py +0 -0
  83. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/myscale_pool.py +0 -0
  84. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/myscale_utils.py +0 -0
  85. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/operators/__init__.py +0 -0
  86. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/operators/adp_myscale.py +0 -0
  87. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/operators/adp_mysql.py +0 -0
  88. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/operators/adp_operator_dispatch.py +0 -0
  89. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/operators/adp_operator_installer.py +0 -0
  90. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/operators/adp_postgres.py +0 -0
  91. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/operators/adp_redis.py +0 -0
  92. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/operators/c2c_bridge_node.py +0 -0
  93. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/operators/c2c_http_gateway.py +0 -0
  94. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/operators/c2c_panel_node.py +0 -0
  95. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/operators/dataflow_system_prompt_cache.bin +0 -0
  96. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/operators/operator_directory_watch.py +0 -0
  97. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/serving/__init__.py +0 -0
  98. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/serving/api_llm_serving_request.py +0 -0
  99. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/storage.py +0 -0
  100. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/utils/__init__.py +0 -0
  101. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/utils/dataframe_transport.py +0 -0
  102. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/utils/docker_api.py +0 -0
  103. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/utils/file_utils.py +0 -0
  104. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/utils/myscale_pool.py +0 -0
  105. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator/utils/myscale_utils.py +0 -0
  106. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator.egg-info/SOURCES.txt +0 -0
  107. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator.egg-info/dependency_links.txt +0 -0
  108. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator.egg-info/entry_points.txt +0 -0
  109. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator.egg-info/requires.txt +0 -0
  110. {adp-operator-1.2.2 → adp_operator-1.2.4}/adp_operator.egg-info/top_level.txt +0 -0
  111. {adp-operator-1.2.2 → adp_operator-1.2.4}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: adp-operator
3
- Version: 1.2.2
3
+ Version: 1.2.4
4
4
  Summary: ADP operator management and C2C runtime tools
5
5
  Requires-Python: >=3.9
6
6
  Description-Content-Type: text/markdown
@@ -19,6 +19,11 @@ Requires-Dist: colorlog
19
19
  Requires-Dist: watchdog
20
20
  Requires-Dist: websockets
21
21
  Requires-Dist: clickhouse_driver
22
+ Dynamic: description
23
+ Dynamic: description-content-type
24
+ Dynamic: requires-dist
25
+ Dynamic: requires-python
26
+ Dynamic: summary
22
27
 
23
28
  # ADP Operator
24
29
 
@@ -182,6 +182,7 @@ def handle_sync_files(
182
182
  executor,
183
183
  registry,
184
184
  request_tracker: RequestTracker,
185
+ source_instance_id=None,
185
186
  ):
186
187
  response = {"type": "sync_files_ack", "node_id": node_id}
187
188
  try:
@@ -202,7 +203,19 @@ def handle_sync_files(
202
203
  )
203
204
  if route is None:
204
205
  raise ConnectionError(f"探测不到节点 {identifier}")
205
- manifest = _request_on_route(registry, route, {
206
+ if source_instance_id not in (None, instance_id):
207
+ route = [source_instance_id, *route]
208
+ logging.info(
209
+ "[文件] 同步路径 %s: %s",
210
+ identifier,
211
+ " -> ".join(route),
212
+ )
213
+ network_route = (
214
+ route[1:]
215
+ if route[:2] == [source_instance_id, instance_id]
216
+ else route
217
+ )
218
+ manifest = _request_on_route(registry, network_route, {
206
219
  "type": "file_manifest",
207
220
  "session_id": message["session_id"],
208
221
  })
@@ -215,7 +228,7 @@ def handle_sync_files(
215
228
  for relative_path in changed:
216
229
  _send_file(
217
230
  registry,
218
- route,
231
+ network_route,
219
232
  message["session_id"],
220
233
  relative_path,
221
234
  directory / relative_path,
@@ -83,13 +83,18 @@ class C2CNodeTransport:
83
83
  "operator_name": (
84
84
  local_executor.operator_name if local_executor else executor.operator_name
85
85
  ),
86
+ "instance_id": getattr(
87
+ local_executor or executor,
88
+ "instance_id",
89
+ self.client.instance_id,
90
+ ),
86
91
  "weight": getattr(
87
92
  (local_executor or executor).operator_class,
88
93
  "weight",
89
94
  "medium",
90
95
  ),
91
96
  }
92
- return discover_route_group(
97
+ routes = discover_route_group(
93
98
  self.client.node_id,
94
99
  self.client.instance_id,
95
100
  operator_name,
@@ -98,6 +103,13 @@ class C2CNodeTransport:
98
103
  local_match=local_match,
99
104
  expires_at=time.time() + timeout,
100
105
  )
106
+ member_instance_id = getattr(self.client, "member_instance_id", None)
107
+ if member_instance_id is None:
108
+ return routes
109
+ return [
110
+ {**item, "route": [member_instance_id, *item["route"]]}
111
+ for item in routes
112
+ ]
101
113
 
102
114
  def request(
103
115
  self,
@@ -111,12 +123,20 @@ class C2CNodeTransport:
111
123
  local_route = (
112
124
  explicit_route is None
113
125
  or explicit_route[-1:] == [self.client.instance_id]
126
+ or (
127
+ local_executor is not None
128
+ and explicit_route[-1:] == [
129
+ getattr(local_executor, "instance_id", None)
130
+ ]
131
+ )
114
132
  )
115
133
  if local_executor is not None and local_route:
116
134
  yield from self._local_request(local_executor, message, session_id)
117
135
  return
118
136
  target = C2CCommands._target(message.get("route"))
119
- selected_route = self._select_route(operator_name, target.get("route"))
137
+ selected_route = self._select_route(
138
+ operator_name, self._network_route(target.get("route"))
139
+ )
120
140
  if selected_route is None:
121
141
  raise ConnectionError(f"探测不到节点 {operator_name}")
122
142
  self._validate_local_route(selected_route)
@@ -165,7 +185,9 @@ class C2CNodeTransport:
165
185
  route: list[str] | None = None,
166
186
  ) -> str:
167
187
  target = C2CCommands._target(route)
168
- selected_route = self._select_route(operator_name, target.get("route"))
188
+ selected_route = self._select_route(
189
+ operator_name, self._network_route(target.get("route"))
190
+ )
169
191
  if selected_route is None:
170
192
  raise ConnectionError(f"探测不到节点 {operator_name}")
171
193
  self._validate_local_route(selected_route)
@@ -226,6 +248,14 @@ class C2CNodeTransport:
226
248
  if len(route) < 2:
227
249
  raise ValueError("不能通过网络向当前节点发送请求")
228
250
 
251
+ def _network_route(self, route: list[str] | None) -> list[str] | None:
252
+ member_instance_id = getattr(self.client, "member_instance_id", None)
253
+ if route is None or member_instance_id is None:
254
+ return route
255
+ if len(route) < 2 or route[:2] != [member_instance_id, self.client.instance_id]:
256
+ raise ValueError("Collect 成员路由缺少所属 Collect 实例")
257
+ return route[1:]
258
+
229
259
  def _local_executor(self, operator_name: str):
230
260
  collect_executor = getattr(self.client, "collect_executor", None)
231
261
  resolver = getattr(collect_executor, "resolve_executor", None)
@@ -146,12 +146,16 @@ def discover_route_group(
146
146
  weight = local_match.get("weight", "medium")
147
147
  if weight not in WEIGHT_PRIORITY:
148
148
  weight = "medium"
149
+ target_instance_id = local_match.get("instance_id") or source_id
150
+ local_route = [source_id]
151
+ if target_instance_id != source_id:
152
+ local_route.append(target_instance_id)
149
153
  routes.append({
150
154
  "node_id": local_match.get("node_id") or node_id,
151
155
  "operator_name": local_match.get("operator_name"),
152
- "instance_id": source_id,
156
+ "instance_id": target_instance_id,
153
157
  "weight": weight,
154
- "route": [source_id],
158
+ "route": local_route,
155
159
  })
156
160
 
157
161
  local = registry.direct_peers()
@@ -201,12 +201,23 @@ def _handle_tcp_message(
201
201
  ):
202
202
  node_id, instance_id = state.identity()
203
203
  message_type = message.get("type")
204
+ # probe.route 仅记录已经过路径,不是业务指令的目标路由。
205
+ route_supplied = message_type != "probe" and "route" in message
206
+ route = message.get("route") if message_type != "probe" else None
204
207
  resolve_executor = getattr(executor, "resolve_executor", None)
205
208
  target_executor = (
206
209
  resolve_executor(message.get("operator_name"))
207
210
  if callable(resolve_executor)
208
211
  else executor
209
212
  )
213
+ # Collect 的最终两跳是 collect_instance_id -> member_instance_id。
214
+ if (
215
+ callable(resolve_executor)
216
+ and isinstance(route, list)
217
+ and len(route) == 2
218
+ and route[0] in (node_id, instance_id)
219
+ ):
220
+ target_executor = resolve_executor(route[1]) or target_executor
210
221
  if message_type == "channel" and target_executor is executor:
211
222
  resolve_channel = getattr(executor, "resolve_channel", None)
212
223
  if callable(resolve_channel):
@@ -243,10 +254,6 @@ def _handle_tcp_message(
243
254
  connection,
244
255
  )
245
256
  return
246
- # probe.route 是探测波已经经过的实例路径,不是业务指令的目标路由。
247
- # 将它交给通用路由会使 probe 从第二跳开始被错误地送回上一跳。
248
- route_supplied = message_type != "probe" and "route" in message
249
- route = message.get("route") if message_type != "probe" else None
250
257
  identifier = (
251
258
  route[-1]
252
259
  if isinstance(route, list) and route
@@ -259,8 +266,25 @@ def _handle_tcp_message(
259
266
  if identifier is not None:
260
267
  if not isinstance(identifier, str) or not identifier:
261
268
  raise ValueError("identifier 必须是非空字符串")
262
- consume_here = identifier in (node_id, instance_id)
269
+ member_instance_id = (
270
+ getattr(target_executor, "instance_id", None)
271
+ if target_executor is not executor else None
272
+ )
273
+ internal_next = (
274
+ member_instance_id is not None
275
+ and route == [instance_id, member_instance_id]
276
+ )
277
+ consume_here = identifier in (node_id, instance_id) or internal_next
263
278
  if message_type == "route_probe":
279
+ matched_executor = (
280
+ resolve_executor(identifier)
281
+ if callable(resolve_executor)
282
+ else executor
283
+ )
284
+ matched_member_instance_id = (
285
+ getattr(matched_executor, "instance_id", None)
286
+ if matched_executor is not executor else None
287
+ )
264
288
  probe_here = consume_here or (
265
289
  executor is not None
266
290
  and (
@@ -271,15 +295,21 @@ def _handle_tcp_message(
271
295
  )
272
296
  )
273
297
  )
274
- discovered = [instance_id] if probe_here else discover_route(
275
- node_id,
276
- instance_id,
277
- identifier,
278
- registry,
279
- request_tracker,
280
- probe_id=message.get("probe_id"),
281
- sender_node_id=message.get("sender_node_id"),
282
- force_probe=message.get("force_probe") is True,
298
+ discovered = (
299
+ [instance_id, matched_member_instance_id]
300
+ if probe_here and matched_member_instance_id
301
+ else [instance_id]
302
+ if probe_here
303
+ else discover_route(
304
+ node_id,
305
+ instance_id,
306
+ identifier,
307
+ registry,
308
+ request_tracker,
309
+ probe_id=message.get("probe_id"),
310
+ sender_node_id=message.get("sender_node_id"),
311
+ force_probe=message.get("force_probe") is True,
312
+ )
283
313
  )
284
314
  send_json(
285
315
  connection,
@@ -319,6 +349,9 @@ def _handle_tcp_message(
319
349
  getattr(matched_executor.operator_class, "weight", "medium")
320
350
  if matched_executor is not None else "medium"
321
351
  ),
352
+ "instance_id": getattr(
353
+ matched_executor, "instance_id", instance_id
354
+ ),
322
355
  }
323
356
  discovered = discover_route_group(
324
357
  node_id,
@@ -346,6 +379,11 @@ def _handle_tcp_message(
346
379
  local_identifiers.add(executor.operator_name)
347
380
  if target_executor is not None:
348
381
  local_identifiers.add(target_executor.operator_name)
382
+ target_instance_id = getattr(
383
+ target_executor, "instance_id", None
384
+ )
385
+ if target_instance_id:
386
+ local_identifiers.add(target_instance_id)
349
387
  if operator_name not in local_identifiers:
350
388
  send_routing_error(
351
389
  connection,
@@ -440,7 +478,19 @@ def _handle_tcp_message(
440
478
  elif message_type in {"route_probe", "route_probe_group"}:
441
479
  raise ValueError(f"{message_type} 指令必须提供 identifier")
442
480
  # Frozen nodes keep discovery and lifecycle control alive for recovery.
443
- if target_executor is not None and target_executor.missing_dependencies() and message_type not in {
481
+ missing_dependencies = (
482
+ target_executor.missing_dependencies()
483
+ if target_executor is not None else []
484
+ )
485
+ if missing_dependencies and message_type == "sync_files":
486
+ send_json(connection, {
487
+ "type": "sync_files_ack",
488
+ "status": "error",
489
+ "node_id": node_id,
490
+ "error": "节点依赖不满足: " + ", ".join(missing_dependencies),
491
+ })
492
+ return
493
+ if missing_dependencies and message_type not in {
444
494
  "identify", "info", "discover", "join", "handshake",
445
495
  "hidden", "visible", "shutdown", "kill", "close_session", "event",
446
496
  }:
@@ -709,6 +759,11 @@ def _handle_tcp_message(
709
759
  target_executor,
710
760
  registry,
711
761
  request_tracker,
762
+ (
763
+ getattr(target_executor, "instance_id", instance_id)
764
+ if target_executor is not executor
765
+ else instance_id
766
+ ),
712
767
  )
713
768
  elif message_type == "close_session":
714
769
  response = {"type": "close_session_ack", "node_id": node_id}
@@ -2,6 +2,7 @@ from __future__ import annotations
2
2
 
3
3
  import os
4
4
  import threading
5
+ import uuid
5
6
  from typing import Optional
6
7
 
7
8
  from adp_operator.c2c.operator import C2COperatorBase
@@ -58,6 +59,11 @@ class C2CCollect(C2CNodeRuntime):
58
59
  except Exception:
59
60
  collect_executor.stop()
60
61
  raise
62
+ for member in self.members:
63
+ member.executor.instance_id = uuid.uuid5(
64
+ uuid.NAMESPACE_OID,
65
+ f"{self.instance_id}:{member.operator_name}",
66
+ ).hex
61
67
  local_names = set(collect_executor.member_executors)
62
68
  for member in self.members:
63
69
  dependencies = tuple(getattr(member.operator_class, "dependent", ()))
@@ -92,7 +92,16 @@ class CollectExecutor:
92
92
  def resolve_executor(self, operator_name):
93
93
  if operator_name in (None, self.operator_name, self.node_id):
94
94
  return self
95
- return self.member_executors.get(operator_name)
95
+ direct = self.member_executors.get(operator_name)
96
+ if direct is not None:
97
+ return direct
98
+ return next((
99
+ executor for executor in self.member_executors.values()
100
+ if operator_name in {
101
+ executor.node_id,
102
+ getattr(executor, "instance_id", None),
103
+ }
104
+ ), None)
96
105
 
97
106
  def resolve_channel(self, channel_name):
98
107
  matches = [
@@ -137,6 +146,7 @@ class CollectExecutor:
137
146
  "members": [
138
147
  {
139
148
  "node_id": executor.node_id,
149
+ "instance_id": getattr(executor, "instance_id", None),
140
150
  "operator_name": executor.operator_name,
141
151
  "operator": executor.get_extra_info(),
142
152
  "running_tasks": executor._state_pool.running_count,
@@ -157,6 +167,7 @@ class CollectExecutor:
157
167
  "members": [
158
168
  {
159
169
  "node_id": executor.node_id,
170
+ "instance_id": getattr(executor, "instance_id", None),
160
171
  "operator_name": executor.operator_name,
161
172
  }
162
173
  for executor in self.member_executors.values()
@@ -45,6 +45,7 @@ class CollectMemberClient:
45
45
  self.operator_class = executor.operator_class
46
46
  self.node_id = runtime.node_id
47
47
  self.instance_id = runtime.instance_id
48
+ self.member_instance_id = executor.instance_id
48
49
  self.registry = runtime.registry
49
50
  self.state = runtime.state
50
51
  self.request_tracker = runtime.request_tracker
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: adp-operator
3
- Version: 1.2.2
3
+ Version: 1.2.4
4
4
  Summary: ADP operator management and C2C runtime tools
5
5
  Requires-Python: >=3.9
6
6
  Description-Content-Type: text/markdown
@@ -19,6 +19,11 @@ Requires-Dist: colorlog
19
19
  Requires-Dist: watchdog
20
20
  Requires-Dist: websockets
21
21
  Requires-Dist: clickhouse_driver
22
+ Dynamic: description
23
+ Dynamic: description-content-type
24
+ Dynamic: requires-dist
25
+ Dynamic: requires-python
26
+ Dynamic: summary
22
27
 
23
28
  # ADP Operator
24
29
 
@@ -9,7 +9,7 @@ ROOT = Path(__file__).parent
9
9
 
10
10
  setup(
11
11
  name="adp-operator",
12
- version="1.2.2",
12
+ version="1.2.4",
13
13
  description="ADP operator management and C2C runtime tools",
14
14
  long_description=(ROOT / "README.md").read_text(encoding="utf-8"),
15
15
  long_description_content_type="text/markdown",
File without changes
File without changes
File without changes