fractal-server 2.18.0a3__py3-none-any.whl → 2.18.0a5__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/v2/job.py +13 -2
- fractal_server/app/models/v2/resource.py +13 -0
- fractal_server/app/routes/admin/v2/__init__.py +10 -12
- fractal_server/app/routes/admin/v2/job.py +15 -15
- fractal_server/app/routes/admin/v2/task.py +7 -7
- fractal_server/app/routes/admin/v2/task_group.py +11 -11
- fractal_server/app/routes/admin/v2/task_group_lifecycle.py +20 -20
- fractal_server/app/routes/api/v2/__init__.py +47 -49
- fractal_server/app/routes/api/v2/_aux_functions.py +22 -47
- fractal_server/app/routes/api/v2/_aux_functions_task_lifecycle.py +4 -4
- fractal_server/app/routes/api/v2/_aux_functions_tasks.py +2 -2
- fractal_server/app/routes/api/v2/dataset.py +63 -73
- fractal_server/app/routes/api/v2/history.py +7 -5
- fractal_server/app/routes/api/v2/job.py +12 -12
- fractal_server/app/routes/api/v2/project.py +11 -11
- fractal_server/app/routes/api/v2/status_legacy.py +15 -29
- fractal_server/app/routes/api/v2/submit.py +65 -66
- fractal_server/app/routes/api/v2/task.py +15 -17
- fractal_server/app/routes/api/v2/task_collection.py +18 -18
- fractal_server/app/routes/api/v2/task_collection_custom.py +11 -13
- fractal_server/app/routes/api/v2/task_collection_pixi.py +9 -9
- fractal_server/app/routes/api/v2/task_group.py +18 -18
- fractal_server/app/routes/api/v2/task_group_lifecycle.py +26 -26
- fractal_server/app/routes/api/v2/task_version_update.py +5 -5
- fractal_server/app/routes/api/v2/workflow.py +18 -18
- fractal_server/app/routes/api/v2/workflow_import.py +11 -11
- fractal_server/app/routes/api/v2/workflowtask.py +10 -10
- fractal_server/app/routes/auth/_aux_auth.py +99 -0
- fractal_server/app/routes/auth/users.py +9 -0
- fractal_server/app/schemas/user.py +1 -1
- fractal_server/app/schemas/v2/__init__.py +48 -48
- fractal_server/app/schemas/v2/dataset.py +25 -13
- fractal_server/app/schemas/v2/dumps.py +9 -9
- fractal_server/app/schemas/v2/job.py +11 -11
- fractal_server/app/schemas/v2/project.py +3 -3
- fractal_server/app/schemas/v2/resource.py +13 -4
- fractal_server/app/schemas/v2/status_legacy.py +3 -3
- fractal_server/app/schemas/v2/task.py +6 -6
- fractal_server/app/schemas/v2/task_collection.py +4 -4
- fractal_server/app/schemas/v2/task_group.py +16 -16
- fractal_server/app/schemas/v2/workflow.py +16 -16
- fractal_server/app/schemas/v2/workflowtask.py +14 -14
- fractal_server/app/shutdown.py +6 -6
- fractal_server/config/_main.py +1 -1
- fractal_server/data_migrations/{2_18_1.py → 2_18_0.py} +2 -1
- fractal_server/main.py +8 -12
- fractal_server/migrations/versions/88270f589c9b_add_prevent_new_submissions.py +39 -0
- fractal_server/migrations/versions/f0702066b007_one_submitted_job_per_dataset.py +40 -0
- fractal_server/runner/v2/_local.py +3 -2
- fractal_server/runner/v2/_slurm_ssh.py +3 -2
- fractal_server/runner/v2/_slurm_sudo.py +3 -2
- fractal_server/runner/v2/runner.py +36 -17
- fractal_server/runner/v2/runner_functions.py +11 -14
- fractal_server/runner/v2/submit_workflow.py +22 -9
- fractal_server/tasks/v2/local/_utils.py +2 -2
- fractal_server/tasks/v2/local/collect.py +5 -6
- fractal_server/tasks/v2/local/collect_pixi.py +5 -6
- fractal_server/tasks/v2/local/deactivate.py +7 -7
- fractal_server/tasks/v2/local/deactivate_pixi.py +3 -3
- fractal_server/tasks/v2/local/delete.py +5 -5
- fractal_server/tasks/v2/local/reactivate.py +5 -5
- fractal_server/tasks/v2/local/reactivate_pixi.py +5 -5
- fractal_server/tasks/v2/ssh/collect.py +5 -5
- fractal_server/tasks/v2/ssh/collect_pixi.py +5 -5
- fractal_server/tasks/v2/ssh/deactivate.py +7 -7
- fractal_server/tasks/v2/ssh/deactivate_pixi.py +2 -2
- fractal_server/tasks/v2/ssh/delete.py +5 -5
- fractal_server/tasks/v2/ssh/reactivate.py +5 -5
- fractal_server/tasks/v2/ssh/reactivate_pixi.py +5 -5
- fractal_server/tasks/v2/utils_background.py +7 -7
- fractal_server/tasks/v2/utils_database.py +5 -5
- fractal_server/types/__init__.py +13 -4
- fractal_server/types/validators/__init__.py +3 -1
- fractal_server/types/validators/_common_validators.py +23 -1
- {fractal_server-2.18.0a3.dist-info → fractal_server-2.18.0a5.dist-info}/METADATA +1 -1
- {fractal_server-2.18.0a3.dist-info → fractal_server-2.18.0a5.dist-info}/RECORD +80 -78
- {fractal_server-2.18.0a3.dist-info → fractal_server-2.18.0a5.dist-info}/WHEEL +0 -0
- {fractal_server-2.18.0a3.dist-info → fractal_server-2.18.0a5.dist-info}/entry_points.txt +0 -0
- {fractal_server-2.18.0a3.dist-info → fractal_server-2.18.0a5.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
from .accounting import AccountingRecordRead # noqa F401
|
|
2
|
-
from .dataset import
|
|
3
|
-
from .dataset import
|
|
4
|
-
from .dataset import
|
|
5
|
-
from .dataset import
|
|
6
|
-
from .dataset import
|
|
7
|
-
from .dumps import
|
|
8
|
-
from .dumps import
|
|
9
|
-
from .dumps import
|
|
10
|
-
from .dumps import
|
|
11
|
-
from .dumps import
|
|
12
|
-
from .dumps import
|
|
2
|
+
from .dataset import DatasetCreate # noqa F401
|
|
3
|
+
from .dataset import DatasetExport # noqa F401
|
|
4
|
+
from .dataset import DatasetImport # noqa F401
|
|
5
|
+
from .dataset import DatasetRead # noqa F401
|
|
6
|
+
from .dataset import DatasetUpdate # noqa F401
|
|
7
|
+
from .dumps import DatasetDump # noqa F401
|
|
8
|
+
from .dumps import ProjectDump # noqa F401
|
|
9
|
+
from .dumps import TaskDump # noqa F401
|
|
10
|
+
from .dumps import TaskGroupDump # noqa F401
|
|
11
|
+
from .dumps import WorkflowDump # noqa F401
|
|
12
|
+
from .dumps import WorkflowTaskDump # noqa F401
|
|
13
13
|
from .history import HistoryRunRead # noqa F401
|
|
14
14
|
from .history import HistoryRunReadAggregated # noqa F401
|
|
15
15
|
from .history import HistoryUnitRead # noqa F401
|
|
16
16
|
from .history import HistoryUnitStatus # noqa F401
|
|
17
17
|
from .history import HistoryUnitStatusWithUnset # noqa F401
|
|
18
18
|
from .history import ImageLogsRequest # noqa F401
|
|
19
|
-
from .job import
|
|
20
|
-
from .job import
|
|
21
|
-
from .job import
|
|
22
|
-
from .job import
|
|
19
|
+
from .job import JobCreate # noqa F401
|
|
20
|
+
from .job import JobRead # noqa F401
|
|
21
|
+
from .job import JobStatusType # noqa F401
|
|
22
|
+
from .job import JobUpdate # noqa F401
|
|
23
23
|
from .manifest import ManifestV2 # noqa F401
|
|
24
24
|
from .manifest import TaskManifestV2 # noqa F401
|
|
25
25
|
from .profile import ProfileCreate # noqa F401
|
|
@@ -27,9 +27,9 @@ from .profile import ProfileRead # noqa F401
|
|
|
27
27
|
from .profile import ValidProfileLocal # noqa F401
|
|
28
28
|
from .profile import ValidProfileSlurmSSH # noqa F401
|
|
29
29
|
from .profile import ValidProfileSlurmSudo # noqa F401
|
|
30
|
-
from .project import
|
|
31
|
-
from .project import
|
|
32
|
-
from .project import
|
|
30
|
+
from .project import ProjectCreate # noqa F401
|
|
31
|
+
from .project import ProjectRead # noqa F401
|
|
32
|
+
from .project import ProjectUpdate # noqa F401
|
|
33
33
|
from .sharing import ProjectPermissions # noqa F401
|
|
34
34
|
from .sharing import ProjectGuestCreate # noqa F401
|
|
35
35
|
from .sharing import ProjectAccessRead # noqa F401
|
|
@@ -43,36 +43,36 @@ from .resource import ResourceType # noqa F401
|
|
|
43
43
|
from .resource import ValidResourceLocal # noqa F401
|
|
44
44
|
from .resource import ValidResourceSlurmSSH # noqa F401
|
|
45
45
|
from .resource import ValidResourceSlurmSudo # noqa F401
|
|
46
|
-
from .status_legacy import
|
|
47
|
-
from .task import
|
|
48
|
-
from .task import
|
|
49
|
-
from .task import
|
|
50
|
-
from .task import
|
|
51
|
-
from .task import
|
|
46
|
+
from .status_legacy import WorkflowTaskStatusType # noqa F401
|
|
47
|
+
from .task import TaskCreate # noqa F401
|
|
48
|
+
from .task import TaskExport # noqa F401
|
|
49
|
+
from .task import TaskImport # noqa F401
|
|
50
|
+
from .task import TaskImportLegacy # noqa F401
|
|
51
|
+
from .task import TaskRead # noqa F401
|
|
52
52
|
from .task import TaskType # noqa F401
|
|
53
|
-
from .task import
|
|
53
|
+
from .task import TaskUpdate # noqa F401
|
|
54
54
|
from .task_collection import FractalUploadedFile # noqa F401
|
|
55
|
-
from .task_collection import
|
|
56
|
-
from .task_collection import
|
|
57
|
-
from .task_group import
|
|
58
|
-
from .task_group import
|
|
59
|
-
from .task_group import
|
|
60
|
-
from .task_group import
|
|
61
|
-
from .task_group import
|
|
55
|
+
from .task_collection import TaskCollectCustom # noqa F401
|
|
56
|
+
from .task_collection import TaskCollectPip # noqa F401
|
|
57
|
+
from .task_group import TaskGroupActivityAction # noqa F401
|
|
58
|
+
from .task_group import TaskGroupActivityStatus # noqa F401
|
|
59
|
+
from .task_group import TaskGroupActivityRead # noqa F401
|
|
60
|
+
from .task_group import TaskGroupCreate # noqa F401
|
|
61
|
+
from .task_group import TaskGroupCreateStrict # noqa F401
|
|
62
62
|
from .task_group import TaskGroupReadSuperuser # noqa F401
|
|
63
|
-
from .task_group import
|
|
64
|
-
from .task_group import
|
|
65
|
-
from .task_group import
|
|
66
|
-
from .workflow import
|
|
67
|
-
from .workflow import
|
|
68
|
-
from .workflow import
|
|
69
|
-
from .workflow import
|
|
70
|
-
from .workflow import
|
|
71
|
-
from .workflow import
|
|
72
|
-
from .workflowtask import
|
|
73
|
-
from .workflowtask import
|
|
74
|
-
from .workflowtask import
|
|
75
|
-
from .workflowtask import
|
|
76
|
-
from .workflowtask import
|
|
77
|
-
from .workflowtask import
|
|
78
|
-
from .workflowtask import
|
|
63
|
+
from .task_group import TaskGroupRead # noqa F401
|
|
64
|
+
from .task_group import TaskGroupUpdate # noqa F401
|
|
65
|
+
from .task_group import TaskGroupOriginEnum # noqa F401
|
|
66
|
+
from .workflow import WorkflowCreate # noqa F401
|
|
67
|
+
from .workflow import WorkflowExport # noqa F401
|
|
68
|
+
from .workflow import WorkflowImport # noqa F401
|
|
69
|
+
from .workflow import WorkflowRead # noqa F401
|
|
70
|
+
from .workflow import WorkflowReadWithWarnings # noqa F401
|
|
71
|
+
from .workflow import WorkflowUpdate # noqa F401
|
|
72
|
+
from .workflowtask import WorkflowTaskCreate # noqa F401
|
|
73
|
+
from .workflowtask import WorkflowTaskExport # noqa F401
|
|
74
|
+
from .workflowtask import WorkflowTaskImport # noqa F401
|
|
75
|
+
from .workflowtask import WorkflowTaskRead # noqa F401
|
|
76
|
+
from .workflowtask import WorkflowTaskReadWithWarning # noqa F401
|
|
77
|
+
from .workflowtask import WorkflowTaskReplace # noqa F401
|
|
78
|
+
from .workflowtask import WorkflowTaskUpdate # noqa F401
|
|
@@ -4,32 +4,45 @@ from pydantic import BaseModel
|
|
|
4
4
|
from pydantic import ConfigDict
|
|
5
5
|
from pydantic import Field
|
|
6
6
|
from pydantic import field_serializer
|
|
7
|
+
from pydantic import model_validator
|
|
7
8
|
from pydantic.types import AwareDatetime
|
|
8
9
|
|
|
9
|
-
from fractal_server.app.schemas.v2.project import
|
|
10
|
+
from fractal_server.app.schemas.v2.project import ProjectRead
|
|
10
11
|
from fractal_server.images import SingleImage
|
|
12
|
+
from fractal_server.types import AbsolutePathStr
|
|
11
13
|
from fractal_server.types import NonEmptyStr
|
|
14
|
+
from fractal_server.types import RelativePathStr
|
|
12
15
|
from fractal_server.types import ZarrDirStr
|
|
13
16
|
|
|
14
17
|
|
|
15
|
-
class
|
|
18
|
+
class DatasetCreate(BaseModel):
|
|
16
19
|
"""
|
|
17
|
-
|
|
20
|
+
DatasetCreate
|
|
18
21
|
|
|
19
22
|
Attributes:
|
|
20
23
|
name:
|
|
21
|
-
|
|
24
|
+
project_dir:
|
|
25
|
+
zarr_subfolder:
|
|
22
26
|
"""
|
|
23
27
|
|
|
24
28
|
model_config = ConfigDict(extra="forbid")
|
|
25
29
|
|
|
26
30
|
name: NonEmptyStr
|
|
27
|
-
|
|
31
|
+
project_dir: AbsolutePathStr | None = None
|
|
32
|
+
zarr_subfolder: RelativePathStr | None = None
|
|
33
|
+
|
|
34
|
+
@model_validator(mode="after")
|
|
35
|
+
def validate_zarr_dir(self):
|
|
36
|
+
if (self.project_dir is None) and (self.zarr_subfolder is not None):
|
|
37
|
+
raise ValueError(
|
|
38
|
+
"Cannot provide `zarr_subfolder` without `project_dir`"
|
|
39
|
+
)
|
|
40
|
+
return self
|
|
28
41
|
|
|
29
42
|
|
|
30
|
-
class
|
|
43
|
+
class DatasetRead(BaseModel):
|
|
31
44
|
"""
|
|
32
|
-
|
|
45
|
+
DatasetRead
|
|
33
46
|
|
|
34
47
|
Attributes:
|
|
35
48
|
id:
|
|
@@ -44,7 +57,7 @@ class DatasetReadV2(BaseModel):
|
|
|
44
57
|
name: str
|
|
45
58
|
|
|
46
59
|
project_id: int
|
|
47
|
-
project:
|
|
60
|
+
project: ProjectRead
|
|
48
61
|
|
|
49
62
|
timestamp_created: AwareDatetime
|
|
50
63
|
|
|
@@ -55,9 +68,9 @@ class DatasetReadV2(BaseModel):
|
|
|
55
68
|
return v.isoformat()
|
|
56
69
|
|
|
57
70
|
|
|
58
|
-
class
|
|
71
|
+
class DatasetUpdate(BaseModel):
|
|
59
72
|
"""
|
|
60
|
-
|
|
73
|
+
DatasetUpdate
|
|
61
74
|
|
|
62
75
|
Attributes:
|
|
63
76
|
name:
|
|
@@ -67,10 +80,9 @@ class DatasetUpdateV2(BaseModel):
|
|
|
67
80
|
model_config = ConfigDict(extra="forbid")
|
|
68
81
|
|
|
69
82
|
name: NonEmptyStr = None
|
|
70
|
-
zarr_dir: ZarrDirStr | None = None
|
|
71
83
|
|
|
72
84
|
|
|
73
|
-
class
|
|
85
|
+
class DatasetImport(BaseModel):
|
|
74
86
|
"""
|
|
75
87
|
Class for `Dataset` import.
|
|
76
88
|
|
|
@@ -89,7 +101,7 @@ class DatasetImportV2(BaseModel):
|
|
|
89
101
|
images: list[SingleImage] = Field(default_factory=list)
|
|
90
102
|
|
|
91
103
|
|
|
92
|
-
class
|
|
104
|
+
class DatasetExport(BaseModel):
|
|
93
105
|
"""
|
|
94
106
|
Class for `Dataset` export.
|
|
95
107
|
|
|
@@ -13,17 +13,17 @@ from pydantic import ConfigDict
|
|
|
13
13
|
from pydantic import Field
|
|
14
14
|
|
|
15
15
|
from .task import TaskType
|
|
16
|
-
from .task_group import
|
|
16
|
+
from .task_group import TaskGroupOriginEnum
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
class
|
|
19
|
+
class ProjectDump(BaseModel):
|
|
20
20
|
model_config = ConfigDict(extra="forbid")
|
|
21
21
|
id: int
|
|
22
22
|
name: str
|
|
23
23
|
timestamp_created: str
|
|
24
24
|
|
|
25
25
|
|
|
26
|
-
class
|
|
26
|
+
class TaskDump(BaseModel):
|
|
27
27
|
id: int
|
|
28
28
|
name: str
|
|
29
29
|
type: TaskType
|
|
@@ -37,7 +37,7 @@ class TaskDumpV2(BaseModel):
|
|
|
37
37
|
output_types: dict[str, bool]
|
|
38
38
|
|
|
39
39
|
|
|
40
|
-
class
|
|
40
|
+
class WorkflowTaskDump(BaseModel):
|
|
41
41
|
"""
|
|
42
42
|
We do not include 'model_config = ConfigDict(extra="forbid")'
|
|
43
43
|
because legacy data may include 'input_filters' field and we want to avoid
|
|
@@ -51,10 +51,10 @@ class WorkflowTaskDumpV2(BaseModel):
|
|
|
51
51
|
type_filters: dict[str, bool]
|
|
52
52
|
|
|
53
53
|
task_id: int | None = None
|
|
54
|
-
task:
|
|
54
|
+
task: TaskDump | None = None
|
|
55
55
|
|
|
56
56
|
|
|
57
|
-
class
|
|
57
|
+
class WorkflowDump(BaseModel):
|
|
58
58
|
model_config = ConfigDict(extra="forbid")
|
|
59
59
|
id: int
|
|
60
60
|
name: str
|
|
@@ -62,7 +62,7 @@ class WorkflowDumpV2(BaseModel):
|
|
|
62
62
|
timestamp_created: str
|
|
63
63
|
|
|
64
64
|
|
|
65
|
-
class
|
|
65
|
+
class DatasetDump(BaseModel):
|
|
66
66
|
"""
|
|
67
67
|
We do not include 'model_config = ConfigDict(extra="forbid")' because
|
|
68
68
|
legacy data may include 'type_filters' or 'attribute_filters' and we
|
|
@@ -76,9 +76,9 @@ class DatasetDumpV2(BaseModel):
|
|
|
76
76
|
zarr_dir: str
|
|
77
77
|
|
|
78
78
|
|
|
79
|
-
class
|
|
79
|
+
class TaskGroupDump(BaseModel):
|
|
80
80
|
id: int
|
|
81
|
-
origin:
|
|
81
|
+
origin: TaskGroupOriginEnum
|
|
82
82
|
pkg_name: str
|
|
83
83
|
version: str | None = None
|
|
84
84
|
python_version: str | None = None
|
|
@@ -10,15 +10,15 @@ from pydantic.types import AwareDatetime
|
|
|
10
10
|
from pydantic.types import NonNegativeInt
|
|
11
11
|
from pydantic.types import StrictStr
|
|
12
12
|
|
|
13
|
-
from fractal_server.app.schemas.v2.dumps import
|
|
14
|
-
from fractal_server.app.schemas.v2.dumps import
|
|
15
|
-
from fractal_server.app.schemas.v2.dumps import
|
|
13
|
+
from fractal_server.app.schemas.v2.dumps import DatasetDump
|
|
14
|
+
from fractal_server.app.schemas.v2.dumps import ProjectDump
|
|
15
|
+
from fractal_server.app.schemas.v2.dumps import WorkflowDump
|
|
16
16
|
from fractal_server.types import AttributeFilters
|
|
17
17
|
from fractal_server.types import NonEmptyStr
|
|
18
18
|
from fractal_server.types import TypeFilters
|
|
19
19
|
|
|
20
20
|
|
|
21
|
-
class
|
|
21
|
+
class JobStatusType(StrEnum):
|
|
22
22
|
"""
|
|
23
23
|
Define the available job statuses
|
|
24
24
|
|
|
@@ -39,7 +39,7 @@ class JobStatusTypeV2(StrEnum):
|
|
|
39
39
|
FAILED = "failed"
|
|
40
40
|
|
|
41
41
|
|
|
42
|
-
class
|
|
42
|
+
class JobCreate(BaseModel):
|
|
43
43
|
model_config = ConfigDict(extra="forbid")
|
|
44
44
|
|
|
45
45
|
first_task_index: NonNegativeInt | None = None
|
|
@@ -65,16 +65,16 @@ class JobCreateV2(BaseModel):
|
|
|
65
65
|
return values
|
|
66
66
|
|
|
67
67
|
|
|
68
|
-
class
|
|
68
|
+
class JobRead(BaseModel):
|
|
69
69
|
id: int
|
|
70
70
|
project_id: int | None = None
|
|
71
|
-
project_dump:
|
|
71
|
+
project_dump: ProjectDump
|
|
72
72
|
user_email: str
|
|
73
73
|
slurm_account: str | None = None
|
|
74
74
|
workflow_id: int | None = None
|
|
75
|
-
workflow_dump:
|
|
75
|
+
workflow_dump: WorkflowDump
|
|
76
76
|
dataset_id: int | None = None
|
|
77
|
-
dataset_dump:
|
|
77
|
+
dataset_dump: DatasetDump
|
|
78
78
|
start_timestamp: AwareDatetime
|
|
79
79
|
end_timestamp: AwareDatetime | None = None
|
|
80
80
|
status: str
|
|
@@ -100,7 +100,7 @@ class JobReadV2(BaseModel):
|
|
|
100
100
|
return v.isoformat()
|
|
101
101
|
|
|
102
102
|
|
|
103
|
-
class
|
|
103
|
+
class JobUpdate(BaseModel):
|
|
104
104
|
model_config = ConfigDict(extra="forbid")
|
|
105
105
|
|
|
106
|
-
status:
|
|
106
|
+
status: JobStatusType
|
|
@@ -8,13 +8,13 @@ from pydantic.types import AwareDatetime
|
|
|
8
8
|
from fractal_server.types import NonEmptyStr
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
class
|
|
11
|
+
class ProjectCreate(BaseModel):
|
|
12
12
|
model_config = ConfigDict(extra="forbid")
|
|
13
13
|
|
|
14
14
|
name: NonEmptyStr
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
class
|
|
17
|
+
class ProjectRead(BaseModel):
|
|
18
18
|
id: int
|
|
19
19
|
name: str
|
|
20
20
|
timestamp_created: AwareDatetime
|
|
@@ -24,7 +24,7 @@ class ProjectReadV2(BaseModel):
|
|
|
24
24
|
return v.isoformat()
|
|
25
25
|
|
|
26
26
|
|
|
27
|
-
class
|
|
27
|
+
class ProjectUpdate(BaseModel):
|
|
28
28
|
model_config = ConfigDict(extra="forbid")
|
|
29
29
|
|
|
30
30
|
name: NonEmptyStr = None
|
|
@@ -77,6 +77,8 @@ class ValidResourceBase(BaseModel):
|
|
|
77
77
|
jobs_runner_config: dict[NonEmptyStr, Any]
|
|
78
78
|
jobs_poll_interval: int = 5
|
|
79
79
|
|
|
80
|
+
prevent_new_submissions: bool = False
|
|
81
|
+
|
|
80
82
|
@model_validator(mode="after")
|
|
81
83
|
def _pixi_slurm_config(self) -> Self:
|
|
82
84
|
if (
|
|
@@ -95,6 +97,9 @@ class ValidResourceLocal(ValidResourceBase):
|
|
|
95
97
|
Attributes:
|
|
96
98
|
name: Resource name.
|
|
97
99
|
type: Resource type.
|
|
100
|
+
prevent_new_submissions:
|
|
101
|
+
When set to true: Prevent new job submissions and stop execution of
|
|
102
|
+
ongoing jobs as soon as the current task is complete.
|
|
98
103
|
tasks_python_config:
|
|
99
104
|
Configuration of Python interpreters used for task collection.
|
|
100
105
|
tasks_pixi_config:
|
|
@@ -105,7 +110,6 @@ class ValidResourceLocal(ValidResourceBase):
|
|
|
105
110
|
Local base folder for job folders.
|
|
106
111
|
jobs_runner_config:
|
|
107
112
|
Runner configuration.
|
|
108
|
-
|
|
109
113
|
"""
|
|
110
114
|
|
|
111
115
|
type: Literal[ResourceType.LOCAL]
|
|
@@ -121,6 +125,9 @@ class ValidResourceSlurmSudo(ValidResourceBase):
|
|
|
121
125
|
Attributes:
|
|
122
126
|
name: Resource name.
|
|
123
127
|
type: Resource type.
|
|
128
|
+
prevent_new_submissions:
|
|
129
|
+
When set to true: Prevent new job submissions and stop execution of
|
|
130
|
+
ongoing jobs as soon as the current task is complete.
|
|
124
131
|
tasks_python_config:
|
|
125
132
|
Configuration of Python interpreters used for task collection.
|
|
126
133
|
tasks_pixi_config:
|
|
@@ -150,6 +157,9 @@ class ValidResourceSlurmSSH(ValidResourceBase):
|
|
|
150
157
|
Attributes:
|
|
151
158
|
name: Resource name
|
|
152
159
|
type: Resource type.
|
|
160
|
+
prevent_new_submissions:
|
|
161
|
+
When set to true: Prevent new job submissions and stop execution of
|
|
162
|
+
ongoing jobs as soon as the current task is complete.
|
|
153
163
|
tasks_python_config:
|
|
154
164
|
Configuration of Python interpreters used for task collection.
|
|
155
165
|
tasks_pixi_config:
|
|
@@ -198,10 +208,9 @@ class ResourceRead(BaseModel):
|
|
|
198
208
|
"""
|
|
199
209
|
|
|
200
210
|
id: int
|
|
201
|
-
|
|
202
|
-
type: str
|
|
203
|
-
|
|
204
211
|
name: str
|
|
212
|
+
type: str
|
|
213
|
+
prevent_new_submissions: bool
|
|
205
214
|
timestamp_created: AwareDatetime
|
|
206
215
|
|
|
207
216
|
host: str | None
|
|
@@ -4,7 +4,7 @@ from pydantic import BaseModel
|
|
|
4
4
|
from pydantic import Field
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
class
|
|
7
|
+
class WorkflowTaskStatusType(StrEnum):
|
|
8
8
|
"""
|
|
9
9
|
Define the available values for the status of a `WorkflowTask`.
|
|
10
10
|
|
|
@@ -23,7 +23,7 @@ class WorkflowTaskStatusTypeV2(StrEnum):
|
|
|
23
23
|
FAILED = "failed"
|
|
24
24
|
|
|
25
25
|
|
|
26
|
-
class
|
|
26
|
+
class LegacyStatusRead(BaseModel):
|
|
27
27
|
"""
|
|
28
28
|
Response type for the
|
|
29
29
|
`/project/{project_id}/status/` endpoint
|
|
@@ -31,5 +31,5 @@ class LegacyStatusReadV2(BaseModel):
|
|
|
31
31
|
|
|
32
32
|
status: dict[
|
|
33
33
|
str,
|
|
34
|
-
|
|
34
|
+
WorkflowTaskStatusType,
|
|
35
35
|
] = Field(default_factory=dict)
|
|
@@ -29,7 +29,7 @@ class TaskType(StrEnum):
|
|
|
29
29
|
PARALLEL = "parallel"
|
|
30
30
|
|
|
31
31
|
|
|
32
|
-
class
|
|
32
|
+
class TaskCreate(BaseModel):
|
|
33
33
|
model_config = ConfigDict(extra="forbid")
|
|
34
34
|
|
|
35
35
|
name: NonEmptyStr
|
|
@@ -90,7 +90,7 @@ class TaskCreateV2(BaseModel):
|
|
|
90
90
|
return self
|
|
91
91
|
|
|
92
92
|
|
|
93
|
-
class
|
|
93
|
+
class TaskRead(BaseModel):
|
|
94
94
|
id: int
|
|
95
95
|
name: str
|
|
96
96
|
type: TaskType
|
|
@@ -117,7 +117,7 @@ class TaskReadV2(BaseModel):
|
|
|
117
117
|
tags: list[str]
|
|
118
118
|
|
|
119
119
|
|
|
120
|
-
class
|
|
120
|
+
class TaskUpdate(BaseModel):
|
|
121
121
|
model_config = ConfigDict(extra="forbid")
|
|
122
122
|
|
|
123
123
|
command_parallel: NonEmptyStr = None
|
|
@@ -131,7 +131,7 @@ class TaskUpdateV2(BaseModel):
|
|
|
131
131
|
tags: ListUniqueNonEmptyString | None = None
|
|
132
132
|
|
|
133
133
|
|
|
134
|
-
class
|
|
134
|
+
class TaskImport(BaseModel):
|
|
135
135
|
model_config = ConfigDict(extra="forbid")
|
|
136
136
|
|
|
137
137
|
pkg_name: NonEmptyStr
|
|
@@ -139,11 +139,11 @@ class TaskImportV2(BaseModel):
|
|
|
139
139
|
name: NonEmptyStr
|
|
140
140
|
|
|
141
141
|
|
|
142
|
-
class
|
|
142
|
+
class TaskImportLegacy(BaseModel):
|
|
143
143
|
source: NonEmptyStr
|
|
144
144
|
|
|
145
145
|
|
|
146
|
-
class
|
|
146
|
+
class TaskExport(BaseModel):
|
|
147
147
|
pkg_name: NonEmptyStr
|
|
148
148
|
version: NonEmptyStr | None = None
|
|
149
149
|
name: NonEmptyStr
|
|
@@ -21,9 +21,9 @@ class FractalUploadedFile(BaseModel):
|
|
|
21
21
|
contents: bytes
|
|
22
22
|
|
|
23
23
|
|
|
24
|
-
class
|
|
24
|
+
class TaskCollectPip(BaseModel):
|
|
25
25
|
"""
|
|
26
|
-
|
|
26
|
+
TaskCollectPip class
|
|
27
27
|
|
|
28
28
|
This class only encodes the attributes required to trigger a
|
|
29
29
|
task-collection operation. Other attributes (that are assigned *during*
|
|
@@ -91,7 +91,7 @@ class TaskCollectPipV2(BaseModel):
|
|
|
91
91
|
return value
|
|
92
92
|
|
|
93
93
|
|
|
94
|
-
class
|
|
94
|
+
class TaskCollectCustom(BaseModel):
|
|
95
95
|
"""
|
|
96
96
|
Attributes:
|
|
97
97
|
manifest: Manifest of a Fractal task package (this is typically the
|
|
@@ -99,7 +99,7 @@ class TaskCollectCustomV2(BaseModel):
|
|
|
99
99
|
python_interpreter: Absolute path to the Python interpreter to be used
|
|
100
100
|
for running tasks.
|
|
101
101
|
name: A name identifying this package, that will fill the
|
|
102
|
-
`
|
|
102
|
+
`TaskGroup.pkg_name` column.
|
|
103
103
|
package_root: The folder where the package is installed.
|
|
104
104
|
If not provided, it will be extracted via `pip show`
|
|
105
105
|
(requires `package_name` to be set).
|
|
@@ -7,40 +7,40 @@ from pydantic import Field
|
|
|
7
7
|
from pydantic import field_serializer
|
|
8
8
|
from pydantic.types import AwareDatetime
|
|
9
9
|
|
|
10
|
-
from fractal_server.app.schemas.v2.task import
|
|
10
|
+
from fractal_server.app.schemas.v2.task import TaskRead
|
|
11
11
|
from fractal_server.types import AbsolutePathStr
|
|
12
12
|
from fractal_server.types import DictStrStr
|
|
13
13
|
from fractal_server.types import NonEmptyStr
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
class
|
|
16
|
+
class TaskGroupOriginEnum(StrEnum):
|
|
17
17
|
PYPI = "pypi"
|
|
18
18
|
WHEELFILE = "wheel-file"
|
|
19
19
|
PIXI = "pixi"
|
|
20
20
|
OTHER = "other"
|
|
21
21
|
|
|
22
22
|
|
|
23
|
-
class
|
|
23
|
+
class TaskGroupActivityStatus(StrEnum):
|
|
24
24
|
PENDING = "pending"
|
|
25
25
|
ONGOING = "ongoing"
|
|
26
26
|
FAILED = "failed"
|
|
27
27
|
OK = "OK"
|
|
28
28
|
|
|
29
29
|
|
|
30
|
-
class
|
|
30
|
+
class TaskGroupActivityAction(StrEnum):
|
|
31
31
|
COLLECT = "collect"
|
|
32
32
|
DEACTIVATE = "deactivate"
|
|
33
33
|
REACTIVATE = "reactivate"
|
|
34
34
|
DELETE = "delete"
|
|
35
35
|
|
|
36
36
|
|
|
37
|
-
class
|
|
37
|
+
class TaskGroupCreate(BaseModel):
|
|
38
38
|
model_config = ConfigDict(extra="forbid")
|
|
39
39
|
user_id: int
|
|
40
40
|
resource_id: int
|
|
41
41
|
user_group_id: int | None = None
|
|
42
42
|
active: bool = True
|
|
43
|
-
origin:
|
|
43
|
+
origin: TaskGroupOriginEnum
|
|
44
44
|
pkg_name: str
|
|
45
45
|
version: str | None = None
|
|
46
46
|
python_version: NonEmptyStr = None
|
|
@@ -54,9 +54,9 @@ class TaskGroupCreateV2(BaseModel):
|
|
|
54
54
|
pinned_package_versions_post: DictStrStr = Field(default_factory=dict)
|
|
55
55
|
|
|
56
56
|
|
|
57
|
-
class
|
|
57
|
+
class TaskGroupCreateStrict(TaskGroupCreate):
|
|
58
58
|
"""
|
|
59
|
-
A strict version of
|
|
59
|
+
A strict version of TaskGroupCreate, to be used for task collection.
|
|
60
60
|
"""
|
|
61
61
|
|
|
62
62
|
path: AbsolutePathStr
|
|
@@ -65,14 +65,14 @@ class TaskGroupCreateV2Strict(TaskGroupCreateV2):
|
|
|
65
65
|
python_version: NonEmptyStr
|
|
66
66
|
|
|
67
67
|
|
|
68
|
-
class
|
|
68
|
+
class TaskGroupRead(BaseModel):
|
|
69
69
|
id: int
|
|
70
|
-
task_list: list[
|
|
70
|
+
task_list: list[TaskRead]
|
|
71
71
|
|
|
72
72
|
user_id: int
|
|
73
73
|
user_group_id: int | None = None
|
|
74
74
|
|
|
75
|
-
origin:
|
|
75
|
+
origin: TaskGroupOriginEnum
|
|
76
76
|
pkg_name: str
|
|
77
77
|
version: str | None = None
|
|
78
78
|
python_version: str | None = None
|
|
@@ -96,16 +96,16 @@ class TaskGroupReadV2(BaseModel):
|
|
|
96
96
|
return v.isoformat()
|
|
97
97
|
|
|
98
98
|
|
|
99
|
-
class TaskGroupReadSuperuser(
|
|
99
|
+
class TaskGroupReadSuperuser(TaskGroupRead):
|
|
100
100
|
resource_id: int
|
|
101
101
|
|
|
102
102
|
|
|
103
|
-
class
|
|
103
|
+
class TaskGroupUpdate(BaseModel):
|
|
104
104
|
model_config = ConfigDict(extra="forbid")
|
|
105
105
|
user_group_id: int | None = None
|
|
106
106
|
|
|
107
107
|
|
|
108
|
-
class
|
|
108
|
+
class TaskGroupActivityRead(BaseModel):
|
|
109
109
|
id: int
|
|
110
110
|
user_id: int
|
|
111
111
|
taskgroupv2_id: int | None = None
|
|
@@ -113,8 +113,8 @@ class TaskGroupActivityV2Read(BaseModel):
|
|
|
113
113
|
timestamp_ended: AwareDatetime | None = None
|
|
114
114
|
pkg_name: str
|
|
115
115
|
version: str
|
|
116
|
-
status:
|
|
117
|
-
action:
|
|
116
|
+
status: TaskGroupActivityStatus
|
|
117
|
+
action: TaskGroupActivityAction
|
|
118
118
|
log: str | None = None
|
|
119
119
|
|
|
120
120
|
@field_serializer("timestamp_started")
|