fractal-server 2.14.0a5__tar.gz → 2.14.0a7__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 (213) hide show
  1. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/PKG-INFO +1 -1
  2. fractal_server-2.14.0a7/fractal_server/__init__.py +1 -0
  3. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/routes/api/v2/task.py +3 -10
  4. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/routes/api/v2/workflowtask.py +13 -2
  5. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/runner/executors/base_runner.py +53 -26
  6. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/runner/executors/local/runner.py +6 -5
  7. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/runner/executors/slurm_sudo/runner.py +5 -60
  8. fractal_server-2.14.0a7/fractal_server/app/runner/v2/_db_tools.py +48 -0
  9. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/runner/v2/runner.py +55 -17
  10. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/runner/v2/runner_functions.py +307 -62
  11. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/schemas/v2/manifest.py +11 -0
  12. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/schemas/v2/task.py +33 -0
  13. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/schemas/v2/workflowtask.py +2 -1
  14. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/tasks/v2/utils_database.py +1 -16
  15. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/pyproject.toml +2 -2
  16. fractal_server-2.14.0a5/fractal_server/__init__.py +0 -1
  17. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/LICENSE +0 -0
  18. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/README.md +0 -0
  19. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/__main__.py +0 -0
  20. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/alembic.ini +0 -0
  21. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/__init__.py +0 -0
  22. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/db/__init__.py +0 -0
  23. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/history/__init__.py +0 -0
  24. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/history/image_updates.py +0 -0
  25. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/history/status_enum.py +0 -0
  26. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/models/__init__.py +0 -0
  27. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/models/linkusergroup.py +0 -0
  28. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/models/linkuserproject.py +0 -0
  29. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/models/security.py +0 -0
  30. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/models/user_settings.py +0 -0
  31. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/models/v2/__init__.py +0 -0
  32. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/models/v2/accounting.py +0 -0
  33. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/models/v2/dataset.py +0 -0
  34. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/models/v2/history.py +0 -0
  35. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/models/v2/job.py +0 -0
  36. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/models/v2/project.py +0 -0
  37. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/models/v2/task.py +0 -0
  38. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/models/v2/task_group.py +0 -0
  39. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/models/v2/workflow.py +0 -0
  40. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/models/v2/workflowtask.py +0 -0
  41. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/routes/__init__.py +0 -0
  42. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/routes/admin/__init__.py +0 -0
  43. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/routes/admin/v2/__init__.py +0 -0
  44. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/routes/admin/v2/accounting.py +0 -0
  45. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/routes/admin/v2/impersonate.py +0 -0
  46. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/routes/admin/v2/job.py +0 -0
  47. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/routes/admin/v2/project.py +0 -0
  48. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/routes/admin/v2/task.py +0 -0
  49. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/routes/admin/v2/task_group.py +0 -0
  50. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/routes/admin/v2/task_group_lifecycle.py +0 -0
  51. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/routes/api/__init__.py +0 -0
  52. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/routes/api/v2/__init__.py +0 -0
  53. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/routes/api/v2/_aux_functions.py +0 -0
  54. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/routes/api/v2/_aux_functions_history.py +0 -0
  55. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/routes/api/v2/_aux_functions_task_lifecycle.py +0 -0
  56. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/routes/api/v2/_aux_functions_tasks.py +0 -0
  57. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/routes/api/v2/dataset.py +0 -0
  58. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/routes/api/v2/history.py +0 -0
  59. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/routes/api/v2/images.py +0 -0
  60. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/routes/api/v2/job.py +0 -0
  61. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/routes/api/v2/project.py +0 -0
  62. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/routes/api/v2/status_legacy.py +0 -0
  63. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/routes/api/v2/submit.py +0 -0
  64. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/routes/api/v2/task_collection.py +0 -0
  65. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/routes/api/v2/task_collection_custom.py +0 -0
  66. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/routes/api/v2/task_group.py +0 -0
  67. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/routes/api/v2/task_group_lifecycle.py +0 -0
  68. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/routes/api/v2/workflow.py +0 -0
  69. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/routes/api/v2/workflow_import.py +0 -0
  70. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/routes/auth/__init__.py +0 -0
  71. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/routes/auth/_aux_auth.py +0 -0
  72. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/routes/auth/current_user.py +0 -0
  73. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/routes/auth/group.py +0 -0
  74. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/routes/auth/login.py +0 -0
  75. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/routes/auth/oauth.py +0 -0
  76. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/routes/auth/register.py +0 -0
  77. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/routes/auth/router.py +0 -0
  78. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/routes/auth/users.py +0 -0
  79. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/routes/aux/__init__.py +0 -0
  80. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/routes/aux/_job.py +0 -0
  81. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/routes/aux/_runner.py +0 -0
  82. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/routes/aux/validate_user_settings.py +0 -0
  83. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/routes/pagination.py +0 -0
  84. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/runner/__init__.py +0 -0
  85. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/runner/components.py +0 -0
  86. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/runner/compress_folder.py +0 -0
  87. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/runner/exceptions.py +0 -0
  88. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/runner/executors/__init__.py +0 -0
  89. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/runner/executors/local/__init__.py +0 -0
  90. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/runner/executors/local/_local_config.py +0 -0
  91. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/runner/executors/local/_submit_setup.py +0 -0
  92. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/runner/executors/slurm_common/__init__.py +0 -0
  93. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/runner/executors/slurm_common/_batching.py +0 -0
  94. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/runner/executors/slurm_common/_job_states.py +0 -0
  95. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/runner/executors/slurm_common/_slurm_config.py +0 -0
  96. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/runner/executors/slurm_common/_submit_setup.py +0 -0
  97. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/runner/executors/slurm_common/get_slurm_config.py +0 -0
  98. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/runner/executors/slurm_common/remote.py +0 -0
  99. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/runner/executors/slurm_common/utils_executors.py +0 -0
  100. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/runner/executors/slurm_ssh/__init__.py +0 -0
  101. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/runner/executors/slurm_ssh/_executor_wait_thread.py +0 -0
  102. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/runner/executors/slurm_ssh/_slurm_job.py +0 -0
  103. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/runner/executors/slurm_ssh/executor.py +0 -0
  104. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/runner/executors/slurm_sudo/__init__.py +0 -0
  105. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/runner/executors/slurm_sudo/_check_jobs_status.py +0 -0
  106. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/runner/executors/slurm_sudo/_subprocess_run_as_user.py +0 -0
  107. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/runner/extract_archive.py +0 -0
  108. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/runner/filenames.py +0 -0
  109. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/runner/run_subprocess.py +0 -0
  110. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/runner/set_start_and_last_task_index.py +0 -0
  111. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/runner/shutdown.py +0 -0
  112. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/runner/task_files.py +0 -0
  113. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/runner/v2/__init__.py +0 -0
  114. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/runner/v2/_local.py +0 -0
  115. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/runner/v2/_slurm_ssh.py +0 -0
  116. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/runner/v2/_slurm_sudo.py +0 -0
  117. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/runner/v2/deduplicate_list.py +0 -0
  118. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/runner/v2/merge_outputs.py +0 -0
  119. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/runner/v2/runner_functions_low_level.py +0 -0
  120. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/runner/v2/task_interface.py +0 -0
  121. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/runner/versions.py +0 -0
  122. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/schemas/__init__.py +0 -0
  123. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/schemas/_filter_validators.py +0 -0
  124. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/schemas/_validators.py +0 -0
  125. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/schemas/user.py +0 -0
  126. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/schemas/user_group.py +0 -0
  127. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/schemas/user_settings.py +0 -0
  128. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/schemas/v2/__init__.py +0 -0
  129. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/schemas/v2/accounting.py +0 -0
  130. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/schemas/v2/dataset.py +0 -0
  131. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/schemas/v2/dumps.py +0 -0
  132. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/schemas/v2/job.py +0 -0
  133. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/schemas/v2/project.py +0 -0
  134. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/schemas/v2/status.py +0 -0
  135. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/schemas/v2/task_collection.py +0 -0
  136. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/schemas/v2/task_group.py +0 -0
  137. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/schemas/v2/workflow.py +0 -0
  138. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/security/__init__.py +0 -0
  139. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/security/signup_email.py +0 -0
  140. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/app/user_settings.py +0 -0
  141. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/config.py +0 -0
  142. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/data_migrations/README.md +0 -0
  143. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/data_migrations/tools.py +0 -0
  144. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/gunicorn_fractal.py +0 -0
  145. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/images/__init__.py +0 -0
  146. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/images/models.py +0 -0
  147. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/images/tools.py +0 -0
  148. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/logger.py +0 -0
  149. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/main.py +0 -0
  150. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/migrations/env.py +0 -0
  151. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/migrations/naming_convention.py +0 -0
  152. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/migrations/versions/034a469ec2eb_task_groups.py +0 -0
  153. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/migrations/versions/091b01f51f88_add_usergroup_and_linkusergroup_table.py +0 -0
  154. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/migrations/versions/19eca0dd47a9_user_settings_project_dir.py +0 -0
  155. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/migrations/versions/1eac13a26c83_drop_v1_tables.py +0 -0
  156. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/migrations/versions/316140ff7ee1_remove_usersettings_cache_dir.py +0 -0
  157. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/migrations/versions/4c308bcaea2b_add_task_args_schema_and_task_args_.py +0 -0
  158. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/migrations/versions/4cedeb448a53_workflowtask_foreign_keys_not_nullables.py +0 -0
  159. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/migrations/versions/501961cfcd85_remove_link_between_v1_and_v2_tasks_.py +0 -0
  160. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/migrations/versions/50a13d6138fd_initial_schema.py +0 -0
  161. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/migrations/versions/5bf02391cfef_v2.py +0 -0
  162. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/migrations/versions/70e77f1c38b0_add_applyworkflow_first_task_index_and_.py +0 -0
  163. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/migrations/versions/71eefd1dd202_add_slurm_accounts.py +0 -0
  164. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/migrations/versions/84bf0fffde30_add_dumps_to_applyworkflow.py +0 -0
  165. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/migrations/versions/8e8f227a3e36_update_taskv2_post_2_7_0.py +0 -0
  166. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/migrations/versions/8f79bd162e35_add_docs_info_and_docs_link_to_task_.py +0 -0
  167. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/migrations/versions/94a47ea2d3ff_remove_cache_dir_slurm_user_and_slurm_.py +0 -0
  168. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/migrations/versions/97f444d47249_add_applyworkflow_project_dump.py +0 -0
  169. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/migrations/versions/99ea79d9e5d2_add_dataset_history.py +0 -0
  170. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/migrations/versions/9c5ae74c9b98_add_user_settings_table.py +0 -0
  171. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/migrations/versions/9fd26a2b0de4_add_workflow_timestamp_created.py +0 -0
  172. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/migrations/versions/a7f4d6137b53_add_workflow_dump_to_applyworkflow.py +0 -0
  173. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/migrations/versions/af1ef1c83c9b_add_accounting_tables.py +0 -0
  174. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/migrations/versions/af8673379a5c_drop_old_filter_columns.py +0 -0
  175. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/migrations/versions/d256a7379ab8_taskgroup_activity_and_venv_info_to_.py +0 -0
  176. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/migrations/versions/d4fe3708d309_make_applyworkflow_workflow_dump_non_.py +0 -0
  177. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/migrations/versions/da2cb2ac4255_user_group_viewer_paths.py +0 -0
  178. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/migrations/versions/db09233ad13a_split_filters_and_keep_old_columns.py +0 -0
  179. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/migrations/versions/e75cac726012_make_applyworkflow_start_timestamp_not_.py +0 -0
  180. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/migrations/versions/efa89c30e0a4_add_project_timestamp_created.py +0 -0
  181. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/migrations/versions/f384e1c0cf5d_drop_task_default_args_columns.py +0 -0
  182. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/migrations/versions/fbce16ff4e47_new_history_items.py +0 -0
  183. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/py.typed +0 -0
  184. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/ssh/__init__.py +0 -0
  185. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/ssh/_fabric.py +0 -0
  186. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/string_tools.py +0 -0
  187. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/syringe.py +0 -0
  188. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/tasks/__init__.py +0 -0
  189. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/tasks/utils.py +0 -0
  190. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/tasks/v2/__init__.py +0 -0
  191. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/tasks/v2/local/__init__.py +0 -0
  192. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/tasks/v2/local/_utils.py +0 -0
  193. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/tasks/v2/local/collect.py +0 -0
  194. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/tasks/v2/local/deactivate.py +0 -0
  195. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/tasks/v2/local/reactivate.py +0 -0
  196. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/tasks/v2/ssh/__init__.py +0 -0
  197. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/tasks/v2/ssh/_utils.py +0 -0
  198. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/tasks/v2/ssh/collect.py +0 -0
  199. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/tasks/v2/ssh/deactivate.py +0 -0
  200. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/tasks/v2/ssh/reactivate.py +0 -0
  201. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/tasks/v2/templates/1_create_venv.sh +0 -0
  202. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/tasks/v2/templates/2_pip_install.sh +0 -0
  203. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/tasks/v2/templates/3_pip_freeze.sh +0 -0
  204. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/tasks/v2/templates/4_pip_show.sh +0 -0
  205. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/tasks/v2/templates/5_get_venv_size_and_file_number.sh +0 -0
  206. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/tasks/v2/templates/6_pip_install_from_freeze.sh +0 -0
  207. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/tasks/v2/utils_background.py +0 -0
  208. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/tasks/v2/utils_package_names.py +0 -0
  209. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/tasks/v2/utils_python_interpreter.py +0 -0
  210. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/tasks/v2/utils_templates.py +0 -0
  211. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/urls.py +0 -0
  212. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/fractal_server/utils.py +0 -0
  213. {fractal_server-2.14.0a5 → fractal_server-2.14.0a7}/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.0a5
3
+ Version: 2.14.0a7
4
4
  Summary: Backend component of the Fractal analytics platform
5
5
  Home-page: https://github.com/fractal-analytics-platform/fractal-server
6
6
  License: BSD-3-Clause
@@ -0,0 +1 @@
1
+ __VERSION__ = "2.14.0a7"
@@ -152,14 +152,7 @@ async def create_task(
152
152
  db=db,
153
153
  )
154
154
 
155
- if task.command_non_parallel is None:
156
- task_type = "parallel"
157
- elif task.command_parallel is None:
158
- task_type = "non_parallel"
159
- else:
160
- task_type = "compound"
161
-
162
- if task_type == "parallel" and (
155
+ if task.type == "parallel" and (
163
156
  task.args_schema_non_parallel is not None
164
157
  or task.meta_non_parallel is not None
165
158
  ):
@@ -170,7 +163,7 @@ async def create_task(
170
163
  "`TaskV2.args_schema_non_parallel` if TaskV2 is parallel"
171
164
  ),
172
165
  )
173
- elif task_type == "non_parallel" and (
166
+ elif task.type == "non_parallel" and (
174
167
  task.args_schema_parallel is not None or task.meta_parallel is not None
175
168
  ):
176
169
  raise HTTPException(
@@ -183,7 +176,7 @@ async def create_task(
183
176
 
184
177
  # Add task
185
178
 
186
- db_task = TaskV2(**task.model_dump(exclude_unset=True), type=task_type)
179
+ db_task = TaskV2(**task.model_dump(exclude_unset=True))
187
180
  pkg_name = db_task.name
188
181
  await _verify_non_duplication_user_constraint(
189
182
  db=db, pkg_name=pkg_name, user_id=user.id, version=db_task.version
@@ -56,7 +56,14 @@ async def replace_workflowtask(
56
56
  )
57
57
 
58
58
  # Preliminary checks
59
- if old_wftask.task_type != new_task.type:
59
+ EQUIVALENT_TASK_TYPES = [
60
+ {"non_parallel", "converter_non_parallel"},
61
+ {"compound", "converter_compound"},
62
+ ]
63
+ if (
64
+ old_wftask.task_type != new_task.type
65
+ and {old_wftask.task_type, new_task.type} not in EQUIVALENT_TASK_TYPES
66
+ ):
60
67
  raise HTTPException(
61
68
  status_code=status.HTTP_422_UNPROCESSABLE_ENTITY,
62
69
  detail=(
@@ -64,6 +71,7 @@ async def replace_workflowtask(
64
71
  f"{old_wftask.task_type} to {new_task.type}."
65
72
  ),
66
73
  )
74
+
67
75
  if replace.args_non_parallel is not None and new_task.type == "parallel":
68
76
  raise HTTPException(
69
77
  status_code=status.HTTP_422_UNPROCESSABLE_ENTITY,
@@ -259,7 +267,10 @@ async def update_workflowtask(
259
267
  "parallel."
260
268
  ),
261
269
  )
262
- elif db_wf_task.task_type == "non_parallel" and (
270
+ elif db_wf_task.task_type in [
271
+ "non_parallel",
272
+ "converter_non_parallel",
273
+ ] and (
263
274
  workflow_task_update.args_parallel is not None
264
275
  or workflow_task_update.meta_parallel is not None
265
276
  ):
@@ -1,6 +1,20 @@
1
1
  from typing import Any
2
2
 
3
3
  from fractal_server.app.runner.components import _COMPONENT_KEY_
4
+ from fractal_server.app.schemas.v2.task import TaskTypeType
5
+
6
+
7
+ TASK_TYPES_SUBMIT: list[TaskTypeType] = [
8
+ "compound",
9
+ "converter_compound",
10
+ "non_parallel",
11
+ "converter_non_parallel",
12
+ ]
13
+ TASK_TYPES_MULTISUBMIT: list[TaskTypeType] = [
14
+ "compound",
15
+ "converter_compound",
16
+ "parallel",
17
+ ]
4
18
 
5
19
 
6
20
  class BaseRunner(object):
@@ -16,7 +30,7 @@ class BaseRunner(object):
16
30
  func: callable,
17
31
  parameters: dict[str, Any],
18
32
  history_item_id: int,
19
- in_compound_task: bool,
33
+ task_type: TaskTypeType,
20
34
  **kwargs,
21
35
  ) -> tuple[Any, BaseException]:
22
36
  """
@@ -25,16 +39,13 @@ class BaseRunner(object):
25
39
  # FIXME: Describe more in detail
26
40
 
27
41
  Args:
28
- func:
29
- Function to be executed.
42
+ func: Function to be executed.
30
43
  parameters:
31
44
  Dictionary of parameters. Must include `zarr_urls` key.
32
45
  history_item_id:
33
46
  Database ID of the corresponding `HistoryItemV2` entry.
34
- in_compound_task:
35
- Whether this is the init part of a compound task.
36
- kwargs:
37
- Runner-specific parameters.
47
+ task_type: Task type.
48
+ kwargs: Runner-specific parameters.
38
49
  """
39
50
  raise NotImplementedError()
40
51
 
@@ -43,7 +54,7 @@ class BaseRunner(object):
43
54
  func: callable,
44
55
  list_parameters: list[dict[str, Any]],
45
56
  history_item_id: int,
46
- in_compound_task: bool,
57
+ task_type: TaskTypeType,
47
58
  **kwargs,
48
59
  ) -> tuple[dict[int, Any], dict[int, BaseException]]:
49
60
  """
@@ -52,33 +63,44 @@ class BaseRunner(object):
52
63
  # FIXME: Describe more in detail
53
64
 
54
65
  Args:
55
- func:
56
- Function to be executed.
66
+ func: Function to be executed.
57
67
  list_parameters:
58
68
  List of dictionaries of parameters. Each one must include a
59
69
  `zarr_url` key.
60
70
  history_item_id:
61
71
  Database ID of the corresponding `HistoryItemV2` entry.
62
- in_compound_task:
63
- Whether this is the compute part of a compound task.
64
- kwargs:
65
- Runner-specific parameters.
72
+ task_type: Task type.
73
+ kwargs: Runner-specific parameters.
66
74
  """
67
75
  raise NotImplementedError()
68
76
 
69
- def validate_submit_parameters(self, parameters: dict[str, Any]) -> None:
77
+ def validate_submit_parameters(
78
+ self,
79
+ parameters: dict[str, Any],
80
+ task_type: TaskTypeType,
81
+ ) -> None:
70
82
  """
71
83
  Validate parameters for `submit` method
72
84
 
73
85
  Args:
74
86
  parameters: Parameters dictionary.
87
+ task_type: Task type.s
75
88
  """
89
+ if task_type not in TASK_TYPES_SUBMIT:
90
+ raise ValueError(f"Invalid {task_type=} for `submit`.")
76
91
  if not isinstance(parameters, dict):
77
92
  raise ValueError("`parameters` must be a dictionary.")
78
- if "zarr_urls" not in parameters.keys():
79
- raise ValueError(
80
- f"No 'zarr_urls' key in in {list(parameters.keys())}"
81
- )
93
+ if task_type in ["non_parallel", "compound"]:
94
+ if "zarr_urls" not in parameters.keys():
95
+ raise ValueError(
96
+ f"No 'zarr_urls' key in in {list(parameters.keys())}"
97
+ )
98
+ elif task_type in ["converter_non_parallel", "converter_compound"]:
99
+ if "zarr_urls" in parameters.keys():
100
+ raise ValueError(
101
+ f"Forbidden 'zarr_urls' key in {list(parameters.keys())}"
102
+ )
103
+
82
104
  if _COMPONENT_KEY_ not in parameters.keys():
83
105
  raise ValueError(
84
106
  f"No '{_COMPONENT_KEY_}' key in in {list(parameters.keys())}"
@@ -87,21 +109,26 @@ class BaseRunner(object):
87
109
  def validate_multisubmit_parameters(
88
110
  self,
89
111
  list_parameters: list[dict[str, Any]],
90
- in_compound_task: bool,
112
+ task_type: TaskTypeType,
91
113
  ) -> None:
92
114
  """
93
115
  Validate parameters for `multi_submit` method
94
116
 
95
117
  Args:
96
118
  list_parameters: List of parameters dictionaries.
97
- in_compound_task:
98
- Whether this is the compute part of a compound task.
119
+ task_type: Task type.
99
120
  """
121
+ if task_type not in TASK_TYPES_MULTISUBMIT:
122
+ raise ValueError(f"Invalid {task_type=} for `multisubmit`.")
123
+
124
+ if not isinstance(list_parameters, list):
125
+ raise ValueError("`parameters` must be a list.")
126
+
100
127
  for single_kwargs in list_parameters:
101
128
  if not isinstance(single_kwargs, dict):
102
- raise RuntimeError("kwargs itemt must be a dictionary.")
129
+ raise ValueError("kwargs itemt must be a dictionary.")
103
130
  if "zarr_url" not in single_kwargs.keys():
104
- raise RuntimeError(
131
+ raise ValueError(
105
132
  f"No 'zarr_url' key in in {list(single_kwargs.keys())}"
106
133
  )
107
134
  if _COMPONENT_KEY_ not in single_kwargs.keys():
@@ -109,7 +136,7 @@ class BaseRunner(object):
109
136
  f"No '{_COMPONENT_KEY_}' key "
110
137
  f"in {list(single_kwargs.keys())}"
111
138
  )
112
- if not in_compound_task:
139
+ if task_type == "parallel":
113
140
  zarr_urls = [kwargs["zarr_url"] for kwargs in list_parameters]
114
141
  if len(zarr_urls) != len(set(zarr_urls)):
115
- raise RuntimeError("Non-unique zarr_urls")
142
+ raise ValueError("Non-unique zarr_urls")
@@ -9,9 +9,9 @@ from ._local_config import LocalBackendConfig
9
9
  from fractal_server.app.runner.components import _COMPONENT_KEY_
10
10
  from fractal_server.app.runner.executors.base_runner import BaseRunner
11
11
  from fractal_server.app.runner.task_files import TaskFiles
12
+ from fractal_server.app.schemas.v2.task import TaskTypeType
12
13
  from fractal_server.logger import set_logger
13
14
 
14
-
15
15
  logger = set_logger(__name__)
16
16
 
17
17
 
@@ -50,6 +50,7 @@ class LocalRunner(BaseRunner):
50
50
  func: callable,
51
51
  parameters: dict[str, Any],
52
52
  task_files: TaskFiles,
53
+ task_type: TaskTypeType,
53
54
  local_backend_config: Optional[LocalBackendConfig] = None,
54
55
  ) -> tuple[Any, Exception]:
55
56
  logger.debug("[submit] START")
@@ -61,7 +62,7 @@ class LocalRunner(BaseRunner):
61
62
  component=parameters[_COMPONENT_KEY_],
62
63
  )
63
64
 
64
- self.validate_submit_parameters(parameters)
65
+ self.validate_submit_parameters(parameters, task_type=task_type)
65
66
  workdir_local = current_task_files.wftask_subfolder_local
66
67
  workdir_local.mkdir()
67
68
 
@@ -83,18 +84,18 @@ class LocalRunner(BaseRunner):
83
84
  func: callable,
84
85
  list_parameters: list[dict],
85
86
  task_files: TaskFiles,
86
- in_compound_task: bool = False,
87
+ task_type: TaskTypeType,
87
88
  local_backend_config: Optional[LocalBackendConfig] = None,
88
89
  ):
89
90
  logger.debug(f"[multisubmit] START, {len(list_parameters)=}")
90
91
 
91
92
  self.validate_multisubmit_parameters(
92
93
  list_parameters=list_parameters,
93
- in_compound_task=in_compound_task,
94
+ task_type=task_type,
94
95
  )
95
96
 
96
97
  workdir_local = task_files.wftask_subfolder_local
97
- if not in_compound_task:
98
+ if task_type not in ["compound", "converter_compound"]:
98
99
  workdir_local.mkdir()
99
100
 
100
101
  # Get local_backend_config
@@ -30,15 +30,11 @@ from fractal_server.app.runner.executors.slurm_common._slurm_config import (
30
30
  )
31
31
  from fractal_server.app.runner.filenames import SHUTDOWN_FILENAME
32
32
  from fractal_server.app.runner.task_files import TaskFiles
33
+ from fractal_server.app.schemas.v2.task import TaskTypeType
33
34
  from fractal_server.config import get_settings
34
35
  from fractal_server.logger import set_logger
35
36
  from fractal_server.syringe import Inject
36
37
 
37
- # from fractal_server.app.history import ImageStatus
38
- # from fractal_server.app.history import update_all_images
39
- # from fractal_server.app.history import update_single_image
40
- # from fractal_server.app.history import update_single_image_logfile
41
-
42
38
 
43
39
  logger = set_logger(__name__)
44
40
 
@@ -426,7 +422,7 @@ class RunnerSlurmSudo(BaseRunner):
426
422
  history_item_id: int,
427
423
  task_files: TaskFiles,
428
424
  slurm_config: SlurmConfig,
429
- in_compound_task: bool = False,
425
+ task_type: TaskTypeType,
430
426
  ) -> tuple[Any, Exception]:
431
427
  workdir_local = task_files.wftask_subfolder_local
432
428
  workdir_remote = task_files.wftask_subfolder_remote
@@ -439,21 +435,9 @@ class RunnerSlurmSudo(BaseRunner):
439
435
  )
440
436
 
441
437
  if self.jobs != {}:
442
- if not in_compound_task:
443
- pass
444
- # update_all_images(
445
- # history_item_id=history_item_id,
446
- # status=ImageStatus.FAILED,
447
- # )
448
438
  raise JobExecutionError("Unexpected branch: jobs should be empty.")
449
439
 
450
440
  if self.is_shutdown():
451
- if not in_compound_task:
452
- pass
453
- # update_all_images(
454
- # history_item_id=history_item_id,
455
- # status=ImageStatus.FAILED,
456
- # )
457
441
  raise JobExecutionError("Cannot continue after shutdown.")
458
442
 
459
443
  # Validation phase
@@ -505,22 +489,6 @@ class RunnerSlurmSudo(BaseRunner):
505
489
  )
506
490
  time.sleep(self.slurm_poll_interval)
507
491
 
508
- if not in_compound_task:
509
- if exception is None:
510
- pass
511
- # update_all_images(
512
- # history_item_id=history_item_id,
513
- # status=ImageStatus.DONE,
514
- # logfile=LOGFILE,
515
- # )
516
- else:
517
- pass
518
- # update_all_images(
519
- # history_item_id=history_item_id,
520
- # status=ImageStatus.FAILED,
521
- # logfile=LOGFILE,
522
- # )
523
-
524
492
  return result, exception
525
493
 
526
494
  def multisubmit(
@@ -530,20 +498,19 @@ class RunnerSlurmSudo(BaseRunner):
530
498
  history_item_id: int,
531
499
  task_files: TaskFiles,
532
500
  slurm_config: SlurmConfig,
533
- in_compound_task: bool = False,
501
+ task_type: TaskTypeType,
534
502
  ):
535
503
  # self.scancel_jobs()
536
504
 
537
505
  self.validate_multisubmit_parameters(
538
- list_parameters=list_parameters,
539
- in_compound_task=in_compound_task,
506
+ list_parameters=list_parameters, task_type=task_type
540
507
  )
541
508
 
542
509
  workdir_local = task_files.wftask_subfolder_local
543
510
  workdir_remote = task_files.wftask_subfolder_remote
544
511
 
545
512
  # Create local&remote task subfolders
546
- if not in_compound_task:
513
+ if task_type not in ["converter_compound", "compound"]:
547
514
  original_umask = os.umask(0)
548
515
  workdir_local.mkdir(parents=True, mode=0o755)
549
516
  os.umask(original_umask)
@@ -640,28 +607,6 @@ class RunnerSlurmSudo(BaseRunner):
640
607
  result, exception = self._postprocess_single_task(
641
608
  task=task
642
609
  )
643
- if not in_compound_task:
644
- pass
645
- # update_single_image_logfile(
646
- # history_item_id=history_item_id,
647
- # zarr_url=task.zarr_url,
648
- # logfile=task.task_files.log_file_local,
649
- # )
650
- if not in_compound_task:
651
- if exception is None:
652
- pass
653
- # update_single_image(
654
- # zarr_url=task.zarr_url,
655
- # history_item_id=history_item_id,
656
- # status=ImageStatus.DONE,
657
- # )
658
- else:
659
- pass
660
- # update_single_image(
661
- # zarr_url=task.zarr_url,
662
- # history_item_id=history_item_id,
663
- # status=ImageStatus.FAILED,
664
- # )
665
610
  if exception is None:
666
611
  results[task.index] = result
667
612
  else:
@@ -0,0 +1,48 @@
1
+ from typing import Any
2
+
3
+ from sqlalchemy.dialects.postgresql import insert as pg_insert
4
+ from sqlalchemy.orm import Session
5
+
6
+ from fractal_server.app.models.v2 import HistoryImageCache
7
+
8
+
9
+ def bulk_upsert_image_cache_fast(
10
+ *,
11
+ list_upsert_objects: list[dict[str, Any]],
12
+ db: Session,
13
+ ) -> None:
14
+ """
15
+ Insert or update many objects into `HistoryImageCache` and commit
16
+
17
+ This function is an optimized version of
18
+
19
+ ```python
20
+ for obj in list_upsert_objects:
21
+ db.merge(**obj)
22
+ db.commit()
23
+ ```
24
+
25
+ See docs at
26
+ https://docs.sqlalchemy.org/en/20/dialects/postgresql.html#insert-on-conflict-upsert
27
+
28
+ FIXME: we tried to replace `index_elements` with
29
+ `constraint="pk_historyimagecache"`, but it did not work as expected.
30
+
31
+ Arguments:
32
+ list_upsert_objects:
33
+ List of dictionaries for objects to be upsert-ed.
34
+ db: A sync database session
35
+ """
36
+ if len(list_upsert_objects) == 0:
37
+ return None
38
+ stmt = pg_insert(HistoryImageCache).values(list_upsert_objects)
39
+ stmt = stmt.on_conflict_do_update(
40
+ index_elements=[
41
+ HistoryImageCache.zarr_url,
42
+ HistoryImageCache.dataset_id,
43
+ HistoryImageCache.workflowtask_id,
44
+ ],
45
+ set_=dict(latest_history_unit_id=stmt.excluded.latest_history_unit_id),
46
+ )
47
+ db.execute(stmt)
48
+ db.commit()
@@ -14,6 +14,8 @@ from ....images.tools import find_image_by_zarr_url
14
14
  from ..exceptions import JobExecutionError
15
15
  from .runner_functions import no_op_submit_setup_call
16
16
  from .runner_functions import run_v2_task_compound
17
+ from .runner_functions import run_v2_task_converter_compound
18
+ from .runner_functions import run_v2_task_converter_non_parallel
17
19
  from .runner_functions import run_v2_task_non_parallel
18
20
  from .runner_functions import run_v2_task_parallel
19
21
  from .task_interface import TaskOutput
@@ -63,22 +65,26 @@ def execute_tasks_v2(
63
65
  # PRE TASK EXECUTION
64
66
 
65
67
  # Filter images by types and attributes (in two steps)
66
- type_filters = copy(current_dataset_type_filters)
67
- type_filters_patch = merge_type_filters(
68
- task_input_types=task.input_types,
69
- wftask_type_filters=wftask.type_filters,
70
- )
71
- type_filters.update(type_filters_patch)
72
- type_filtered_images = filter_image_list(
73
- images=tmp_images,
74
- type_filters=type_filters,
75
- attribute_filters=None,
76
- )
77
- filtered_images = filter_image_list(
78
- images=type_filtered_images,
79
- type_filters=None,
80
- attribute_filters=job_attribute_filters,
81
- )
68
+ if wftask.task_type in ["compound", "parallel", "non_parallel"]:
69
+ type_filters = copy(current_dataset_type_filters)
70
+ type_filters_patch = merge_type_filters(
71
+ task_input_types=task.input_types,
72
+ wftask_type_filters=wftask.type_filters,
73
+ )
74
+ type_filters.update(type_filters_patch)
75
+ type_filtered_images = filter_image_list(
76
+ images=tmp_images,
77
+ type_filters=type_filters,
78
+ attribute_filters=None,
79
+ )
80
+ num_available_images = len(type_filtered_images)
81
+ filtered_images = filter_image_list(
82
+ images=type_filtered_images,
83
+ type_filters=None,
84
+ attribute_filters=job_attribute_filters,
85
+ )
86
+ else:
87
+ num_available_images = 0
82
88
 
83
89
  # Create history item
84
90
  with next(get_sync_db()) as db:
@@ -100,7 +106,7 @@ def execute_tasks_v2(
100
106
  workflowtask_id=wftask.id,
101
107
  workflowtask_dump=workflowtask_dump,
102
108
  task_group_dump=task_group_dump,
103
- num_available_images=len(type_filtered_images),
109
+ num_available_images=num_available_images,
104
110
  status=XXXStatus.SUBMITTED,
105
111
  )
106
112
  db.add(history_run)
@@ -126,6 +132,22 @@ def execute_tasks_v2(
126
132
  history_run_id=history_run_id,
127
133
  dataset_id=dataset.id,
128
134
  )
135
+ elif task.type == "converter_non_parallel":
136
+ (
137
+ current_task_output,
138
+ num_tasks,
139
+ exceptions,
140
+ ) = run_v2_task_converter_non_parallel(
141
+ zarr_dir=zarr_dir,
142
+ wftask=wftask,
143
+ task=task,
144
+ workflow_dir_local=workflow_dir_local,
145
+ workflow_dir_remote=workflow_dir_remote,
146
+ executor=runner,
147
+ submit_setup_call=submit_setup_call,
148
+ history_run_id=history_run_id,
149
+ dataset_id=dataset.id,
150
+ )
129
151
  elif task.type == "parallel":
130
152
  current_task_output, num_tasks, exceptions = run_v2_task_parallel(
131
153
  images=filtered_images,
@@ -151,6 +173,22 @@ def execute_tasks_v2(
151
173
  history_run_id=history_run_id,
152
174
  dataset_id=dataset.id,
153
175
  )
176
+ elif task.type == "converter_compound":
177
+ (
178
+ current_task_output,
179
+ num_tasks,
180
+ exceptions,
181
+ ) = run_v2_task_converter_compound(
182
+ zarr_dir=zarr_dir,
183
+ wftask=wftask,
184
+ task=task,
185
+ workflow_dir_local=workflow_dir_local,
186
+ workflow_dir_remote=workflow_dir_remote,
187
+ executor=runner,
188
+ submit_setup_call=submit_setup_call,
189
+ history_run_id=history_run_id,
190
+ dataset_id=dataset.id,
191
+ )
154
192
  else:
155
193
  raise ValueError(f"Unexpected error: Invalid {task.type=}.")
156
194