indexify 0.3.0__py3-none-any.whl → 0.3.2__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.
indexify/cli/cli.py CHANGED
@@ -190,7 +190,9 @@ def executor(
190
190
  "--function",
191
191
  "-f",
192
192
  help="Function that the executor will run "
193
- "specified as <namespace>:<workflow>:<function>:<version>",
193
+ "specified as <namespace>:<workflow>:<function>:<version>"
194
+ "version is optional, not specifying it will make the server send any version"
195
+ "of the function",
194
196
  ),
195
197
  ] = None,
196
198
  config_path: Optional[str] = typer.Option(
@@ -261,16 +263,23 @@ def _parse_function_uris(uri_strs: Optional[List[str]]) -> Optional[List[Functio
261
263
  uris: List[FunctionURI] = []
262
264
  for uri_str in uri_strs:
263
265
  tokens = uri_str.split(":")
264
- if len(tokens) != 4:
266
+ # FIXME bring this back when we have a dynamic scheduler
267
+ # if len(tokens) != 4:
268
+ if len(tokens) < 3 and len(tokens) > 4:
265
269
  raise typer.BadParameter(
266
- "Function should be specified as <namespace>:<workflow>:<function>:<version>"
270
+ "Function should be specified as <namespace>:<workflow>:<function>:<version> or"
271
+ "<namespace>:<workflow>:<function>"
267
272
  )
273
+ try:
274
+ version = tokens[3]
275
+ except IndexError:
276
+ version = None
268
277
  uris.append(
269
278
  FunctionURI(
270
279
  namespace=tokens[0],
271
280
  compute_graph=tokens[1],
272
281
  compute_fn=tokens[2],
273
- version=tokens[3],
282
+ version=version,
274
283
  )
275
284
  )
276
285
  return uris
@@ -20,7 +20,7 @@ class FunctionURI(BaseModel):
20
20
  namespace: str
21
21
  compute_graph: str
22
22
  compute_fn: str
23
- version: str
23
+ version: Optional[str] = None
24
24
 
25
25
 
26
26
  class ExecutorMetadata(BaseModel):
@@ -86,33 +86,37 @@ class Service(FunctionExecutorServicer):
86
86
  # If our code raises an exception the grpc framework converts it into GRPC_STATUS_UNKNOWN
87
87
  # error with the exception message. Differentiating errors is not needed for now.
88
88
  RunTaskRequestValidator(request=request).check()
89
+ self._check_task_routed_correctly(request)
89
90
 
91
+ return RunTaskHandler(
92
+ request=request,
93
+ graph_name=self._graph_name,
94
+ graph_version=self._graph_version,
95
+ function_name=self._function_name,
96
+ function=self._function,
97
+ invocation_state=ProxiedInvocationState(
98
+ request.task_id, self._invocation_state_proxy_server
99
+ ),
100
+ logger=self._logger,
101
+ ).run()
102
+
103
+ def _check_task_routed_correctly(self, request: RunTaskRequest):
90
104
  # Fail with internal error as this happened due to wrong task routing to this Server.
105
+ # If we run the wrongly routed task then it can steal data from this Server if it belongs
106
+ # to a different customer.
91
107
  if request.namespace != self._namespace:
92
108
  raise ValueError(
93
109
  f"This Function Executor is not initialized for this namespace {request.namespace}"
94
110
  )
95
111
  if request.graph_name != self._graph_name:
96
112
  raise ValueError(
97
- f"This Function Executor is not initialized for this graph {request.graph_name}"
113
+ f"This Function Executor is not initialized for this graph_name {request.graph_name}"
98
114
  )
99
115
  if request.graph_version != self._graph_version:
100
116
  raise ValueError(
101
- f"This Function Executor is not initialized for this graph version {request.graph_version}"
117
+ f"This Function Executor is not initialized for this graph_version {request.graph_version}"
102
118
  )
103
119
  if request.function_name != self._function_name:
104
120
  raise ValueError(
105
- f"This Function Executor is not initialized for this function {request.function_name}"
121
+ f"This Function Executor is not initialized for this function_name {request.function_name}"
106
122
  )
107
-
108
- return RunTaskHandler(
109
- request=request,
110
- graph_name=self._graph_name,
111
- graph_version=self._graph_version,
112
- function_name=self._function_name,
113
- function=self._function,
114
- invocation_state=ProxiedInvocationState(
115
- request.task_id, self._invocation_state_proxy_server
116
- ),
117
- logger=self._logger,
118
- ).run()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: indexify
3
- Version: 0.3.0
3
+ Version: 0.3.2
4
4
  Summary: Open Source Indexify components and helper tools
5
5
  Home-page: https://github.com/tensorlakeai/indexify
6
6
  License: Apache 2.0
@@ -23,7 +23,7 @@ Requires-Dist: pydantic (==2.10.4)
23
23
  Requires-Dist: pyyaml (>=6,<7)
24
24
  Requires-Dist: rich (>=13.9.2,<14.0.0)
25
25
  Requires-Dist: structlog (>=24.4.0,<25.0.0)
26
- Requires-Dist: tensorlake (==0.1.7)
26
+ Requires-Dist: tensorlake (>=0.1.7,<0.2.0)
27
27
  Requires-Dist: typer (>=0.12,<0.13)
28
28
  Project-URL: Repository, https://github.com/tensorlakeai/indexify
29
29
  Description-Content-Type: text/markdown
@@ -1,6 +1,6 @@
1
- indexify/cli/cli.py,sha256=II73vJlVeEy51pPLnrnBcYJbZQxCPItkFRFEN8MD37c,9122
1
+ indexify/cli/cli.py,sha256=3HU3fz4mcE-yuKij3rRb7gS99SVaMzVN8Z-9Y4UpqT8,9510
2
2
  indexify/executor/README.md,sha256=ozC6_hMkhQQNVCMEpBxwiUALz6lwErPQxNxQfQDqnG4,2029
3
- indexify/executor/api_objects.py,sha256=QeXOZpS7nkVA_dsRQFlS3EuMvqFvLGaw1Spcr0c-5lA,1015
3
+ indexify/executor/api_objects.py,sha256=k5tKYxaWml0sSECoEDzamCYeJnlD7zO2M7E_qGwyMrg,1032
4
4
  indexify/executor/downloader.py,sha256=Vrq1dAW4BifG62tlqFnImiMxdezIgOZcByTRnhDsnnw,6457
5
5
  indexify/executor/executor.py,sha256=lln0p0cVN2aNY3bsHFp7Phbaa2q9gnQABi1xEPxo1Nc,5859
6
6
  indexify/executor/function_executor/function_executor.py,sha256=a9pAWQWDLJL-i5bp1PEMD2eMYOTvXAh_1jQsXcL_JCQ,5226
@@ -34,11 +34,11 @@ indexify/function_executor/proto/function_executor_pb2.pyi,sha256=TQEOl3W1s4fxtp
34
34
  indexify/function_executor/proto/function_executor_pb2_grpc.py,sha256=xrqIDrcl1PTyQTGAAGrgSDKEtZilC445Op0tJ7LmS5Q,8716
35
35
  indexify/function_executor/proto/message_validator.py,sha256=OKXPYgy5L9c-spnV9Zjv7PA_yxwzvykfhbYylYx8cwQ,1456
36
36
  indexify/function_executor/server.py,sha256=tJzUy_v4BT8Le9G3hgtiuDJo9YVFkAU2dVISSsX36II,1061
37
- indexify/function_executor/service.py,sha256=3JYcMcWiCgvxXhRPReUUBjTBNLIqUbhhsGZIsqIcVw4,5343
37
+ indexify/function_executor/service.py,sha256=i3bI7RSKSr3cDiNFoZdl4TSY_SMKlXBXPdExjvaAoBY,5606
38
38
  indexify/utils/README.md,sha256=2g8-H9GopacOW4YrViZc0QsaJPtK-Fox7GyfX01kcDk,86
39
39
  indexify/utils/http_client.py,sha256=deMlmAu4E_ZXV3blCdWNag3uO_cyD-GsMZjFFmO5r7s,3541
40
40
  indexify/utils/logging.py,sha256=c6NwzY7uVHMRJc8f2w2KF36rNkeZVoQfGdq7suIg9s8,2025
41
- indexify-0.3.0.dist-info/METADATA,sha256=ZZHmhRQjHMzLT-l9rkqkZX_1YSvMEyo6XEY4j7Iw0GU,1376
42
- indexify-0.3.0.dist-info/WHEEL,sha256=RaoafKOydTQ7I_I3JTrPCg6kUmTgtm4BornzOqyEfJ8,88
43
- indexify-0.3.0.dist-info/entry_points.txt,sha256=pJG0YRnypesbiNJHuObfHEkjk0p_ZvEDTyyTH0kGVTY,108
44
- indexify-0.3.0.dist-info/RECORD,,
41
+ indexify-0.3.2.dist-info/METADATA,sha256=YqG6aAKrJhBV7YQal0ojM9HnpdvuIb0aGbHTTOjePS4,1383
42
+ indexify-0.3.2.dist-info/WHEEL,sha256=RaoafKOydTQ7I_I3JTrPCg6kUmTgtm4BornzOqyEfJ8,88
43
+ indexify-0.3.2.dist-info/entry_points.txt,sha256=pJG0YRnypesbiNJHuObfHEkjk0p_ZvEDTyyTH0kGVTY,108
44
+ indexify-0.3.2.dist-info/RECORD,,