fractal-server 2.17.1a0__py3-none-any.whl → 2.17.2__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 +19 -18
- fractal_server/app/db/__init__.py +3 -3
- fractal_server/app/models/__init__.py +1 -1
- fractal_server/app/models/linkuserproject.py +3 -1
- fractal_server/app/models/security.py +22 -17
- 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 +4 -0
- fractal_server/app/models/v2/profile.py +29 -0
- fractal_server/app/models/v2/project.py +5 -14
- fractal_server/app/models/v2/resource.py +4 -0
- fractal_server/app/models/v2/task_group.py +5 -7
- fractal_server/app/models/v2/workflow.py +2 -1
- fractal_server/app/routes/admin/v2/__init__.py +1 -2
- fractal_server/app/routes/admin/v2/accounting.py +1 -1
- fractal_server/app/routes/admin/v2/job.py +9 -9
- 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/task.py +28 -18
- fractal_server/app/routes/admin/v2/task_group.py +0 -1
- fractal_server/app/routes/admin/v2/task_group_lifecycle.py +1 -2
- fractal_server/app/routes/api/__init__.py +1 -0
- fractal_server/app/routes/api/v2/__init__.py +5 -6
- fractal_server/app/routes/api/v2/_aux_functions.py +70 -63
- fractal_server/app/routes/api/v2/_aux_functions_history.py +43 -20
- fractal_server/app/routes/api/v2/_aux_functions_task_lifecycle.py +2 -4
- fractal_server/app/routes/api/v2/_aux_functions_tasks.py +5 -7
- fractal_server/app/routes/api/v2/_aux_task_group_disambiguation.py +1 -2
- fractal_server/app/routes/api/v2/dataset.py +13 -32
- fractal_server/app/routes/api/v2/history.py +35 -21
- fractal_server/app/routes/api/v2/images.py +3 -2
- fractal_server/app/routes/api/v2/job.py +17 -14
- fractal_server/app/routes/api/v2/pre_submission_checks.py +5 -4
- fractal_server/app/routes/api/v2/project.py +22 -17
- fractal_server/app/routes/api/v2/status_legacy.py +12 -11
- fractal_server/app/routes/api/v2/submit.py +11 -12
- fractal_server/app/routes/api/v2/task.py +4 -3
- fractal_server/app/routes/api/v2/task_collection.py +28 -30
- fractal_server/app/routes/api/v2/task_collection_custom.py +8 -7
- fractal_server/app/routes/api/v2/task_collection_pixi.py +1 -2
- fractal_server/app/routes/api/v2/task_group.py +7 -6
- fractal_server/app/routes/api/v2/task_group_lifecycle.py +6 -6
- fractal_server/app/routes/api/v2/task_version_update.py +13 -12
- fractal_server/app/routes/api/v2/workflow.py +14 -31
- fractal_server/app/routes/api/v2/workflow_import.py +17 -19
- fractal_server/app/routes/api/v2/workflowtask.py +10 -12
- fractal_server/app/routes/auth/__init__.py +1 -3
- fractal_server/app/routes/auth/_aux_auth.py +1 -2
- fractal_server/app/routes/auth/current_user.py +4 -5
- fractal_server/app/routes/auth/group.py +7 -5
- 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/users.py +10 -10
- 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 +3 -3
- fractal_server/app/schemas/v2/accounting.py +11 -0
- fractal_server/app/schemas/v2/dataset.py +28 -4
- fractal_server/app/schemas/v2/dumps.py +1 -0
- fractal_server/app/schemas/v2/manifest.py +4 -3
- fractal_server/app/schemas/v2/profile.py +53 -2
- fractal_server/app/schemas/v2/resource.py +109 -13
- fractal_server/app/schemas/v2/task.py +0 -1
- fractal_server/app/schemas/v2/task_collection.py +1 -1
- fractal_server/app/schemas/v2/workflowtask.py +4 -3
- fractal_server/app/security/__init__.py +4 -7
- fractal_server/app/security/signup_email.py +4 -5
- fractal_server/app/shutdown.py +23 -19
- fractal_server/config/_data.py +36 -25
- fractal_server/config/_database.py +19 -20
- fractal_server/config/_email.py +30 -38
- fractal_server/config/_main.py +34 -53
- fractal_server/config/_oauth.py +17 -21
- fractal_server/exceptions.py +4 -0
- fractal_server/images/models.py +3 -3
- fractal_server/images/status_tools.py +4 -2
- fractal_server/logger.py +1 -1
- fractal_server/main.py +4 -3
- 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 +46 -0
- fractal_server/migrations/versions/47351f8c7ebc_drop_dataset_filters.py +1 -0
- fractal_server/migrations/versions/49d0856e9569_drop_table.py +62 -0
- 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 +29 -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/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/c90a7c76e996_job_id_in_history_run.py +1 -1
- fractal_server/migrations/versions/caba9fb1ea5e_drop_useroauth_user_settings_id.py +49 -0
- 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/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 +37 -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 +5 -10
- 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 +1 -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 +9 -4
- fractal_server/runner/v2/_slurm_ssh.py +11 -5
- fractal_server/runner/v2/_slurm_sudo.py +11 -5
- fractal_server/runner/v2/db_tools.py +0 -1
- fractal_server/runner/v2/deduplicate_list.py +2 -1
- fractal_server/runner/v2/runner.py +11 -14
- fractal_server/runner/v2/runner_functions.py +11 -14
- fractal_server/runner/v2/submit_workflow.py +7 -6
- 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 +1 -1
- fractal_server/tasks/v2/local/collect.py +10 -12
- fractal_server/tasks/v2/local/collect_pixi.py +9 -10
- fractal_server/tasks/v2/local/deactivate.py +7 -8
- fractal_server/tasks/v2/local/deactivate_pixi.py +4 -4
- fractal_server/tasks/v2/local/delete.py +1 -3
- fractal_server/tasks/v2/local/reactivate.py +7 -7
- fractal_server/tasks/v2/local/reactivate_pixi.py +7 -7
- fractal_server/tasks/v2/ssh/_utils.py +3 -3
- fractal_server/tasks/v2/ssh/collect.py +14 -19
- fractal_server/tasks/v2/ssh/collect_pixi.py +17 -19
- fractal_server/tasks/v2/ssh/deactivate.py +10 -8
- fractal_server/tasks/v2/ssh/deactivate_pixi.py +6 -5
- fractal_server/tasks/v2/ssh/delete.py +7 -5
- fractal_server/tasks/v2/ssh/reactivate.py +11 -11
- fractal_server/tasks/v2/ssh/reactivate_pixi.py +8 -9
- 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 +3 -3
- fractal_server/tasks/v2/utils_package_names.py +1 -2
- fractal_server/tasks/v2/utils_pixi.py +1 -3
- fractal_server/types/__init__.py +76 -1
- fractal_server/types/validators/_common_validators.py +1 -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.1a0.dist-info → fractal_server-2.17.2.dist-info}/METADATA +1 -1
- fractal_server-2.17.2.dist-info/RECORD +265 -0
- fractal_server/app/models/user_settings.py +0 -37
- fractal_server/app/routes/admin/v2/project.py +0 -41
- fractal_server/data_migrations/2_17_0.py +0 -339
- fractal_server-2.17.1a0.dist-info/RECORD +0 -262
- {fractal_server-2.17.1a0.dist-info → fractal_server-2.17.2.dist-info}/WHEEL +0 -0
- {fractal_server-2.17.1a0.dist-info → fractal_server-2.17.2.dist-info}/entry_points.txt +0 -0
- {fractal_server-2.17.1a0.dist-info → fractal_server-2.17.2.dist-info}/licenses/LICENSE +0 -0
|
@@ -6,40 +6,42 @@ from fastapi.responses import JSONResponse
|
|
|
6
6
|
from sqlmodel import func
|
|
7
7
|
from sqlmodel import select
|
|
8
8
|
|
|
9
|
-
from ._aux_functions import _get_dataset_check_owner
|
|
10
|
-
from ._aux_functions import _get_submitted_job_or_none
|
|
11
|
-
from ._aux_functions import _get_workflow_check_owner
|
|
12
|
-
from ._aux_functions_history import _verify_workflow_and_dataset_access
|
|
13
|
-
from ._aux_functions_history import get_history_run_or_404
|
|
14
|
-
from ._aux_functions_history import get_history_unit_or_404
|
|
15
|
-
from ._aux_functions_history import get_wftask_check_owner
|
|
16
|
-
from ._aux_functions_history import read_log_file
|
|
17
|
-
from .images import ImagePage
|
|
18
|
-
from .images import ImageQuery
|
|
19
9
|
from fractal_server.app.db import AsyncSession
|
|
20
10
|
from fractal_server.app.db import get_async_db
|
|
21
11
|
from fractal_server.app.models import UserOAuth
|
|
22
12
|
from fractal_server.app.models.v2 import HistoryImageCache
|
|
23
13
|
from fractal_server.app.models.v2 import HistoryRun
|
|
24
14
|
from fractal_server.app.models.v2 import HistoryUnit
|
|
15
|
+
from fractal_server.app.models.v2 import JobV2
|
|
25
16
|
from fractal_server.app.models.v2 import TaskV2
|
|
26
17
|
from fractal_server.app.routes.auth import current_user_act_ver_prof
|
|
27
|
-
from fractal_server.app.routes.pagination import get_pagination_params
|
|
28
18
|
from fractal_server.app.routes.pagination import PaginationRequest
|
|
29
19
|
from fractal_server.app.routes.pagination import PaginationResponse
|
|
20
|
+
from fractal_server.app.routes.pagination import get_pagination_params
|
|
30
21
|
from fractal_server.app.schemas.v2 import HistoryRunRead
|
|
31
22
|
from fractal_server.app.schemas.v2 import HistoryRunReadAggregated
|
|
32
23
|
from fractal_server.app.schemas.v2 import HistoryUnitRead
|
|
33
24
|
from fractal_server.app.schemas.v2 import HistoryUnitStatus
|
|
34
25
|
from fractal_server.app.schemas.v2 import HistoryUnitStatusWithUnset
|
|
35
26
|
from fractal_server.app.schemas.v2 import ImageLogsRequest
|
|
36
|
-
from fractal_server.images.status_tools import enrich_images_unsorted_async
|
|
37
27
|
from fractal_server.images.status_tools import IMAGE_STATUS_KEY
|
|
28
|
+
from fractal_server.images.status_tools import enrich_images_unsorted_async
|
|
38
29
|
from fractal_server.images.tools import aggregate_attributes
|
|
39
30
|
from fractal_server.images.tools import aggregate_types
|
|
40
31
|
from fractal_server.images.tools import filter_image_list
|
|
41
32
|
from fractal_server.logger import set_logger
|
|
42
33
|
|
|
34
|
+
from ._aux_functions import _get_dataset_check_owner
|
|
35
|
+
from ._aux_functions import _get_submitted_job_or_none
|
|
36
|
+
from ._aux_functions import _get_workflow_check_owner
|
|
37
|
+
from ._aux_functions_history import _verify_workflow_and_dataset_access
|
|
38
|
+
from ._aux_functions_history import get_history_run_or_404
|
|
39
|
+
from ._aux_functions_history import get_history_unit_or_404
|
|
40
|
+
from ._aux_functions_history import get_wftask_check_owner
|
|
41
|
+
from ._aux_functions_history import read_log_file
|
|
42
|
+
from .images import ImagePage
|
|
43
|
+
from .images import ImageQuery
|
|
44
|
+
|
|
43
45
|
|
|
44
46
|
def check_historyrun_related_to_dataset_and_wftask(
|
|
45
47
|
history_run: HistoryRun,
|
|
@@ -135,19 +137,19 @@ async def get_workflow_tasks_statuses(
|
|
|
135
137
|
logger.debug(f"C1: {wftask.id=} not in {running_wftask_ids=}.")
|
|
136
138
|
response[wftask.id] = dict(status=latest_run.status)
|
|
137
139
|
|
|
138
|
-
response[wftask.id][
|
|
139
|
-
|
|
140
|
-
|
|
140
|
+
response[wftask.id]["num_available_images"] = (
|
|
141
|
+
latest_run.num_available_images
|
|
142
|
+
)
|
|
141
143
|
|
|
142
144
|
for target_status in HistoryUnitStatus:
|
|
143
145
|
stm = (
|
|
144
146
|
select(func.count(HistoryImageCache.zarr_url))
|
|
145
|
-
.join(
|
|
147
|
+
.join(
|
|
148
|
+
HistoryUnit,
|
|
149
|
+
HistoryImageCache.latest_history_unit_id == HistoryUnit.id,
|
|
150
|
+
)
|
|
146
151
|
.where(HistoryImageCache.dataset_id == dataset_id)
|
|
147
152
|
.where(HistoryImageCache.workflowtask_id == wftask.id)
|
|
148
|
-
.where(
|
|
149
|
-
HistoryImageCache.latest_history_unit_id == HistoryUnit.id
|
|
150
|
-
)
|
|
151
153
|
.where(HistoryUnit.status == target_status)
|
|
152
154
|
)
|
|
153
155
|
res = await db.execute(stm)
|
|
@@ -444,11 +446,20 @@ async def get_image_log(
|
|
|
444
446
|
db=db,
|
|
445
447
|
)
|
|
446
448
|
|
|
449
|
+
# Get job.working_dir
|
|
450
|
+
res = await db.execute(
|
|
451
|
+
select(JobV2.working_dir)
|
|
452
|
+
.join(HistoryRun, HistoryRun.job_id == JobV2.id)
|
|
453
|
+
.where(HistoryRun.id == history_unit.history_run_id)
|
|
454
|
+
)
|
|
455
|
+
job_working_dir = res.scalar_one_or_none()
|
|
456
|
+
|
|
447
457
|
# Get log or placeholder text
|
|
448
458
|
log = read_log_file(
|
|
449
459
|
logfile=history_unit.logfile,
|
|
450
|
-
|
|
460
|
+
task_name=wftask.task.name,
|
|
451
461
|
dataset_id=request_data.dataset_id,
|
|
462
|
+
job_working_dir=job_working_dir,
|
|
452
463
|
)
|
|
453
464
|
return JSONResponse(content=log)
|
|
454
465
|
|
|
@@ -495,11 +506,14 @@ async def get_history_unit_log(
|
|
|
495
506
|
workflowtask_id=workflowtask_id,
|
|
496
507
|
)
|
|
497
508
|
|
|
509
|
+
job = await db.get(JobV2, history_run.job_id)
|
|
510
|
+
|
|
498
511
|
# Get log or placeholder text
|
|
499
512
|
log = read_log_file(
|
|
500
513
|
logfile=history_unit.logfile,
|
|
501
|
-
|
|
514
|
+
task_name=wftask.task.name,
|
|
502
515
|
dataset_id=dataset_id,
|
|
516
|
+
job_working_dir=job.working_dir,
|
|
503
517
|
)
|
|
504
518
|
return JSONResponse(content=log)
|
|
505
519
|
|
|
@@ -8,15 +8,14 @@ from pydantic import Field
|
|
|
8
8
|
from sqlalchemy.orm.attributes import flag_modified
|
|
9
9
|
from sqlmodel import delete
|
|
10
10
|
|
|
11
|
-
from ._aux_functions import _get_dataset_check_owner
|
|
12
11
|
from fractal_server.app.db import AsyncSession
|
|
13
12
|
from fractal_server.app.db import get_async_db
|
|
14
13
|
from fractal_server.app.models import HistoryImageCache
|
|
15
14
|
from fractal_server.app.models import UserOAuth
|
|
16
15
|
from fractal_server.app.routes.auth import current_user_act_ver_prof
|
|
17
|
-
from fractal_server.app.routes.pagination import get_pagination_params
|
|
18
16
|
from fractal_server.app.routes.pagination import PaginationRequest
|
|
19
17
|
from fractal_server.app.routes.pagination import PaginationResponse
|
|
18
|
+
from fractal_server.app.routes.pagination import get_pagination_params
|
|
20
19
|
from fractal_server.images import SingleImage
|
|
21
20
|
from fractal_server.images import SingleImageUpdate
|
|
22
21
|
from fractal_server.images.tools import aggregate_attributes
|
|
@@ -27,6 +26,8 @@ from fractal_server.types import AttributeFilters
|
|
|
27
26
|
from fractal_server.types import ImageAttributeValue
|
|
28
27
|
from fractal_server.types import TypeFilters
|
|
29
28
|
|
|
29
|
+
from ._aux_functions import _get_dataset_check_owner
|
|
30
|
+
|
|
30
31
|
router = APIRouter()
|
|
31
32
|
|
|
32
33
|
|
|
@@ -10,21 +10,22 @@ from fastapi import status
|
|
|
10
10
|
from fastapi.responses import StreamingResponse
|
|
11
11
|
from sqlmodel import select
|
|
12
12
|
|
|
13
|
-
from
|
|
14
|
-
from
|
|
15
|
-
from ....db import get_async_db
|
|
16
|
-
from ....models.v2 import JobV2
|
|
17
|
-
from ....models.v2 import ProjectV2
|
|
18
|
-
from ....schemas.v2 import JobReadV2
|
|
19
|
-
from ....schemas.v2 import JobStatusTypeV2
|
|
20
|
-
from ...aux._job import _write_shutdown_file
|
|
21
|
-
from ...aux._runner import _check_shutdown_is_supported
|
|
22
|
-
from ._aux_functions import _get_job_check_owner
|
|
23
|
-
from ._aux_functions import _get_project_check_owner
|
|
24
|
-
from ._aux_functions import _get_workflow_check_owner
|
|
13
|
+
from fractal_server.app.db import AsyncSession
|
|
14
|
+
from fractal_server.app.db import get_async_db
|
|
25
15
|
from fractal_server.app.models import UserOAuth
|
|
16
|
+
from fractal_server.app.models.v2 import JobV2
|
|
17
|
+
from fractal_server.app.models.v2 import LinkUserProjectV2
|
|
26
18
|
from fractal_server.app.routes.auth import current_user_act_ver_prof
|
|
19
|
+
from fractal_server.app.routes.aux._job import _write_shutdown_file
|
|
20
|
+
from fractal_server.app.routes.aux._runner import _check_shutdown_is_supported
|
|
21
|
+
from fractal_server.app.schemas.v2 import JobReadV2
|
|
22
|
+
from fractal_server.app.schemas.v2 import JobStatusTypeV2
|
|
27
23
|
from fractal_server.runner.filenames import WORKFLOW_LOG_FILENAME
|
|
24
|
+
from fractal_server.zip_tools import _zip_folder_to_byte_stream_iterator
|
|
25
|
+
|
|
26
|
+
from ._aux_functions import _get_job_check_owner
|
|
27
|
+
from ._aux_functions import _get_project_check_owner
|
|
28
|
+
from ._aux_functions import _get_workflow_check_owner
|
|
28
29
|
|
|
29
30
|
|
|
30
31
|
# https://docs.python.org/3/library/asyncio-task.html#asyncio.to_thread
|
|
@@ -48,8 +49,10 @@ async def get_user_jobs(
|
|
|
48
49
|
"""
|
|
49
50
|
stm = (
|
|
50
51
|
select(JobV2)
|
|
51
|
-
.join(
|
|
52
|
-
|
|
52
|
+
.join(
|
|
53
|
+
LinkUserProjectV2, LinkUserProjectV2.project_id == JobV2.project_id
|
|
54
|
+
)
|
|
55
|
+
.where(LinkUserProjectV2.user_id == user.id)
|
|
53
56
|
)
|
|
54
57
|
res = await db.execute(stm)
|
|
55
58
|
job_list = res.scalars().all()
|
|
@@ -5,21 +5,22 @@ from fastapi.responses import JSONResponse
|
|
|
5
5
|
from pydantic import BaseModel
|
|
6
6
|
from pydantic import Field
|
|
7
7
|
|
|
8
|
-
from ._aux_functions import _get_dataset_check_owner
|
|
9
|
-
from ._aux_functions import _get_workflow_task_check_owner
|
|
10
|
-
from .images import ImageQuery
|
|
11
8
|
from fractal_server.app.db import AsyncSession
|
|
12
9
|
from fractal_server.app.db import get_async_db
|
|
13
10
|
from fractal_server.app.models import UserOAuth
|
|
14
11
|
from fractal_server.app.routes.auth import current_user_act_ver_prof
|
|
15
12
|
from fractal_server.app.schemas.v2 import HistoryUnitStatus
|
|
16
13
|
from fractal_server.app.schemas.v2 import TaskType
|
|
17
|
-
from fractal_server.images.status_tools import enrich_images_unsorted_async
|
|
18
14
|
from fractal_server.images.status_tools import IMAGE_STATUS_KEY
|
|
15
|
+
from fractal_server.images.status_tools import enrich_images_unsorted_async
|
|
19
16
|
from fractal_server.images.tools import aggregate_types
|
|
20
17
|
from fractal_server.images.tools import filter_image_list
|
|
21
18
|
from fractal_server.types import AttributeFilters
|
|
22
19
|
|
|
20
|
+
from ._aux_functions import _get_dataset_check_owner
|
|
21
|
+
from ._aux_functions import _get_workflow_task_check_owner
|
|
22
|
+
from .images import ImageQuery
|
|
23
|
+
|
|
23
24
|
router = APIRouter()
|
|
24
25
|
|
|
25
26
|
|
|
@@ -5,22 +5,25 @@ from fastapi import Response
|
|
|
5
5
|
from fastapi import status
|
|
6
6
|
from sqlmodel import select
|
|
7
7
|
|
|
8
|
-
from
|
|
9
|
-
from
|
|
10
|
-
from
|
|
11
|
-
from
|
|
12
|
-
from
|
|
13
|
-
from
|
|
14
|
-
from
|
|
15
|
-
from
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
from
|
|
8
|
+
from fractal_server.app.db import AsyncSession
|
|
9
|
+
from fractal_server.app.db import get_async_db
|
|
10
|
+
from fractal_server.app.models import UserOAuth
|
|
11
|
+
from fractal_server.app.models.v2 import JobV2
|
|
12
|
+
from fractal_server.app.models.v2 import LinkUserProjectV2
|
|
13
|
+
from fractal_server.app.models.v2 import ProjectV2
|
|
14
|
+
from fractal_server.app.routes.auth import current_user_act_ver_prof
|
|
15
|
+
from fractal_server.app.routes.aux.validate_user_profile import (
|
|
16
|
+
validate_user_profile,
|
|
17
|
+
)
|
|
18
|
+
from fractal_server.app.schemas.v2 import ProjectCreateV2
|
|
19
|
+
from fractal_server.app.schemas.v2 import ProjectReadV2
|
|
20
|
+
from fractal_server.app.schemas.v2 import ProjectUpdateV2
|
|
21
|
+
from fractal_server.logger import reset_logger_handlers
|
|
22
|
+
from fractal_server.logger import set_logger
|
|
23
|
+
|
|
19
24
|
from ._aux_functions import _check_project_exists
|
|
20
25
|
from ._aux_functions import _get_project_check_owner
|
|
21
26
|
from ._aux_functions import _get_submitted_jobs_statement
|
|
22
|
-
from fractal_server.app.models import UserOAuth
|
|
23
|
-
from fractal_server.app.routes.auth import current_user_act_ver_prof
|
|
24
27
|
|
|
25
28
|
router = APIRouter()
|
|
26
29
|
|
|
@@ -35,7 +38,7 @@ async def get_list_project(
|
|
|
35
38
|
"""
|
|
36
39
|
stm = (
|
|
37
40
|
select(ProjectV2)
|
|
38
|
-
.join(LinkUserProjectV2)
|
|
41
|
+
.join(LinkUserProjectV2, LinkUserProjectV2.project_id == ProjectV2.id)
|
|
39
42
|
.where(LinkUserProjectV2.user_id == user.id)
|
|
40
43
|
)
|
|
41
44
|
res = await db.execute(stm)
|
|
@@ -67,12 +70,14 @@ async def create_project(
|
|
|
67
70
|
)
|
|
68
71
|
|
|
69
72
|
db_project = ProjectV2(**project.model_dump(), resource_id=resource_id)
|
|
70
|
-
db_project.user_list.append(user)
|
|
71
|
-
|
|
72
73
|
db.add(db_project)
|
|
74
|
+
await db.flush()
|
|
75
|
+
|
|
76
|
+
link = LinkUserProjectV2(project_id=db_project.id, user_id=user.id)
|
|
77
|
+
db.add(link)
|
|
78
|
+
|
|
73
79
|
await db.commit()
|
|
74
80
|
await db.refresh(db_project)
|
|
75
|
-
await db.close()
|
|
76
81
|
|
|
77
82
|
return db_project
|
|
78
83
|
|
|
@@ -3,17 +3,18 @@ from fastapi import Depends
|
|
|
3
3
|
from fastapi import HTTPException
|
|
4
4
|
from fastapi import status
|
|
5
5
|
|
|
6
|
-
from
|
|
7
|
-
from
|
|
8
|
-
from
|
|
9
|
-
from
|
|
10
|
-
from
|
|
11
|
-
from
|
|
6
|
+
from fractal_server.app.db import AsyncSession
|
|
7
|
+
from fractal_server.app.db import get_async_db
|
|
8
|
+
from fractal_server.app.models import UserOAuth
|
|
9
|
+
from fractal_server.app.models.v2 import JobV2
|
|
10
|
+
from fractal_server.app.routes.auth import current_user_act_ver_prof
|
|
11
|
+
from fractal_server.app.schemas.v2.status_legacy import LegacyStatusReadV2
|
|
12
|
+
from fractal_server.app.schemas.v2.status_legacy import WorkflowTaskStatusTypeV2
|
|
13
|
+
from fractal_server.logger import set_logger
|
|
14
|
+
|
|
12
15
|
from ._aux_functions import _get_dataset_check_owner
|
|
13
16
|
from ._aux_functions import _get_submitted_jobs_statement
|
|
14
17
|
from ._aux_functions import _get_workflow_check_owner
|
|
15
|
-
from fractal_server.app.models import UserOAuth
|
|
16
|
-
from fractal_server.app.routes.auth import current_user_act_ver_prof
|
|
17
18
|
|
|
18
19
|
router = APIRouter()
|
|
19
20
|
|
|
@@ -122,9 +123,9 @@ async def get_workflowtask_status(
|
|
|
122
123
|
first_submitted_index = 0
|
|
123
124
|
|
|
124
125
|
for wftask in running_job_wftasks[first_submitted_index:]:
|
|
125
|
-
workflow_tasks_status_dict[
|
|
126
|
-
|
|
127
|
-
|
|
126
|
+
workflow_tasks_status_dict[wftask.id] = (
|
|
127
|
+
WorkflowTaskStatusTypeV2.SUBMITTED
|
|
128
|
+
)
|
|
128
129
|
|
|
129
130
|
# The last workflow task that is included in the submitted job is also
|
|
130
131
|
# the positional-last workflow task to be included in the response.
|
|
@@ -10,11 +10,6 @@ from fastapi import Request
|
|
|
10
10
|
from fastapi import status
|
|
11
11
|
from sqlmodel import select
|
|
12
12
|
|
|
13
|
-
from ...aux.validate_user_profile import validate_user_profile
|
|
14
|
-
from ._aux_functions import _get_dataset_check_owner
|
|
15
|
-
from ._aux_functions import _get_workflow_check_owner
|
|
16
|
-
from ._aux_functions import clean_app_job_list_v2
|
|
17
|
-
from ._aux_functions_tasks import _check_type_filters_compatibility
|
|
18
13
|
from fractal_server.app.db import AsyncSession
|
|
19
14
|
from fractal_server.app.db import get_async_db
|
|
20
15
|
from fractal_server.app.models import Profile
|
|
@@ -25,6 +20,9 @@ from fractal_server.app.routes.api.v2._aux_functions_tasks import (
|
|
|
25
20
|
_get_task_read_access,
|
|
26
21
|
)
|
|
27
22
|
from fractal_server.app.routes.auth import current_user_act_ver_prof
|
|
23
|
+
from fractal_server.app.routes.aux.validate_user_profile import (
|
|
24
|
+
validate_user_profile,
|
|
25
|
+
)
|
|
28
26
|
from fractal_server.app.schemas.v2 import JobCreateV2
|
|
29
27
|
from fractal_server.app.schemas.v2 import JobReadV2
|
|
30
28
|
from fractal_server.app.schemas.v2 import JobStatusTypeV2
|
|
@@ -37,6 +35,11 @@ from fractal_server.runner.set_start_and_last_task_index import (
|
|
|
37
35
|
from fractal_server.runner.v2.submit_workflow import submit_workflow
|
|
38
36
|
from fractal_server.syringe import Inject
|
|
39
37
|
|
|
38
|
+
from ._aux_functions import _get_dataset_check_owner
|
|
39
|
+
from ._aux_functions import _get_workflow_check_owner
|
|
40
|
+
from ._aux_functions import clean_app_job_list_v2
|
|
41
|
+
from ._aux_functions_tasks import _check_type_filters_compatibility
|
|
42
|
+
|
|
40
43
|
FRACTAL_CACHE_DIR = ".fractal_cache"
|
|
41
44
|
router = APIRouter()
|
|
42
45
|
logger = set_logger(__name__)
|
|
@@ -63,10 +66,7 @@ async def apply_workflow(
|
|
|
63
66
|
# requests take place at the same time and `clean_app_job_list_v2` is
|
|
64
67
|
# somewhat slow.
|
|
65
68
|
settings = Inject(get_settings)
|
|
66
|
-
if (
|
|
67
|
-
len(request.app.state.jobsV2)
|
|
68
|
-
> settings.FRACTAL_API_MAX_JOB_LIST_LENGTH
|
|
69
|
-
):
|
|
69
|
+
if len(request.app.state.jobsV2) > settings.FRACTAL_API_MAX_JOB_LIST_LENGTH:
|
|
70
70
|
new_jobs_list = await clean_app_job_list_v2(
|
|
71
71
|
db, request.app.state.jobsV2
|
|
72
72
|
)
|
|
@@ -153,8 +153,7 @@ async def apply_workflow(
|
|
|
153
153
|
raise HTTPException(
|
|
154
154
|
status_code=status.HTTP_422_UNPROCESSABLE_CONTENT,
|
|
155
155
|
detail=(
|
|
156
|
-
f"Dataset {dataset_id} is already in use "
|
|
157
|
-
"in submitted job(s)."
|
|
156
|
+
f"Dataset {dataset_id} is already in use in submitted job(s)."
|
|
158
157
|
),
|
|
159
158
|
)
|
|
160
159
|
|
|
@@ -206,7 +205,7 @@ async def apply_workflow(
|
|
|
206
205
|
workflow.model_dump_json(exclude={"task_list"})
|
|
207
206
|
),
|
|
208
207
|
project_dump=json.loads(
|
|
209
|
-
project.model_dump_json(exclude={"
|
|
208
|
+
project.model_dump_json(exclude={"resource_id"})
|
|
210
209
|
),
|
|
211
210
|
**job_create.model_dump(),
|
|
212
211
|
)
|
|
@@ -9,7 +9,9 @@ from sqlmodel import func
|
|
|
9
9
|
from sqlmodel import or_
|
|
10
10
|
from sqlmodel import select
|
|
11
11
|
|
|
12
|
-
from
|
|
12
|
+
from fractal_server.app.routes.aux.validate_user_profile import (
|
|
13
|
+
validate_user_profile,
|
|
14
|
+
)
|
|
13
15
|
from ._aux_functions import _get_user_resource_id
|
|
14
16
|
from ._aux_functions_tasks import _get_task_full_access
|
|
15
17
|
from ._aux_functions_tasks import _get_task_read_access
|
|
@@ -52,8 +54,7 @@ async def get_list_task(
|
|
|
52
54
|
|
|
53
55
|
stm = (
|
|
54
56
|
select(TaskV2)
|
|
55
|
-
.join(TaskGroupV2)
|
|
56
|
-
.where(TaskGroupV2.id == TaskV2.taskgroupv2_id)
|
|
57
|
+
.join(TaskGroupV2, TaskGroupV2.id == TaskV2.taskgroupv2_id)
|
|
57
58
|
.where(TaskGroupV2.resource_id == user_resource_id)
|
|
58
59
|
.where(
|
|
59
60
|
or_(
|
|
@@ -8,39 +8,32 @@ from fastapi import File
|
|
|
8
8
|
from fastapi import Form
|
|
9
9
|
from fastapi import HTTPException
|
|
10
10
|
from fastapi import Response
|
|
11
|
-
from fastapi import status
|
|
12
11
|
from fastapi import UploadFile
|
|
12
|
+
from fastapi import status
|
|
13
13
|
from pydantic import BaseModel
|
|
14
|
-
from pydantic import model_validator
|
|
15
14
|
from pydantic import ValidationError
|
|
15
|
+
from pydantic import model_validator
|
|
16
16
|
|
|
17
|
-
from
|
|
18
|
-
from
|
|
19
|
-
from ....db import AsyncSession
|
|
20
|
-
from ....db import get_async_db
|
|
21
|
-
from ....models.v2 import TaskGroupV2
|
|
22
|
-
from ....schemas.v2 import FractalUploadedFile
|
|
23
|
-
from ....schemas.v2 import TaskCollectPipV2
|
|
24
|
-
from ....schemas.v2 import TaskGroupActivityStatusV2
|
|
25
|
-
from ....schemas.v2 import TaskGroupActivityV2Read
|
|
26
|
-
from ....schemas.v2 import TaskGroupCreateV2Strict
|
|
27
|
-
from ...aux.validate_user_profile import validate_user_profile
|
|
28
|
-
from ._aux_functions_task_lifecycle import get_package_version_from_pypi
|
|
29
|
-
from ._aux_functions_tasks import _get_valid_user_group_id
|
|
30
|
-
from ._aux_functions_tasks import _verify_non_duplication_group_constraint
|
|
31
|
-
from ._aux_functions_tasks import _verify_non_duplication_group_path
|
|
32
|
-
from ._aux_functions_tasks import _verify_non_duplication_user_constraint
|
|
17
|
+
from fractal_server.app.db import AsyncSession
|
|
18
|
+
from fractal_server.app.db import get_async_db
|
|
33
19
|
from fractal_server.app.models import UserOAuth
|
|
34
20
|
from fractal_server.app.models.v2 import TaskGroupActivityV2
|
|
21
|
+
from fractal_server.app.models.v2 import TaskGroupV2
|
|
35
22
|
from fractal_server.app.routes.auth import current_user_act_ver_prof
|
|
36
|
-
from fractal_server.app.
|
|
37
|
-
|
|
38
|
-
TaskGroupActivityActionV2,
|
|
23
|
+
from fractal_server.app.routes.aux.validate_user_profile import (
|
|
24
|
+
validate_user_profile,
|
|
39
25
|
)
|
|
26
|
+
from fractal_server.app.schemas.v2 import FractalUploadedFile
|
|
27
|
+
from fractal_server.app.schemas.v2 import ResourceType
|
|
28
|
+
from fractal_server.app.schemas.v2 import TaskCollectPipV2
|
|
29
|
+
from fractal_server.app.schemas.v2 import TaskGroupActivityActionV2
|
|
30
|
+
from fractal_server.app.schemas.v2 import TaskGroupActivityStatusV2
|
|
31
|
+
from fractal_server.app.schemas.v2 import TaskGroupActivityV2Read
|
|
32
|
+
from fractal_server.app.schemas.v2 import TaskGroupCreateV2Strict
|
|
40
33
|
from fractal_server.app.schemas.v2 import TaskGroupV2OriginEnum
|
|
41
|
-
from fractal_server.
|
|
42
|
-
|
|
43
|
-
|
|
34
|
+
from fractal_server.logger import reset_logger_handlers
|
|
35
|
+
from fractal_server.logger import set_logger
|
|
36
|
+
from fractal_server.tasks.v2.local.collect import collect_local
|
|
44
37
|
from fractal_server.tasks.v2.ssh import collect_ssh
|
|
45
38
|
from fractal_server.tasks.v2.utils_package_names import _parse_wheel_filename
|
|
46
39
|
from fractal_server.tasks.v2.utils_package_names import normalize_package_name
|
|
@@ -48,6 +41,11 @@ from fractal_server.tasks.v2.utils_python_interpreter import (
|
|
|
48
41
|
get_python_interpreter,
|
|
49
42
|
)
|
|
50
43
|
|
|
44
|
+
from ._aux_functions_task_lifecycle import get_package_version_from_pypi
|
|
45
|
+
from ._aux_functions_tasks import _get_valid_user_group_id
|
|
46
|
+
from ._aux_functions_tasks import _verify_non_duplication_group_constraint
|
|
47
|
+
from ._aux_functions_tasks import _verify_non_duplication_group_path
|
|
48
|
+
from ._aux_functions_tasks import _verify_non_duplication_user_constraint
|
|
51
49
|
|
|
52
50
|
router = APIRouter()
|
|
53
51
|
|
|
@@ -211,13 +209,13 @@ async def collect_tasks_pip(
|
|
|
211
209
|
|
|
212
210
|
# Set pinned_package_versions
|
|
213
211
|
if task_collect.pinned_package_versions_pre is not None:
|
|
214
|
-
task_group_attrs[
|
|
215
|
-
|
|
216
|
-
|
|
212
|
+
task_group_attrs["pinned_package_versions_pre"] = (
|
|
213
|
+
task_collect.pinned_package_versions_pre
|
|
214
|
+
)
|
|
217
215
|
if task_collect.pinned_package_versions_post is not None:
|
|
218
|
-
task_group_attrs[
|
|
219
|
-
|
|
220
|
-
|
|
216
|
+
task_group_attrs["pinned_package_versions_post"] = (
|
|
217
|
+
task_collect.pinned_package_versions_post
|
|
218
|
+
)
|
|
221
219
|
|
|
222
220
|
# Initialize wheel_file_content as None
|
|
223
221
|
wheel_file = None
|
|
@@ -9,14 +9,13 @@ from fastapi import HTTPException
|
|
|
9
9
|
from fastapi import status
|
|
10
10
|
from sqlalchemy.ext.asyncio import AsyncSession
|
|
11
11
|
|
|
12
|
-
from ...aux.validate_user_profile import validate_user_profile
|
|
13
|
-
from ._aux_functions_tasks import _get_valid_user_group_id
|
|
14
|
-
from ._aux_functions_tasks import _verify_non_duplication_group_constraint
|
|
15
|
-
from ._aux_functions_tasks import _verify_non_duplication_user_constraint
|
|
16
12
|
from fractal_server.app.db import get_async_db
|
|
17
13
|
from fractal_server.app.models import UserOAuth
|
|
18
14
|
from fractal_server.app.models.v2 import TaskGroupV2
|
|
19
15
|
from fractal_server.app.routes.auth import current_user_act_ver_prof
|
|
16
|
+
from fractal_server.app.routes.aux.validate_user_profile import (
|
|
17
|
+
validate_user_profile,
|
|
18
|
+
)
|
|
20
19
|
from fractal_server.app.schemas.v2 import ResourceType
|
|
21
20
|
from fractal_server.app.schemas.v2 import TaskCollectCustomV2
|
|
22
21
|
from fractal_server.app.schemas.v2 import TaskCreateV2
|
|
@@ -25,13 +24,15 @@ from fractal_server.app.schemas.v2 import TaskGroupV2OriginEnum
|
|
|
25
24
|
from fractal_server.app.schemas.v2 import TaskReadV2
|
|
26
25
|
from fractal_server.logger import set_logger
|
|
27
26
|
from fractal_server.string_tools import validate_cmd
|
|
28
|
-
from fractal_server.tasks.v2.utils_background import
|
|
29
|
-
prepare_tasks_metadata,
|
|
30
|
-
)
|
|
27
|
+
from fractal_server.tasks.v2.utils_background import prepare_tasks_metadata
|
|
31
28
|
from fractal_server.tasks.v2.utils_database import (
|
|
32
29
|
create_db_tasks_and_update_task_group_async,
|
|
33
30
|
)
|
|
34
31
|
|
|
32
|
+
from ._aux_functions_tasks import _get_valid_user_group_id
|
|
33
|
+
from ._aux_functions_tasks import _verify_non_duplication_group_constraint
|
|
34
|
+
from ._aux_functions_tasks import _verify_non_duplication_user_constraint
|
|
35
|
+
|
|
35
36
|
router = APIRouter()
|
|
36
37
|
|
|
37
38
|
logger = set_logger(__name__)
|
|
@@ -7,8 +7,8 @@ from fastapi import Depends
|
|
|
7
7
|
from fastapi import Form
|
|
8
8
|
from fastapi import HTTPException
|
|
9
9
|
from fastapi import Response
|
|
10
|
-
from fastapi import status
|
|
11
10
|
from fastapi import UploadFile
|
|
11
|
+
from fastapi import status
|
|
12
12
|
|
|
13
13
|
from fractal_server.app.db import AsyncSession
|
|
14
14
|
from fractal_server.app.db import get_async_db
|
|
@@ -43,7 +43,6 @@ from fractal_server.tasks.v2.ssh import collect_ssh_pixi
|
|
|
43
43
|
from fractal_server.tasks.v2.utils_package_names import normalize_package_name
|
|
44
44
|
from fractal_server.types import NonEmptyStr
|
|
45
45
|
|
|
46
|
-
|
|
47
46
|
router = APIRouter()
|
|
48
47
|
|
|
49
48
|
logger = set_logger(__name__)
|
|
@@ -5,17 +5,12 @@ from fastapi import Depends
|
|
|
5
5
|
from fastapi import HTTPException
|
|
6
6
|
from fastapi import status
|
|
7
7
|
from packaging.version import InvalidVersion
|
|
8
|
-
from packaging.version import parse
|
|
9
8
|
from packaging.version import Version
|
|
9
|
+
from packaging.version import parse
|
|
10
10
|
from pydantic.types import AwareDatetime
|
|
11
11
|
from sqlmodel import or_
|
|
12
12
|
from sqlmodel import select
|
|
13
13
|
|
|
14
|
-
from ._aux_functions import _get_user_resource_id
|
|
15
|
-
from ._aux_functions_tasks import _get_task_group_full_access
|
|
16
|
-
from ._aux_functions_tasks import _get_task_group_read_access
|
|
17
|
-
from ._aux_functions_tasks import _verify_non_duplication_group_constraint
|
|
18
|
-
from ._aux_task_group_disambiguation import remove_duplicate_task_groups
|
|
19
14
|
from fractal_server.app.db import AsyncSession
|
|
20
15
|
from fractal_server.app.db import get_async_db
|
|
21
16
|
from fractal_server.app.models import LinkUserGroup
|
|
@@ -36,6 +31,12 @@ from fractal_server.app.schemas.v2 import TaskGroupReadV2
|
|
|
36
31
|
from fractal_server.app.schemas.v2 import TaskGroupUpdateV2
|
|
37
32
|
from fractal_server.logger import set_logger
|
|
38
33
|
|
|
34
|
+
from ._aux_functions import _get_user_resource_id
|
|
35
|
+
from ._aux_functions_tasks import _get_task_group_full_access
|
|
36
|
+
from ._aux_functions_tasks import _get_task_group_read_access
|
|
37
|
+
from ._aux_functions_tasks import _verify_non_duplication_group_constraint
|
|
38
|
+
from ._aux_task_group_disambiguation import remove_duplicate_task_groups
|
|
39
|
+
|
|
39
40
|
router = APIRouter()
|
|
40
41
|
|
|
41
42
|
logger = set_logger(__name__)
|
|
@@ -5,10 +5,6 @@ from fastapi import HTTPException
|
|
|
5
5
|
from fastapi import Response
|
|
6
6
|
from fastapi import status
|
|
7
7
|
|
|
8
|
-
from ._aux_functions_task_lifecycle import check_no_ongoing_activity
|
|
9
|
-
from ._aux_functions_task_lifecycle import check_no_related_workflowtask
|
|
10
|
-
from ._aux_functions_task_lifecycle import check_no_submitted_job
|
|
11
|
-
from ._aux_functions_tasks import _get_task_group_full_access
|
|
12
8
|
from fractal_server.app.db import AsyncSession
|
|
13
9
|
from fractal_server.app.db import get_async_db
|
|
14
10
|
from fractal_server.app.models import UserOAuth
|
|
@@ -36,6 +32,11 @@ from fractal_server.tasks.v2.ssh import reactivate_ssh
|
|
|
36
32
|
from fractal_server.tasks.v2.ssh import reactivate_ssh_pixi
|
|
37
33
|
from fractal_server.utils import get_timestamp
|
|
38
34
|
|
|
35
|
+
from ._aux_functions_task_lifecycle import check_no_ongoing_activity
|
|
36
|
+
from ._aux_functions_task_lifecycle import check_no_related_workflowtask
|
|
37
|
+
from ._aux_functions_task_lifecycle import check_no_submitted_job
|
|
38
|
+
from ._aux_functions_tasks import _get_task_group_full_access
|
|
39
|
+
|
|
39
40
|
router = APIRouter()
|
|
40
41
|
|
|
41
42
|
|
|
@@ -212,8 +213,7 @@ async def reactivate_task_group(
|
|
|
212
213
|
raise HTTPException(
|
|
213
214
|
status_code=status.HTTP_422_UNPROCESSABLE_CONTENT,
|
|
214
215
|
detail=(
|
|
215
|
-
"Cannot reactivate a task group with "
|
|
216
|
-
f"{task_group.env_info=}."
|
|
216
|
+
f"Cannot reactivate a task group with {task_group.env_info=}."
|
|
217
217
|
),
|
|
218
218
|
)
|
|
219
219
|
|
|
@@ -2,32 +2,33 @@ from fastapi import APIRouter
|
|
|
2
2
|
from fastapi import Depends
|
|
3
3
|
from fastapi import HTTPException
|
|
4
4
|
from fastapi import status
|
|
5
|
-
from packaging.version import parse
|
|
6
5
|
from packaging.version import Version
|
|
6
|
+
from packaging.version import parse
|
|
7
7
|
from pydantic import BaseModel
|
|
8
8
|
from pydantic import ConfigDict
|
|
9
|
+
from sqlmodel import String
|
|
9
10
|
from sqlmodel import cast
|
|
10
11
|
from sqlmodel import or_
|
|
11
12
|
from sqlmodel import select
|
|
12
|
-
from sqlmodel import String
|
|
13
13
|
|
|
14
|
-
from
|
|
15
|
-
from
|
|
16
|
-
from
|
|
17
|
-
from ....models.v2 import TaskV2
|
|
18
|
-
from ._aux_functions import _get_workflow_check_owner
|
|
19
|
-
from ._aux_functions import _get_workflow_task_check_owner
|
|
20
|
-
from ._aux_functions_task_version_update import get_new_workflow_task_meta
|
|
21
|
-
from ._aux_functions_tasks import _check_type_filters_compatibility
|
|
22
|
-
from ._aux_functions_tasks import _get_task_group_or_404
|
|
23
|
-
from ._aux_functions_tasks import _get_task_read_access
|
|
14
|
+
from fractal_server.app.db import AsyncSession
|
|
15
|
+
from fractal_server.app.db import get_async_db
|
|
16
|
+
from fractal_server.app.models import LinkUserGroup
|
|
24
17
|
from fractal_server.app.models import UserOAuth
|
|
25
18
|
from fractal_server.app.models.v2 import TaskGroupV2
|
|
19
|
+
from fractal_server.app.models.v2 import TaskV2
|
|
26
20
|
from fractal_server.app.routes.auth import current_user_act_ver_prof
|
|
27
21
|
from fractal_server.app.schemas.v2 import TaskType
|
|
28
22
|
from fractal_server.app.schemas.v2 import WorkflowTaskReadV2
|
|
29
23
|
from fractal_server.app.schemas.v2 import WorkflowTaskReplaceV2
|
|
30
24
|
|
|
25
|
+
from ._aux_functions import _get_workflow_check_owner
|
|
26
|
+
from ._aux_functions import _get_workflow_task_check_owner
|
|
27
|
+
from ._aux_functions_task_version_update import get_new_workflow_task_meta
|
|
28
|
+
from ._aux_functions_tasks import _check_type_filters_compatibility
|
|
29
|
+
from ._aux_functions_tasks import _get_task_group_or_404
|
|
30
|
+
from ._aux_functions_tasks import _get_task_read_access
|
|
31
|
+
|
|
31
32
|
router = APIRouter()
|
|
32
33
|
|
|
33
34
|
|