digitalhub-runtime-python 0.7.0b1__tar.gz → 0.7.0b3__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.
- {digitalhub_runtime_python-0.7.0b1 → digitalhub_runtime_python-0.7.0b3}/PKG-INFO +1 -1
- digitalhub_runtime_python-0.7.0b3/digitalhub_runtime_python/entities/run/status.py +36 -0
- {digitalhub_runtime_python-0.7.0b1 → digitalhub_runtime_python-0.7.0b3}/digitalhub_runtime_python/runtimes/runtime.py +3 -6
- {digitalhub_runtime_python-0.7.0b1 → digitalhub_runtime_python-0.7.0b3}/digitalhub_runtime_python.egg-info/PKG-INFO +1 -1
- {digitalhub_runtime_python-0.7.0b1 → digitalhub_runtime_python-0.7.0b3}/pyproject.toml +4 -4
- digitalhub_runtime_python-0.7.0b1/digitalhub_runtime_python/entities/run/status.py +0 -9
- {digitalhub_runtime_python-0.7.0b1 → digitalhub_runtime_python-0.7.0b3}/LICENSE.txt +0 -0
- {digitalhub_runtime_python-0.7.0b1 → digitalhub_runtime_python-0.7.0b3}/README.md +0 -0
- {digitalhub_runtime_python-0.7.0b1 → digitalhub_runtime_python-0.7.0b3}/digitalhub_runtime_python/__init__.py +0 -0
- {digitalhub_runtime_python-0.7.0b1 → digitalhub_runtime_python-0.7.0b3}/digitalhub_runtime_python/entities/__init__.py +0 -0
- {digitalhub_runtime_python-0.7.0b1 → digitalhub_runtime_python-0.7.0b3}/digitalhub_runtime_python/entities/function/__init__.py +0 -0
- {digitalhub_runtime_python-0.7.0b1 → digitalhub_runtime_python-0.7.0b3}/digitalhub_runtime_python/entities/function/models.py +0 -0
- {digitalhub_runtime_python-0.7.0b1 → digitalhub_runtime_python-0.7.0b3}/digitalhub_runtime_python/entities/function/spec.py +0 -0
- {digitalhub_runtime_python-0.7.0b1 → digitalhub_runtime_python-0.7.0b3}/digitalhub_runtime_python/entities/function/status.py +0 -0
- {digitalhub_runtime_python-0.7.0b1 → digitalhub_runtime_python-0.7.0b3}/digitalhub_runtime_python/entities/run/__init__.py +0 -0
- {digitalhub_runtime_python-0.7.0b1 → digitalhub_runtime_python-0.7.0b3}/digitalhub_runtime_python/entities/run/spec.py +0 -0
- {digitalhub_runtime_python-0.7.0b1 → digitalhub_runtime_python-0.7.0b3}/digitalhub_runtime_python/entities/task/__init__.py +0 -0
- {digitalhub_runtime_python-0.7.0b1 → digitalhub_runtime_python-0.7.0b3}/digitalhub_runtime_python/entities/task/models.py +0 -0
- {digitalhub_runtime_python-0.7.0b1 → digitalhub_runtime_python-0.7.0b3}/digitalhub_runtime_python/entities/task/spec.py +0 -0
- {digitalhub_runtime_python-0.7.0b1 → digitalhub_runtime_python-0.7.0b3}/digitalhub_runtime_python/entities/task/status.py +0 -0
- {digitalhub_runtime_python-0.7.0b1 → digitalhub_runtime_python-0.7.0b3}/digitalhub_runtime_python/runtimes/__init__.py +0 -0
- {digitalhub_runtime_python-0.7.0b1 → digitalhub_runtime_python-0.7.0b3}/digitalhub_runtime_python/runtimes/kind_registry.py +0 -0
- {digitalhub_runtime_python-0.7.0b1 → digitalhub_runtime_python-0.7.0b3}/digitalhub_runtime_python/utils/configuration.py +0 -0
- {digitalhub_runtime_python-0.7.0b1 → digitalhub_runtime_python-0.7.0b3}/digitalhub_runtime_python/utils/env.py +0 -0
- {digitalhub_runtime_python-0.7.0b1 → digitalhub_runtime_python-0.7.0b3}/digitalhub_runtime_python/utils/inputs.py +0 -0
- {digitalhub_runtime_python-0.7.0b1 → digitalhub_runtime_python-0.7.0b3}/digitalhub_runtime_python/utils/nuclio_configuration.py +0 -0
- {digitalhub_runtime_python-0.7.0b1 → digitalhub_runtime_python-0.7.0b3}/digitalhub_runtime_python/utils/outputs.py +0 -0
- {digitalhub_runtime_python-0.7.0b1 → digitalhub_runtime_python-0.7.0b3}/digitalhub_runtime_python/utils/utils.py +0 -0
- {digitalhub_runtime_python-0.7.0b1 → digitalhub_runtime_python-0.7.0b3}/digitalhub_runtime_python.egg-info/SOURCES.txt +0 -0
- {digitalhub_runtime_python-0.7.0b1 → digitalhub_runtime_python-0.7.0b3}/digitalhub_runtime_python.egg-info/dependency_links.txt +0 -0
- {digitalhub_runtime_python-0.7.0b1 → digitalhub_runtime_python-0.7.0b3}/digitalhub_runtime_python.egg-info/requires.txt +0 -0
- {digitalhub_runtime_python-0.7.0b1 → digitalhub_runtime_python-0.7.0b3}/digitalhub_runtime_python.egg-info/top_level.txt +0 -0
- {digitalhub_runtime_python-0.7.0b1 → digitalhub_runtime_python-0.7.0b3}/setup.cfg +0 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import requests
|
|
4
|
+
from digitalhub_core.utils.exceptions import EntityError
|
|
5
|
+
from digitalhub_ml.entities.run.status import RunStatusMl
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class RunStatusPython(RunStatusMl):
|
|
9
|
+
"""
|
|
10
|
+
Run Python status.
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
def invoke(self, local: bool, **kwargs) -> requests.Response:
|
|
14
|
+
"""
|
|
15
|
+
Invoke running process.
|
|
16
|
+
|
|
17
|
+
Parameters
|
|
18
|
+
----------
|
|
19
|
+
kwargs
|
|
20
|
+
Keyword arguments to pass to the request.
|
|
21
|
+
|
|
22
|
+
Returns
|
|
23
|
+
-------
|
|
24
|
+
requests.Response
|
|
25
|
+
Response from service.
|
|
26
|
+
"""
|
|
27
|
+
try:
|
|
28
|
+
if local:
|
|
29
|
+
raise EntityError("Invoke not supported locally.")
|
|
30
|
+
kwargs["url"] = "http://" + self.service.get("url")
|
|
31
|
+
response = requests.request(**kwargs)
|
|
32
|
+
response.raise_for_status()
|
|
33
|
+
return response
|
|
34
|
+
except Exception as e:
|
|
35
|
+
msg = f"Something got wrong during model serving. Exception: {e.__class__}. Error: {e.args}"
|
|
36
|
+
raise EntityError(msg)
|
|
@@ -22,11 +22,8 @@ class RuntimePython(Runtime):
|
|
|
22
22
|
def __init__(self, kind_registry: KindRegistry, project: str) -> None:
|
|
23
23
|
super().__init__(kind_registry, project)
|
|
24
24
|
ctx = get_context(self.project)
|
|
25
|
-
self.
|
|
26
|
-
self.
|
|
27
|
-
|
|
28
|
-
self.root.mkdir(parents=True, exist_ok=True)
|
|
29
|
-
self.tmp_dir.mkdir(parents=True, exist_ok=True)
|
|
25
|
+
self.runtime_dir = ctx.root / "runtime_python"
|
|
26
|
+
self.runtime_dir.mkdir(parents=True, exist_ok=True)
|
|
30
27
|
|
|
31
28
|
def build(self, function: dict, task: dict, run: dict) -> dict:
|
|
32
29
|
"""
|
|
@@ -148,7 +145,7 @@ class RuntimePython(Runtime):
|
|
|
148
145
|
Function to execute.
|
|
149
146
|
"""
|
|
150
147
|
fnc = get_function_from_source(
|
|
151
|
-
self.
|
|
148
|
+
self.runtime_dir,
|
|
152
149
|
spec.get("source", {}),
|
|
153
150
|
)
|
|
154
151
|
return fnc, hasattr(fnc, "__wrapped__")
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "digitalhub-runtime-python"
|
|
7
|
-
version = "0.7.
|
|
7
|
+
version = "0.7.0b3"
|
|
8
8
|
description = "Python runtime for DHCore"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
authors = [
|
|
@@ -32,14 +32,14 @@ max-line-length = 120
|
|
|
32
32
|
[tool.ruff]
|
|
33
33
|
line-length = 120
|
|
34
34
|
|
|
35
|
-
[tool.ruff.extend-per-file-ignores]
|
|
35
|
+
[tool.ruff.lint.extend-per-file-ignores]
|
|
36
36
|
"__init__.py" = ["F401"]
|
|
37
37
|
|
|
38
|
-
[tool.ruff.pydocstyle]
|
|
38
|
+
[tool.ruff.lint.pydocstyle]
|
|
39
39
|
convention = "numpy"
|
|
40
40
|
|
|
41
41
|
[tool.bumpver]
|
|
42
|
-
current_version = "0.7.
|
|
42
|
+
current_version = "0.7.0b3"
|
|
43
43
|
version_pattern = "MAJOR.MINOR.PATCH[PYTAGNUM]"
|
|
44
44
|
commit_message = "Bump version {old_version} -> {new_version}"
|
|
45
45
|
commit = false
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|