konduktor-nightly 0.1.0.dev20250413104535__py3-none-any.whl → 0.1.0.dev20250415104823__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/adaptors/common.py +31 -0
- konduktor/adaptors/gcp.py +7 -32
- konduktor/backends/jobset.py +3 -1
- konduktor/data/aws/s3.py +9 -4
- konduktor/utils/accelerator_registry.py +1 -0
- {konduktor_nightly-0.1.0.dev20250413104535.dist-info → konduktor_nightly-0.1.0.dev20250415104823.dist-info}/METADATA +1 -1
- {konduktor_nightly-0.1.0.dev20250413104535.dist-info → konduktor_nightly-0.1.0.dev20250415104823.dist-info}/RECORD +11 -11
- {konduktor_nightly-0.1.0.dev20250413104535.dist-info → konduktor_nightly-0.1.0.dev20250415104823.dist-info}/LICENSE +0 -0
- {konduktor_nightly-0.1.0.dev20250413104535.dist-info → konduktor_nightly-0.1.0.dev20250415104823.dist-info}/WHEEL +0 -0
- {konduktor_nightly-0.1.0.dev20250413104535.dist-info → konduktor_nightly-0.1.0.dev20250415104823.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 = 'db987d020cad5afaafe4fd3c7ff858fd9bcb264d'
|
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.dev20250415104823'
|
52
52
|
__root_dir__ = os.path.dirname(os.path.abspath(__file__))
|
konduktor/adaptors/common.py
CHANGED
@@ -14,9 +14,12 @@
|
|
14
14
|
|
15
15
|
import functools
|
16
16
|
import importlib
|
17
|
+
import os
|
17
18
|
import threading
|
18
19
|
from typing import Any, Callable, Optional, Tuple
|
19
20
|
|
21
|
+
from filelock import FileLock
|
22
|
+
|
20
23
|
|
21
24
|
class LazyImport:
|
22
25
|
"""Lazy importer for heavy modules or cloud modules only when enabled.
|
@@ -86,3 +89,31 @@ def load_lazy_modules(modules: Tuple[LazyImport, ...]):
|
|
86
89
|
return wrapper
|
87
90
|
|
88
91
|
return decorator
|
92
|
+
|
93
|
+
|
94
|
+
class LockedClientProxy:
|
95
|
+
"""Proxy for GCP client that locks access to the client."""
|
96
|
+
|
97
|
+
def __init__(
|
98
|
+
self,
|
99
|
+
client,
|
100
|
+
lock_path=os.path.expanduser('~/.konduktor/gcs_storage.lock'),
|
101
|
+
timeout=10,
|
102
|
+
):
|
103
|
+
self._client = client
|
104
|
+
self._lock = FileLock(lock_path, timeout=timeout)
|
105
|
+
|
106
|
+
def __getattr__(self, attr):
|
107
|
+
target = getattr(self._client, attr)
|
108
|
+
|
109
|
+
if callable(target):
|
110
|
+
|
111
|
+
@functools.wraps(target)
|
112
|
+
def locked_method(*args, **kwargs):
|
113
|
+
with self._lock:
|
114
|
+
return target(*args, **kwargs)
|
115
|
+
|
116
|
+
return locked_method
|
117
|
+
else:
|
118
|
+
# Attribute (not method) access just passes through
|
119
|
+
return target
|
konduktor/adaptors/gcp.py
CHANGED
@@ -14,9 +14,6 @@
|
|
14
14
|
|
15
15
|
import json
|
16
16
|
import os
|
17
|
-
from functools import wraps
|
18
|
-
|
19
|
-
from filelock import FileLock
|
20
17
|
|
21
18
|
from konduktor.adaptors import common
|
22
19
|
|
@@ -29,33 +26,7 @@ googleapiclient = common.LazyImport(
|
|
29
26
|
google = common.LazyImport('google', import_error_message=_IMPORT_ERROR_MESSAGE)
|
30
27
|
_LAZY_MODULES = (google, googleapiclient)
|
31
28
|
|
32
|
-
|
33
|
-
class LockedClientProxy:
|
34
|
-
"""Proxy for GCP client that locks access to the client."""
|
35
|
-
|
36
|
-
def __init__(
|
37
|
-
self,
|
38
|
-
client,
|
39
|
-
lock_path=os.path.expanduser('~/.konduktor/gcs_storage.lock'),
|
40
|
-
timeout=10,
|
41
|
-
):
|
42
|
-
self._client = client
|
43
|
-
self._lock = FileLock(lock_path, timeout=timeout)
|
44
|
-
|
45
|
-
def __getattr__(self, attr):
|
46
|
-
target = getattr(self._client, attr)
|
47
|
-
|
48
|
-
if callable(target):
|
49
|
-
|
50
|
-
@wraps(target)
|
51
|
-
def locked_method(*args, **kwargs):
|
52
|
-
with self._lock:
|
53
|
-
return target(*args, **kwargs)
|
54
|
-
|
55
|
-
return locked_method
|
56
|
-
else:
|
57
|
-
# Attribute (not method) access just passes through
|
58
|
-
return target
|
29
|
+
_LOCK_PATH = '~/.konduktor/gcs_storage.lock'
|
59
30
|
|
60
31
|
|
61
32
|
@common.load_lazy_modules(_LAZY_MODULES)
|
@@ -75,7 +46,9 @@ def storage_client():
|
|
75
46
|
"""Helper that connects to GCS Storage Client for GCS Bucket"""
|
76
47
|
from google.cloud import storage
|
77
48
|
|
78
|
-
return LockedClientProxy(
|
49
|
+
return common.LockedClientProxy(
|
50
|
+
storage.Client(), lock_path=os.path.expanduser(_LOCK_PATH)
|
51
|
+
)
|
79
52
|
|
80
53
|
|
81
54
|
@common.load_lazy_modules(_LAZY_MODULES)
|
@@ -83,7 +56,9 @@ def anonymous_storage_client():
|
|
83
56
|
"""Helper that connects to GCS Storage Client for Public GCS Buckets"""
|
84
57
|
from google.cloud import storage
|
85
58
|
|
86
|
-
return LockedClientProxy(
|
59
|
+
return common.LockedClientProxy(
|
60
|
+
storage.Client(), lock_path=os.path.expanduser(_LOCK_PATH)
|
61
|
+
)
|
87
62
|
|
88
63
|
|
89
64
|
@common.load_lazy_modules(_LAZY_MODULES)
|
konduktor/backends/jobset.py
CHANGED
@@ -185,7 +185,9 @@ class JobsetBackend(backend.Backend):
|
|
185
185
|
if not dryrun and not detach_run:
|
186
186
|
with ux_utils.print_exception_no_traceback():
|
187
187
|
with rich_utils.safe_status(
|
188
|
-
ux_utils.spinner_message(
|
188
|
+
ux_utils.spinner_message(
|
189
|
+
'waiting for job to start. ' 'Press Ctrl+C to detach. \n'
|
190
|
+
)
|
189
191
|
):
|
190
192
|
_wait_for_jobset_start(namespace, task.name)
|
191
193
|
try:
|
konduktor/data/aws/s3.py
CHANGED
@@ -24,11 +24,11 @@ import typing
|
|
24
24
|
import uuid
|
25
25
|
from typing import Any, Dict, List, Optional, Tuple
|
26
26
|
|
27
|
-
import boto3
|
28
27
|
import colorama
|
29
28
|
|
30
29
|
from konduktor import config, logging
|
31
30
|
from konduktor.adaptors import aws
|
31
|
+
from konduktor.adaptors.aws import boto3
|
32
32
|
from konduktor.data import constants, data_utils, storage_utils
|
33
33
|
from konduktor.utils import (
|
34
34
|
annotations,
|
@@ -40,6 +40,9 @@ from konduktor.utils import (
|
|
40
40
|
ux_utils,
|
41
41
|
)
|
42
42
|
|
43
|
+
if typing.TYPE_CHECKING:
|
44
|
+
from konduktor.adaptors.aws import boto3
|
45
|
+
|
43
46
|
logger = logging.get_logger(__name__)
|
44
47
|
|
45
48
|
# Maximum number of concurrent rsync upload processes
|
@@ -54,6 +57,8 @@ DEFAULT_AWS_CREDENTIALS_DIR = '~/.aws/'
|
|
54
57
|
DEFAULT_AWS_CREDENTIAL_PATH = '~/.aws/credentials'
|
55
58
|
DEFAULT_AWS_CONFIG_PATH = '~/.aws/config'
|
56
59
|
|
60
|
+
_LOCK_PATH = '~/.konduktor/s3_storage.lock'
|
61
|
+
|
57
62
|
|
58
63
|
class AWSIdentityType(enum.Enum):
|
59
64
|
"""AWS identity type.
|
@@ -148,7 +153,7 @@ class S3Store(storage_utils.AbstractStore):
|
|
148
153
|
sync_on_reconstruction: Optional[bool] = True,
|
149
154
|
_bucket_sub_path: Optional[str] = None,
|
150
155
|
):
|
151
|
-
self.client: 'boto3.client.Client'
|
156
|
+
self.client: 'boto3.client.Client' # type: ignore[name-defined]
|
152
157
|
self.bucket: 'constants.StorageHandle'
|
153
158
|
if region in self._CUSTOM_ENDPOINT_REGIONS:
|
154
159
|
logger.warning(
|
@@ -908,7 +913,7 @@ class S3Store(storage_utils.AbstractStore):
|
|
908
913
|
)
|
909
914
|
|
910
915
|
try:
|
911
|
-
s3 =
|
916
|
+
s3 = aws.client('s3')
|
912
917
|
|
913
918
|
suffix = uuid.uuid4().hex[:6]
|
914
919
|
test_bucket = f'konduktor-check-s3-{int(time.time())}-{suffix}'
|
@@ -1039,7 +1044,7 @@ class S3Store(storage_utils.AbstractStore):
|
|
1039
1044
|
)
|
1040
1045
|
|
1041
1046
|
try:
|
1042
|
-
identity =
|
1047
|
+
identity = aws.client('sts').get_caller_identity()
|
1043
1048
|
logger.info(
|
1044
1049
|
f"Using AWS credentials for ARN: {identity['Arn']} "
|
1045
1050
|
f"(UserId: {identity['UserId']}, Account: {identity['Account']})"
|
@@ -1,11 +1,11 @@
|
|
1
|
-
konduktor/__init__.py,sha256=
|
1
|
+
konduktor/__init__.py,sha256=VJF7ZnbESJxOkss-YKq2XSCaeT9dHxtZXycwhvnxzgc,1540
|
2
2
|
konduktor/adaptors/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
3
3
|
konduktor/adaptors/aws.py,sha256=s47Ra-GaqCQibzVfmD0pmwEWHif1EGO5opMbwkLxTCU,8244
|
4
|
-
konduktor/adaptors/common.py,sha256=
|
5
|
-
konduktor/adaptors/gcp.py,sha256=
|
4
|
+
konduktor/adaptors/common.py,sha256=lbsLs5ldUN2nWAWmiUwvy_RFNL_s5KHl4lDYavYpkmY,4301
|
5
|
+
konduktor/adaptors/gcp.py,sha256=ierTF4z7vwpJ9BsC7LSiwv4uLcjGXscwZOwQrddr2vM,4102
|
6
6
|
konduktor/backends/__init__.py,sha256=1Q6sqqdeMYarpTX_U-QVywJYf7idiUTRsyP-E4BQSOw,129
|
7
7
|
konduktor/backends/backend.py,sha256=qh0bp94lzoTYZkzyQv2-CVrB5l91FkG2vclXg24UFC0,2910
|
8
|
-
konduktor/backends/jobset.py,sha256=
|
8
|
+
konduktor/backends/jobset.py,sha256=veptYGXtk-ugWxBsBV5SnqI4rGKOlGfm_N3wApvNhSQ,8326
|
9
9
|
konduktor/backends/jobset_utils.py,sha256=NIwTvJdGhbDnXEceabiuUm9aHZ29LK3jVHfQzutB_ec,17297
|
10
10
|
konduktor/check.py,sha256=JennyWoaqSKhdyfUldd266KwVXTPJpcYQa4EED4a_BA,7569
|
11
11
|
konduktor/cli.py,sha256=Ii9-2mrc-1f2ksLasA-xRb-JnEi_9ZeCXZ3lJ1GG8H8,23515
|
@@ -50,7 +50,7 @@ konduktor/dashboard/frontend/server.js,sha256=jcp6_Ww9YJD3uKY07jR3KMlAM6n1QZdxZn
|
|
50
50
|
konduktor/dashboard/frontend/tailwind.config.js,sha256=fCnc48wvioIDOe5ldQ_6RE7F76cP7aU7pDrxBPJx-Fk,366
|
51
51
|
konduktor/data/__init__.py,sha256=KMR2i3E9YcIpiIuCxtRdS7BQ1w2vUAbbve7agziJrLo,213
|
52
52
|
konduktor/data/aws/__init__.py,sha256=_6zWfNNAK1QGgyKqg_yPYWcXlnffchyvIMErYa6tw_U,331
|
53
|
-
konduktor/data/aws/s3.py,sha256=
|
53
|
+
konduktor/data/aws/s3.py,sha256=O2RDWlO3rwVZVIKXHiT_tqt3_ll-fa8KbAdocKKGj_8,47947
|
54
54
|
konduktor/data/constants.py,sha256=yXVEoTI2we1xOjVSU-bjRCQCLpVvpEvJ0GedXvSwEfw,127
|
55
55
|
konduktor/data/data_utils.py,sha256=yrnu8_cY63TXqfWfFG3yqY2w_tE9UQK9jIQAFQCDVg0,9668
|
56
56
|
konduktor/data/gcp/__init__.py,sha256=rlQxACBC_Vu36mdgPyJgUy4mGc_6Nt_a96JAuaPz2pQ,489
|
@@ -74,7 +74,7 @@ konduktor/templates/pod.yaml.j2,sha256=q_kFyuYP-RlHocQUV8Vsnh-hYurWO7Y_pwl0gytGM
|
|
74
74
|
konduktor/usage/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
75
75
|
konduktor/usage/constants.py,sha256=gCL8afIHZhO0dcxbJGpESE9sCC1cBSbeRnQ8GwNOY4M,612
|
76
76
|
konduktor/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
77
|
-
konduktor/utils/accelerator_registry.py,sha256=
|
77
|
+
konduktor/utils/accelerator_registry.py,sha256=VeEw57wtG7i4WfjMfNZ8N59hOte0RSUWaxYkKTbckTc,562
|
78
78
|
konduktor/utils/annotations.py,sha256=oy2-BLydkFt3KWkXDuaGY84d6b7iISuy4eAT9uXk0Fc,2225
|
79
79
|
konduktor/utils/base64_utils.py,sha256=mF-Tw98mFRG70YE4w6s9feuQSCYZHOb8YatBZwMugyI,3130
|
80
80
|
konduktor/utils/common_utils.py,sha256=F5x7k4AdBB44u8PYRkaugORnZKnK3JLqGn1jHOKgUYo,14960
|
@@ -90,8 +90,8 @@ konduktor/utils/schemas.py,sha256=Gv7SEhFpv-eO5izqRz8d-eQ9z-lVmY05akm6HEXIIdc,17
|
|
90
90
|
konduktor/utils/subprocess_utils.py,sha256=WoFkoFhGecPR8-rF8WJxbIe-YtV94LXz9UG64SDhCY4,9448
|
91
91
|
konduktor/utils/ux_utils.py,sha256=NPNu3Igu2Z9Oq77ghJhy_fIxQZTXWr9BtKyxN3Wslzo,7164
|
92
92
|
konduktor/utils/validator.py,sha256=tgBghVyedyzGx84-U2Qfoh_cJBE3oUk9gclMW90ORks,691
|
93
|
-
konduktor_nightly-0.1.0.
|
94
|
-
konduktor_nightly-0.1.0.
|
95
|
-
konduktor_nightly-0.1.0.
|
96
|
-
konduktor_nightly-0.1.0.
|
97
|
-
konduktor_nightly-0.1.0.
|
93
|
+
konduktor_nightly-0.1.0.dev20250415104823.dist-info/LICENSE,sha256=MuuqTZbHvmqXR_aNKAXzggdV45ANd3wQ5YI7tnpZhm0,6586
|
94
|
+
konduktor_nightly-0.1.0.dev20250415104823.dist-info/METADATA,sha256=GpTIP6xFNr0dovup5nz-hBvFjNFHllBL5Spl1x2sJ-c,4303
|
95
|
+
konduktor_nightly-0.1.0.dev20250415104823.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
|
96
|
+
konduktor_nightly-0.1.0.dev20250415104823.dist-info/entry_points.txt,sha256=k3nG5wDFIJhNqsZWrHk4d0irIB2Ns9s47cjRWYsTCT8,48
|
97
|
+
konduktor_nightly-0.1.0.dev20250415104823.dist-info/RECORD,,
|
File without changes
|
File without changes
|