datatailr 0.1.73__tar.gz → 0.1.75__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.
Potentially problematic release.
This version of datatailr might be problematic. Click here for more details.
- {datatailr-0.1.73/src/datatailr.egg-info → datatailr-0.1.75}/PKG-INFO +1 -1
- {datatailr-0.1.73 → datatailr-0.1.75}/pyproject.toml +1 -1
- {datatailr-0.1.73 → datatailr-0.1.75}/src/datatailr/scheduler/base.py +8 -5
- {datatailr-0.1.73 → datatailr-0.1.75/src/datatailr.egg-info}/PKG-INFO +1 -1
- {datatailr-0.1.73 → datatailr-0.1.75}/src/sbin/datatailr_run.py +13 -12
- {datatailr-0.1.73 → datatailr-0.1.75}/LICENSE +0 -0
- {datatailr-0.1.73 → datatailr-0.1.75}/README.md +0 -0
- {datatailr-0.1.73 → datatailr-0.1.75}/setup.cfg +0 -0
- {datatailr-0.1.73 → datatailr-0.1.75}/setup.py +0 -0
- {datatailr-0.1.73 → datatailr-0.1.75}/src/datatailr/__init__.py +0 -0
- {datatailr-0.1.73 → datatailr-0.1.75}/src/datatailr/acl.py +0 -0
- {datatailr-0.1.73 → datatailr-0.1.75}/src/datatailr/blob.py +0 -0
- {datatailr-0.1.73 → datatailr-0.1.75}/src/datatailr/build/__init__.py +0 -0
- {datatailr-0.1.73 → datatailr-0.1.75}/src/datatailr/build/image.py +0 -0
- {datatailr-0.1.73 → datatailr-0.1.75}/src/datatailr/dt_json.py +0 -0
- {datatailr-0.1.73 → datatailr-0.1.75}/src/datatailr/errors.py +0 -0
- {datatailr-0.1.73 → datatailr-0.1.75}/src/datatailr/excel/__init__.py +0 -0
- {datatailr-0.1.73 → datatailr-0.1.75}/src/datatailr/excel/addin.py +0 -0
- {datatailr-0.1.73 → datatailr-0.1.75}/src/datatailr/excel/stubs.py +0 -0
- {datatailr-0.1.73 → datatailr-0.1.75}/src/datatailr/group.py +0 -0
- {datatailr-0.1.73 → datatailr-0.1.75}/src/datatailr/logging.py +0 -0
- {datatailr-0.1.73 → datatailr-0.1.75}/src/datatailr/scheduler/__init__.py +0 -0
- {datatailr-0.1.73 → datatailr-0.1.75}/src/datatailr/scheduler/arguments_cache.py +0 -0
- {datatailr-0.1.73 → datatailr-0.1.75}/src/datatailr/scheduler/batch.py +0 -0
- {datatailr-0.1.73 → datatailr-0.1.75}/src/datatailr/scheduler/batch_decorator.py +0 -0
- {datatailr-0.1.73 → datatailr-0.1.75}/src/datatailr/scheduler/constants.py +0 -0
- {datatailr-0.1.73 → datatailr-0.1.75}/src/datatailr/scheduler/schedule.py +0 -0
- {datatailr-0.1.73 → datatailr-0.1.75}/src/datatailr/scheduler/utils.py +0 -0
- {datatailr-0.1.73 → datatailr-0.1.75}/src/datatailr/tag.py +0 -0
- {datatailr-0.1.73 → datatailr-0.1.75}/src/datatailr/user.py +0 -0
- {datatailr-0.1.73 → datatailr-0.1.75}/src/datatailr/utils.py +0 -0
- {datatailr-0.1.73 → datatailr-0.1.75}/src/datatailr/version.py +0 -0
- {datatailr-0.1.73 → datatailr-0.1.75}/src/datatailr/wrapper.py +0 -0
- {datatailr-0.1.73 → datatailr-0.1.75}/src/datatailr.egg-info/SOURCES.txt +0 -0
- {datatailr-0.1.73 → datatailr-0.1.75}/src/datatailr.egg-info/dependency_links.txt +0 -0
- {datatailr-0.1.73 → datatailr-0.1.75}/src/datatailr.egg-info/entry_points.txt +0 -0
- {datatailr-0.1.73 → datatailr-0.1.75}/src/datatailr.egg-info/requires.txt +0 -0
- {datatailr-0.1.73 → datatailr-0.1.75}/src/datatailr.egg-info/top_level.txt +0 -0
- {datatailr-0.1.73 → datatailr-0.1.75}/src/sbin/datatailr_run_app.py +0 -0
- {datatailr-0.1.73 → datatailr-0.1.75}/src/sbin/datatailr_run_batch.py +0 -0
- {datatailr-0.1.73 → datatailr-0.1.75}/src/sbin/datatailr_run_excel.py +0 -0
- {datatailr-0.1.73 → datatailr-0.1.75}/src/sbin/datatailr_run_service.py +0 -0
|
@@ -245,7 +245,6 @@ class Job:
|
|
|
245
245
|
if self.type == JobType.EXCEL:
|
|
246
246
|
if "DATATAILR_LOCAL" not in self.__env_vars:
|
|
247
247
|
self.__env_vars.update({"DATATAILR_LOCAL": "false"})
|
|
248
|
-
job_dict["per_user_job"] = True
|
|
249
248
|
if self.type != JobType.BATCH:
|
|
250
249
|
job_dict["entrypoint"] = str(self.entrypoint) if self.entrypoint else None
|
|
251
250
|
job_dict["env"] = dict_to_env_vars(self.__env_vars)
|
|
@@ -294,6 +293,7 @@ class Job:
|
|
|
294
293
|
Returns a tuple of (branch: str, commit_hash: str).
|
|
295
294
|
"""
|
|
296
295
|
path_to_repo = self.image.path_to_repo or "."
|
|
296
|
+
branch_name, local_commit, return_code = "unknown", "unknown", None
|
|
297
297
|
try:
|
|
298
298
|
local_commit = run_shell_command(
|
|
299
299
|
f"cd {path_to_repo} && git rev-parse HEAD"
|
|
@@ -301,6 +301,13 @@ class Job:
|
|
|
301
301
|
branch_name = run_shell_command(
|
|
302
302
|
f"cd {path_to_repo} && git rev-parse --abbrev-ref HEAD"
|
|
303
303
|
)[0]
|
|
304
|
+
|
|
305
|
+
if (
|
|
306
|
+
os.getenv("DATATAILR_ALLOW_UNSAFE_SCHEDULING", "false").lower()
|
|
307
|
+
== "true"
|
|
308
|
+
):
|
|
309
|
+
return branch_name, local_commit
|
|
310
|
+
|
|
304
311
|
return_code = run_shell_command(
|
|
305
312
|
f"cd {path_to_repo} && git diff --exit-code"
|
|
306
313
|
)
|
|
@@ -309,15 +316,11 @@ class Job:
|
|
|
309
316
|
logger.warning(
|
|
310
317
|
"Git is not installed or not found in PATH. Repository validation is not possible."
|
|
311
318
|
)
|
|
312
|
-
branch_name, local_commit, return_code = "unknown", "unknown", None
|
|
313
319
|
else:
|
|
314
320
|
raise RepoValidationError(
|
|
315
321
|
f"Error accessing git repository at {path_to_repo}: {e}"
|
|
316
322
|
) from e
|
|
317
323
|
|
|
318
|
-
if os.getenv("DATATAILR_ALLOW_UNSAFE_SCHEDULING", "false").lower() == "true":
|
|
319
|
-
return branch_name, local_commit
|
|
320
|
-
|
|
321
324
|
is_committed = return_code is not None and return_code[1] == 0
|
|
322
325
|
|
|
323
326
|
if not is_committed:
|
|
@@ -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:
|
|
@@ -80,10 +81,10 @@ def create_user_and_group() -> Tuple[str, str]:
|
|
|
80
81
|
|
|
81
82
|
# Create user if it does not exist
|
|
82
83
|
# -s /bin/bash: set the shell to bash
|
|
83
|
-
# -M: do not create home directory (it is already created on the NFS volume)
|
|
84
84
|
# -o: allow to create a user with a non-unique UID
|
|
85
|
+
# -m: create the home directory for the group - .bashrc file is located in build/.bashrc and copied to /etc/skel/ during image build
|
|
85
86
|
os.system(
|
|
86
|
-
f"getent passwd {user} || useradd -g {group} -s /bin/bash -
|
|
87
|
+
f"getent passwd {user} || useradd -g {group} -s /bin/bash -u {uid} -o -m {user}"
|
|
87
88
|
)
|
|
88
89
|
|
|
89
90
|
permissions = (
|
|
@@ -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)
|
|
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
|
|
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
|