fractal-server 2.17.1a1__py3-none-any.whl → 2.18.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (225) hide show
  1. fractal_server/__init__.py +1 -1
  2. fractal_server/__main__.py +21 -19
  3. fractal_server/app/db/__init__.py +3 -3
  4. fractal_server/app/models/__init__.py +1 -0
  5. fractal_server/app/models/linkuserproject.py +43 -1
  6. fractal_server/app/models/security.py +28 -8
  7. fractal_server/app/models/v2/__init__.py +3 -1
  8. fractal_server/app/models/v2/accounting.py +9 -1
  9. fractal_server/app/models/v2/dataset.py +5 -1
  10. fractal_server/app/models/v2/history.py +15 -1
  11. fractal_server/app/models/v2/job.py +17 -2
  12. fractal_server/app/models/v2/profile.py +29 -0
  13. fractal_server/app/models/v2/project.py +4 -10
  14. fractal_server/app/models/v2/resource.py +17 -0
  15. fractal_server/app/models/v2/task_group.py +4 -3
  16. fractal_server/app/models/v2/workflow.py +2 -1
  17. fractal_server/app/routes/admin/v2/__init__.py +12 -13
  18. fractal_server/app/routes/admin/v2/accounting.py +3 -3
  19. fractal_server/app/routes/admin/v2/job.py +35 -24
  20. fractal_server/app/routes/admin/v2/profile.py +3 -2
  21. fractal_server/app/routes/admin/v2/resource.py +5 -5
  22. fractal_server/app/routes/admin/v2/sharing.py +103 -0
  23. fractal_server/app/routes/admin/v2/task.py +37 -26
  24. fractal_server/app/routes/admin/v2/task_group.py +94 -17
  25. fractal_server/app/routes/admin/v2/task_group_lifecycle.py +21 -22
  26. fractal_server/app/routes/api/__init__.py +1 -9
  27. fractal_server/app/routes/api/v2/__init__.py +49 -50
  28. fractal_server/app/routes/api/v2/_aux_functions.py +132 -124
  29. fractal_server/app/routes/api/v2/_aux_functions_history.py +51 -23
  30. fractal_server/app/routes/api/v2/_aux_functions_sharing.py +97 -0
  31. fractal_server/app/routes/api/v2/_aux_functions_task_lifecycle.py +6 -8
  32. fractal_server/app/routes/api/v2/_aux_functions_tasks.py +7 -9
  33. fractal_server/app/routes/api/v2/_aux_task_group_disambiguation.py +1 -2
  34. fractal_server/app/routes/api/v2/dataset.py +95 -102
  35. fractal_server/app/routes/api/v2/history.py +59 -33
  36. fractal_server/app/routes/api/v2/images.py +24 -9
  37. fractal_server/app/routes/api/v2/job.py +52 -33
  38. fractal_server/app/routes/api/v2/pre_submission_checks.py +16 -8
  39. fractal_server/app/routes/api/v2/project.py +65 -37
  40. fractal_server/app/routes/api/v2/sharing.py +311 -0
  41. fractal_server/app/routes/api/v2/status_legacy.py +31 -41
  42. fractal_server/app/routes/api/v2/submit.py +82 -78
  43. fractal_server/app/routes/api/v2/task.py +19 -20
  44. fractal_server/app/routes/api/v2/task_collection.py +41 -43
  45. fractal_server/app/routes/api/v2/task_collection_custom.py +19 -20
  46. fractal_server/app/routes/api/v2/task_collection_pixi.py +10 -11
  47. fractal_server/app/routes/api/v2/task_group.py +25 -24
  48. fractal_server/app/routes/api/v2/task_group_lifecycle.py +32 -32
  49. fractal_server/app/routes/api/v2/task_version_update.py +23 -19
  50. fractal_server/app/routes/api/v2/workflow.py +50 -55
  51. fractal_server/app/routes/api/v2/workflow_import.py +37 -37
  52. fractal_server/app/routes/api/v2/workflowtask.py +32 -26
  53. fractal_server/app/routes/auth/__init__.py +1 -3
  54. fractal_server/app/routes/auth/_aux_auth.py +101 -2
  55. fractal_server/app/routes/auth/current_user.py +2 -66
  56. fractal_server/app/routes/auth/group.py +8 -35
  57. fractal_server/app/routes/auth/login.py +1 -0
  58. fractal_server/app/routes/auth/oauth.py +4 -3
  59. fractal_server/app/routes/auth/register.py +4 -2
  60. fractal_server/app/routes/auth/router.py +2 -0
  61. fractal_server/app/routes/auth/users.py +19 -10
  62. fractal_server/app/routes/auth/viewer_paths.py +43 -0
  63. fractal_server/app/routes/aux/_job.py +1 -1
  64. fractal_server/app/routes/aux/_runner.py +2 -2
  65. fractal_server/app/routes/pagination.py +1 -1
  66. fractal_server/app/schemas/user.py +29 -12
  67. fractal_server/app/schemas/user_group.py +0 -15
  68. fractal_server/app/schemas/v2/__init__.py +55 -48
  69. fractal_server/app/schemas/v2/accounting.py +11 -0
  70. fractal_server/app/schemas/v2/dataset.py +57 -11
  71. fractal_server/app/schemas/v2/dumps.py +10 -9
  72. fractal_server/app/schemas/v2/job.py +11 -11
  73. fractal_server/app/schemas/v2/manifest.py +4 -3
  74. fractal_server/app/schemas/v2/profile.py +53 -2
  75. fractal_server/app/schemas/v2/project.py +3 -3
  76. fractal_server/app/schemas/v2/resource.py +121 -16
  77. fractal_server/app/schemas/v2/sharing.py +99 -0
  78. fractal_server/app/schemas/v2/status_legacy.py +3 -3
  79. fractal_server/app/schemas/v2/task.py +6 -7
  80. fractal_server/app/schemas/v2/task_collection.py +5 -5
  81. fractal_server/app/schemas/v2/task_group.py +16 -16
  82. fractal_server/app/schemas/v2/workflow.py +16 -16
  83. fractal_server/app/schemas/v2/workflowtask.py +16 -15
  84. fractal_server/app/security/__init__.py +5 -8
  85. fractal_server/app/security/signup_email.py +4 -5
  86. fractal_server/app/shutdown.py +6 -6
  87. fractal_server/config/__init__.py +0 -6
  88. fractal_server/config/_data.py +0 -68
  89. fractal_server/config/_database.py +19 -20
  90. fractal_server/config/_email.py +30 -38
  91. fractal_server/config/_main.py +38 -52
  92. fractal_server/config/_oauth.py +17 -21
  93. fractal_server/data_migrations/2_18_0.py +30 -0
  94. fractal_server/exceptions.py +4 -0
  95. fractal_server/images/models.py +4 -5
  96. fractal_server/images/status_tools.py +4 -2
  97. fractal_server/logger.py +1 -1
  98. fractal_server/main.py +75 -13
  99. fractal_server/migrations/versions/034a469ec2eb_task_groups.py +4 -8
  100. fractal_server/migrations/versions/091b01f51f88_add_usergroup_and_linkusergroup_table.py +1 -1
  101. fractal_server/migrations/versions/0f5f85bb2ae7_add_pre_pinned_packages.py +1 -0
  102. fractal_server/migrations/versions/19eca0dd47a9_user_settings_project_dir.py +1 -1
  103. fractal_server/migrations/versions/1a83a5260664_rename.py +1 -1
  104. fractal_server/migrations/versions/1eac13a26c83_drop_v1_tables.py +1 -0
  105. fractal_server/migrations/versions/316140ff7ee1_remove_usersettings_cache_dir.py +1 -1
  106. fractal_server/migrations/versions/40d6d6511b20_add_index_to_history_models.py +47 -0
  107. fractal_server/migrations/versions/45fbb391d7af_make_resource_id_fk_non_nullable.py +1 -1
  108. fractal_server/migrations/versions/47351f8c7ebc_drop_dataset_filters.py +1 -0
  109. fractal_server/migrations/versions/49d0856e9569_drop_table.py +2 -3
  110. fractal_server/migrations/versions/4c308bcaea2b_add_task_args_schema_and_task_args_.py +1 -1
  111. fractal_server/migrations/versions/4cedeb448a53_workflowtask_foreign_keys_not_nullables.py +1 -1
  112. fractal_server/migrations/versions/501961cfcd85_remove_link_between_v1_and_v2_tasks_.py +2 -1
  113. fractal_server/migrations/versions/50a13d6138fd_initial_schema.py +7 -19
  114. fractal_server/migrations/versions/5bf02391cfef_v2.py +4 -10
  115. fractal_server/migrations/versions/70e77f1c38b0_add_applyworkflow_first_task_index_and_.py +1 -0
  116. fractal_server/migrations/versions/71eefd1dd202_add_slurm_accounts.py +1 -1
  117. fractal_server/migrations/versions/7673fe18c05d_remove_project_dir_server_default.py +1 -1
  118. fractal_server/migrations/versions/7910eed4cf97_user_project_dirs_and_usergroup_viewer_.py +60 -0
  119. fractal_server/migrations/versions/791ce783d3d8_add_indices.py +1 -1
  120. fractal_server/migrations/versions/83bc2ad3ffcc_2_17_0.py +1 -0
  121. fractal_server/migrations/versions/84bf0fffde30_add_dumps_to_applyworkflow.py +1 -0
  122. fractal_server/migrations/versions/88270f589c9b_add_prevent_new_submissions.py +39 -0
  123. fractal_server/migrations/versions/8e8f227a3e36_update_taskv2_post_2_7_0.py +2 -4
  124. fractal_server/migrations/versions/8f79bd162e35_add_docs_info_and_docs_link_to_task_.py +1 -1
  125. fractal_server/migrations/versions/94a47ea2d3ff_remove_cache_dir_slurm_user_and_slurm_.py +1 -0
  126. fractal_server/migrations/versions/969d84257cac_add_historyrun_task_id.py +1 -1
  127. fractal_server/migrations/versions/97f444d47249_add_applyworkflow_project_dump.py +1 -1
  128. fractal_server/migrations/versions/981d588fe248_add_executor_error_log.py +1 -1
  129. fractal_server/migrations/versions/99ea79d9e5d2_add_dataset_history.py +2 -4
  130. fractal_server/migrations/versions/9c5ae74c9b98_add_user_settings_table.py +1 -1
  131. fractal_server/migrations/versions/9db60297b8b2_set_ondelete.py +1 -1
  132. fractal_server/migrations/versions/9fd26a2b0de4_add_workflow_timestamp_created.py +1 -1
  133. fractal_server/migrations/versions/a7f4d6137b53_add_workflow_dump_to_applyworkflow.py +1 -1
  134. fractal_server/migrations/versions/af1ef1c83c9b_add_accounting_tables.py +1 -0
  135. fractal_server/migrations/versions/af8673379a5c_drop_old_filter_columns.py +1 -0
  136. fractal_server/migrations/versions/b1e7f7a1ff71_task_group_for_pixi.py +1 -1
  137. fractal_server/migrations/versions/b3ffb095f973_json_to_jsonb.py +1 -0
  138. fractal_server/migrations/versions/bc0e8b3327a7_project_sharing.py +72 -0
  139. fractal_server/migrations/versions/c90a7c76e996_job_id_in_history_run.py +1 -1
  140. fractal_server/migrations/versions/caba9fb1ea5e_drop_useroauth_user_settings_id.py +1 -1
  141. fractal_server/migrations/versions/d256a7379ab8_taskgroup_activity_and_venv_info_to_.py +4 -9
  142. fractal_server/migrations/versions/d4fe3708d309_make_applyworkflow_workflow_dump_non_.py +1 -0
  143. fractal_server/migrations/versions/da2cb2ac4255_user_group_viewer_paths.py +1 -1
  144. fractal_server/migrations/versions/db09233ad13a_split_filters_and_keep_old_columns.py +1 -0
  145. fractal_server/migrations/versions/e0e717ae2f26_delete_linkuserproject_ondelete_project.py +50 -0
  146. fractal_server/migrations/versions/e75cac726012_make_applyworkflow_start_timestamp_not_.py +1 -0
  147. fractal_server/migrations/versions/e81103413827_add_job_type_filters.py +1 -1
  148. fractal_server/migrations/versions/efa89c30e0a4_add_project_timestamp_created.py +1 -0
  149. fractal_server/migrations/versions/f0702066b007_one_submitted_job_per_dataset.py +40 -0
  150. fractal_server/migrations/versions/f37aceb45062_make_historyunit_logfile_required.py +1 -1
  151. fractal_server/migrations/versions/f384e1c0cf5d_drop_task_default_args_columns.py +1 -0
  152. fractal_server/migrations/versions/fbce16ff4e47_new_history_items.py +4 -9
  153. fractal_server/runner/config/_local.py +8 -5
  154. fractal_server/runner/config/_slurm.py +39 -33
  155. fractal_server/runner/config/slurm_mem_to_MB.py +0 -1
  156. fractal_server/runner/executors/base_runner.py +29 -4
  157. fractal_server/runner/executors/local/get_local_config.py +1 -0
  158. fractal_server/runner/executors/local/runner.py +14 -13
  159. fractal_server/runner/executors/slurm_common/_batching.py +9 -20
  160. fractal_server/runner/executors/slurm_common/base_slurm_runner.py +53 -27
  161. fractal_server/runner/executors/slurm_common/get_slurm_config.py +14 -7
  162. fractal_server/runner/executors/slurm_common/remote.py +3 -1
  163. fractal_server/runner/executors/slurm_common/slurm_config.py +2 -0
  164. fractal_server/runner/executors/slurm_common/slurm_job_task_models.py +1 -3
  165. fractal_server/runner/executors/slurm_ssh/runner.py +16 -11
  166. fractal_server/runner/executors/slurm_ssh/tar_commands.py +1 -0
  167. fractal_server/runner/executors/slurm_sudo/_subprocess_run_as_user.py +1 -0
  168. fractal_server/runner/executors/slurm_sudo/runner.py +16 -11
  169. fractal_server/runner/task_files.py +9 -3
  170. fractal_server/runner/v2/_local.py +12 -6
  171. fractal_server/runner/v2/_slurm_ssh.py +14 -7
  172. fractal_server/runner/v2/_slurm_sudo.py +14 -7
  173. fractal_server/runner/v2/db_tools.py +0 -1
  174. fractal_server/runner/v2/deduplicate_list.py +2 -1
  175. fractal_server/runner/v2/runner.py +44 -28
  176. fractal_server/runner/v2/runner_functions.py +22 -28
  177. fractal_server/runner/v2/submit_workflow.py +29 -15
  178. fractal_server/ssh/_fabric.py +6 -13
  179. fractal_server/string_tools.py +0 -1
  180. fractal_server/syringe.py +1 -1
  181. fractal_server/tasks/config/_pixi.py +1 -1
  182. fractal_server/tasks/config/_python.py +16 -9
  183. fractal_server/tasks/utils.py +0 -1
  184. fractal_server/tasks/v2/local/_utils.py +3 -3
  185. fractal_server/tasks/v2/local/collect.py +15 -18
  186. fractal_server/tasks/v2/local/collect_pixi.py +14 -16
  187. fractal_server/tasks/v2/local/deactivate.py +14 -15
  188. fractal_server/tasks/v2/local/deactivate_pixi.py +7 -7
  189. fractal_server/tasks/v2/local/delete.py +6 -8
  190. fractal_server/tasks/v2/local/reactivate.py +12 -12
  191. fractal_server/tasks/v2/local/reactivate_pixi.py +12 -12
  192. fractal_server/tasks/v2/ssh/_utils.py +3 -3
  193. fractal_server/tasks/v2/ssh/collect.py +19 -24
  194. fractal_server/tasks/v2/ssh/collect_pixi.py +22 -24
  195. fractal_server/tasks/v2/ssh/deactivate.py +17 -15
  196. fractal_server/tasks/v2/ssh/deactivate_pixi.py +8 -7
  197. fractal_server/tasks/v2/ssh/delete.py +12 -10
  198. fractal_server/tasks/v2/ssh/reactivate.py +16 -16
  199. fractal_server/tasks/v2/ssh/reactivate_pixi.py +13 -14
  200. fractal_server/tasks/v2/templates/1_create_venv.sh +2 -0
  201. fractal_server/tasks/v2/templates/2_pip_install.sh +2 -0
  202. fractal_server/tasks/v2/templates/3_pip_freeze.sh +2 -0
  203. fractal_server/tasks/v2/templates/4_pip_show.sh +2 -0
  204. fractal_server/tasks/v2/templates/5_get_venv_size_and_file_number.sh +3 -1
  205. fractal_server/tasks/v2/templates/6_pip_install_from_freeze.sh +2 -0
  206. fractal_server/tasks/v2/templates/pixi_1_extract.sh +2 -0
  207. fractal_server/tasks/v2/templates/pixi_2_install.sh +2 -0
  208. fractal_server/tasks/v2/templates/pixi_3_post_install.sh +2 -0
  209. fractal_server/tasks/v2/utils_background.py +10 -10
  210. fractal_server/tasks/v2/utils_database.py +5 -5
  211. fractal_server/tasks/v2/utils_package_names.py +1 -2
  212. fractal_server/tasks/v2/utils_pixi.py +1 -3
  213. fractal_server/types/__init__.py +98 -1
  214. fractal_server/types/validators/__init__.py +3 -0
  215. fractal_server/types/validators/_common_validators.py +33 -3
  216. fractal_server/types/validators/_workflow_task_arguments_validators.py +1 -2
  217. fractal_server/utils.py +1 -0
  218. fractal_server/zip_tools.py +34 -0
  219. {fractal_server-2.17.1a1.dist-info → fractal_server-2.18.0.dist-info}/METADATA +3 -2
  220. fractal_server-2.18.0.dist-info/RECORD +275 -0
  221. fractal_server/app/routes/admin/v2/project.py +0 -41
  222. fractal_server-2.17.1a1.dist-info/RECORD +0 -264
  223. {fractal_server-2.17.1a1.dist-info → fractal_server-2.18.0.dist-info}/WHEEL +0 -0
  224. {fractal_server-2.17.1a1.dist-info → fractal_server-2.18.0.dist-info}/entry_points.txt +0 -0
  225. {fractal_server-2.17.1a1.dist-info → fractal_server-2.18.0.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,60 @@
1
+ """User project_dirs and UserGroup viewer paths
2
+
3
+ Revision ID: 7910eed4cf97
4
+ Revises: bc0e8b3327a7
5
+ Create Date: 2025-11-27 16:02:51.824653
6
+
7
+ """
8
+
9
+ import sqlalchemy as sa
10
+ from alembic import op
11
+ from sqlalchemy.dialects import postgresql
12
+
13
+ # revision identifiers, used by Alembic.
14
+ revision = "7910eed4cf97"
15
+ down_revision = "bc0e8b3327a7"
16
+ branch_labels = None
17
+ depends_on = None
18
+
19
+
20
+ def upgrade() -> None:
21
+ # ### commands auto generated by Alembic - please adjust! ###
22
+ with op.batch_alter_table("user_oauth", schema=None) as batch_op:
23
+ batch_op.add_column(
24
+ sa.Column(
25
+ "project_dirs",
26
+ postgresql.ARRAY(sa.String()),
27
+ server_default="{}",
28
+ nullable=False,
29
+ )
30
+ )
31
+ batch_op.alter_column(
32
+ "project_dir", existing_type=sa.VARCHAR(), nullable=True
33
+ )
34
+
35
+ with op.batch_alter_table("usergroup", schema=None) as batch_op:
36
+ batch_op.drop_column("viewer_paths")
37
+
38
+ # ### end Alembic commands ###
39
+
40
+
41
+ def downgrade() -> None:
42
+ # ### commands auto generated by Alembic - please adjust! ###
43
+ with op.batch_alter_table("usergroup", schema=None) as batch_op:
44
+ batch_op.add_column(
45
+ sa.Column(
46
+ "viewer_paths",
47
+ postgresql.JSONB(astext_type=sa.Text()),
48
+ server_default=sa.text("'[]'::json"),
49
+ autoincrement=False,
50
+ nullable=False,
51
+ )
52
+ )
53
+
54
+ with op.batch_alter_table("user_oauth", schema=None) as batch_op:
55
+ batch_op.alter_column(
56
+ "project_dir", existing_type=sa.VARCHAR(), nullable=False
57
+ )
58
+ batch_op.drop_column("project_dirs")
59
+
60
+ # ### end Alembic commands ###
@@ -5,8 +5,8 @@ Revises: 969d84257cac
5
5
  Create Date: 2025-06-03 09:32:30.757651
6
6
 
7
7
  """
8
- from alembic import op
9
8
 
9
+ from alembic import op
10
10
 
11
11
  # revision identifiers, used by Alembic.
12
12
  revision = "791ce783d3d8"
@@ -5,6 +5,7 @@ Revises: 981d588fe248
5
5
  Create Date: 2025-10-30 14:16:53.639006
6
6
 
7
7
  """
8
+
8
9
  import sqlalchemy as sa
9
10
  import sqlmodel
10
11
  from alembic import op
@@ -5,6 +5,7 @@ Revises: 99ea79d9e5d2
5
5
  Create Date: 2023-10-26 16:11:44.061971
6
6
 
7
7
  """
8
+
8
9
  import sqlalchemy as sa
9
10
  from alembic import op
10
11
 
@@ -0,0 +1,39 @@
1
+ """add_prevent_new_submissions
2
+
3
+ Revision ID: 88270f589c9b
4
+ Revises: f0702066b007
5
+ Create Date: 2025-12-02 12:34:11.028259
6
+
7
+ """
8
+
9
+ import sqlalchemy as sa
10
+ from alembic import op
11
+
12
+ # revision identifiers, used by Alembic.
13
+ revision = "88270f589c9b"
14
+ down_revision = "f0702066b007"
15
+ branch_labels = None
16
+ depends_on = None
17
+
18
+
19
+ def upgrade() -> None:
20
+ # ### commands auto generated by Alembic - please adjust! ###
21
+ with op.batch_alter_table("resource", schema=None) as batch_op:
22
+ batch_op.add_column(
23
+ sa.Column(
24
+ "prevent_new_submissions",
25
+ sa.BOOLEAN(),
26
+ server_default="false",
27
+ nullable=False,
28
+ )
29
+ )
30
+
31
+ # ### end Alembic commands ###
32
+
33
+
34
+ def downgrade() -> None:
35
+ # ### commands auto generated by Alembic - please adjust! ###
36
+ with op.batch_alter_table("resource", schema=None) as batch_op:
37
+ batch_op.drop_column("prevent_new_submissions")
38
+
39
+ # ### end Alembic commands ###
@@ -5,10 +5,10 @@ Revises: 034a469ec2eb
5
5
  Create Date: 2024-10-29 09:01:33.075251
6
6
 
7
7
  """
8
+
8
9
  import sqlalchemy as sa
9
10
  from alembic import op
10
11
 
11
-
12
12
  # revision identifiers, used by Alembic.
13
13
  revision = "8e8f227a3e36"
14
14
  down_revision = "034a469ec2eb"
@@ -31,9 +31,7 @@ def downgrade() -> None:
31
31
  # ### commands auto generated by Alembic - please adjust! ###
32
32
  with op.batch_alter_table("taskv2", schema=None) as batch_op:
33
33
  batch_op.add_column(
34
- sa.Column(
35
- "owner", sa.VARCHAR(), autoincrement=False, nullable=True
36
- )
34
+ sa.Column("owner", sa.VARCHAR(), autoincrement=False, nullable=True)
37
35
  )
38
36
  batch_op.alter_column(
39
37
  "taskgroupv2_id", existing_type=sa.INTEGER(), nullable=True
@@ -5,11 +5,11 @@ Revises: a7f4d6137b53
5
5
  Create Date: 2023-08-01 14:13:15.322398
6
6
 
7
7
  """
8
+
8
9
  import sqlalchemy as sa
9
10
  import sqlmodel
10
11
  from alembic import op
11
12
 
12
-
13
13
  # revision identifiers, used by Alembic.
14
14
  revision = "8f79bd162e35"
15
15
  down_revision = "a7f4d6137b53"
@@ -5,6 +5,7 @@ Revises: 9c5ae74c9b98
5
5
  Create Date: 2024-09-25 09:33:18.014831
6
6
 
7
7
  """
8
+
8
9
  import sqlalchemy as sa
9
10
  from alembic import op
10
11
  from sqlalchemy.dialects import postgresql
@@ -5,10 +5,10 @@ Revises: c90a7c76e996
5
5
  Create Date: 2025-05-13 11:17:22.089308
6
6
 
7
7
  """
8
+
8
9
  import sqlalchemy as sa
9
10
  from alembic import op
10
11
 
11
-
12
12
  # revision identifiers, used by Alembic.
13
13
  revision = "969d84257cac"
14
14
  down_revision = "c90a7c76e996"
@@ -5,10 +5,10 @@ Revises: 71eefd1dd202
5
5
  Create Date: 2023-12-05 15:36:48.573358
6
6
 
7
7
  """
8
+
8
9
  import sqlalchemy as sa
9
10
  from alembic import op
10
11
 
11
-
12
12
  # revision identifiers, used by Alembic.
13
13
  revision = "97f444d47249"
14
14
  down_revision = "71eefd1dd202"
@@ -5,11 +5,11 @@ Revises: 0f5f85bb2ae7
5
5
  Create Date: 2025-09-15 08:31:10.363449
6
6
 
7
7
  """
8
+
8
9
  import sqlalchemy as sa
9
10
  import sqlmodel
10
11
  from alembic import op
11
12
 
12
-
13
13
  # revision identifiers, used by Alembic.
14
14
  revision = "981d588fe248"
15
15
  down_revision = "0f5f85bb2ae7"
@@ -5,10 +5,10 @@ Revises: 8f79bd162e35
5
5
  Create Date: 2023-10-16 09:45:15.132185
6
6
 
7
7
  """
8
+
8
9
  import sqlalchemy as sa
9
10
  from alembic import op
10
11
 
11
-
12
12
  # revision identifiers, used by Alembic.
13
13
  revision = "99ea79d9e5d2"
14
14
  down_revision = "8f79bd162e35"
@@ -20,9 +20,7 @@ def upgrade() -> None:
20
20
  # ### commands auto generated by Alembic - please adjust! ###
21
21
  with op.batch_alter_table("dataset", schema=None) as batch_op:
22
22
  batch_op.add_column(
23
- sa.Column(
24
- "history", sa.JSON(), server_default="[]", nullable=False
25
- )
23
+ sa.Column("history", sa.JSON(), server_default="[]", nullable=False)
26
24
  )
27
25
 
28
26
  # ### end Alembic commands ###
@@ -5,11 +5,11 @@ Revises: d9a140db5d42
5
5
  Create Date: 2024-09-24 12:01:13.393326
6
6
 
7
7
  """
8
+
8
9
  import sqlalchemy as sa
9
10
  import sqlmodel
10
11
  from alembic import op
11
12
 
12
-
13
13
  # revision identifiers, used by Alembic.
14
14
  revision = "9c5ae74c9b98"
15
15
  down_revision = "d9a140db5d42"
@@ -5,8 +5,8 @@ Revises: e81103413827
5
5
  Create Date: 2025-04-07 13:13:14.596394
6
6
 
7
7
  """
8
- from alembic import op
9
8
 
9
+ from alembic import op
10
10
 
11
11
  # revision identifiers, used by Alembic.
12
12
  revision = "9db60297b8b2"
@@ -5,13 +5,13 @@ Revises: efa89c30e0a4
5
5
  Create Date: 2024-01-11 09:31:20.950090
6
6
 
7
7
  """
8
+
8
9
  from datetime import datetime
9
10
  from datetime import timezone
10
11
 
11
12
  import sqlalchemy as sa
12
13
  from alembic import op
13
14
 
14
-
15
15
  # revision identifiers, used by Alembic.
16
16
  revision = "9fd26a2b0de4"
17
17
  down_revision = "4cedeb448a53"
@@ -5,10 +5,10 @@ Revises: 70e77f1c38b0
5
5
  Create Date: 2023-07-24 16:53:02.569582
6
6
 
7
7
  """
8
+
8
9
  import sqlalchemy as sa
9
10
  from alembic import op
10
11
 
11
-
12
12
  # revision identifiers, used by Alembic.
13
13
  revision = "a7f4d6137b53"
14
14
  down_revision = "70e77f1c38b0"
@@ -5,6 +5,7 @@ Revises: 1eac13a26c83
5
5
  Create Date: 2025-02-17 14:22:32.701581
6
6
 
7
7
  """
8
+
8
9
  import sqlalchemy as sa
9
10
  from alembic import op
10
11
  from sqlalchemy.dialects import postgresql
@@ -5,6 +5,7 @@ Revises: db09233ad13a
5
5
  Create Date: 2025-01-30 14:44:04.302795
6
6
 
7
7
  """
8
+
8
9
  import sqlalchemy as sa
9
10
  from alembic import op
10
11
  from sqlalchemy.dialects import postgresql
@@ -5,11 +5,11 @@ Revises: 791ce783d3d8
5
5
  Create Date: 2025-05-29 16:31:17.565973
6
6
 
7
7
  """
8
+
8
9
  import sqlalchemy as sa
9
10
  import sqlmodel
10
11
  from alembic import op
11
12
 
12
-
13
13
  # revision identifiers, used by Alembic.
14
14
  revision = "b1e7f7a1ff71"
15
15
  down_revision = "791ce783d3d8"
@@ -5,6 +5,7 @@ Revises: b1e7f7a1ff71
5
5
  Create Date: 2025-06-19 10:12:06.699107
6
6
 
7
7
  """
8
+
8
9
  import sqlalchemy as sa
9
10
  from alembic import op
10
11
  from sqlalchemy.dialects import postgresql
@@ -0,0 +1,72 @@
1
+ """Project sharing
2
+
3
+ Revision ID: bc0e8b3327a7
4
+ Revises: e0e717ae2f26
5
+ Create Date: 2025-11-20 11:40:03.796112
6
+
7
+ """
8
+
9
+ import sqlalchemy as sa
10
+ from alembic import op
11
+
12
+ # revision identifiers, used by Alembic.
13
+ revision = "bc0e8b3327a7"
14
+ down_revision = "e0e717ae2f26"
15
+ branch_labels = None
16
+ depends_on = None
17
+
18
+
19
+ def upgrade() -> None:
20
+ # ### commands auto generated by Alembic - please adjust! ###
21
+ with op.batch_alter_table("linkuserprojectv2", schema=None) as batch_op:
22
+ batch_op.add_column(
23
+ sa.Column(
24
+ "is_owner", sa.BOOLEAN(), server_default="true", nullable=False
25
+ )
26
+ )
27
+ batch_op.add_column(
28
+ sa.Column(
29
+ "is_verified",
30
+ sa.BOOLEAN(),
31
+ server_default="true",
32
+ nullable=False,
33
+ )
34
+ )
35
+ batch_op.add_column(
36
+ sa.Column(
37
+ "permissions", sa.String(), server_default="rwx", nullable=False
38
+ )
39
+ )
40
+ batch_op.create_index(
41
+ "ix_linkuserprojectv2_one_owner_per_project",
42
+ ["project_id"],
43
+ unique=True,
44
+ postgresql_where=sa.text("is_owner IS true"),
45
+ )
46
+
47
+ # ### end Alembic commands ###
48
+
49
+ # Manually add check constraints
50
+ batch_op.create_check_constraint(
51
+ "owner_is_verified", "NOT (is_owner AND NOT is_verified)"
52
+ )
53
+ batch_op.create_check_constraint(
54
+ "owner_full_permissions", "NOT (is_owner AND permissions <> 'rwx')"
55
+ )
56
+ batch_op.create_check_constraint(
57
+ "valid_permissions", "permissions IN ('r', 'rw', 'rwx')"
58
+ )
59
+
60
+
61
+ def downgrade() -> None:
62
+ # ### commands auto generated by Alembic - please adjust! ###
63
+ with op.batch_alter_table("linkuserprojectv2", schema=None) as batch_op:
64
+ batch_op.drop_index(
65
+ "ix_linkuserprojectv2_one_owner_per_project",
66
+ postgresql_where=sa.text("is_owner IS true"),
67
+ )
68
+ batch_op.drop_column("permissions")
69
+ batch_op.drop_column("is_verified")
70
+ batch_op.drop_column("is_owner")
71
+
72
+ # ### end Alembic commands ###
@@ -5,10 +5,10 @@ Revises: f37aceb45062
5
5
  Create Date: 2025-04-16 10:44:30.219309
6
6
 
7
7
  """
8
+
8
9
  import sqlalchemy as sa
9
10
  from alembic import op
10
11
 
11
-
12
12
  # revision identifiers, used by Alembic.
13
13
  revision = "c90a7c76e996"
14
14
  down_revision = "f37aceb45062"
@@ -5,10 +5,10 @@ Revises: 83bc2ad3ffcc
5
5
  Create Date: 2025-11-11 16:38:27.243693
6
6
 
7
7
  """
8
+
8
9
  import sqlalchemy as sa
9
10
  from alembic import op
10
11
 
11
-
12
12
  # revision identifiers, used by Alembic.
13
13
  revision = "caba9fb1ea5e"
14
14
  down_revision = "83bc2ad3ffcc"
@@ -5,6 +5,7 @@ Revises: 19eca0dd47a9
5
5
  Create Date: 2024-11-20 15:01:52.659832
6
6
 
7
7
  """
8
+
8
9
  import sqlalchemy as sa
9
10
  import sqlmodel
10
11
  from alembic import op
@@ -33,16 +34,10 @@ def upgrade() -> None:
33
34
  sa.Column(
34
35
  "version", sqlmodel.sql.sqltypes.AutoString(), nullable=False
35
36
  ),
36
- sa.Column(
37
- "status", sqlmodel.sql.sqltypes.AutoString(), nullable=False
38
- ),
39
- sa.Column(
40
- "action", sqlmodel.sql.sqltypes.AutoString(), nullable=False
41
- ),
37
+ sa.Column("status", sqlmodel.sql.sqltypes.AutoString(), nullable=False),
38
+ sa.Column("action", sqlmodel.sql.sqltypes.AutoString(), nullable=False),
42
39
  sa.Column("log", sqlmodel.sql.sqltypes.AutoString(), nullable=True),
43
- sa.Column(
44
- "timestamp_ended", sa.DateTime(timezone=True), nullable=True
45
- ),
40
+ sa.Column("timestamp_ended", sa.DateTime(timezone=True), nullable=True),
46
41
  sa.ForeignKeyConstraint(
47
42
  ["taskgroupv2_id"],
48
43
  ["taskgroupv2.id"],
@@ -5,6 +5,7 @@ Revises: e75cac726012
5
5
  Create Date: 2023-11-30 14:58:23.917824
6
6
 
7
7
  """
8
+
8
9
  import sqlalchemy as sa
9
10
  from alembic import op
10
11
 
@@ -5,10 +5,10 @@ Revises: 94a47ea2d3ff
5
5
  Create Date: 2024-09-26 14:39:26.135101
6
6
 
7
7
  """
8
+
8
9
  import sqlalchemy as sa
9
10
  from alembic import op
10
11
 
11
-
12
12
  # revision identifiers, used by Alembic.
13
13
  revision = "da2cb2ac4255"
14
14
  down_revision = "94a47ea2d3ff"
@@ -5,6 +5,7 @@ Revises: 316140ff7ee1
5
5
  Create Date: 2025-01-14 14:50:46.007222
6
6
 
7
7
  """
8
+
8
9
  import sqlalchemy as sa
9
10
  from alembic import op
10
11
  from sqlalchemy.dialects import postgresql
@@ -0,0 +1,50 @@
1
+ """delete LinkUserProject ondelete Project
2
+
3
+ Revision ID: e0e717ae2f26
4
+ Revises: 40d6d6511b20
5
+ Create Date: 2025-11-17 14:33:56.348071
6
+
7
+ """
8
+
9
+ from alembic import op
10
+
11
+ # revision identifiers, used by Alembic.
12
+ revision = "e0e717ae2f26"
13
+ down_revision = "40d6d6511b20"
14
+ branch_labels = None
15
+ depends_on = None
16
+
17
+
18
+ def upgrade() -> None:
19
+ # ### commands auto generated by Alembic - please adjust! ###
20
+ with op.batch_alter_table("linkuserprojectv2", schema=None) as batch_op:
21
+ batch_op.drop_constraint(
22
+ batch_op.f("fk_linkuserprojectv2_project_id_projectv2"),
23
+ type_="foreignkey",
24
+ )
25
+ batch_op.create_foreign_key(
26
+ batch_op.f("fk_linkuserprojectv2_project_id_projectv2"),
27
+ "projectv2",
28
+ ["project_id"],
29
+ ["id"],
30
+ ondelete="CASCADE",
31
+ )
32
+
33
+ # ### end Alembic commands ###
34
+
35
+
36
+ def downgrade() -> None:
37
+ # ### commands auto generated by Alembic - please adjust! ###
38
+ with op.batch_alter_table("linkuserprojectv2", schema=None) as batch_op:
39
+ batch_op.drop_constraint(
40
+ batch_op.f("fk_linkuserprojectv2_project_id_projectv2"),
41
+ type_="foreignkey",
42
+ )
43
+ batch_op.create_foreign_key(
44
+ batch_op.f("fk_linkuserprojectv2_project_id_projectv2"),
45
+ "projectv2",
46
+ ["project_id"],
47
+ ["id"],
48
+ )
49
+
50
+ # ### end Alembic commands ###
@@ -5,6 +5,7 @@ Revises: 84bf0fffde30
5
5
  Create Date: 2023-10-30 15:51:18.808789
6
6
 
7
7
  """
8
+
8
9
  import sqlalchemy as sa
9
10
  from alembic import op
10
11
 
@@ -5,10 +5,10 @@ Revises: 47351f8c7ebc
5
5
  Create Date: 2025-03-26 11:10:41.748248
6
6
 
7
7
  """
8
+
8
9
  import sqlalchemy as sa
9
10
  from alembic import op
10
11
 
11
-
12
12
  # revision identifiers, used by Alembic.
13
13
  revision = "e81103413827"
14
14
  down_revision = "47351f8c7ebc"
@@ -5,6 +5,7 @@ Revises: 97f444d47249
5
5
  Create Date: 2023-12-20 10:06:52.139917
6
6
 
7
7
  """
8
+
8
9
  from datetime import datetime
9
10
  from datetime import timezone
10
11
 
@@ -0,0 +1,40 @@
1
+ """One submitted Job per Dataset
2
+
3
+ Revision ID: f0702066b007
4
+ Revises: 7910eed4cf97
5
+ Create Date: 2025-12-01 20:54:03.137093
6
+
7
+ """
8
+
9
+ import sqlalchemy as sa
10
+ from alembic import op
11
+
12
+ # revision identifiers, used by Alembic.
13
+ revision = "f0702066b007"
14
+ down_revision = "7910eed4cf97"
15
+ branch_labels = None
16
+ depends_on = None
17
+
18
+
19
+ def upgrade() -> None:
20
+ # ### commands auto generated by Alembic - please adjust! ###
21
+ with op.batch_alter_table("jobv2", schema=None) as batch_op:
22
+ batch_op.create_index(
23
+ "ix_jobv2_one_submitted_job_per_dataset",
24
+ ["dataset_id"],
25
+ unique=True,
26
+ postgresql_where=sa.text("status = 'submitted'"),
27
+ )
28
+
29
+ # ### end Alembic commands ###
30
+
31
+
32
+ def downgrade() -> None:
33
+ # ### commands auto generated by Alembic - please adjust! ###
34
+ with op.batch_alter_table("jobv2", schema=None) as batch_op:
35
+ batch_op.drop_index(
36
+ "ix_jobv2_one_submitted_job_per_dataset",
37
+ postgresql_where=sa.text("status = 'submitted'"),
38
+ )
39
+
40
+ # ### end Alembic commands ###
@@ -5,10 +5,10 @@ Revises: 9db60297b8b2
5
5
  Create Date: 2025-04-14 13:49:40.910342
6
6
 
7
7
  """
8
+
8
9
  import sqlalchemy as sa
9
10
  from alembic import op
10
11
 
11
-
12
12
  # revision identifiers, used by Alembic.
13
13
  revision = "f37aceb45062"
14
14
  down_revision = "9db60297b8b2"
@@ -5,6 +5,7 @@ Revises: 4c308bcaea2b
5
5
  Create Date: 2023-06-06 15:10:51.838607
6
6
 
7
7
  """
8
+
8
9
  import sqlalchemy as sa
9
10
  from alembic import op
10
11
  from sqlalchemy.dialects import sqlite
@@ -5,6 +5,7 @@ Revises: af1ef1c83c9b
5
5
  Create Date: 2025-03-14 15:25:01.083619
6
6
 
7
7
  """
8
+
8
9
  import sqlalchemy as sa
9
10
  import sqlmodel
10
11
  from alembic import op
@@ -37,9 +38,7 @@ def upgrade() -> None:
37
38
  sa.Column(
38
39
  "timestamp_started", sa.DateTime(timezone=True), nullable=False
39
40
  ),
40
- sa.Column(
41
- "status", sqlmodel.sql.sqltypes.AutoString(), nullable=False
42
- ),
41
+ sa.Column("status", sqlmodel.sql.sqltypes.AutoString(), nullable=False),
43
42
  sa.Column("num_available_images", sa.Integer(), nullable=False),
44
43
  sa.ForeignKeyConstraint(
45
44
  ["dataset_id"],
@@ -59,12 +58,8 @@ def upgrade() -> None:
59
58
  "historyunit",
60
59
  sa.Column("id", sa.Integer(), nullable=False),
61
60
  sa.Column("history_run_id", sa.Integer(), nullable=False),
62
- sa.Column(
63
- "logfile", sqlmodel.sql.sqltypes.AutoString(), nullable=True
64
- ),
65
- sa.Column(
66
- "status", sqlmodel.sql.sqltypes.AutoString(), nullable=False
67
- ),
61
+ sa.Column("logfile", sqlmodel.sql.sqltypes.AutoString(), nullable=True),
62
+ sa.Column("status", sqlmodel.sql.sqltypes.AutoString(), nullable=False),
68
63
  sa.Column("zarr_urls", postgresql.ARRAY(sa.String()), nullable=True),
69
64
  sa.ForeignKeyConstraint(
70
65
  ["history_run_id"],