fractal-server 2.17.1a1__py3-none-any.whl → 2.18.0__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/__main__.py +21 -19
- fractal_server/app/db/__init__.py +3 -3
- fractal_server/app/models/__init__.py +1 -0
- fractal_server/app/models/linkuserproject.py +43 -1
- fractal_server/app/models/security.py +28 -8
- fractal_server/app/models/v2/__init__.py +3 -1
- fractal_server/app/models/v2/accounting.py +9 -1
- fractal_server/app/models/v2/dataset.py +5 -1
- fractal_server/app/models/v2/history.py +15 -1
- fractal_server/app/models/v2/job.py +17 -2
- fractal_server/app/models/v2/profile.py +29 -0
- fractal_server/app/models/v2/project.py +4 -10
- fractal_server/app/models/v2/resource.py +17 -0
- fractal_server/app/models/v2/task_group.py +4 -3
- fractal_server/app/models/v2/workflow.py +2 -1
- fractal_server/app/routes/admin/v2/__init__.py +12 -13
- fractal_server/app/routes/admin/v2/accounting.py +3 -3
- fractal_server/app/routes/admin/v2/job.py +35 -24
- fractal_server/app/routes/admin/v2/profile.py +3 -2
- fractal_server/app/routes/admin/v2/resource.py +5 -5
- fractal_server/app/routes/admin/v2/sharing.py +103 -0
- fractal_server/app/routes/admin/v2/task.py +37 -26
- fractal_server/app/routes/admin/v2/task_group.py +94 -17
- fractal_server/app/routes/admin/v2/task_group_lifecycle.py +21 -22
- fractal_server/app/routes/api/__init__.py +1 -9
- fractal_server/app/routes/api/v2/__init__.py +49 -50
- fractal_server/app/routes/api/v2/_aux_functions.py +132 -124
- fractal_server/app/routes/api/v2/_aux_functions_history.py +51 -23
- fractal_server/app/routes/api/v2/_aux_functions_sharing.py +97 -0
- fractal_server/app/routes/api/v2/_aux_functions_task_lifecycle.py +6 -8
- fractal_server/app/routes/api/v2/_aux_functions_tasks.py +7 -9
- fractal_server/app/routes/api/v2/_aux_task_group_disambiguation.py +1 -2
- fractal_server/app/routes/api/v2/dataset.py +95 -102
- fractal_server/app/routes/api/v2/history.py +59 -33
- fractal_server/app/routes/api/v2/images.py +24 -9
- fractal_server/app/routes/api/v2/job.py +52 -33
- fractal_server/app/routes/api/v2/pre_submission_checks.py +16 -8
- fractal_server/app/routes/api/v2/project.py +65 -37
- fractal_server/app/routes/api/v2/sharing.py +311 -0
- fractal_server/app/routes/api/v2/status_legacy.py +31 -41
- fractal_server/app/routes/api/v2/submit.py +82 -78
- fractal_server/app/routes/api/v2/task.py +19 -20
- fractal_server/app/routes/api/v2/task_collection.py +41 -43
- fractal_server/app/routes/api/v2/task_collection_custom.py +19 -20
- fractal_server/app/routes/api/v2/task_collection_pixi.py +10 -11
- fractal_server/app/routes/api/v2/task_group.py +25 -24
- fractal_server/app/routes/api/v2/task_group_lifecycle.py +32 -32
- fractal_server/app/routes/api/v2/task_version_update.py +23 -19
- fractal_server/app/routes/api/v2/workflow.py +50 -55
- fractal_server/app/routes/api/v2/workflow_import.py +37 -37
- fractal_server/app/routes/api/v2/workflowtask.py +32 -26
- fractal_server/app/routes/auth/__init__.py +1 -3
- fractal_server/app/routes/auth/_aux_auth.py +101 -2
- fractal_server/app/routes/auth/current_user.py +2 -66
- fractal_server/app/routes/auth/group.py +8 -35
- fractal_server/app/routes/auth/login.py +1 -0
- fractal_server/app/routes/auth/oauth.py +4 -3
- fractal_server/app/routes/auth/register.py +4 -2
- fractal_server/app/routes/auth/router.py +2 -0
- fractal_server/app/routes/auth/users.py +19 -10
- fractal_server/app/routes/auth/viewer_paths.py +43 -0
- fractal_server/app/routes/aux/_job.py +1 -1
- fractal_server/app/routes/aux/_runner.py +2 -2
- fractal_server/app/routes/pagination.py +1 -1
- fractal_server/app/schemas/user.py +29 -12
- fractal_server/app/schemas/user_group.py +0 -15
- fractal_server/app/schemas/v2/__init__.py +55 -48
- fractal_server/app/schemas/v2/accounting.py +11 -0
- fractal_server/app/schemas/v2/dataset.py +57 -11
- fractal_server/app/schemas/v2/dumps.py +10 -9
- fractal_server/app/schemas/v2/job.py +11 -11
- fractal_server/app/schemas/v2/manifest.py +4 -3
- fractal_server/app/schemas/v2/profile.py +53 -2
- fractal_server/app/schemas/v2/project.py +3 -3
- fractal_server/app/schemas/v2/resource.py +121 -16
- fractal_server/app/schemas/v2/sharing.py +99 -0
- fractal_server/app/schemas/v2/status_legacy.py +3 -3
- fractal_server/app/schemas/v2/task.py +6 -7
- fractal_server/app/schemas/v2/task_collection.py +5 -5
- 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 +16 -15
- fractal_server/app/security/__init__.py +5 -8
- fractal_server/app/security/signup_email.py +4 -5
- fractal_server/app/shutdown.py +6 -6
- fractal_server/config/__init__.py +0 -6
- fractal_server/config/_data.py +0 -68
- fractal_server/config/_database.py +19 -20
- fractal_server/config/_email.py +30 -38
- fractal_server/config/_main.py +38 -52
- fractal_server/config/_oauth.py +17 -21
- fractal_server/data_migrations/2_18_0.py +30 -0
- fractal_server/exceptions.py +4 -0
- fractal_server/images/models.py +4 -5
- fractal_server/images/status_tools.py +4 -2
- fractal_server/logger.py +1 -1
- fractal_server/main.py +75 -13
- fractal_server/migrations/versions/034a469ec2eb_task_groups.py +4 -8
- fractal_server/migrations/versions/091b01f51f88_add_usergroup_and_linkusergroup_table.py +1 -1
- fractal_server/migrations/versions/0f5f85bb2ae7_add_pre_pinned_packages.py +1 -0
- fractal_server/migrations/versions/19eca0dd47a9_user_settings_project_dir.py +1 -1
- fractal_server/migrations/versions/1a83a5260664_rename.py +1 -1
- fractal_server/migrations/versions/1eac13a26c83_drop_v1_tables.py +1 -0
- fractal_server/migrations/versions/316140ff7ee1_remove_usersettings_cache_dir.py +1 -1
- fractal_server/migrations/versions/40d6d6511b20_add_index_to_history_models.py +47 -0
- fractal_server/migrations/versions/45fbb391d7af_make_resource_id_fk_non_nullable.py +1 -1
- fractal_server/migrations/versions/47351f8c7ebc_drop_dataset_filters.py +1 -0
- fractal_server/migrations/versions/49d0856e9569_drop_table.py +2 -3
- fractal_server/migrations/versions/4c308bcaea2b_add_task_args_schema_and_task_args_.py +1 -1
- fractal_server/migrations/versions/4cedeb448a53_workflowtask_foreign_keys_not_nullables.py +1 -1
- fractal_server/migrations/versions/501961cfcd85_remove_link_between_v1_and_v2_tasks_.py +2 -1
- fractal_server/migrations/versions/50a13d6138fd_initial_schema.py +7 -19
- fractal_server/migrations/versions/5bf02391cfef_v2.py +4 -10
- fractal_server/migrations/versions/70e77f1c38b0_add_applyworkflow_first_task_index_and_.py +1 -0
- fractal_server/migrations/versions/71eefd1dd202_add_slurm_accounts.py +1 -1
- fractal_server/migrations/versions/7673fe18c05d_remove_project_dir_server_default.py +1 -1
- fractal_server/migrations/versions/7910eed4cf97_user_project_dirs_and_usergroup_viewer_.py +60 -0
- fractal_server/migrations/versions/791ce783d3d8_add_indices.py +1 -1
- fractal_server/migrations/versions/83bc2ad3ffcc_2_17_0.py +1 -0
- fractal_server/migrations/versions/84bf0fffde30_add_dumps_to_applyworkflow.py +1 -0
- fractal_server/migrations/versions/88270f589c9b_add_prevent_new_submissions.py +39 -0
- fractal_server/migrations/versions/8e8f227a3e36_update_taskv2_post_2_7_0.py +2 -4
- fractal_server/migrations/versions/8f79bd162e35_add_docs_info_and_docs_link_to_task_.py +1 -1
- fractal_server/migrations/versions/94a47ea2d3ff_remove_cache_dir_slurm_user_and_slurm_.py +1 -0
- fractal_server/migrations/versions/969d84257cac_add_historyrun_task_id.py +1 -1
- fractal_server/migrations/versions/97f444d47249_add_applyworkflow_project_dump.py +1 -1
- fractal_server/migrations/versions/981d588fe248_add_executor_error_log.py +1 -1
- fractal_server/migrations/versions/99ea79d9e5d2_add_dataset_history.py +2 -4
- fractal_server/migrations/versions/9c5ae74c9b98_add_user_settings_table.py +1 -1
- fractal_server/migrations/versions/9db60297b8b2_set_ondelete.py +1 -1
- fractal_server/migrations/versions/9fd26a2b0de4_add_workflow_timestamp_created.py +1 -1
- fractal_server/migrations/versions/a7f4d6137b53_add_workflow_dump_to_applyworkflow.py +1 -1
- fractal_server/migrations/versions/af1ef1c83c9b_add_accounting_tables.py +1 -0
- fractal_server/migrations/versions/af8673379a5c_drop_old_filter_columns.py +1 -0
- fractal_server/migrations/versions/b1e7f7a1ff71_task_group_for_pixi.py +1 -1
- fractal_server/migrations/versions/b3ffb095f973_json_to_jsonb.py +1 -0
- fractal_server/migrations/versions/bc0e8b3327a7_project_sharing.py +72 -0
- fractal_server/migrations/versions/c90a7c76e996_job_id_in_history_run.py +1 -1
- fractal_server/migrations/versions/caba9fb1ea5e_drop_useroauth_user_settings_id.py +1 -1
- fractal_server/migrations/versions/d256a7379ab8_taskgroup_activity_and_venv_info_to_.py +4 -9
- fractal_server/migrations/versions/d4fe3708d309_make_applyworkflow_workflow_dump_non_.py +1 -0
- fractal_server/migrations/versions/da2cb2ac4255_user_group_viewer_paths.py +1 -1
- fractal_server/migrations/versions/db09233ad13a_split_filters_and_keep_old_columns.py +1 -0
- fractal_server/migrations/versions/e0e717ae2f26_delete_linkuserproject_ondelete_project.py +50 -0
- fractal_server/migrations/versions/e75cac726012_make_applyworkflow_start_timestamp_not_.py +1 -0
- fractal_server/migrations/versions/e81103413827_add_job_type_filters.py +1 -1
- fractal_server/migrations/versions/efa89c30e0a4_add_project_timestamp_created.py +1 -0
- fractal_server/migrations/versions/f0702066b007_one_submitted_job_per_dataset.py +40 -0
- fractal_server/migrations/versions/f37aceb45062_make_historyunit_logfile_required.py +1 -1
- fractal_server/migrations/versions/f384e1c0cf5d_drop_task_default_args_columns.py +1 -0
- fractal_server/migrations/versions/fbce16ff4e47_new_history_items.py +4 -9
- fractal_server/runner/config/_local.py +8 -5
- fractal_server/runner/config/_slurm.py +39 -33
- fractal_server/runner/config/slurm_mem_to_MB.py +0 -1
- fractal_server/runner/executors/base_runner.py +29 -4
- fractal_server/runner/executors/local/get_local_config.py +1 -0
- fractal_server/runner/executors/local/runner.py +14 -13
- fractal_server/runner/executors/slurm_common/_batching.py +9 -20
- fractal_server/runner/executors/slurm_common/base_slurm_runner.py +53 -27
- fractal_server/runner/executors/slurm_common/get_slurm_config.py +14 -7
- fractal_server/runner/executors/slurm_common/remote.py +3 -1
- fractal_server/runner/executors/slurm_common/slurm_config.py +2 -0
- fractal_server/runner/executors/slurm_common/slurm_job_task_models.py +1 -3
- fractal_server/runner/executors/slurm_ssh/runner.py +16 -11
- fractal_server/runner/executors/slurm_ssh/tar_commands.py +1 -0
- fractal_server/runner/executors/slurm_sudo/_subprocess_run_as_user.py +1 -0
- fractal_server/runner/executors/slurm_sudo/runner.py +16 -11
- fractal_server/runner/task_files.py +9 -3
- fractal_server/runner/v2/_local.py +12 -6
- fractal_server/runner/v2/_slurm_ssh.py +14 -7
- fractal_server/runner/v2/_slurm_sudo.py +14 -7
- fractal_server/runner/v2/db_tools.py +0 -1
- fractal_server/runner/v2/deduplicate_list.py +2 -1
- fractal_server/runner/v2/runner.py +44 -28
- fractal_server/runner/v2/runner_functions.py +22 -28
- fractal_server/runner/v2/submit_workflow.py +29 -15
- fractal_server/ssh/_fabric.py +6 -13
- fractal_server/string_tools.py +0 -1
- fractal_server/syringe.py +1 -1
- fractal_server/tasks/config/_pixi.py +1 -1
- fractal_server/tasks/config/_python.py +16 -9
- fractal_server/tasks/utils.py +0 -1
- fractal_server/tasks/v2/local/_utils.py +3 -3
- fractal_server/tasks/v2/local/collect.py +15 -18
- fractal_server/tasks/v2/local/collect_pixi.py +14 -16
- fractal_server/tasks/v2/local/deactivate.py +14 -15
- fractal_server/tasks/v2/local/deactivate_pixi.py +7 -7
- fractal_server/tasks/v2/local/delete.py +6 -8
- fractal_server/tasks/v2/local/reactivate.py +12 -12
- fractal_server/tasks/v2/local/reactivate_pixi.py +12 -12
- fractal_server/tasks/v2/ssh/_utils.py +3 -3
- fractal_server/tasks/v2/ssh/collect.py +19 -24
- fractal_server/tasks/v2/ssh/collect_pixi.py +22 -24
- fractal_server/tasks/v2/ssh/deactivate.py +17 -15
- fractal_server/tasks/v2/ssh/deactivate_pixi.py +8 -7
- fractal_server/tasks/v2/ssh/delete.py +12 -10
- fractal_server/tasks/v2/ssh/reactivate.py +16 -16
- fractal_server/tasks/v2/ssh/reactivate_pixi.py +13 -14
- fractal_server/tasks/v2/templates/1_create_venv.sh +2 -0
- fractal_server/tasks/v2/templates/2_pip_install.sh +2 -0
- fractal_server/tasks/v2/templates/3_pip_freeze.sh +2 -0
- fractal_server/tasks/v2/templates/4_pip_show.sh +2 -0
- fractal_server/tasks/v2/templates/5_get_venv_size_and_file_number.sh +3 -1
- fractal_server/tasks/v2/templates/6_pip_install_from_freeze.sh +2 -0
- fractal_server/tasks/v2/templates/pixi_1_extract.sh +2 -0
- fractal_server/tasks/v2/templates/pixi_2_install.sh +2 -0
- fractal_server/tasks/v2/templates/pixi_3_post_install.sh +2 -0
- fractal_server/tasks/v2/utils_background.py +10 -10
- fractal_server/tasks/v2/utils_database.py +5 -5
- fractal_server/tasks/v2/utils_package_names.py +1 -2
- fractal_server/tasks/v2/utils_pixi.py +1 -3
- fractal_server/types/__init__.py +98 -1
- fractal_server/types/validators/__init__.py +3 -0
- fractal_server/types/validators/_common_validators.py +33 -3
- fractal_server/types/validators/_workflow_task_arguments_validators.py +1 -2
- fractal_server/utils.py +1 -0
- fractal_server/zip_tools.py +34 -0
- {fractal_server-2.17.1a1.dist-info → fractal_server-2.18.0.dist-info}/METADATA +3 -2
- fractal_server-2.18.0.dist-info/RECORD +275 -0
- fractal_server/app/routes/admin/v2/project.py +0 -41
- fractal_server-2.17.1a1.dist-info/RECORD +0 -264
- {fractal_server-2.17.1a1.dist-info → fractal_server-2.18.0.dist-info}/WHEEL +0 -0
- {fractal_server-2.17.1a1.dist-info → fractal_server-2.18.0.dist-info}/entry_points.txt +0 -0
- {fractal_server-2.17.1a1.dist-info → fractal_server-2.18.0.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,45 +27,52 @@ 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
|
+
from .sharing import ProjectPermissions # noqa F401
|
|
34
|
+
from .sharing import ProjectGuestCreate # noqa F401
|
|
35
|
+
from .sharing import ProjectAccessRead # noqa F401
|
|
36
|
+
from .sharing import ProjectInvitationRead # noqa F401
|
|
37
|
+
from .sharing import ProjectGuestRead # noqa F401
|
|
38
|
+
from .sharing import ProjectGuestUpdate # noqa F401
|
|
39
|
+
from .sharing import LinkUserProjectRead # noqa F401
|
|
33
40
|
from .resource import ResourceCreate # noqa F401
|
|
34
41
|
from .resource import ResourceRead # noqa F401
|
|
35
42
|
from .resource import ResourceType # noqa F401
|
|
36
43
|
from .resource import ValidResourceLocal # noqa F401
|
|
37
44
|
from .resource import ValidResourceSlurmSSH # noqa F401
|
|
38
45
|
from .resource import ValidResourceSlurmSudo # noqa F401
|
|
39
|
-
from .status_legacy import
|
|
40
|
-
from .task import
|
|
41
|
-
from .task import
|
|
42
|
-
from .task import
|
|
43
|
-
from .task import
|
|
44
|
-
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
|
|
45
52
|
from .task import TaskType # noqa F401
|
|
46
|
-
from .task import
|
|
53
|
+
from .task import TaskUpdate # noqa F401
|
|
47
54
|
from .task_collection import FractalUploadedFile # noqa F401
|
|
48
|
-
from .task_collection import
|
|
49
|
-
from .task_collection import
|
|
50
|
-
from .task_group import
|
|
51
|
-
from .task_group import
|
|
52
|
-
from .task_group import
|
|
53
|
-
from .task_group import
|
|
54
|
-
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
|
|
55
62
|
from .task_group import TaskGroupReadSuperuser # noqa F401
|
|
56
|
-
from .task_group import
|
|
57
|
-
from .task_group import
|
|
58
|
-
from .task_group import
|
|
59
|
-
from .workflow import
|
|
60
|
-
from .workflow import
|
|
61
|
-
from .workflow import
|
|
62
|
-
from .workflow import
|
|
63
|
-
from .workflow import
|
|
64
|
-
from .workflow import
|
|
65
|
-
from .workflowtask import
|
|
66
|
-
from .workflowtask import
|
|
67
|
-
from .workflowtask import
|
|
68
|
-
from .workflowtask import
|
|
69
|
-
from .workflowtask import
|
|
70
|
-
from .workflowtask import
|
|
71
|
-
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
|
|
@@ -6,6 +6,17 @@ from pydantic.types import AwareDatetime
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
class AccountingRecordRead(BaseModel):
|
|
9
|
+
"""
|
|
10
|
+
AccountingRecordRead
|
|
11
|
+
|
|
12
|
+
Attributes:
|
|
13
|
+
id:
|
|
14
|
+
user_id:
|
|
15
|
+
timestamp:
|
|
16
|
+
num_tasks:
|
|
17
|
+
num_new_images:
|
|
18
|
+
"""
|
|
19
|
+
|
|
9
20
|
id: int
|
|
10
21
|
user_id: int
|
|
11
22
|
timestamp: AwareDatetime
|
|
@@ -1,34 +1,64 @@
|
|
|
1
1
|
from datetime import datetime
|
|
2
|
+
from pathlib import Path
|
|
2
3
|
|
|
3
4
|
from pydantic import BaseModel
|
|
4
5
|
from pydantic import ConfigDict
|
|
5
6
|
from pydantic import Field
|
|
6
7
|
from pydantic import field_serializer
|
|
8
|
+
from pydantic import model_validator
|
|
7
9
|
from pydantic.types import AwareDatetime
|
|
8
10
|
|
|
9
|
-
from fractal_server.app.schemas.v2.project import
|
|
11
|
+
from fractal_server.app.schemas.v2.project import ProjectRead
|
|
10
12
|
from fractal_server.images import SingleImage
|
|
11
|
-
from fractal_server.types import
|
|
13
|
+
from fractal_server.types import AbsolutePathStr
|
|
12
14
|
from fractal_server.types import NonEmptyStr
|
|
15
|
+
from fractal_server.types import RelativePathStr
|
|
13
16
|
from fractal_server.types import ZarrDirStr
|
|
14
17
|
|
|
15
18
|
|
|
16
|
-
class
|
|
19
|
+
class DatasetCreate(BaseModel):
|
|
20
|
+
"""
|
|
21
|
+
DatasetCreate
|
|
22
|
+
|
|
23
|
+
Attributes:
|
|
24
|
+
name:
|
|
25
|
+
project_dir:
|
|
26
|
+
zarr_subfolder:
|
|
27
|
+
"""
|
|
28
|
+
|
|
17
29
|
model_config = ConfigDict(extra="forbid")
|
|
18
30
|
|
|
19
31
|
name: NonEmptyStr
|
|
32
|
+
project_dir: AbsolutePathStr | None = None
|
|
33
|
+
zarr_subfolder: RelativePathStr | None = None
|
|
34
|
+
|
|
35
|
+
@model_validator(mode="after")
|
|
36
|
+
def validate_zarr_dir(self):
|
|
37
|
+
if (self.project_dir is None) and (self.zarr_subfolder is not None):
|
|
38
|
+
raise ValueError(
|
|
39
|
+
"Cannot provide `zarr_subfolder` without `project_dir`"
|
|
40
|
+
)
|
|
41
|
+
return self
|
|
20
42
|
|
|
21
|
-
zarr_dir: ZarrDirStr | None = None
|
|
22
43
|
|
|
23
|
-
|
|
44
|
+
class DatasetRead(BaseModel):
|
|
45
|
+
"""
|
|
46
|
+
DatasetRead
|
|
24
47
|
|
|
48
|
+
Attributes:
|
|
49
|
+
id:
|
|
50
|
+
name:
|
|
51
|
+
project_id:
|
|
52
|
+
project:
|
|
53
|
+
timestamp_created:
|
|
54
|
+
zarr_dir:
|
|
55
|
+
"""
|
|
25
56
|
|
|
26
|
-
class DatasetReadV2(BaseModel):
|
|
27
57
|
id: int
|
|
28
58
|
name: str
|
|
29
59
|
|
|
30
60
|
project_id: int
|
|
31
|
-
project:
|
|
61
|
+
project: ProjectRead
|
|
32
62
|
|
|
33
63
|
timestamp_created: AwareDatetime
|
|
34
64
|
|
|
@@ -39,14 +69,21 @@ class DatasetReadV2(BaseModel):
|
|
|
39
69
|
return v.isoformat()
|
|
40
70
|
|
|
41
71
|
|
|
42
|
-
class
|
|
72
|
+
class DatasetUpdate(BaseModel):
|
|
73
|
+
"""
|
|
74
|
+
DatasetUpdate
|
|
75
|
+
|
|
76
|
+
Attributes:
|
|
77
|
+
name:
|
|
78
|
+
zarr_dir:
|
|
79
|
+
"""
|
|
80
|
+
|
|
43
81
|
model_config = ConfigDict(extra="forbid")
|
|
44
82
|
|
|
45
83
|
name: NonEmptyStr = None
|
|
46
|
-
zarr_dir: ZarrDirStr | None = None
|
|
47
84
|
|
|
48
85
|
|
|
49
|
-
class
|
|
86
|
+
class DatasetImport(BaseModel):
|
|
50
87
|
"""
|
|
51
88
|
Class for `Dataset` import.
|
|
52
89
|
|
|
@@ -64,8 +101,17 @@ class DatasetImportV2(BaseModel):
|
|
|
64
101
|
zarr_dir: ZarrDirStr
|
|
65
102
|
images: list[SingleImage] = Field(default_factory=list)
|
|
66
103
|
|
|
104
|
+
@model_validator(mode="after")
|
|
105
|
+
def validate_image_zarr_url(self):
|
|
106
|
+
for image in self.images:
|
|
107
|
+
if not Path(image.zarr_url).is_relative_to(self.zarr_dir):
|
|
108
|
+
raise ValueError(
|
|
109
|
+
f"{image.zarr_url=} is not relative to {self.zarr_dir=}."
|
|
110
|
+
)
|
|
111
|
+
return self
|
|
112
|
+
|
|
67
113
|
|
|
68
|
-
class
|
|
114
|
+
class DatasetExport(BaseModel):
|
|
69
115
|
"""
|
|
70
116
|
Class for `Dataset` export.
|
|
71
117
|
|
|
@@ -7,22 +7,23 @@ These models are used in at least two situations:
|
|
|
7
7
|
1. In the "*_dump" attributes of Job models;
|
|
8
8
|
2. In the history items, to trim their size.
|
|
9
9
|
"""
|
|
10
|
+
|
|
10
11
|
from pydantic import BaseModel
|
|
11
12
|
from pydantic import ConfigDict
|
|
12
13
|
from pydantic import Field
|
|
13
14
|
|
|
14
15
|
from .task import TaskType
|
|
15
|
-
from .task_group import
|
|
16
|
+
from .task_group import TaskGroupOriginEnum
|
|
16
17
|
|
|
17
18
|
|
|
18
|
-
class
|
|
19
|
+
class ProjectDump(BaseModel):
|
|
19
20
|
model_config = ConfigDict(extra="forbid")
|
|
20
21
|
id: int
|
|
21
22
|
name: str
|
|
22
23
|
timestamp_created: str
|
|
23
24
|
|
|
24
25
|
|
|
25
|
-
class
|
|
26
|
+
class TaskDump(BaseModel):
|
|
26
27
|
id: int
|
|
27
28
|
name: str
|
|
28
29
|
type: TaskType
|
|
@@ -36,7 +37,7 @@ class TaskDumpV2(BaseModel):
|
|
|
36
37
|
output_types: dict[str, bool]
|
|
37
38
|
|
|
38
39
|
|
|
39
|
-
class
|
|
40
|
+
class WorkflowTaskDump(BaseModel):
|
|
40
41
|
"""
|
|
41
42
|
We do not include 'model_config = ConfigDict(extra="forbid")'
|
|
42
43
|
because legacy data may include 'input_filters' field and we want to avoid
|
|
@@ -50,10 +51,10 @@ class WorkflowTaskDumpV2(BaseModel):
|
|
|
50
51
|
type_filters: dict[str, bool]
|
|
51
52
|
|
|
52
53
|
task_id: int | None = None
|
|
53
|
-
task:
|
|
54
|
+
task: TaskDump | None = None
|
|
54
55
|
|
|
55
56
|
|
|
56
|
-
class
|
|
57
|
+
class WorkflowDump(BaseModel):
|
|
57
58
|
model_config = ConfigDict(extra="forbid")
|
|
58
59
|
id: int
|
|
59
60
|
name: str
|
|
@@ -61,7 +62,7 @@ class WorkflowDumpV2(BaseModel):
|
|
|
61
62
|
timestamp_created: str
|
|
62
63
|
|
|
63
64
|
|
|
64
|
-
class
|
|
65
|
+
class DatasetDump(BaseModel):
|
|
65
66
|
"""
|
|
66
67
|
We do not include 'model_config = ConfigDict(extra="forbid")' because
|
|
67
68
|
legacy data may include 'type_filters' or 'attribute_filters' and we
|
|
@@ -75,9 +76,9 @@ class DatasetDumpV2(BaseModel):
|
|
|
75
76
|
zarr_dir: str
|
|
76
77
|
|
|
77
78
|
|
|
78
|
-
class
|
|
79
|
+
class TaskGroupDump(BaseModel):
|
|
79
80
|
id: int
|
|
80
|
-
origin:
|
|
81
|
+
origin: TaskGroupOriginEnum
|
|
81
82
|
pkg_name: str
|
|
82
83
|
version: str | None = None
|
|
83
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
|
|
@@ -4,11 +4,12 @@ from pydantic import BaseModel
|
|
|
4
4
|
from pydantic import Field
|
|
5
5
|
from pydantic import model_validator
|
|
6
6
|
|
|
7
|
-
from .task import TaskType
|
|
8
7
|
from fractal_server.types import DictStrAny
|
|
9
8
|
from fractal_server.types import HttpUrlStr
|
|
10
9
|
from fractal_server.types import NonEmptyStr
|
|
11
10
|
|
|
11
|
+
from .task import TaskType
|
|
12
|
+
|
|
12
13
|
|
|
13
14
|
class TaskManifestV2(BaseModel):
|
|
14
15
|
"""
|
|
@@ -119,9 +120,9 @@ class ManifestV2(BaseModel):
|
|
|
119
120
|
manifests as the schema evolves. This is for instance used by
|
|
120
121
|
Fractal to determine which subclass of the present base class needs
|
|
121
122
|
be used to read and validate the input.
|
|
122
|
-
task_list
|
|
123
|
+
task_list:
|
|
123
124
|
The list of tasks, represented as specified by subclasses of the
|
|
124
|
-
_TaskManifestBase (a.k.a. TaskManifestType)
|
|
125
|
+
`_TaskManifestBase` (a.k.a. `TaskManifestType`)
|
|
125
126
|
has_args_schemas:
|
|
126
127
|
`True` if the manifest includes JSON Schemas for the arguments of
|
|
127
128
|
each task.
|
|
@@ -6,12 +6,21 @@ from pydantic import Discriminator
|
|
|
6
6
|
from pydantic import Tag
|
|
7
7
|
from pydantic import validate_call
|
|
8
8
|
|
|
9
|
-
from .resource import ResourceType
|
|
10
9
|
from fractal_server.types import AbsolutePathStr
|
|
11
10
|
from fractal_server.types import NonEmptyStr
|
|
12
11
|
|
|
12
|
+
from .resource import ResourceType
|
|
13
|
+
|
|
13
14
|
|
|
14
15
|
class ValidProfileLocal(BaseModel):
|
|
16
|
+
"""
|
|
17
|
+
Valid local profile.
|
|
18
|
+
|
|
19
|
+
Attributes:
|
|
20
|
+
name: Profile name.
|
|
21
|
+
resource_type: Type of the corresponding resource.
|
|
22
|
+
"""
|
|
23
|
+
|
|
15
24
|
name: NonEmptyStr
|
|
16
25
|
resource_type: ResourceType
|
|
17
26
|
username: None = None
|
|
@@ -21,6 +30,17 @@ class ValidProfileLocal(BaseModel):
|
|
|
21
30
|
|
|
22
31
|
|
|
23
32
|
class ValidProfileSlurmSudo(BaseModel):
|
|
33
|
+
"""
|
|
34
|
+
Valid SLURM/sudo profile.
|
|
35
|
+
|
|
36
|
+
Attributes:
|
|
37
|
+
name: Profile name.
|
|
38
|
+
resource_type: Type of the corresponding resource.
|
|
39
|
+
username:
|
|
40
|
+
SLURM user to impersonate (e.g. as in
|
|
41
|
+
`sudo -u username sbatch /some/script.sh`).
|
|
42
|
+
"""
|
|
43
|
+
|
|
24
44
|
name: NonEmptyStr
|
|
25
45
|
resource_type: ResourceType
|
|
26
46
|
username: NonEmptyStr
|
|
@@ -30,6 +50,23 @@ class ValidProfileSlurmSudo(BaseModel):
|
|
|
30
50
|
|
|
31
51
|
|
|
32
52
|
class ValidProfileSlurmSSH(BaseModel):
|
|
53
|
+
"""
|
|
54
|
+
Valid SLURM/sudo profile.
|
|
55
|
+
|
|
56
|
+
Attributes:
|
|
57
|
+
name: Profile name.
|
|
58
|
+
resource_type: Type of the corresponding resource.
|
|
59
|
+
username:
|
|
60
|
+
SLURM user to impersonate (e.g. as in
|
|
61
|
+
`ssh username@cluster sbatch /some/script.sh`).
|
|
62
|
+
ssh_key_path:
|
|
63
|
+
Local path of SSH private key for user `username`.
|
|
64
|
+
tasks_remote_dir:
|
|
65
|
+
Base folder for task environments on the remote SLURM cluster.
|
|
66
|
+
jobs_remote_dir:
|
|
67
|
+
Base folder for job directories on the remote SLURM cluster.
|
|
68
|
+
"""
|
|
69
|
+
|
|
33
70
|
name: NonEmptyStr
|
|
34
71
|
resource_type: ResourceType
|
|
35
72
|
username: NonEmptyStr
|
|
@@ -54,6 +91,20 @@ ProfileCreate = Annotated[
|
|
|
54
91
|
|
|
55
92
|
|
|
56
93
|
class ProfileRead(BaseModel):
|
|
94
|
+
"""
|
|
95
|
+
Profile schema for GET endpoints.
|
|
96
|
+
|
|
97
|
+
Attributes:
|
|
98
|
+
id:
|
|
99
|
+
name:
|
|
100
|
+
resource_id:
|
|
101
|
+
resource_type:
|
|
102
|
+
username:
|
|
103
|
+
ssh_key_path:
|
|
104
|
+
jobs_remote_dir:
|
|
105
|
+
tasks_remote_dir:
|
|
106
|
+
"""
|
|
107
|
+
|
|
57
108
|
id: int
|
|
58
109
|
name: str
|
|
59
110
|
resource_id: int
|
|
@@ -69,7 +120,7 @@ def cast_serialize_profile(_data: ProfileCreate) -> dict[str, Any]:
|
|
|
69
120
|
"""
|
|
70
121
|
Cast/serialize round-trip for `Profile` data.
|
|
71
122
|
|
|
72
|
-
We use `@validate_call` because `
|
|
123
|
+
We use `@validate_call` because `ProfileCreate` is a `Union` type and it
|
|
73
124
|
cannot be instantiated directly.
|
|
74
125
|
|
|
75
126
|
Return:
|
|
@@ -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
|