konduktor-nightly 0.1.0.dev20250617053930__py3-none-any.whl → 0.1.0.dev20250618105008__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.
- konduktor/__init__.py +2 -2
- konduktor/utils/validator.py +21 -17
- {konduktor_nightly-0.1.0.dev20250617053930.dist-info → konduktor_nightly-0.1.0.dev20250618105008.dist-info}/METADATA +1 -1
- {konduktor_nightly-0.1.0.dev20250617053930.dist-info → konduktor_nightly-0.1.0.dev20250618105008.dist-info}/RECORD +7 -7
- {konduktor_nightly-0.1.0.dev20250617053930.dist-info → konduktor_nightly-0.1.0.dev20250618105008.dist-info}/LICENSE +0 -0
- {konduktor_nightly-0.1.0.dev20250617053930.dist-info → konduktor_nightly-0.1.0.dev20250618105008.dist-info}/WHEEL +0 -0
- {konduktor_nightly-0.1.0.dev20250617053930.dist-info → konduktor_nightly-0.1.0.dev20250618105008.dist-info}/entry_points.txt +0 -0
konduktor/__init__.py
CHANGED
@@ -14,7 +14,7 @@ __all__ = [
|
|
14
14
|
]
|
15
15
|
|
16
16
|
# Replaced with the current commit when building the wheels.
|
17
|
-
_KONDUKTOR_COMMIT_SHA = '
|
17
|
+
_KONDUKTOR_COMMIT_SHA = '85910d43c76d5297f0501ccc778ec7dd2e53c56f'
|
18
18
|
os.makedirs(os.path.expanduser('~/.konduktor'), exist_ok=True)
|
19
19
|
|
20
20
|
|
@@ -48,5 +48,5 @@ def _get_git_commit():
|
|
48
48
|
|
49
49
|
|
50
50
|
__commit__ = _get_git_commit()
|
51
|
-
__version__ = '1.0.0.dev0.1.0.
|
51
|
+
__version__ = '1.0.0.dev0.1.0.dev20250618105008'
|
52
52
|
__root_dir__ = os.path.dirname(os.path.abspath(__file__))
|
konduktor/utils/validator.py
CHANGED
@@ -12,10 +12,12 @@ from pathlib import Path
|
|
12
12
|
import jsonschema
|
13
13
|
import requests
|
14
14
|
from colorama import Fore, Style
|
15
|
+
from filelock import FileLock
|
15
16
|
|
16
17
|
SCHEMA_VERSION = 'v1.32.0-standalone-strict'
|
17
18
|
SCHEMA_URL = f'https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/{SCHEMA_VERSION}/podspec.json'
|
18
19
|
SCHEMA_CACHE_PATH = Path.home() / '.konduktor/schemas/podspec.json'
|
20
|
+
SCHEMA_LOCK_PATH = SCHEMA_CACHE_PATH.with_suffix('.lock')
|
19
21
|
CACHE_MAX_AGE_SECONDS = 86400 # 24 hours
|
20
22
|
|
21
23
|
|
@@ -32,23 +34,25 @@ SchemaValidator = jsonschema.validators.extend(
|
|
32
34
|
|
33
35
|
|
34
36
|
def get_cached_schema() -> dict:
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
37
|
+
lock = FileLock(str(SCHEMA_LOCK_PATH))
|
38
|
+
with lock:
|
39
|
+
# Check if schema file exists and is fresh
|
40
|
+
if SCHEMA_CACHE_PATH.exists():
|
41
|
+
age = time.time() - SCHEMA_CACHE_PATH.stat().st_mtime
|
42
|
+
# if old
|
43
|
+
if age < CACHE_MAX_AGE_SECONDS:
|
44
|
+
with open(SCHEMA_CACHE_PATH, 'r') as f:
|
45
|
+
return json.load(f)
|
46
|
+
|
47
|
+
# Download schema
|
48
|
+
resp = requests.get(SCHEMA_URL)
|
49
|
+
resp.raise_for_status()
|
50
|
+
|
51
|
+
SCHEMA_CACHE_PATH.parent.mkdir(parents=True, exist_ok=True)
|
52
|
+
with open(SCHEMA_CACHE_PATH, 'w') as f:
|
53
|
+
f.write(resp.text)
|
54
|
+
|
55
|
+
return resp.json()
|
52
56
|
|
53
57
|
|
54
58
|
def validate_pod_spec(pod_spec: dict) -> None:
|
@@ -1,4 +1,4 @@
|
|
1
|
-
konduktor/__init__.py,sha256=
|
1
|
+
konduktor/__init__.py,sha256=YvXdUFqiT3sGsPqOMFos6qLxFNJ1XaXCU7HcNCFAtnY,1540
|
2
2
|
konduktor/adaptors/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
3
3
|
konduktor/adaptors/aws.py,sha256=s47Ra-GaqCQibzVfmD0pmwEWHif1EGO5opMbwkLxTCU,8244
|
4
4
|
konduktor/adaptors/common.py,sha256=ZIqzjx77PIHUwpjfAQ1uX8B2aX78YMuGj4Bppd-MdyM,4183
|
@@ -90,9 +90,9 @@ konduktor/utils/rich_utils.py,sha256=ycADW6Ij3wX3uT8ou7T8qxX519RxlkJivsLvUahQaJo
|
|
90
90
|
konduktor/utils/schemas.py,sha256=VGPERAso2G4sVAznsJ80qT2Q-I_EFxXw6Rfcw-vkYgQ,16535
|
91
91
|
konduktor/utils/subprocess_utils.py,sha256=WoFkoFhGecPR8-rF8WJxbIe-YtV94LXz9UG64SDhCY4,9448
|
92
92
|
konduktor/utils/ux_utils.py,sha256=czCwiS1bDqgeKtzAJctczpLwFZzAse7WuozdvzEFYJ4,7437
|
93
|
-
konduktor/utils/validator.py,sha256=
|
94
|
-
konduktor_nightly-0.1.0.
|
95
|
-
konduktor_nightly-0.1.0.
|
96
|
-
konduktor_nightly-0.1.0.
|
97
|
-
konduktor_nightly-0.1.0.
|
98
|
-
konduktor_nightly-0.1.0.
|
93
|
+
konduktor/utils/validator.py,sha256=K-eEmwq4qgYcOhMv6SqgIPcrpWqDusH0f8EBkzv827Q,2429
|
94
|
+
konduktor_nightly-0.1.0.dev20250618105008.dist-info/LICENSE,sha256=MuuqTZbHvmqXR_aNKAXzggdV45ANd3wQ5YI7tnpZhm0,6586
|
95
|
+
konduktor_nightly-0.1.0.dev20250618105008.dist-info/METADATA,sha256=XQnx13U54JVbngY3hoL5Jq_i7F_5bj6Dml5ohWuIY9Y,4289
|
96
|
+
konduktor_nightly-0.1.0.dev20250618105008.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
|
97
|
+
konduktor_nightly-0.1.0.dev20250618105008.dist-info/entry_points.txt,sha256=k3nG5wDFIJhNqsZWrHk4d0irIB2Ns9s47cjRWYsTCT8,48
|
98
|
+
konduktor_nightly-0.1.0.dev20250618105008.dist-info/RECORD,,
|
File without changes
|
File without changes
|