fractal-server 2.14.0a12__py3-none-any.whl → 2.14.0a14__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.
- fractal_server/__init__.py +1 -1
- fractal_server/app/models/linkusergroup.py +6 -2
- fractal_server/app/models/v2/dataset.py +1 -1
- fractal_server/app/models/v2/job.py +7 -3
- fractal_server/app/models/v2/task_group.py +2 -2
- fractal_server/app/models/v2/workflow.py +1 -1
- fractal_server/app/models/v2/workflowtask.py +1 -1
- fractal_server/app/routes/admin/v2/task_group.py +0 -17
- fractal_server/app/routes/api/v2/dataset.py +0 -8
- fractal_server/app/routes/api/v2/history.py +112 -27
- fractal_server/app/routes/api/v2/images.py +16 -14
- fractal_server/app/routes/api/v2/project.py +0 -52
- fractal_server/app/routes/api/v2/task_group.py +0 -17
- fractal_server/app/routes/api/v2/workflow.py +0 -8
- fractal_server/app/routes/auth/group.py +0 -16
- fractal_server/app/runner/executors/base_runner.py +5 -0
- fractal_server/app/runner/executors/local/runner.py +15 -7
- fractal_server/app/runner/executors/slurm_common/_handle_exception_proxy.py +17 -0
- fractal_server/app/runner/executors/slurm_common/base_slurm_runner.py +676 -0
- fractal_server/app/runner/executors/slurm_common/slurm_job_task_models.py +102 -0
- fractal_server/app/runner/executors/slurm_ssh/runner.py +110 -648
- fractal_server/app/runner/executors/slurm_sudo/runner.py +32 -661
- fractal_server/app/runner/task_files.py +20 -6
- fractal_server/app/runner/v2/_slurm_ssh.py +6 -6
- fractal_server/app/runner/v2/_slurm_sudo.py +4 -4
- fractal_server/app/runner/v2/db_tools.py +1 -0
- fractal_server/app/runner/v2/runner.py +4 -0
- fractal_server/app/runner/v2/runner_functions.py +2 -2
- fractal_server/app/runner/v2/submit_workflow.py +7 -16
- fractal_server/app/schemas/v2/__init__.py +3 -1
- fractal_server/app/schemas/v2/history.py +27 -2
- fractal_server/config.py +6 -2
- fractal_server/images/tools.py +23 -0
- fractal_server/migrations/versions/5b6007027595_on_cascade.py +250 -0
- fractal_server/migrations/versions/fbce16ff4e47_new_history_items.py +2 -2
- fractal_server/tasks/v2/utils_background.py +0 -19
- {fractal_server-2.14.0a12.dist-info → fractal_server-2.14.0a14.dist-info}/METADATA +1 -1
- {fractal_server-2.14.0a12.dist-info → fractal_server-2.14.0a14.dist-info}/RECORD +41 -42
- fractal_server/app/runner/executors/slurm_common/_check_jobs_status.py +0 -77
- fractal_server/app/runner/executors/slurm_ssh/_check_job_status_ssh.py +0 -67
- fractal_server/app/runner/executors/slurm_ssh/_executor_wait_thread.py +0 -126
- fractal_server/app/runner/executors/slurm_ssh/_slurm_job.py +0 -116
- fractal_server/app/runner/executors/slurm_ssh/executor.py +0 -1386
- {fractal_server-2.14.0a12.dist-info → fractal_server-2.14.0a14.dist-info}/LICENSE +0 -0
- {fractal_server-2.14.0a12.dist-info → fractal_server-2.14.0a14.dist-info}/WHEEL +0 -0
- {fractal_server-2.14.0a12.dist-info → fractal_server-2.14.0a14.dist-info}/entry_points.txt +0 -0
@@ -0,0 +1,102 @@
|
|
1
|
+
from pathlib import Path
|
2
|
+
from typing import Any
|
3
|
+
from typing import Optional
|
4
|
+
|
5
|
+
from pydantic import BaseModel
|
6
|
+
from pydantic import ConfigDict
|
7
|
+
|
8
|
+
from fractal_server.app.runner.task_files import TaskFiles
|
9
|
+
|
10
|
+
|
11
|
+
class SlurmTask(BaseModel):
|
12
|
+
model_config = ConfigDict(arbitrary_types_allowed=True)
|
13
|
+
component: str
|
14
|
+
prefix: str
|
15
|
+
workdir_local: Path
|
16
|
+
workdir_remote: Path
|
17
|
+
parameters: dict[str, Any]
|
18
|
+
zarr_url: Optional[str] = None
|
19
|
+
task_files: TaskFiles
|
20
|
+
index: int
|
21
|
+
|
22
|
+
@property
|
23
|
+
def input_pickle_file_local(self) -> str:
|
24
|
+
return (
|
25
|
+
self.workdir_local / f"{self.prefix}-{self.component}-input.pickle"
|
26
|
+
).as_posix()
|
27
|
+
|
28
|
+
@property
|
29
|
+
def input_pickle_file_remote(self) -> str:
|
30
|
+
return (
|
31
|
+
self.workdir_remote
|
32
|
+
/ f"{self.prefix}-{self.component}-input.pickle"
|
33
|
+
).as_posix()
|
34
|
+
|
35
|
+
@property
|
36
|
+
def output_pickle_file_local(self) -> str:
|
37
|
+
return (
|
38
|
+
self.workdir_local
|
39
|
+
/ f"{self.prefix}-{self.component}-output.pickle"
|
40
|
+
).as_posix()
|
41
|
+
|
42
|
+
@property
|
43
|
+
def output_pickle_file_remote(self) -> str:
|
44
|
+
return (
|
45
|
+
self.workdir_remote
|
46
|
+
/ f"{self.prefix}-{self.component}-output.pickle"
|
47
|
+
).as_posix()
|
48
|
+
|
49
|
+
|
50
|
+
class SlurmJob(BaseModel):
|
51
|
+
slurm_job_id: Optional[str] = None
|
52
|
+
prefix: str
|
53
|
+
workdir_local: Path
|
54
|
+
workdir_remote: Path
|
55
|
+
tasks: list[SlurmTask]
|
56
|
+
|
57
|
+
@property
|
58
|
+
def slurm_submission_script_local(self) -> str:
|
59
|
+
return (
|
60
|
+
self.workdir_local / f"{self.prefix}-slurm-submit.sh"
|
61
|
+
).as_posix()
|
62
|
+
|
63
|
+
@property
|
64
|
+
def slurm_submission_script_remote(self) -> str:
|
65
|
+
return (
|
66
|
+
self.workdir_remote / f"{self.prefix}-slurm-submit.sh"
|
67
|
+
).as_posix()
|
68
|
+
|
69
|
+
@property
|
70
|
+
def slurm_job_id_placeholder(self) -> str:
|
71
|
+
if self.slurm_job_id:
|
72
|
+
return self.slurm_job_id
|
73
|
+
else:
|
74
|
+
return "%j"
|
75
|
+
|
76
|
+
@property
|
77
|
+
def slurm_stdout_remote(self) -> str:
|
78
|
+
return (
|
79
|
+
self.workdir_remote
|
80
|
+
/ f"{self.prefix}-slurm-{self.slurm_job_id_placeholder}.out"
|
81
|
+
).as_posix()
|
82
|
+
|
83
|
+
@property
|
84
|
+
def slurm_stderr_remote(self) -> str:
|
85
|
+
return (
|
86
|
+
self.workdir_remote
|
87
|
+
/ f"{self.prefix}-slurm-{self.slurm_job_id_placeholder}.err"
|
88
|
+
).as_posix()
|
89
|
+
|
90
|
+
@property
|
91
|
+
def slurm_stdout_local(self) -> str:
|
92
|
+
return (
|
93
|
+
self.workdir_local
|
94
|
+
/ f"{self.prefix}-slurm-{self.slurm_job_id_placeholder}.out"
|
95
|
+
).as_posix()
|
96
|
+
|
97
|
+
@property
|
98
|
+
def slurm_stderr_local(self) -> str:
|
99
|
+
return (
|
100
|
+
self.workdir_local
|
101
|
+
/ f"{self.prefix}-slurm-{self.slurm_job_id_placeholder}.err"
|
102
|
+
).as_posix()
|