digitalhub-runtime-python 0.7.0__tar.gz → 0.7.0b1__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.0 → digitalhub_runtime_python-0.7.0b1}/PKG-INFO +2 -2
- digitalhub_runtime_python-0.7.0b1/digitalhub_runtime_python/entities/run/status.py +9 -0
- {digitalhub_runtime_python-0.7.0 → digitalhub_runtime_python-0.7.0b1}/digitalhub_runtime_python/runtimes/runtime.py +6 -3
- {digitalhub_runtime_python-0.7.0 → digitalhub_runtime_python-0.7.0b1}/digitalhub_runtime_python/utils/outputs.py +6 -5
- {digitalhub_runtime_python-0.7.0 → digitalhub_runtime_python-0.7.0b1}/digitalhub_runtime_python.egg-info/PKG-INFO +2 -2
- digitalhub_runtime_python-0.7.0b1/digitalhub_runtime_python.egg-info/requires.txt +1 -0
- {digitalhub_runtime_python-0.7.0 → digitalhub_runtime_python-0.7.0b1}/pyproject.toml +5 -5
- digitalhub_runtime_python-0.7.0/digitalhub_runtime_python/entities/run/status.py +0 -39
- digitalhub_runtime_python-0.7.0/digitalhub_runtime_python.egg-info/requires.txt +0 -1
- {digitalhub_runtime_python-0.7.0 → digitalhub_runtime_python-0.7.0b1}/LICENSE.txt +0 -0
- {digitalhub_runtime_python-0.7.0 → digitalhub_runtime_python-0.7.0b1}/README.md +0 -0
- {digitalhub_runtime_python-0.7.0 → digitalhub_runtime_python-0.7.0b1}/digitalhub_runtime_python/__init__.py +0 -0
- {digitalhub_runtime_python-0.7.0 → digitalhub_runtime_python-0.7.0b1}/digitalhub_runtime_python/entities/__init__.py +0 -0
- {digitalhub_runtime_python-0.7.0 → digitalhub_runtime_python-0.7.0b1}/digitalhub_runtime_python/entities/function/__init__.py +0 -0
- {digitalhub_runtime_python-0.7.0 → digitalhub_runtime_python-0.7.0b1}/digitalhub_runtime_python/entities/function/models.py +0 -0
- {digitalhub_runtime_python-0.7.0 → digitalhub_runtime_python-0.7.0b1}/digitalhub_runtime_python/entities/function/spec.py +0 -0
- {digitalhub_runtime_python-0.7.0 → digitalhub_runtime_python-0.7.0b1}/digitalhub_runtime_python/entities/function/status.py +0 -0
- {digitalhub_runtime_python-0.7.0 → digitalhub_runtime_python-0.7.0b1}/digitalhub_runtime_python/entities/run/__init__.py +0 -0
- {digitalhub_runtime_python-0.7.0 → digitalhub_runtime_python-0.7.0b1}/digitalhub_runtime_python/entities/run/spec.py +0 -0
- {digitalhub_runtime_python-0.7.0 → digitalhub_runtime_python-0.7.0b1}/digitalhub_runtime_python/entities/task/__init__.py +0 -0
- {digitalhub_runtime_python-0.7.0 → digitalhub_runtime_python-0.7.0b1}/digitalhub_runtime_python/entities/task/models.py +0 -0
- {digitalhub_runtime_python-0.7.0 → digitalhub_runtime_python-0.7.0b1}/digitalhub_runtime_python/entities/task/spec.py +0 -0
- {digitalhub_runtime_python-0.7.0 → digitalhub_runtime_python-0.7.0b1}/digitalhub_runtime_python/entities/task/status.py +0 -0
- {digitalhub_runtime_python-0.7.0 → digitalhub_runtime_python-0.7.0b1}/digitalhub_runtime_python/runtimes/__init__.py +0 -0
- {digitalhub_runtime_python-0.7.0 → digitalhub_runtime_python-0.7.0b1}/digitalhub_runtime_python/runtimes/kind_registry.py +0 -0
- {digitalhub_runtime_python-0.7.0 → digitalhub_runtime_python-0.7.0b1}/digitalhub_runtime_python/utils/configuration.py +0 -0
- {digitalhub_runtime_python-0.7.0 → digitalhub_runtime_python-0.7.0b1}/digitalhub_runtime_python/utils/env.py +0 -0
- {digitalhub_runtime_python-0.7.0 → digitalhub_runtime_python-0.7.0b1}/digitalhub_runtime_python/utils/inputs.py +0 -0
- {digitalhub_runtime_python-0.7.0 → digitalhub_runtime_python-0.7.0b1}/digitalhub_runtime_python/utils/nuclio_configuration.py +0 -0
- {digitalhub_runtime_python-0.7.0 → digitalhub_runtime_python-0.7.0b1}/digitalhub_runtime_python/utils/utils.py +0 -0
- {digitalhub_runtime_python-0.7.0 → digitalhub_runtime_python-0.7.0b1}/digitalhub_runtime_python.egg-info/SOURCES.txt +0 -0
- {digitalhub_runtime_python-0.7.0 → digitalhub_runtime_python-0.7.0b1}/digitalhub_runtime_python.egg-info/dependency_links.txt +0 -0
- {digitalhub_runtime_python-0.7.0 → digitalhub_runtime_python-0.7.0b1}/digitalhub_runtime_python.egg-info/top_level.txt +0 -0
- {digitalhub_runtime_python-0.7.0 → digitalhub_runtime_python-0.7.0b1}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: digitalhub-runtime-python
|
|
3
|
-
Version: 0.7.
|
|
3
|
+
Version: 0.7.0b1
|
|
4
4
|
Summary: Python runtime for DHCore
|
|
5
5
|
Author-email: Fondazione Bruno Kessler <dslab@fbk.eu>, Matteo Martini <mmartini@fbk.eu>
|
|
6
6
|
License: Apache License
|
|
@@ -228,6 +228,6 @@ Classifier: Programming Language :: Python :: 3.10
|
|
|
228
228
|
Requires-Python: >=3.9
|
|
229
229
|
Description-Content-Type: text/markdown
|
|
230
230
|
License-File: LICENSE.txt
|
|
231
|
-
Requires-Dist: digitalhub[ml]
|
|
231
|
+
Requires-Dist: digitalhub[ml]>=0.7.0b
|
|
232
232
|
|
|
233
233
|
# SDK for DHCore
|
|
@@ -22,8 +22,11 @@ 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.
|
|
25
|
+
self.root = ctx.runtime_dir
|
|
26
|
+
self.tmp_dir = ctx.tmp_dir
|
|
27
|
+
|
|
28
|
+
self.root.mkdir(parents=True, exist_ok=True)
|
|
29
|
+
self.tmp_dir.mkdir(parents=True, exist_ok=True)
|
|
27
30
|
|
|
28
31
|
def build(self, function: dict, task: dict, run: dict) -> dict:
|
|
29
32
|
"""
|
|
@@ -145,7 +148,7 @@ class RuntimePython(Runtime):
|
|
|
145
148
|
Function to execute.
|
|
146
149
|
"""
|
|
147
150
|
fnc = get_function_from_source(
|
|
148
|
-
self.
|
|
151
|
+
self.root,
|
|
149
152
|
spec.get("source", {}),
|
|
150
153
|
)
|
|
151
154
|
return fnc, hasattr(fnc, "__wrapped__")
|
|
@@ -190,11 +190,12 @@ def build_status(
|
|
|
190
190
|
mapped_outputs = {}
|
|
191
191
|
|
|
192
192
|
try:
|
|
193
|
-
for key,
|
|
194
|
-
if
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
193
|
+
for key, _ in mapped_outputs.items():
|
|
194
|
+
if key in parsed_execution:
|
|
195
|
+
if isinstance(parsed_execution[key], (DataitemTable, Artifact)):
|
|
196
|
+
outputs[key] = parsed_execution[key].key
|
|
197
|
+
else:
|
|
198
|
+
results[key] = parsed_execution[key]
|
|
198
199
|
return {
|
|
199
200
|
"state": State.COMPLETED.value,
|
|
200
201
|
"outputs": outputs,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: digitalhub-runtime-python
|
|
3
|
-
Version: 0.7.
|
|
3
|
+
Version: 0.7.0b1
|
|
4
4
|
Summary: Python runtime for DHCore
|
|
5
5
|
Author-email: Fondazione Bruno Kessler <dslab@fbk.eu>, Matteo Martini <mmartini@fbk.eu>
|
|
6
6
|
License: Apache License
|
|
@@ -228,6 +228,6 @@ Classifier: Programming Language :: Python :: 3.10
|
|
|
228
228
|
Requires-Python: >=3.9
|
|
229
229
|
Description-Content-Type: text/markdown
|
|
230
230
|
License-File: LICENSE.txt
|
|
231
|
-
Requires-Dist: digitalhub[ml]
|
|
231
|
+
Requires-Dist: digitalhub[ml]>=0.7.0b
|
|
232
232
|
|
|
233
233
|
# SDK for DHCore
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
digitalhub[ml]>=0.7.0b
|
|
@@ -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.0b1"
|
|
8
8
|
description = "Python runtime for DHCore"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
authors = [
|
|
@@ -20,7 +20,7 @@ classifiers = [
|
|
|
20
20
|
keywords = ["data", "dataops", "kubernetes"]
|
|
21
21
|
requires-python = ">=3.9"
|
|
22
22
|
dependencies = [
|
|
23
|
-
"digitalhub[ml]>=0.7.0b
|
|
23
|
+
"digitalhub[ml]>=0.7.0b",
|
|
24
24
|
]
|
|
25
25
|
|
|
26
26
|
[project.urls]
|
|
@@ -32,14 +32,14 @@ max-line-length = 120
|
|
|
32
32
|
[tool.ruff]
|
|
33
33
|
line-length = 120
|
|
34
34
|
|
|
35
|
-
[tool.ruff.
|
|
35
|
+
[tool.ruff.extend-per-file-ignores]
|
|
36
36
|
"__init__.py" = ["F401"]
|
|
37
37
|
|
|
38
|
-
[tool.ruff.
|
|
38
|
+
[tool.ruff.pydocstyle]
|
|
39
39
|
convention = "numpy"
|
|
40
40
|
|
|
41
41
|
[tool.bumpver]
|
|
42
|
-
current_version = "0.7.
|
|
42
|
+
current_version = "0.7.0b1"
|
|
43
43
|
version_pattern = "MAJOR.MINOR.PATCH[PYTAGNUM]"
|
|
44
44
|
commit_message = "Bump version {old_version} -> {new_version}"
|
|
45
45
|
commit = false
|
|
@@ -1,39 +0,0 @@
|
|
|
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
|
-
|
|
31
|
-
method = kwargs.pop("method", "POST")
|
|
32
|
-
url = kwargs.get("url", "http://" + self.service.get("url"))
|
|
33
|
-
|
|
34
|
-
response = requests.request(method=method, url=url, **kwargs)
|
|
35
|
-
response.raise_for_status()
|
|
36
|
-
return response
|
|
37
|
-
except Exception as e:
|
|
38
|
-
msg = f"Something got wrong during model serving. Exception: {e.__class__}. Error: {e.args}"
|
|
39
|
-
raise EntityError(msg)
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
digitalhub[ml]<0.8,>=0.7.0b
|
|
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
|