datatailr 0.1.73__py3-none-any.whl → 0.1.74__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 datatailr might be problematic. Click here for more details.
- datatailr/sbin/datatailr_run.py +11 -10
- datatailr/scheduler/base.py +8 -4
- {datatailr-0.1.73.dist-info → datatailr-0.1.74.dist-info}/METADATA +1 -1
- {datatailr-0.1.73.dist-info → datatailr-0.1.74.dist-info}/RECORD +8 -8
- {datatailr-0.1.73.dist-info → datatailr-0.1.74.dist-info}/WHEEL +0 -0
- {datatailr-0.1.73.dist-info → datatailr-0.1.74.dist-info}/entry_points.txt +0 -0
- {datatailr-0.1.73.dist-info → datatailr-0.1.74.dist-info}/licenses/LICENSE +0 -0
- {datatailr-0.1.73.dist-info → datatailr-0.1.74.dist-info}/top_level.txt +0 -0
datatailr/sbin/datatailr_run.py
CHANGED
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
import concurrent.futures
|
|
36
36
|
import subprocess
|
|
37
37
|
import os
|
|
38
|
+
import sys
|
|
38
39
|
import stat
|
|
39
40
|
import shlex
|
|
40
41
|
import sysconfig
|
|
@@ -46,7 +47,7 @@ logger = DatatailrLogger(os.path.abspath(__file__)).get_logger()
|
|
|
46
47
|
|
|
47
48
|
if not is_dt_installed():
|
|
48
49
|
logger.error("Datatailr is not installed.")
|
|
49
|
-
|
|
50
|
+
sys.exit(1)
|
|
50
51
|
|
|
51
52
|
|
|
52
53
|
def get_env_var(name: str, default: str | None = None) -> str:
|
|
@@ -205,7 +206,7 @@ def main():
|
|
|
205
206
|
"DATATAILR_BATCH_ID": batch_id,
|
|
206
207
|
"DATATAILR_BATCH_ENTRYPOINT": entrypoint,
|
|
207
208
|
} | env
|
|
208
|
-
run_single_command_non_blocking("datatailr_run_batch", user, env)
|
|
209
|
+
return run_single_command_non_blocking("datatailr_run_batch", user, env)
|
|
209
210
|
elif job_type == "service":
|
|
210
211
|
port = get_env_var("DATATAILR_SERVICE_PORT", 8080)
|
|
211
212
|
entrypoint = get_env_var("DATATAILR_ENTRYPOINT")
|
|
@@ -213,16 +214,15 @@ def main():
|
|
|
213
214
|
"DATATAILR_ENTRYPOINT": entrypoint,
|
|
214
215
|
"DATATAILR_SERVICE_PORT": port,
|
|
215
216
|
} | env
|
|
216
|
-
run_single_command_non_blocking("datatailr_run_service", user, env)
|
|
217
|
+
return run_single_command_non_blocking("datatailr_run_service", user, env)
|
|
217
218
|
elif job_type == "app":
|
|
218
219
|
entrypoint = get_env_var("DATATAILR_ENTRYPOINT")
|
|
219
220
|
env = {
|
|
220
221
|
"DATATAILR_ENTRYPOINT": entrypoint,
|
|
221
222
|
} | env
|
|
222
|
-
run_single_command_non_blocking("datatailr_run_app", user, env)
|
|
223
|
+
return run_single_command_non_blocking("datatailr_run_app", user, env)
|
|
223
224
|
elif job_type == "excel":
|
|
224
225
|
host = get_env_var("DATATAILR_HOST", "")
|
|
225
|
-
local = get_env_var("DATATAILR_LOCAL", "")
|
|
226
226
|
entrypoint = get_env_var("DATATAILR_ENTRYPOINT")
|
|
227
227
|
local = get_env_var("DATATAILR_LOCAL", False)
|
|
228
228
|
env = {
|
|
@@ -230,7 +230,7 @@ def main():
|
|
|
230
230
|
"DATATAILR_HOST": host,
|
|
231
231
|
"DATATAILR_LOCAL": local,
|
|
232
232
|
} | env
|
|
233
|
-
run_single_command_non_blocking("datatailr_run_excel", user, env)
|
|
233
|
+
return run_single_command_non_blocking("datatailr_run_excel", user, env)
|
|
234
234
|
elif job_type == "workspace":
|
|
235
235
|
os.makedirs("/opt/datatailr/var/log", exist_ok=True)
|
|
236
236
|
ide_command = [
|
|
@@ -251,7 +251,7 @@ def main():
|
|
|
251
251
|
f"--ServerApp.static_url_prefix=/workspace/{job_name}/jupyter/static/",
|
|
252
252
|
f"--ServerApp.root_dir=/home/{user}",
|
|
253
253
|
]
|
|
254
|
-
run_commands_in_parallel(
|
|
254
|
+
return run_commands_in_parallel(
|
|
255
255
|
[ide_command, jupyter_command], user, env, ["code-server", "jupyter"]
|
|
256
256
|
)
|
|
257
257
|
|
|
@@ -262,8 +262,9 @@ def main():
|
|
|
262
262
|
if __name__ == "__main__":
|
|
263
263
|
try:
|
|
264
264
|
logger.debug("Starting job execution...")
|
|
265
|
-
main()
|
|
266
|
-
logger.debug("Job executed successfully
|
|
265
|
+
rc = main()
|
|
266
|
+
logger.debug(f"Job executed successfully, with code {rc}")
|
|
267
|
+
raise SystemExit(rc)
|
|
267
268
|
except Exception as e:
|
|
268
269
|
logger.error(f"Error during job execution: {e}")
|
|
269
|
-
raise
|
|
270
|
+
raise SystemExit(1)
|
datatailr/scheduler/base.py
CHANGED
|
@@ -294,6 +294,7 @@ class Job:
|
|
|
294
294
|
Returns a tuple of (branch: str, commit_hash: str).
|
|
295
295
|
"""
|
|
296
296
|
path_to_repo = self.image.path_to_repo or "."
|
|
297
|
+
branch_name, local_commit, return_code = "unknown", "unknown", None
|
|
297
298
|
try:
|
|
298
299
|
local_commit = run_shell_command(
|
|
299
300
|
f"cd {path_to_repo} && git rev-parse HEAD"
|
|
@@ -301,6 +302,13 @@ class Job:
|
|
|
301
302
|
branch_name = run_shell_command(
|
|
302
303
|
f"cd {path_to_repo} && git rev-parse --abbrev-ref HEAD"
|
|
303
304
|
)[0]
|
|
305
|
+
|
|
306
|
+
if (
|
|
307
|
+
os.getenv("DATATAILR_ALLOW_UNSAFE_SCHEDULING", "false").lower()
|
|
308
|
+
== "true"
|
|
309
|
+
):
|
|
310
|
+
return branch_name, local_commit
|
|
311
|
+
|
|
304
312
|
return_code = run_shell_command(
|
|
305
313
|
f"cd {path_to_repo} && git diff --exit-code"
|
|
306
314
|
)
|
|
@@ -309,15 +317,11 @@ class Job:
|
|
|
309
317
|
logger.warning(
|
|
310
318
|
"Git is not installed or not found in PATH. Repository validation is not possible."
|
|
311
319
|
)
|
|
312
|
-
branch_name, local_commit, return_code = "unknown", "unknown", None
|
|
313
320
|
else:
|
|
314
321
|
raise RepoValidationError(
|
|
315
322
|
f"Error accessing git repository at {path_to_repo}: {e}"
|
|
316
323
|
) from e
|
|
317
324
|
|
|
318
|
-
if os.getenv("DATATAILR_ALLOW_UNSAFE_SCHEDULING", "false").lower() == "true":
|
|
319
|
-
return branch_name, local_commit
|
|
320
|
-
|
|
321
325
|
is_committed = return_code is not None and return_code[1] == 0
|
|
322
326
|
|
|
323
327
|
if not is_committed:
|
|
@@ -15,22 +15,22 @@ datatailr/build/image.py,sha256=YC8ML-l-sj6TcIBY-DCx_vaeI_7SmL9fPFhHnuxzRh0,5509
|
|
|
15
15
|
datatailr/excel/__init__.py,sha256=wox5ltPeOYZcZoRDW4R6tJsfOjf-0WZM2_pGgltGjdo,682
|
|
16
16
|
datatailr/excel/addin.py,sha256=3UiA7z71ewnEvLSTbcJdPNGWf-uYbeSt_3vbgN42h4E,6354
|
|
17
17
|
datatailr/excel/stubs.py,sha256=RU0Y6PWKRAtK-tgBP5uWrWYW-L3TIGRJwcUUhkA5yxU,830
|
|
18
|
-
datatailr/sbin/datatailr_run.py,sha256=
|
|
18
|
+
datatailr/sbin/datatailr_run.py,sha256=Tno239IHIJ0TkAmpfVUEbuZSDElJCLoH5MUvvvgyIRo,9987
|
|
19
19
|
datatailr/sbin/datatailr_run_app.py,sha256=itF76XC2F4RK9s6bkoEppEiYwSLHK_5Jai3yvC-kFhY,1501
|
|
20
20
|
datatailr/sbin/datatailr_run_batch.py,sha256=UWnp96j_G66R_Cape7Bb-rbK6UBLF7Y5_mTlWyGJAVQ,1818
|
|
21
21
|
datatailr/sbin/datatailr_run_excel.py,sha256=BLWmvxpKEE_8vJhs8E4VWq07FOBof5tlow-AkIEXtHw,1470
|
|
22
22
|
datatailr/sbin/datatailr_run_service.py,sha256=DO9LGOpz3CVZOJJRHb4ac7AgY_mLbXHGadSyVCeIknc,1212
|
|
23
23
|
datatailr/scheduler/__init__.py,sha256=qydHYVtEP6SUWd2CQ6FRdTdRWNz3SbYPJy4FK_wOvMk,1772
|
|
24
24
|
datatailr/scheduler/arguments_cache.py,sha256=00OE0DhobYteBOnirjulO1ltgGBRamAdCO168O3_Zes,6236
|
|
25
|
-
datatailr/scheduler/base.py,sha256=
|
|
25
|
+
datatailr/scheduler/base.py,sha256=GFbX6uDvFWzkjeNyGLQAFDwcNixjzjvKuZVNTVtU1Os,17087
|
|
26
26
|
datatailr/scheduler/batch.py,sha256=ZhEf3YkXf1_ieV5ivk4-me60ov9v5r9f9BdkJw84i_0,18475
|
|
27
27
|
datatailr/scheduler/batch_decorator.py,sha256=LqL1bsupWLn-YEQUvFJYae7R3ogrL5-VodyiiScrkRw,5806
|
|
28
28
|
datatailr/scheduler/constants.py,sha256=5WWTsfwZ_BA8gVDOTa2AQX9DJ0NzfaWgtY3vrODS2-8,606
|
|
29
29
|
datatailr/scheduler/schedule.py,sha256=0XJJen2nL1xplRs0Xbjwgq3T-0bFCOrJzkSALdio998,3741
|
|
30
30
|
datatailr/scheduler/utils.py,sha256=up6oR2iwe6G52LkvgfO394xchXgCYNjOMGRQW3e8PQk,1082
|
|
31
|
-
datatailr-0.1.
|
|
32
|
-
datatailr-0.1.
|
|
33
|
-
datatailr-0.1.
|
|
34
|
-
datatailr-0.1.
|
|
35
|
-
datatailr-0.1.
|
|
36
|
-
datatailr-0.1.
|
|
31
|
+
datatailr-0.1.74.dist-info/licenses/LICENSE,sha256=ikKP4_O-UD_b8FuNdKmbzTb6odd0JX085ZW_FAPN3VI,1066
|
|
32
|
+
datatailr-0.1.74.dist-info/METADATA,sha256=EhvMz-_Z4xQM9aG7BrpYvApBHugjb40dv3SkvfwesFE,5146
|
|
33
|
+
datatailr-0.1.74.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
34
|
+
datatailr-0.1.74.dist-info/entry_points.txt,sha256=YqXfk2At-olW4PUSRkqvy_O3Mbv7uTKCCPuAAiz3Qbg,312
|
|
35
|
+
datatailr-0.1.74.dist-info/top_level.txt,sha256=75gntW0X_SKpqxLL6hAPipvpk28GAhJBvoyqN_HohWU,10
|
|
36
|
+
datatailr-0.1.74.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|