thds.mops 3.9.20250730172122__py3-none-any.whl → 3.9.20250730184538__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.
Potentially problematic release.
This version of thds.mops might be problematic. Click here for more details.
- thds/mops/pure/core/lock/__init__.py +0 -1
- thds/mops/pure/core/lock/_acquire.py +1 -6
- thds/mops/pure/pickling/remote.py +2 -35
- {thds_mops-3.9.20250730172122.dist-info → thds_mops-3.9.20250730184538.dist-info}/METADATA +1 -1
- {thds_mops-3.9.20250730172122.dist-info → thds_mops-3.9.20250730184538.dist-info}/RECORD +8 -8
- {thds_mops-3.9.20250730172122.dist-info → thds_mops-3.9.20250730184538.dist-info}/WHEEL +0 -0
- {thds_mops-3.9.20250730172122.dist-info → thds_mops-3.9.20250730184538.dist-info}/entry_points.txt +0 -0
- {thds_mops-3.9.20250730172122.dist-info → thds_mops-3.9.20250730184538.dist-info}/top_level.txt +0 -0
|
@@ -101,12 +101,7 @@ def acquire( # noqa: C901
|
|
|
101
101
|
|
|
102
102
|
start = _funcs.utc_now()
|
|
103
103
|
|
|
104
|
-
my_writer_id = humenc.encode(uuid4().bytes
|
|
105
|
-
# we do not expect there to be many writers, so we make the humenc part of the writer
|
|
106
|
-
# id relatively short so it doesn't 'look' like other uses of humenc. Making the rest
|
|
107
|
-
# of the string identical to the base64 encoding (by choosing a multiple of 3) is not
|
|
108
|
-
# useful to us because we are only using this as a big UUID, not as a hash of an
|
|
109
|
-
# actual input.
|
|
104
|
+
my_writer_id = humenc.encode(uuid4().bytes)
|
|
110
105
|
|
|
111
106
|
lockfile_writer = LockfileWriter(
|
|
112
107
|
my_writer_id,
|
|
@@ -52,30 +52,9 @@ class _ResultExcWithMetadataChannel:
|
|
|
52
52
|
)
|
|
53
53
|
|
|
54
54
|
def return_value(self, r: T) -> None:
|
|
55
|
-
result_uri = self.fs.join(self.call_id, results.RESULT)
|
|
56
|
-
if self.fs.exists(result_uri):
|
|
57
|
-
logger.warning("Not overwriting existing result at %s prior to serialization", result_uri)
|
|
58
|
-
self._write_metadata_only("lost-race")
|
|
59
|
-
return
|
|
60
|
-
|
|
61
|
-
# when we pickle the return value, we also end up potentially uploading
|
|
62
|
-
# various Sources and Paths and other special-cased things inside the result.
|
|
63
55
|
return_value_bytes = _pickle.gimme_bytes(self.dumper, r)
|
|
64
|
-
if self.fs.exists(result_uri):
|
|
65
|
-
logger.warning("Not overwriting existing result at %s after serialization", result_uri)
|
|
66
|
-
self._write_metadata_only("lost-race-after-serialization")
|
|
67
|
-
return
|
|
68
|
-
|
|
69
|
-
# BUG: there remains a race condition between fs.exists and putbytes.
|
|
70
|
-
# multiple callers could get a False from fs.exists and then proceed to write.
|
|
71
|
-
# the biggest issue here is for functions that are not truly pure, because
|
|
72
|
-
# they will be writing different results, and theoretically different callers
|
|
73
|
-
# could end up seeing the different results.
|
|
74
|
-
#
|
|
75
|
-
# In the future, if a Blob Store provided a put_unless_exists method, we could use
|
|
76
|
-
# that to avoid the race condition.
|
|
77
56
|
self.fs.putbytes(
|
|
78
|
-
|
|
57
|
+
self.fs.join(self.call_id, results.RESULT),
|
|
79
58
|
self._metadata_header + return_value_bytes,
|
|
80
59
|
type_hint="application/mops-return-value",
|
|
81
60
|
)
|
|
@@ -113,8 +92,6 @@ def run_pickled_invocation(memo_uri: str, *metadata_args: str) -> None:
|
|
|
113
92
|
|
|
114
93
|
# any recursively-called functions that use metadata will retain the original invoker.
|
|
115
94
|
|
|
116
|
-
failure_to_lock = None
|
|
117
|
-
stop_lock: ty.Callable = lambda: None # noqa: E731
|
|
118
95
|
try:
|
|
119
96
|
stop_lock = lock.launch_daemon_lock_maintainer(
|
|
120
97
|
lock.remote_lock_maintain(
|
|
@@ -123,9 +100,7 @@ def run_pickled_invocation(memo_uri: str, *metadata_args: str) -> None:
|
|
|
123
100
|
)
|
|
124
101
|
except lock.CannotMaintainLock as e:
|
|
125
102
|
logger.info(f"Cannot maintain lock: {e}. Continuing without the lock.")
|
|
126
|
-
|
|
127
|
-
logger.error(f"Lock was stolen: {e}. Exiting without running the function.")
|
|
128
|
-
failure_to_lock = e
|
|
103
|
+
stop_lock = lambda: None # noqa: E731
|
|
129
104
|
|
|
130
105
|
def _extract_invocation_unique_key(memo_uri: str) -> ty.Tuple[str, str]:
|
|
131
106
|
parts = fs.split(memo_uri)
|
|
@@ -149,14 +124,6 @@ def run_pickled_invocation(memo_uri: str, *metadata_args: str) -> None:
|
|
|
149
124
|
def do_work_return_result() -> object:
|
|
150
125
|
# ONLY failures in this code should transmit an EXCEPTION
|
|
151
126
|
# back to the orchestrator side.
|
|
152
|
-
|
|
153
|
-
# if the lock was stolen, we should write an exception
|
|
154
|
-
# so that the orchestrator knows that it failed.
|
|
155
|
-
# in theory, it could resume waiting for a result, though
|
|
156
|
-
# currently it does not do this.
|
|
157
|
-
if failure_to_lock:
|
|
158
|
-
raise failure_to_lock
|
|
159
|
-
|
|
160
127
|
with unwrap_use_runner(func):
|
|
161
128
|
return func(*args, **kwargs)
|
|
162
129
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: thds.mops
|
|
3
|
-
Version: 3.9.
|
|
3
|
+
Version: 3.9.20250730184538
|
|
4
4
|
Summary: ML Ops tools for Trilliant Health
|
|
5
5
|
Author-email: Trilliant Health <info@trillianthealth.com>
|
|
6
6
|
Project-URL: Repository, https://github.com/TrilliantHealth/ds-monorepo
|
|
@@ -66,8 +66,8 @@ thds/mops/pure/core/entry/__init__.py,sha256=kiDcsj16CwjRSexOZW-4h4b4tDCYIS_eLS5
|
|
|
66
66
|
thds/mops/pure/core/entry/main.py,sha256=b1F5lFDK_hnpvW3bqzt5MWDcpKvCXZpWdEHI8zroC4k,2061
|
|
67
67
|
thds/mops/pure/core/entry/route_result.py,sha256=2LcS9M2mYtu56kso0YcMEZbR1mbTWZm0hFlbE2yaf4k,2741
|
|
68
68
|
thds/mops/pure/core/entry/runner_registry.py,sha256=aPDCML7gM_zP6NfPnqx0_Q1oRHzgdaCa_XzYc5VIw7U,601
|
|
69
|
-
thds/mops/pure/core/lock/__init__.py,sha256=
|
|
70
|
-
thds/mops/pure/core/lock/_acquire.py,sha256=
|
|
69
|
+
thds/mops/pure/core/lock/__init__.py,sha256=Fq5Fa9DGFcADFxfyFckSl1mYX7p8DAemjMKH9PMpb-s,240
|
|
70
|
+
thds/mops/pure/core/lock/_acquire.py,sha256=O__mQCUQy0mx-JGNgQjbaSPbfCOXkaiJealYt2Av7Cg,9079
|
|
71
71
|
thds/mops/pure/core/lock/_funcs.py,sha256=j4g8yVWnrAMPDKqLlq8nTnccM1KHSJ3g71L1iWNbV2Q,969
|
|
72
72
|
thds/mops/pure/core/lock/cli.py,sha256=uidtmgHB2y5LDkj7SQTncy_cNe1EfIseuiJPV9kcxBU,2488
|
|
73
73
|
thds/mops/pure/core/lock/maintain.py,sha256=5IUQFAU96p46nNt6SMwTAlB2e0HGHJj8n7kqeRxb26M,5767
|
|
@@ -89,7 +89,7 @@ thds/mops/pure/pickling/_pickle.py,sha256=YB8xbqDiwdk8ccnVZ2_4kQn98V2JSrFqw2E3J-
|
|
|
89
89
|
thds/mops/pure/pickling/memoize_only.py,sha256=oI5CMy6IEJc46Gb_BGWNUuAe3fysS7HxRSTajN0WssI,837
|
|
90
90
|
thds/mops/pure/pickling/mprunner.py,sha256=vabdHIVteddkU5ncOq73wWC7-naChW_3_vvAQArvjqU,8814
|
|
91
91
|
thds/mops/pure/pickling/pickles.py,sha256=CSlnjLssE0Ad8YzqyaKqWCSNyW5LiMFKiXO6hWAZmvU,5097
|
|
92
|
-
thds/mops/pure/pickling/remote.py,sha256=
|
|
92
|
+
thds/mops/pure/pickling/remote.py,sha256=l4bIDc7jg7923IFKBeJE3oJYCN4OeT5tmtAg1eS_k7c,6011
|
|
93
93
|
thds/mops/pure/pickling/sha256_b64.py,sha256=HL0cPixHPZYuZDVDBscxsnI-3a2amWEfw-LseOX-PyY,2916
|
|
94
94
|
thds/mops/pure/runner/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
95
95
|
thds/mops/pure/runner/get_results.py,sha256=1K6qf_Vg2YfUPfUuu103WyYsfS3e_ju6W7Z_PV01-pU,4053
|
|
@@ -109,8 +109,8 @@ thds/mops/pure/tools/summarize/cli.py,sha256=7kDtn24ok8oBO3jFjlMmOK3jnZYpMoE_5Y8
|
|
|
109
109
|
thds/mops/pure/tools/summarize/run_summary.py,sha256=w45qiQr7elrHDiK9Hgs85gtU3gwLuXa447ih1Y23BBY,5776
|
|
110
110
|
thds/mops/testing/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
111
111
|
thds/mops/testing/deferred_imports.py,sha256=f0ezCgQAtzTqW1yAOb0OWgsB9ZrlztLB894LtpWDaVw,3780
|
|
112
|
-
thds_mops-3.9.
|
|
113
|
-
thds_mops-3.9.
|
|
114
|
-
thds_mops-3.9.
|
|
115
|
-
thds_mops-3.9.
|
|
116
|
-
thds_mops-3.9.
|
|
112
|
+
thds_mops-3.9.20250730184538.dist-info/METADATA,sha256=jLElk3god1pLJ8DSrnW5FUPB72Wgo8ICq6_wjwddF_w,2225
|
|
113
|
+
thds_mops-3.9.20250730184538.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
114
|
+
thds_mops-3.9.20250730184538.dist-info/entry_points.txt,sha256=qKvCAaB80syXfxVR3xx6x9J0YJdaQWkIbVSw-NwFgMw,322
|
|
115
|
+
thds_mops-3.9.20250730184538.dist-info/top_level.txt,sha256=LTZaE5SkWJwv9bwOlMbIhiS-JWQEEIcjVYnJrt-CriY,5
|
|
116
|
+
thds_mops-3.9.20250730184538.dist-info/RECORD,,
|
|
File without changes
|
{thds_mops-3.9.20250730172122.dist-info → thds_mops-3.9.20250730184538.dist-info}/entry_points.txt
RENAMED
|
File without changes
|
{thds_mops-3.9.20250730172122.dist-info → thds_mops-3.9.20250730184538.dist-info}/top_level.txt
RENAMED
|
File without changes
|