fractal-server 2.14.13__tar.gz → 2.14.14__tar.gz

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.
Files changed (223) hide show
  1. {fractal_server-2.14.13 → fractal_server-2.14.14}/PKG-INFO +1 -1
  2. fractal_server-2.14.14/fractal_server/__init__.py +1 -0
  3. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/routes/api/v2/_aux_task_group_disambiguation.py +1 -1
  4. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/routes/api/v2/pre_submission_checks.py +3 -2
  5. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/routes/api/v2/task.py +5 -4
  6. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/routes/api/v2/task_group.py +11 -11
  7. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/routes/api/v2/task_version_update.py +18 -10
  8. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/routes/api/v2/workflowtask.py +6 -5
  9. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/runner/executors/base_runner.py +38 -17
  10. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/runner/executors/local/runner.py +14 -14
  11. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/runner/executors/slurm_common/base_slurm_runner.py +12 -14
  12. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/runner/v2/runner.py +19 -8
  13. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/runner/v2/runner_functions.py +12 -8
  14. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/schemas/v2/__init__.py +1 -0
  15. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/schemas/v2/dumps.py +2 -2
  16. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/schemas/v2/manifest.py +2 -9
  17. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/schemas/v2/task.py +18 -14
  18. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/schemas/v2/workflowtask.py +2 -2
  19. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/utils.py +0 -49
  20. {fractal_server-2.14.13 → fractal_server-2.14.14}/pyproject.toml +2 -2
  21. fractal_server-2.14.13/fractal_server/__init__.py +0 -1
  22. {fractal_server-2.14.13 → fractal_server-2.14.14}/LICENSE +0 -0
  23. {fractal_server-2.14.13 → fractal_server-2.14.14}/README.md +0 -0
  24. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/__main__.py +0 -0
  25. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/alembic.ini +0 -0
  26. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/__init__.py +0 -0
  27. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/db/__init__.py +0 -0
  28. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/models/__init__.py +0 -0
  29. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/models/linkusergroup.py +0 -0
  30. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/models/linkuserproject.py +0 -0
  31. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/models/security.py +0 -0
  32. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/models/user_settings.py +0 -0
  33. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/models/v2/__init__.py +0 -0
  34. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/models/v2/accounting.py +0 -0
  35. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/models/v2/dataset.py +0 -0
  36. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/models/v2/history.py +0 -0
  37. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/models/v2/job.py +0 -0
  38. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/models/v2/project.py +0 -0
  39. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/models/v2/task.py +0 -0
  40. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/models/v2/task_group.py +0 -0
  41. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/models/v2/workflow.py +0 -0
  42. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/models/v2/workflowtask.py +0 -0
  43. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/routes/__init__.py +0 -0
  44. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/routes/admin/__init__.py +0 -0
  45. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/routes/admin/v2/__init__.py +0 -0
  46. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/routes/admin/v2/accounting.py +0 -0
  47. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/routes/admin/v2/impersonate.py +0 -0
  48. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/routes/admin/v2/job.py +0 -0
  49. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/routes/admin/v2/project.py +0 -0
  50. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/routes/admin/v2/task.py +0 -0
  51. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/routes/admin/v2/task_group.py +0 -0
  52. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/routes/admin/v2/task_group_lifecycle.py +0 -0
  53. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/routes/api/__init__.py +0 -0
  54. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/routes/api/v2/__init__.py +0 -0
  55. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/routes/api/v2/_aux_functions.py +0 -0
  56. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/routes/api/v2/_aux_functions_history.py +0 -0
  57. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/routes/api/v2/_aux_functions_task_lifecycle.py +0 -0
  58. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/routes/api/v2/_aux_functions_task_version_update.py +0 -0
  59. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/routes/api/v2/_aux_functions_tasks.py +0 -0
  60. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/routes/api/v2/dataset.py +0 -0
  61. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/routes/api/v2/history.py +0 -0
  62. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/routes/api/v2/images.py +0 -0
  63. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/routes/api/v2/job.py +0 -0
  64. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/routes/api/v2/project.py +0 -0
  65. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/routes/api/v2/status_legacy.py +0 -0
  66. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/routes/api/v2/submit.py +0 -0
  67. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/routes/api/v2/task_collection.py +0 -0
  68. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/routes/api/v2/task_collection_custom.py +0 -0
  69. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/routes/api/v2/task_group_lifecycle.py +0 -0
  70. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/routes/api/v2/workflow.py +0 -0
  71. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/routes/api/v2/workflow_import.py +0 -0
  72. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/routes/auth/__init__.py +0 -0
  73. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/routes/auth/_aux_auth.py +0 -0
  74. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/routes/auth/current_user.py +0 -0
  75. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/routes/auth/group.py +0 -0
  76. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/routes/auth/login.py +0 -0
  77. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/routes/auth/oauth.py +0 -0
  78. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/routes/auth/register.py +0 -0
  79. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/routes/auth/router.py +0 -0
  80. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/routes/auth/users.py +0 -0
  81. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/routes/aux/__init__.py +0 -0
  82. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/routes/aux/_job.py +0 -0
  83. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/routes/aux/_runner.py +0 -0
  84. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/routes/aux/validate_user_settings.py +0 -0
  85. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/routes/pagination.py +0 -0
  86. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/runner/__init__.py +0 -0
  87. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/runner/components.py +0 -0
  88. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/runner/exceptions.py +0 -0
  89. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/runner/executors/__init__.py +0 -0
  90. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/runner/executors/call_command_wrapper.py +0 -0
  91. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/runner/executors/local/__init__.py +0 -0
  92. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/runner/executors/local/get_local_config.py +0 -0
  93. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/runner/executors/slurm_common/__init__.py +0 -0
  94. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/runner/executors/slurm_common/_batching.py +0 -0
  95. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/runner/executors/slurm_common/_job_states.py +0 -0
  96. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/runner/executors/slurm_common/_slurm_config.py +0 -0
  97. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/runner/executors/slurm_common/get_slurm_config.py +0 -0
  98. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/runner/executors/slurm_common/remote.py +0 -0
  99. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/runner/executors/slurm_common/slurm_job_task_models.py +0 -0
  100. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/runner/executors/slurm_ssh/__init__.py +0 -0
  101. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/runner/executors/slurm_ssh/run_subprocess.py +0 -0
  102. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/runner/executors/slurm_ssh/runner.py +0 -0
  103. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/runner/executors/slurm_ssh/tar_commands.py +0 -0
  104. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/runner/executors/slurm_sudo/__init__.py +0 -0
  105. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/runner/executors/slurm_sudo/_subprocess_run_as_user.py +0 -0
  106. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/runner/executors/slurm_sudo/runner.py +0 -0
  107. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/runner/filenames.py +0 -0
  108. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/runner/set_start_and_last_task_index.py +0 -0
  109. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/runner/shutdown.py +0 -0
  110. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/runner/task_files.py +0 -0
  111. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/runner/v2/__init__.py +0 -0
  112. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/runner/v2/_local.py +0 -0
  113. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/runner/v2/_slurm_ssh.py +0 -0
  114. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/runner/v2/_slurm_sudo.py +0 -0
  115. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/runner/v2/db_tools.py +0 -0
  116. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/runner/v2/deduplicate_list.py +0 -0
  117. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/runner/v2/merge_outputs.py +0 -0
  118. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/runner/v2/submit_workflow.py +0 -0
  119. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/runner/v2/task_interface.py +0 -0
  120. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/runner/versions.py +0 -0
  121. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/schemas/__init__.py +0 -0
  122. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/schemas/user.py +0 -0
  123. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/schemas/user_group.py +0 -0
  124. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/schemas/user_settings.py +0 -0
  125. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/schemas/v2/accounting.py +0 -0
  126. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/schemas/v2/dataset.py +0 -0
  127. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/schemas/v2/history.py +0 -0
  128. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/schemas/v2/job.py +0 -0
  129. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/schemas/v2/project.py +0 -0
  130. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/schemas/v2/status_legacy.py +0 -0
  131. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/schemas/v2/task_collection.py +0 -0
  132. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/schemas/v2/task_group.py +0 -0
  133. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/schemas/v2/workflow.py +0 -0
  134. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/security/__init__.py +0 -0
  135. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/security/signup_email.py +0 -0
  136. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/app/user_settings.py +0 -0
  137. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/config.py +0 -0
  138. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/data_migrations/2_14_10.py +0 -0
  139. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/data_migrations/README.md +0 -0
  140. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/data_migrations/tools.py +0 -0
  141. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/exceptions.py +0 -0
  142. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/gunicorn_fractal.py +0 -0
  143. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/images/__init__.py +0 -0
  144. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/images/models.py +0 -0
  145. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/images/status_tools.py +0 -0
  146. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/images/tools.py +0 -0
  147. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/logger.py +0 -0
  148. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/main.py +0 -0
  149. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/migrations/env.py +0 -0
  150. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/migrations/naming_convention.py +0 -0
  151. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/migrations/versions/034a469ec2eb_task_groups.py +0 -0
  152. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/migrations/versions/091b01f51f88_add_usergroup_and_linkusergroup_table.py +0 -0
  153. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/migrations/versions/19eca0dd47a9_user_settings_project_dir.py +0 -0
  154. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/migrations/versions/1eac13a26c83_drop_v1_tables.py +0 -0
  155. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/migrations/versions/316140ff7ee1_remove_usersettings_cache_dir.py +0 -0
  156. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/migrations/versions/47351f8c7ebc_drop_dataset_filters.py +0 -0
  157. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/migrations/versions/4c308bcaea2b_add_task_args_schema_and_task_args_.py +0 -0
  158. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/migrations/versions/4cedeb448a53_workflowtask_foreign_keys_not_nullables.py +0 -0
  159. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/migrations/versions/501961cfcd85_remove_link_between_v1_and_v2_tasks_.py +0 -0
  160. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/migrations/versions/50a13d6138fd_initial_schema.py +0 -0
  161. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/migrations/versions/5bf02391cfef_v2.py +0 -0
  162. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/migrations/versions/70e77f1c38b0_add_applyworkflow_first_task_index_and_.py +0 -0
  163. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/migrations/versions/71eefd1dd202_add_slurm_accounts.py +0 -0
  164. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/migrations/versions/84bf0fffde30_add_dumps_to_applyworkflow.py +0 -0
  165. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/migrations/versions/8e8f227a3e36_update_taskv2_post_2_7_0.py +0 -0
  166. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/migrations/versions/8f79bd162e35_add_docs_info_and_docs_link_to_task_.py +0 -0
  167. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/migrations/versions/94a47ea2d3ff_remove_cache_dir_slurm_user_and_slurm_.py +0 -0
  168. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/migrations/versions/969d84257cac_add_historyrun_task_id.py +0 -0
  169. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/migrations/versions/97f444d47249_add_applyworkflow_project_dump.py +0 -0
  170. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/migrations/versions/99ea79d9e5d2_add_dataset_history.py +0 -0
  171. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/migrations/versions/9c5ae74c9b98_add_user_settings_table.py +0 -0
  172. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/migrations/versions/9db60297b8b2_set_ondelete.py +0 -0
  173. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/migrations/versions/9fd26a2b0de4_add_workflow_timestamp_created.py +0 -0
  174. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/migrations/versions/a7f4d6137b53_add_workflow_dump_to_applyworkflow.py +0 -0
  175. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/migrations/versions/af1ef1c83c9b_add_accounting_tables.py +0 -0
  176. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/migrations/versions/af8673379a5c_drop_old_filter_columns.py +0 -0
  177. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/migrations/versions/c90a7c76e996_job_id_in_history_run.py +0 -0
  178. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/migrations/versions/d256a7379ab8_taskgroup_activity_and_venv_info_to_.py +0 -0
  179. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/migrations/versions/d4fe3708d309_make_applyworkflow_workflow_dump_non_.py +0 -0
  180. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/migrations/versions/da2cb2ac4255_user_group_viewer_paths.py +0 -0
  181. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/migrations/versions/db09233ad13a_split_filters_and_keep_old_columns.py +0 -0
  182. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/migrations/versions/e75cac726012_make_applyworkflow_start_timestamp_not_.py +0 -0
  183. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/migrations/versions/e81103413827_add_job_type_filters.py +0 -0
  184. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/migrations/versions/efa89c30e0a4_add_project_timestamp_created.py +0 -0
  185. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/migrations/versions/f37aceb45062_make_historyunit_logfile_required.py +0 -0
  186. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/migrations/versions/f384e1c0cf5d_drop_task_default_args_columns.py +0 -0
  187. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/migrations/versions/fbce16ff4e47_new_history_items.py +0 -0
  188. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/py.typed +0 -0
  189. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/ssh/__init__.py +0 -0
  190. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/ssh/_fabric.py +0 -0
  191. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/string_tools.py +0 -0
  192. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/syringe.py +0 -0
  193. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/tasks/__init__.py +0 -0
  194. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/tasks/utils.py +0 -0
  195. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/tasks/v2/__init__.py +0 -0
  196. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/tasks/v2/local/__init__.py +0 -0
  197. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/tasks/v2/local/_utils.py +0 -0
  198. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/tasks/v2/local/collect.py +0 -0
  199. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/tasks/v2/local/deactivate.py +0 -0
  200. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/tasks/v2/local/reactivate.py +0 -0
  201. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/tasks/v2/ssh/__init__.py +0 -0
  202. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/tasks/v2/ssh/_utils.py +0 -0
  203. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/tasks/v2/ssh/collect.py +0 -0
  204. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/tasks/v2/ssh/deactivate.py +0 -0
  205. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/tasks/v2/ssh/reactivate.py +0 -0
  206. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/tasks/v2/templates/1_create_venv.sh +0 -0
  207. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/tasks/v2/templates/2_pip_install.sh +0 -0
  208. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/tasks/v2/templates/3_pip_freeze.sh +0 -0
  209. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/tasks/v2/templates/4_pip_show.sh +0 -0
  210. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/tasks/v2/templates/5_get_venv_size_and_file_number.sh +0 -0
  211. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/tasks/v2/templates/6_pip_install_from_freeze.sh +0 -0
  212. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/tasks/v2/utils_background.py +0 -0
  213. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/tasks/v2/utils_database.py +0 -0
  214. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/tasks/v2/utils_package_names.py +0 -0
  215. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/tasks/v2/utils_python_interpreter.py +0 -0
  216. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/tasks/v2/utils_templates.py +0 -0
  217. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/types/__init__.py +0 -0
  218. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/types/validators/__init__.py +0 -0
  219. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/types/validators/_common_validators.py +0 -0
  220. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/types/validators/_filter_validators.py +0 -0
  221. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/types/validators/_workflow_task_arguments_validators.py +0 -0
  222. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/urls.py +0 -0
  223. {fractal_server-2.14.13 → fractal_server-2.14.14}/fractal_server/zip_tools.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: fractal-server
3
- Version: 2.14.13
3
+ Version: 2.14.14
4
4
  Summary: Backend component of the Fractal analytics platform
5
5
  License: BSD-3-Clause
6
6
  Author: Tommaso Comparin
@@ -0,0 +1 @@
1
+ __VERSION__ = "2.14.14"
@@ -137,7 +137,7 @@ async def remove_duplicate_task_groups(
137
137
  db: AsyncSession,
138
138
  ) -> list[TaskGroupV2]:
139
139
  """
140
- Extract a single task group for each `version`.
140
+ Extract an item for each `version` from a *sorted* task-group list.
141
141
 
142
142
  Args:
143
143
  task_groups: A list of task groups with identical `pkg_name`
@@ -16,6 +16,7 @@ from fractal_server.app.models.v2 import HistoryImageCache
16
16
  from fractal_server.app.models.v2 import HistoryUnit
17
17
  from fractal_server.app.routes.auth import current_active_user
18
18
  from fractal_server.app.schemas.v2 import HistoryUnitStatus
19
+ from fractal_server.app.schemas.v2 import TaskType
19
20
  from fractal_server.images.tools import aggregate_types
20
21
  from fractal_server.images.tools import filter_image_list
21
22
  from fractal_server.types import AttributeFilters
@@ -105,8 +106,8 @@ async def check_workflowtask(
105
106
  # Skip check if previous task has non-trivial `output_types`
106
107
  return JSONResponse(status_code=200, content=[])
107
108
  elif previous_wft.task.type in [
108
- "converter_compound",
109
- "converter_non_parallel",
109
+ TaskType.CONVERTER_COMPOUND,
110
+ TaskType.CONVERTER_NON_PARALLEL,
110
111
  ]:
111
112
  # Skip check if previous task is converter
112
113
  return JSONResponse(status_code=200, content=[])
@@ -25,6 +25,7 @@ from fractal_server.app.routes.auth import current_active_verified_user
25
25
  from fractal_server.app.schemas.v2 import TaskCreateV2
26
26
  from fractal_server.app.schemas.v2 import TaskGroupV2OriginEnum
27
27
  from fractal_server.app.schemas.v2 import TaskReadV2
28
+ from fractal_server.app.schemas.v2 import TaskType
28
29
  from fractal_server.app.schemas.v2 import TaskUpdateV2
29
30
  from fractal_server.logger import set_logger
30
31
 
@@ -109,12 +110,12 @@ async def patch_task(
109
110
  update = task_update.model_dump(exclude_unset=True)
110
111
 
111
112
  # Forbid changes that set a previously unset command
112
- if db_task.type == "non_parallel" and "command_parallel" in update:
113
+ if db_task.type == TaskType.NON_PARALLEL and "command_parallel" in update:
113
114
  raise HTTPException(
114
115
  status_code=status.HTTP_422_UNPROCESSABLE_ENTITY,
115
116
  detail="Cannot set an unset `command_parallel`.",
116
117
  )
117
- if db_task.type == "parallel" and "command_non_parallel" in update:
118
+ if db_task.type == TaskType.PARALLEL and "command_non_parallel" in update:
118
119
  raise HTTPException(
119
120
  status_code=status.HTTP_422_UNPROCESSABLE_ENTITY,
120
121
  detail="Cannot set an unset `command_non_parallel`.",
@@ -151,7 +152,7 @@ async def create_task(
151
152
  db=db,
152
153
  )
153
154
 
154
- if task.type == "parallel" and (
155
+ if task.type == TaskType.PARALLEL and (
155
156
  task.args_schema_non_parallel is not None
156
157
  or task.meta_non_parallel is not None
157
158
  ):
@@ -162,7 +163,7 @@ async def create_task(
162
163
  "`TaskV2.args_schema_non_parallel` if TaskV2 is parallel"
163
164
  ),
164
165
  )
165
- elif task.type == "non_parallel" and (
166
+ elif task.type == TaskType.NON_PARALLEL and (
166
167
  task.args_schema_parallel is not None or task.meta_parallel is not None
167
168
  ):
168
169
  raise HTTPException(
@@ -163,17 +163,17 @@ async def get_task_group_list(
163
163
  grouped_result = [
164
164
  (
165
165
  pkg_name,
166
- sorted(
167
- (
168
- await remove_duplicate_task_groups(
169
- task_groups=list(groups),
170
- user_id=user.id,
171
- default_group_id=default_group_id,
172
- db=db,
173
- )
174
- ),
175
- key=_version_sort_key,
176
- reverse=True,
166
+ (
167
+ await remove_duplicate_task_groups(
168
+ task_groups=sorted(
169
+ list(groups),
170
+ key=_version_sort_key,
171
+ reverse=True,
172
+ ),
173
+ user_id=user.id,
174
+ default_group_id=default_group_id,
175
+ db=db,
176
+ )
177
177
  ),
178
178
  )
179
179
  for pkg_name, groups in itertools.groupby(
@@ -24,21 +24,23 @@ from ._aux_functions_tasks import _get_task_read_access
24
24
  from fractal_server.app.models import UserOAuth
25
25
  from fractal_server.app.models.v2 import TaskGroupV2
26
26
  from fractal_server.app.routes.auth import current_active_user
27
+ from fractal_server.app.schemas.v2 import TaskType
27
28
  from fractal_server.app.schemas.v2 import WorkflowTaskReadV2
28
29
  from fractal_server.app.schemas.v2 import WorkflowTaskReplaceV2
29
30
 
30
-
31
31
  router = APIRouter()
32
32
 
33
33
 
34
34
  VALID_TYPE_UPDATES = {
35
- ("non_parallel", "converter_non_parallel"),
36
- ("compound", "converter_compound"),
37
- ("converter_non_parallel", "converter_non_parallel"),
38
- ("converter_compound", "converter_compound"),
39
- ("non_parallel", "non_parallel"),
40
- ("compound", "compound"),
41
- ("parallel", "parallel"),
35
+ # Transform into converter
36
+ (TaskType.NON_PARALLEL, TaskType.CONVERTER_NON_PARALLEL),
37
+ (TaskType.COMPOUND, TaskType.CONVERTER_COMPOUND),
38
+ # Keep the same
39
+ (TaskType.CONVERTER_NON_PARALLEL, TaskType.CONVERTER_NON_PARALLEL),
40
+ (TaskType.CONVERTER_COMPOUND, TaskType.CONVERTER_COMPOUND),
41
+ (TaskType.NON_PARALLEL, TaskType.NON_PARALLEL),
42
+ (TaskType.COMPOUND, TaskType.COMPOUND),
43
+ (TaskType.PARALLEL, TaskType.PARALLEL),
42
44
  }
43
45
 
44
46
 
@@ -208,12 +210,18 @@ async def replace_workflowtask(
208
210
  ),
209
211
  )
210
212
 
211
- if replace.args_non_parallel is not None and new_task.type == "parallel":
213
+ if (
214
+ replace.args_non_parallel is not None
215
+ and new_task.type == TaskType.PARALLEL
216
+ ):
212
217
  raise HTTPException(
213
218
  status_code=status.HTTP_422_UNPROCESSABLE_ENTITY,
214
219
  detail="Cannot set 'args_non_parallel' for parallel task.",
215
220
  )
216
- if replace.args_parallel is not None and new_task.type == "non_parallel":
221
+ if (
222
+ replace.args_parallel is not None
223
+ and new_task.type == TaskType.NON_PARALLEL
224
+ ):
217
225
  raise HTTPException(
218
226
  status_code=status.HTTP_422_UNPROCESSABLE_ENTITY,
219
227
  detail="Cannot set 'args_parallel' for non-parallel task.",
@@ -15,6 +15,7 @@ from ._aux_functions_tasks import _check_type_filters_compatibility
15
15
  from ._aux_functions_tasks import _get_task_read_access
16
16
  from fractal_server.app.models import UserOAuth
17
17
  from fractal_server.app.routes.auth import current_active_user
18
+ from fractal_server.app.schemas.v2 import TaskType
18
19
  from fractal_server.app.schemas.v2 import WorkflowTaskCreateV2
19
20
  from fractal_server.app.schemas.v2 import WorkflowTaskReadV2
20
21
  from fractal_server.app.schemas.v2 import WorkflowTaskUpdateV2
@@ -47,7 +48,7 @@ async def create_workflowtask(
47
48
  task_id=task_id, user_id=user.id, db=db, require_active=True
48
49
  )
49
50
 
50
- if task.type == "parallel":
51
+ if task.type == TaskType.PARALLEL:
51
52
  if (
52
53
  wftask.meta_non_parallel is not None
53
54
  or wftask.args_non_parallel is not None
@@ -60,7 +61,7 @@ async def create_workflowtask(
60
61
  "is `parallel`."
61
62
  ),
62
63
  )
63
- elif task.type == "non_parallel":
64
+ elif task.type == TaskType.NON_PARALLEL:
64
65
  if (
65
66
  wftask.meta_parallel is not None
66
67
  or wftask.args_parallel is not None
@@ -143,7 +144,7 @@ async def update_workflowtask(
143
144
  wftask_type_filters=workflow_task_update.type_filters,
144
145
  )
145
146
 
146
- if db_wf_task.task_type == "parallel" and (
147
+ if db_wf_task.task_type == TaskType.PARALLEL and (
147
148
  workflow_task_update.args_non_parallel is not None
148
149
  or workflow_task_update.meta_non_parallel is not None
149
150
  ):
@@ -156,8 +157,8 @@ async def update_workflowtask(
156
157
  ),
157
158
  )
158
159
  elif db_wf_task.task_type in [
159
- "non_parallel",
160
- "converter_non_parallel",
160
+ TaskType.NON_PARALLEL,
161
+ TaskType.CONVERTER_NON_PARALLEL,
161
162
  ] and (
162
163
  workflow_task_update.args_parallel is not None
163
164
  or workflow_task_update.meta_parallel is not None
@@ -1,19 +1,34 @@
1
+ from enum import StrEnum
1
2
  from typing import Any
2
3
 
3
4
  from fractal_server.app.runner.task_files import TaskFiles
4
- from fractal_server.app.schemas.v2.task import TaskTypeType
5
+ from fractal_server.app.schemas.v2.task import TaskType
5
6
  from fractal_server.logger import set_logger
6
7
 
7
- TASK_TYPES_SUBMIT: list[TaskTypeType] = [
8
- "compound",
9
- "converter_compound",
10
- "non_parallel",
11
- "converter_non_parallel",
8
+
9
+ class SubmitTaskType(StrEnum):
10
+ COMPOUND = TaskType.COMPOUND
11
+ NON_PARALLEL = TaskType.NON_PARALLEL
12
+ CONVERTER_NON_PARALLEL = TaskType.CONVERTER_NON_PARALLEL
13
+ CONVERTER_COMPOUND = TaskType.CONVERTER_COMPOUND
14
+
15
+
16
+ class MultisubmitTaskType(StrEnum):
17
+ PARALLEL = TaskType.PARALLEL
18
+ COMPOUND = TaskType.COMPOUND
19
+ CONVERTER_COMPOUND = TaskType.CONVERTER_COMPOUND
20
+
21
+
22
+ TASK_TYPES_SUBMIT: list[TaskType] = [
23
+ TaskType.COMPOUND,
24
+ TaskType.CONVERTER_COMPOUND,
25
+ TaskType.NON_PARALLEL,
26
+ TaskType.CONVERTER_NON_PARALLEL,
12
27
  ]
13
- TASK_TYPES_MULTISUBMIT: list[TaskTypeType] = [
14
- "compound",
15
- "converter_compound",
16
- "parallel",
28
+ TASK_TYPES_MULTISUBMIT: list[TaskType] = [
29
+ TaskType.COMPOUND,
30
+ TaskType.CONVERTER_COMPOUND,
31
+ TaskType.PARALLEL,
17
32
  ]
18
33
 
19
34
  logger = set_logger(__name__)
@@ -32,7 +47,7 @@ class BaseRunner:
32
47
  task_name: str,
33
48
  parameters: dict[str, Any],
34
49
  history_unit_id: int,
35
- task_type: TaskTypeType,
50
+ task_type: TaskType,
36
51
  task_files: TaskFiles,
37
52
  config: Any,
38
53
  user_id: int,
@@ -64,7 +79,7 @@ class BaseRunner:
64
79
  list_parameters: list[dict[str, Any]],
65
80
  history_unit_ids: list[int],
66
81
  list_task_files: list[TaskFiles],
67
- task_type: TaskTypeType,
82
+ task_type: TaskType,
68
83
  config: Any,
69
84
  user_id: int,
70
85
  ) -> tuple[dict[int, Any], dict[int, BaseException]]:
@@ -90,7 +105,7 @@ class BaseRunner:
90
105
  def validate_submit_parameters(
91
106
  self,
92
107
  parameters: dict[str, Any],
93
- task_type: TaskTypeType,
108
+ task_type: TaskType,
94
109
  ) -> None:
95
110
  """
96
111
  Validate parameters for `submit` method
@@ -104,12 +119,18 @@ class BaseRunner:
104
119
  raise ValueError(f"Invalid {task_type=} for `submit`.")
105
120
  if not isinstance(parameters, dict):
106
121
  raise ValueError("`parameters` must be a dictionary.")
107
- if task_type in ["non_parallel", "compound"]:
122
+ if task_type in [
123
+ TaskType.NON_PARALLEL,
124
+ TaskType.COMPOUND,
125
+ ]:
108
126
  if "zarr_urls" not in parameters.keys():
109
127
  raise ValueError(
110
128
  f"No 'zarr_urls' key in in {list(parameters.keys())}"
111
129
  )
112
- elif task_type in ["converter_non_parallel", "converter_compound"]:
130
+ elif task_type in [
131
+ TaskType.CONVERTER_NON_PARALLEL,
132
+ TaskType.CONVERTER_COMPOUND,
133
+ ]:
113
134
  if "zarr_urls" in parameters.keys():
114
135
  raise ValueError(
115
136
  f"Forbidden 'zarr_urls' key in {list(parameters.keys())}"
@@ -119,7 +140,7 @@ class BaseRunner:
119
140
  def validate_multisubmit_parameters(
120
141
  self,
121
142
  *,
122
- task_type: TaskTypeType,
143
+ task_type: TaskType,
123
144
  list_parameters: list[dict[str, Any]],
124
145
  list_task_files: list[TaskFiles],
125
146
  history_unit_ids: list[int],
@@ -163,7 +184,7 @@ class BaseRunner:
163
184
  raise ValueError(
164
185
  f"No 'zarr_url' key in in {list(single_kwargs.keys())}"
165
186
  )
166
- if task_type == "parallel":
187
+ if task_type == TaskType.PARALLEL:
167
188
  zarr_urls = [kwargs["zarr_url"] for kwargs in list_parameters]
168
189
  if len(zarr_urls) != len(set(zarr_urls)):
169
190
  raise ValueError("Non-unique zarr_urls")
@@ -3,19 +3,21 @@ from concurrent.futures import Future
3
3
  from concurrent.futures import ThreadPoolExecutor
4
4
  from pathlib import Path
5
5
  from typing import Any
6
- from typing import Literal
7
6
 
8
7
  from ..call_command_wrapper import call_command_wrapper
9
8
  from .get_local_config import LocalBackendConfig
10
9
  from fractal_server.app.db import get_sync_db
11
10
  from fractal_server.app.runner.exceptions import TaskExecutionError
12
11
  from fractal_server.app.runner.executors.base_runner import BaseRunner
12
+ from fractal_server.app.runner.executors.base_runner import MultisubmitTaskType
13
+ from fractal_server.app.runner.executors.base_runner import SubmitTaskType
13
14
  from fractal_server.app.runner.task_files import TaskFiles
14
15
  from fractal_server.app.runner.v2.db_tools import (
15
16
  bulk_update_status_of_history_unit,
16
17
  )
17
18
  from fractal_server.app.runner.v2.db_tools import update_status_of_history_unit
18
19
  from fractal_server.app.schemas.v2 import HistoryUnitStatus
20
+ from fractal_server.app.schemas.v2 import TaskType
19
21
  from fractal_server.logger import set_logger
20
22
 
21
23
  logger = set_logger(__name__)
@@ -87,12 +89,7 @@ class LocalRunner(BaseRunner):
87
89
  history_unit_id: int,
88
90
  task_files: TaskFiles,
89
91
  config: LocalBackendConfig,
90
- task_type: Literal[
91
- "non_parallel",
92
- "converter_non_parallel",
93
- "compound",
94
- "converter_compound",
95
- ],
92
+ task_type: SubmitTaskType,
96
93
  user_id: int,
97
94
  ) -> tuple[Any, Exception]:
98
95
  logger.debug("[submit] START")
@@ -129,7 +126,10 @@ class LocalRunner(BaseRunner):
129
126
  try:
130
127
  result = future.result()
131
128
  logger.debug("[submit] END with result")
132
- if task_type not in ["compound", "converter_compound"]:
129
+ if task_type not in [
130
+ TaskType.COMPOUND,
131
+ TaskType.CONVERTER_COMPOUND,
132
+ ]:
133
133
  update_status_of_history_unit(
134
134
  history_unit_id=history_unit_id,
135
135
  status=HistoryUnitStatus.DONE,
@@ -154,7 +154,7 @@ class LocalRunner(BaseRunner):
154
154
  list_parameters: list[dict],
155
155
  history_unit_ids: list[int],
156
156
  list_task_files: list[TaskFiles],
157
- task_type: Literal["parallel", "compound", "converter_compound"],
157
+ task_type: MultisubmitTaskType,
158
158
  config: LocalBackendConfig,
159
159
  user_id: int,
160
160
  ) -> tuple[dict[int, Any], dict[int, BaseException]]:
@@ -197,7 +197,7 @@ class LocalRunner(BaseRunner):
197
197
  exceptions = {
198
198
  ind: exception for ind in range(len(list_parameters))
199
199
  }
200
- if task_type == "parallel":
200
+ if task_type == TaskType.PARALLEL:
201
201
  with next(get_sync_db()) as db:
202
202
  bulk_update_status_of_history_unit(
203
203
  history_unit_ids=history_unit_ids,
@@ -233,7 +233,7 @@ class LocalRunner(BaseRunner):
233
233
  positional_index
234
234
  ]
235
235
  exceptions[positional_index] = TaskExecutionError(str(e))
236
- if task_type == "parallel":
236
+ if task_type == TaskType.PARALLEL:
237
237
  with next(get_sync_db()) as db:
238
238
  update_status_of_history_unit(
239
239
  history_unit_id=current_history_unit_id,
@@ -252,14 +252,14 @@ class LocalRunner(BaseRunner):
252
252
  with next(get_sync_db()) as db:
253
253
  for positional_index, fut in finished_futures:
254
254
  active_futures.pop(positional_index)
255
- if task_type == "parallel":
255
+ if task_type == TaskType.PARALLEL:
256
256
  current_history_unit_id = history_unit_ids[
257
257
  positional_index
258
258
  ]
259
259
 
260
260
  try:
261
261
  results[positional_index] = fut.result()
262
- if task_type == "parallel":
262
+ if task_type == TaskType.PARALLEL:
263
263
  update_status_of_history_unit(
264
264
  history_unit_id=current_history_unit_id,
265
265
  status=HistoryUnitStatus.DONE,
@@ -275,7 +275,7 @@ class LocalRunner(BaseRunner):
275
275
  exceptions[positional_index] = TaskExecutionError(
276
276
  str(e)
277
277
  )
278
- if task_type == "parallel":
278
+ if task_type == TaskType.PARALLEL:
279
279
  update_status_of_history_unit(
280
280
  history_unit_id=current_history_unit_id,
281
281
  status=HistoryUnitStatus.FAILED,
@@ -19,6 +19,8 @@ from fractal_server.app.models.v2 import AccountingRecordSlurm
19
19
  from fractal_server.app.runner.exceptions import JobExecutionError
20
20
  from fractal_server.app.runner.exceptions import TaskExecutionError
21
21
  from fractal_server.app.runner.executors.base_runner import BaseRunner
22
+ from fractal_server.app.runner.executors.base_runner import MultisubmitTaskType
23
+ from fractal_server.app.runner.executors.base_runner import SubmitTaskType
22
24
  from fractal_server.app.runner.filenames import SHUTDOWN_FILENAME
23
25
  from fractal_server.app.runner.task_files import TaskFiles
24
26
  from fractal_server.app.runner.v2.db_tools import (
@@ -26,6 +28,7 @@ from fractal_server.app.runner.v2.db_tools import (
26
28
  )
27
29
  from fractal_server.app.runner.v2.db_tools import update_status_of_history_unit
28
30
  from fractal_server.app.schemas.v2 import HistoryUnitStatus
31
+ from fractal_server.app.schemas.v2 import TaskType
29
32
  from fractal_server.config import get_settings
30
33
  from fractal_server.logger import set_logger
31
34
  from fractal_server.syringe import Inject
@@ -501,12 +504,7 @@ class BaseSlurmRunner(BaseRunner):
501
504
  history_unit_id: int,
502
505
  task_files: TaskFiles,
503
506
  config: SlurmConfig,
504
- task_type: Literal[
505
- "non_parallel",
506
- "converter_non_parallel",
507
- "compound",
508
- "converter_compound",
509
- ],
507
+ task_type: SubmitTaskType,
510
508
  user_id: int,
511
509
  ) -> tuple[Any, Exception]:
512
510
  logger.debug("[submit] START")
@@ -604,8 +602,8 @@ class BaseSlurmRunner(BaseRunner):
604
602
  )
605
603
  else:
606
604
  if task_type not in [
607
- "compound",
608
- "converter_compound",
605
+ TaskType.COMPOUND,
606
+ TaskType.CONVERTER_COMPOUND,
609
607
  ]:
610
608
  update_status_of_history_unit(
611
609
  history_unit_id=history_unit_id,
@@ -641,7 +639,7 @@ class BaseSlurmRunner(BaseRunner):
641
639
  list_parameters: list[dict],
642
640
  history_unit_ids: list[int],
643
641
  list_task_files: list[TaskFiles],
644
- task_type: Literal["parallel", "compound", "converter_compound"],
642
+ task_type: MultisubmitTaskType,
645
643
  config: SlurmConfig,
646
644
  user_id: int,
647
645
  ) -> tuple[dict[int, Any], dict[int, BaseException]]:
@@ -654,7 +652,7 @@ class BaseSlurmRunner(BaseRunner):
654
652
  logger.debug(f"[multisubmit] START, {len(list_parameters)=}")
655
653
  try:
656
654
  if self.is_shutdown():
657
- if task_type == "parallel":
655
+ if task_type == TaskType.PARALLEL:
658
656
  with next(get_sync_db()) as db:
659
657
  bulk_update_status_of_history_unit(
660
658
  history_unit_ids=history_unit_ids,
@@ -680,7 +678,7 @@ class BaseSlurmRunner(BaseRunner):
680
678
  workdir_remote = list_task_files[0].wftask_subfolder_remote
681
679
 
682
680
  # Create local&remote task subfolders
683
- if task_type == "parallel":
681
+ if task_type == TaskType.PARALLEL:
684
682
  self._mkdir_local_folder(workdir_local.as_posix())
685
683
  self._mkdir_remote_folder(folder=workdir_remote.as_posix())
686
684
 
@@ -758,7 +756,7 @@ class BaseSlurmRunner(BaseRunner):
758
756
  f" Original error {str(e)}"
759
757
  )
760
758
  self.scancel_jobs()
761
- if task_type == "parallel":
759
+ if task_type == TaskType.PARALLEL:
762
760
  with next(get_sync_db()) as db:
763
761
  bulk_update_status_of_history_unit(
764
762
  history_unit_ids=history_unit_ids,
@@ -824,7 +822,7 @@ class BaseSlurmRunner(BaseRunner):
824
822
  # `result is None` is not relevant for this purpose.
825
823
  if exception is not None:
826
824
  exceptions[task.index] = exception
827
- if task_type == "parallel":
825
+ if task_type == TaskType.PARALLEL:
828
826
  update_status_of_history_unit(
829
827
  history_unit_id=history_unit_ids[
830
828
  task.index
@@ -834,7 +832,7 @@ class BaseSlurmRunner(BaseRunner):
834
832
  )
835
833
  else:
836
834
  results[task.index] = result
837
- if task_type == "parallel":
835
+ if task_type == TaskType.PARALLEL:
838
836
  update_status_of_history_unit(
839
837
  history_unit_id=history_unit_ids[
840
838
  task.index
@@ -10,10 +10,6 @@ from sqlalchemy.orm.attributes import flag_modified
10
10
  from sqlmodel import delete
11
11
  from sqlmodel import update
12
12
 
13
- from ....images import SingleImage
14
- from ....images.tools import filter_image_list
15
- from ....images.tools import find_image_by_zarr_url
16
- from ..exceptions import JobExecutionError
17
13
  from .merge_outputs import merge_outputs
18
14
  from .runner_functions import run_v2_task_compound
19
15
  from .runner_functions import run_v2_task_non_parallel
@@ -28,13 +24,18 @@ from fractal_server.app.models.v2 import HistoryRun
28
24
  from fractal_server.app.models.v2 import HistoryUnit
29
25
  from fractal_server.app.models.v2 import TaskGroupV2
30
26
  from fractal_server.app.models.v2 import WorkflowTaskV2
27
+ from fractal_server.app.runner.exceptions import JobExecutionError
31
28
  from fractal_server.app.runner.executors.base_runner import BaseRunner
32
29
  from fractal_server.app.runner.v2.db_tools import update_status_of_history_run
33
30
  from fractal_server.app.schemas.v2 import HistoryUnitStatus
34
31
  from fractal_server.app.schemas.v2 import TaskDumpV2
35
32
  from fractal_server.app.schemas.v2 import TaskGroupDumpV2
33
+ from fractal_server.app.schemas.v2 import TaskType
34
+ from fractal_server.images import SingleImage
36
35
  from fractal_server.images.status_tools import enrich_images_sync
37
36
  from fractal_server.images.status_tools import IMAGE_STATUS_KEY
37
+ from fractal_server.images.tools import filter_image_list
38
+ from fractal_server.images.tools import find_image_by_zarr_url
38
39
  from fractal_server.images.tools import merge_type_filters
39
40
  from fractal_server.types import AttributeFilters
40
41
 
@@ -131,7 +132,11 @@ def execute_tasks_v2(
131
132
  # PRE TASK EXECUTION
132
133
 
133
134
  # Filter images by types and attributes (in two steps)
134
- if wftask.task_type in ["compound", "parallel", "non_parallel"]:
135
+ if wftask.task_type in [
136
+ TaskType.COMPOUND,
137
+ TaskType.PARALLEL,
138
+ TaskType.NON_PARALLEL,
139
+ ]:
135
140
  # Non-converter task
136
141
  type_filters = copy(current_dataset_type_filters)
137
142
  type_filters_patch = merge_type_filters(
@@ -190,7 +195,10 @@ def execute_tasks_v2(
190
195
 
191
196
  # TASK EXECUTION (V2)
192
197
  try:
193
- if task.type in ["non_parallel", "converter_non_parallel"]:
198
+ if task.type in [
199
+ TaskType.NON_PARALLEL,
200
+ TaskType.CONVERTER_NON_PARALLEL,
201
+ ]:
194
202
  outcomes_dict, num_tasks = run_v2_task_non_parallel(
195
203
  images=filtered_images,
196
204
  zarr_dir=zarr_dir,
@@ -205,7 +213,7 @@ def execute_tasks_v2(
205
213
  user_id=user_id,
206
214
  task_type=task.type,
207
215
  )
208
- elif task.type == "parallel":
216
+ elif task.type == TaskType.PARALLEL:
209
217
  outcomes_dict, num_tasks = run_v2_task_parallel(
210
218
  images=filtered_images,
211
219
  wftask=wftask,
@@ -218,7 +226,10 @@ def execute_tasks_v2(
218
226
  dataset_id=dataset.id,
219
227
  user_id=user_id,
220
228
  )
221
- elif task.type in ["compound", "converter_compound"]:
229
+ elif task.type in [
230
+ TaskType.COMPOUND,
231
+ TaskType.CONVERTER_COMPOUND,
232
+ ]:
222
233
  outcomes_dict, num_tasks = run_v2_task_compound(
223
234
  images=filtered_images,
224
235
  zarr_dir=zarr_dir,
@@ -31,6 +31,7 @@ from fractal_server.app.runner.v2.task_interface import (
31
31
  _cast_and_validate_TaskOutput,
32
32
  )
33
33
  from fractal_server.app.schemas.v2 import HistoryUnitStatus
34
+ from fractal_server.app.schemas.v2 import TaskType
34
35
  from fractal_server.logger import set_logger
35
36
 
36
37
  __all__ = [
@@ -135,14 +136,17 @@ def run_v2_task_non_parallel(
135
136
  ],
136
137
  dataset_id: int,
137
138
  history_run_id: int,
138
- task_type: Literal["non_parallel", "converter_non_parallel"],
139
+ task_type: Literal[TaskType.NON_PARALLEL, TaskType.CONVERTER_NON_PARALLEL],
139
140
  user_id: int,
140
141
  ) -> tuple[dict[int, SubmissionOutcome], int]:
141
142
  """
142
143
  This runs server-side (see `executor` argument)
143
144
  """
144
145
 
145
- if task_type not in ["non_parallel", "converter_non_parallel"]:
146
+ if task_type not in [
147
+ TaskType.NON_PARALLEL,
148
+ TaskType.CONVERTER_NON_PARALLEL,
149
+ ]:
146
150
  raise ValueError(
147
151
  f"Invalid {task_type=} for `run_v2_task_non_parallel`."
148
152
  )
@@ -166,14 +170,14 @@ def run_v2_task_non_parallel(
166
170
  "zarr_dir": zarr_dir,
167
171
  **(wftask.args_non_parallel or {}),
168
172
  }
169
- if task_type == "non_parallel":
173
+ if task_type == TaskType.NON_PARALLEL:
170
174
  function_kwargs["zarr_urls"] = [img["zarr_url"] for img in images]
171
175
 
172
176
  # Database History operations
173
177
  with next(get_sync_db()) as db:
174
- if task_type == "non_parallel":
178
+ if task_type == TaskType.NON_PARALLEL:
175
179
  zarr_urls = function_kwargs["zarr_urls"]
176
- elif task_type == "converter_non_parallel":
180
+ elif task_type == TaskType.CONVERTER_NON_PARALLEL:
177
181
  zarr_urls = []
178
182
 
179
183
  history_unit = HistoryUnit(
@@ -388,7 +392,7 @@ def run_v2_task_compound(
388
392
  ],
389
393
  dataset_id: int,
390
394
  history_run_id: int,
391
- task_type: Literal["compound", "converter_compound"],
395
+ task_type: Literal[TaskType.COMPOUND, TaskType.CONVERTER_COMPOUND],
392
396
  user_id: int,
393
397
  ) -> tuple[dict[int, SubmissionOutcome], int]:
394
398
  # Get TaskFiles object
@@ -410,10 +414,10 @@ def run_v2_task_compound(
410
414
  "zarr_dir": zarr_dir,
411
415
  **(wftask.args_non_parallel or {}),
412
416
  }
413
- if task_type == "compound":
417
+ if task_type == TaskType.COMPOUND:
414
418
  function_kwargs["zarr_urls"] = [img["zarr_url"] for img in images]
415
419
  input_image_zarr_urls = function_kwargs["zarr_urls"]
416
- elif task_type == "converter_compound":
420
+ elif task_type == TaskType.CONVERTER_COMPOUND:
417
421
  input_image_zarr_urls = []
418
422
 
419
423
  # Create database History entries
@@ -31,6 +31,7 @@ from .task import TaskExportV2 # noqa F401
31
31
  from .task import TaskImportV2 # noqa F401
32
32
  from .task import TaskImportV2Legacy # noqa F401
33
33
  from .task import TaskReadV2 # noqa F401
34
+ from .task import TaskType # noqa F401
34
35
  from .task import TaskUpdateV2 # noqa F401
35
36
  from .task_collection import TaskCollectCustomV2 # noqa F401
36
37
  from .task_collection import TaskCollectPipV2 # noqa F401