fractal-server 2.17.1a1__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 -0
- fractal_server/app/models/linkuserproject.py +3 -1
- fractal_server/app/models/security.py +21 -3
- 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 +4 -10
- fractal_server/app/models/v2/resource.py +4 -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 +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/config/_data.py +36 -25
- fractal_server/config/_database.py +19 -20
- fractal_server/config/_email.py +30 -38
- fractal_server/config/_main.py +33 -52
- 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 +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/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 +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/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.1a1.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/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.17.2.dist-info}/WHEEL +0 -0
- {fractal_server-2.17.1a1.dist-info → fractal_server-2.17.2.dist-info}/entry_points.txt +0 -0
- {fractal_server-2.17.1a1.dist-info → fractal_server-2.17.2.dist-info}/licenses/LICENSE +0 -0
|
@@ -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
|
|
|
@@ -8,26 +8,26 @@ from fastapi import status
|
|
|
8
8
|
from pydantic import BaseModel
|
|
9
9
|
from sqlmodel import select
|
|
10
10
|
|
|
11
|
-
from
|
|
12
|
-
from
|
|
13
|
-
from
|
|
14
|
-
from
|
|
15
|
-
from
|
|
16
|
-
from
|
|
17
|
-
from
|
|
18
|
-
from
|
|
19
|
-
from
|
|
20
|
-
from
|
|
11
|
+
from fractal_server.app.db import AsyncSession
|
|
12
|
+
from fractal_server.app.db import get_async_db
|
|
13
|
+
from fractal_server.app.models import UserOAuth
|
|
14
|
+
from fractal_server.app.models.v2 import JobV2
|
|
15
|
+
from fractal_server.app.models.v2 import TaskGroupV2
|
|
16
|
+
from fractal_server.app.models.v2 import WorkflowV2
|
|
17
|
+
from fractal_server.app.routes.auth import current_user_act_ver_prof
|
|
18
|
+
from fractal_server.app.schemas.v2 import WorkflowCreateV2
|
|
19
|
+
from fractal_server.app.schemas.v2 import WorkflowExportV2
|
|
20
|
+
from fractal_server.app.schemas.v2 import WorkflowReadV2
|
|
21
|
+
from fractal_server.app.schemas.v2 import WorkflowReadV2WithWarnings
|
|
22
|
+
from fractal_server.app.schemas.v2 import WorkflowUpdateV2
|
|
23
|
+
from fractal_server.images.tools import merge_type_filters
|
|
24
|
+
|
|
21
25
|
from ._aux_functions import _check_workflow_exists
|
|
22
26
|
from ._aux_functions import _get_project_check_owner
|
|
23
27
|
from ._aux_functions import _get_submitted_jobs_statement
|
|
24
28
|
from ._aux_functions import _get_workflow_check_owner
|
|
25
29
|
from ._aux_functions import _workflow_has_submitted_job
|
|
26
30
|
from ._aux_functions_tasks import _add_warnings_to_workflow_tasks
|
|
27
|
-
from fractal_server.app.models import UserOAuth
|
|
28
|
-
from fractal_server.app.models.v2 import TaskGroupV2
|
|
29
|
-
from fractal_server.app.routes.auth import current_user_act_ver_prof
|
|
30
|
-
from fractal_server.images.tools import merge_type_filters
|
|
31
31
|
|
|
32
32
|
router = APIRouter()
|
|
33
33
|
|
|
@@ -275,23 +275,6 @@ async def export_workflow(
|
|
|
275
275
|
return wf
|
|
276
276
|
|
|
277
277
|
|
|
278
|
-
@router.get("/workflow/", response_model=list[WorkflowReadV2])
|
|
279
|
-
async def get_user_workflows(
|
|
280
|
-
user: UserOAuth = Depends(current_user_act_ver_prof),
|
|
281
|
-
db: AsyncSession = Depends(get_async_db),
|
|
282
|
-
) -> list[WorkflowReadV2]:
|
|
283
|
-
"""
|
|
284
|
-
Returns all the workflows of the current user
|
|
285
|
-
"""
|
|
286
|
-
stm = select(WorkflowV2)
|
|
287
|
-
stm = stm.join(ProjectV2).where(
|
|
288
|
-
ProjectV2.user_list.any(UserOAuth.id == user.id)
|
|
289
|
-
)
|
|
290
|
-
res = await db.execute(stm)
|
|
291
|
-
workflow_list = res.scalars().all()
|
|
292
|
-
return workflow_list
|
|
293
|
-
|
|
294
|
-
|
|
295
278
|
class WorkflowTaskTypeFiltersInfo(BaseModel):
|
|
296
279
|
workflowtask_id: int
|
|
297
280
|
current_type_filters: dict[str, bool]
|
|
@@ -5,23 +5,13 @@ from fastapi import status
|
|
|
5
5
|
from sqlmodel import or_
|
|
6
6
|
from sqlmodel import select
|
|
7
7
|
|
|
8
|
-
from
|
|
9
|
-
from
|
|
10
|
-
from ....models.v2 import TaskV2
|
|
11
|
-
from ....models.v2 import WorkflowV2
|
|
12
|
-
from ....schemas.v2 import TaskImportV2Legacy
|
|
13
|
-
from ....schemas.v2 import WorkflowImportV2
|
|
14
|
-
from ....schemas.v2 import WorkflowReadV2WithWarnings
|
|
15
|
-
from ....schemas.v2 import WorkflowTaskCreateV2
|
|
16
|
-
from ._aux_functions import _check_workflow_exists
|
|
17
|
-
from ._aux_functions import _get_project_check_owner
|
|
18
|
-
from ._aux_functions import _get_user_resource_id
|
|
19
|
-
from ._aux_functions import _workflow_insert_task
|
|
20
|
-
from ._aux_functions_tasks import _add_warnings_to_workflow_tasks
|
|
21
|
-
from ._aux_functions_tasks import _check_type_filters_compatibility
|
|
8
|
+
from fractal_server.app.db import AsyncSession
|
|
9
|
+
from fractal_server.app.db import get_async_db
|
|
22
10
|
from fractal_server.app.models import LinkUserGroup
|
|
23
11
|
from fractal_server.app.models import UserOAuth
|
|
24
12
|
from fractal_server.app.models.v2 import TaskGroupV2
|
|
13
|
+
from fractal_server.app.models.v2 import TaskV2
|
|
14
|
+
from fractal_server.app.models.v2 import WorkflowV2
|
|
25
15
|
from fractal_server.app.routes.api.v2._aux_task_group_disambiguation import (
|
|
26
16
|
_disambiguate_task_groups,
|
|
27
17
|
)
|
|
@@ -30,8 +20,19 @@ from fractal_server.app.routes.auth._aux_auth import (
|
|
|
30
20
|
_get_default_usergroup_id_or_none,
|
|
31
21
|
)
|
|
32
22
|
from fractal_server.app.schemas.v2 import TaskImportV2
|
|
23
|
+
from fractal_server.app.schemas.v2 import TaskImportV2Legacy
|
|
24
|
+
from fractal_server.app.schemas.v2 import WorkflowImportV2
|
|
25
|
+
from fractal_server.app.schemas.v2 import WorkflowReadV2WithWarnings
|
|
26
|
+
from fractal_server.app.schemas.v2 import WorkflowTaskCreateV2
|
|
33
27
|
from fractal_server.logger import set_logger
|
|
34
28
|
|
|
29
|
+
from ._aux_functions import _check_workflow_exists
|
|
30
|
+
from ._aux_functions import _get_project_check_owner
|
|
31
|
+
from ._aux_functions import _get_user_resource_id
|
|
32
|
+
from ._aux_functions import _workflow_insert_task
|
|
33
|
+
from ._aux_functions_tasks import _add_warnings_to_workflow_tasks
|
|
34
|
+
from ._aux_functions_tasks import _check_type_filters_compatibility
|
|
35
|
+
|
|
35
36
|
router = APIRouter()
|
|
36
37
|
|
|
37
38
|
|
|
@@ -127,8 +128,7 @@ async def _get_task_by_taskimport(
|
|
|
127
128
|
for task_group in task_groups_list
|
|
128
129
|
if (
|
|
129
130
|
task_group.pkg_name == task_import.pkg_name
|
|
130
|
-
and task_import.name
|
|
131
|
-
in [task.name for task in task_group.task_list]
|
|
131
|
+
and task_import.name in [task.name for task in task_group.task_list]
|
|
132
132
|
)
|
|
133
133
|
]
|
|
134
134
|
if len(matching_task_groups) < 1:
|
|
@@ -146,9 +146,7 @@ async def _get_task_by_taskimport(
|
|
|
146
146
|
"[_get_task_by_taskimport] "
|
|
147
147
|
"No version requested, looking for latest."
|
|
148
148
|
)
|
|
149
|
-
latest_task = max(
|
|
150
|
-
matching_task_groups, key=lambda tg: tg.version or ""
|
|
151
|
-
)
|
|
149
|
+
latest_task = max(matching_task_groups, key=lambda tg: tg.version or "")
|
|
152
150
|
version = latest_task.version
|
|
153
151
|
logger.info(
|
|
154
152
|
f"[_get_task_by_taskimport] Latest version set to {version}."
|