indexify 0.3.0__tar.gz → 0.3.2__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 (43) hide show
  1. {indexify-0.3.0 → indexify-0.3.2}/PKG-INFO +2 -2
  2. {indexify-0.3.0 → indexify-0.3.2}/pyproject.toml +2 -2
  3. {indexify-0.3.0 → indexify-0.3.2}/src/indexify/cli/cli.py +13 -4
  4. {indexify-0.3.0 → indexify-0.3.2}/src/indexify/executor/api_objects.py +1 -1
  5. {indexify-0.3.0 → indexify-0.3.2}/src/indexify/function_executor/service.py +19 -15
  6. {indexify-0.3.0 → indexify-0.3.2}/README.md +0 -0
  7. {indexify-0.3.0 → indexify-0.3.2}/src/indexify/executor/README.md +0 -0
  8. {indexify-0.3.0 → indexify-0.3.2}/src/indexify/executor/downloader.py +0 -0
  9. {indexify-0.3.0 → indexify-0.3.2}/src/indexify/executor/executor.py +0 -0
  10. {indexify-0.3.0 → indexify-0.3.2}/src/indexify/executor/function_executor/function_executor.py +0 -0
  11. {indexify-0.3.0 → indexify-0.3.2}/src/indexify/executor/function_executor/function_executor_state.py +0 -0
  12. {indexify-0.3.0 → indexify-0.3.2}/src/indexify/executor/function_executor/invocation_state_client.py +0 -0
  13. {indexify-0.3.0 → indexify-0.3.2}/src/indexify/executor/function_executor/server/function_executor_server.py +0 -0
  14. {indexify-0.3.0 → indexify-0.3.2}/src/indexify/executor/function_executor/server/function_executor_server_factory.py +0 -0
  15. {indexify-0.3.0 → indexify-0.3.2}/src/indexify/executor/function_executor/server/subprocess_function_executor_server.py +0 -0
  16. {indexify-0.3.0 → indexify-0.3.2}/src/indexify/executor/function_executor/server/subprocess_function_executor_server_factory.py +0 -0
  17. {indexify-0.3.0 → indexify-0.3.2}/src/indexify/executor/function_executor/single_task_runner.py +0 -0
  18. {indexify-0.3.0 → indexify-0.3.2}/src/indexify/executor/function_executor/task_input.py +0 -0
  19. {indexify-0.3.0 → indexify-0.3.2}/src/indexify/executor/function_executor/task_output.py +0 -0
  20. {indexify-0.3.0 → indexify-0.3.2}/src/indexify/executor/runtime_probes.py +0 -0
  21. {indexify-0.3.0 → indexify-0.3.2}/src/indexify/executor/task_fetcher.py +0 -0
  22. {indexify-0.3.0 → indexify-0.3.2}/src/indexify/executor/task_reporter.py +0 -0
  23. {indexify-0.3.0 → indexify-0.3.2}/src/indexify/executor/task_runner.py +0 -0
  24. {indexify-0.3.0 → indexify-0.3.2}/src/indexify/function_executor/README.md +0 -0
  25. {indexify-0.3.0 → indexify-0.3.2}/src/indexify/function_executor/handlers/run_function/function_inputs_loader.py +0 -0
  26. {indexify-0.3.0 → indexify-0.3.2}/src/indexify/function_executor/handlers/run_function/handler.py +0 -0
  27. {indexify-0.3.0 → indexify-0.3.2}/src/indexify/function_executor/handlers/run_function/request_validator.py +0 -0
  28. {indexify-0.3.0 → indexify-0.3.2}/src/indexify/function_executor/handlers/run_function/response_helper.py +0 -0
  29. {indexify-0.3.0 → indexify-0.3.2}/src/indexify/function_executor/initialize_request_validator.py +0 -0
  30. {indexify-0.3.0 → indexify-0.3.2}/src/indexify/function_executor/invocation_state/invocation_state_proxy_server.py +0 -0
  31. {indexify-0.3.0 → indexify-0.3.2}/src/indexify/function_executor/invocation_state/proxied_invocation_state.py +0 -0
  32. {indexify-0.3.0 → indexify-0.3.2}/src/indexify/function_executor/invocation_state/response_validator.py +0 -0
  33. {indexify-0.3.0 → indexify-0.3.2}/src/indexify/function_executor/main.py +0 -0
  34. {indexify-0.3.0 → indexify-0.3.2}/src/indexify/function_executor/proto/configuration.py +0 -0
  35. {indexify-0.3.0 → indexify-0.3.2}/src/indexify/function_executor/proto/function_executor.proto +0 -0
  36. {indexify-0.3.0 → indexify-0.3.2}/src/indexify/function_executor/proto/function_executor_pb2.py +0 -0
  37. {indexify-0.3.0 → indexify-0.3.2}/src/indexify/function_executor/proto/function_executor_pb2.pyi +0 -0
  38. {indexify-0.3.0 → indexify-0.3.2}/src/indexify/function_executor/proto/function_executor_pb2_grpc.py +0 -0
  39. {indexify-0.3.0 → indexify-0.3.2}/src/indexify/function_executor/proto/message_validator.py +0 -0
  40. {indexify-0.3.0 → indexify-0.3.2}/src/indexify/function_executor/server.py +0 -0
  41. {indexify-0.3.0 → indexify-0.3.2}/src/indexify/utils/README.md +0 -0
  42. {indexify-0.3.0 → indexify-0.3.2}/src/indexify/utils/http_client.py +0 -0
  43. {indexify-0.3.0 → indexify-0.3.2}/src/indexify/utils/logging.py +0 -0
@@ -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,7 +1,7 @@
1
1
  [tool.poetry]
2
2
  name = "indexify"
3
3
  # Incremented if any of the components provided in this packages are updated.
4
- version = "0.3.0"
4
+ version = "0.3.2"
5
5
  description = "Open Source Indexify components and helper tools"
6
6
  authors = ["Tensorlake Inc. <support@tensorlake.ai>"]
7
7
  license = "Apache 2.0"
@@ -23,7 +23,7 @@ grpcio = "1.68.1"
23
23
 
24
24
  # Function Executor only
25
25
  grpcio-tools = "1.68.1"
26
- tensorlake = "0.1.7"
26
+ tensorlake = "~=0.1.7"
27
27
 
28
28
  # Executor only
29
29
  pydantic = "2.10.4"
@@ -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()
File without changes