fractal-server 2.5.2__py3-none-any.whl → 2.6.0a1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- fractal_server/__init__.py +1 -1
- fractal_server/__main__.py +24 -9
- fractal_server/app/models/__init__.py +1 -0
- fractal_server/app/models/security.py +8 -0
- fractal_server/app/models/user_settings.py +38 -0
- fractal_server/app/routes/api/v1/_aux_functions.py +6 -1
- fractal_server/app/routes/api/v1/project.py +11 -24
- fractal_server/app/routes/api/v1/task.py +12 -9
- fractal_server/app/routes/api/v2/_aux_functions.py +6 -1
- fractal_server/app/routes/api/v2/submit.py +19 -23
- fractal_server/app/routes/api/v2/task.py +12 -9
- fractal_server/app/routes/api/v2/task_collection.py +10 -4
- fractal_server/app/routes/api/v2/task_collection_custom.py +6 -1
- fractal_server/app/routes/auth/_aux_auth.py +5 -5
- fractal_server/app/routes/auth/current_user.py +41 -0
- fractal_server/app/routes/auth/users.py +42 -0
- fractal_server/app/routes/aux/validate_user_settings.py +74 -0
- fractal_server/app/runner/v2/__init__.py +5 -7
- fractal_server/app/schemas/__init__.py +2 -0
- fractal_server/app/schemas/user.py +1 -62
- fractal_server/app/schemas/user_settings.py +94 -0
- fractal_server/app/security/__init__.py +22 -9
- fractal_server/app/user_settings.py +42 -0
- fractal_server/config.py +0 -16
- fractal_server/data_migrations/2_6_0.py +49 -0
- fractal_server/data_migrations/tools.py +17 -0
- fractal_server/migrations/versions/9c5ae74c9b98_add_user_settings_table.py +74 -0
- fractal_server/tasks/v2/background_operations_ssh.py +14 -5
- {fractal_server-2.5.2.dist-info → fractal_server-2.6.0a1.dist-info}/METADATA +1 -1
- {fractal_server-2.5.2.dist-info → fractal_server-2.6.0a1.dist-info}/RECORD +33 -27
- fractal_server/data_migrations/2_4_0.py +0 -61
- {fractal_server-2.5.2.dist-info → fractal_server-2.6.0a1.dist-info}/LICENSE +0 -0
- {fractal_server-2.5.2.dist-info → fractal_server-2.6.0a1.dist-info}/WHEEL +0 -0
- {fractal_server-2.5.2.dist-info → fractal_server-2.6.0a1.dist-info}/entry_points.txt +0 -0
@@ -57,6 +57,7 @@ def _customize_and_run_template(
|
|
57
57
|
tmpdir: str,
|
58
58
|
logger_name: str,
|
59
59
|
fractal_ssh: FractalSSH,
|
60
|
+
tasks_base_dir: str,
|
60
61
|
) -> str:
|
61
62
|
"""
|
62
63
|
Customize one of the template bash scripts, transfer it to the remote host
|
@@ -72,7 +73,6 @@ def _customize_and_run_template(
|
|
72
73
|
"""
|
73
74
|
logger = get_logger(logger_name)
|
74
75
|
logger.debug(f"_customize_and_run_template {script_filename} - START")
|
75
|
-
settings = Inject(get_settings)
|
76
76
|
|
77
77
|
# Read template
|
78
78
|
template_path = templates_folder / script_filename
|
@@ -88,7 +88,7 @@ def _customize_and_run_template(
|
|
88
88
|
|
89
89
|
# Transfer script to remote host
|
90
90
|
script_path_remote = os.path.join(
|
91
|
-
|
91
|
+
tasks_base_dir,
|
92
92
|
f"script_{abs(hash(tmpdir))}{script_filename}",
|
93
93
|
)
|
94
94
|
logger.debug(f"Now transfer {script_path_local=} over SSH.")
|
@@ -111,6 +111,7 @@ def background_collect_pip_ssh(
|
|
111
111
|
state_id: int,
|
112
112
|
task_pkg: _TaskCollectPip,
|
113
113
|
fractal_ssh: FractalSSH,
|
114
|
+
tasks_base_dir: str,
|
114
115
|
) -> None:
|
115
116
|
"""
|
116
117
|
Collect a task package over SSH
|
@@ -121,6 +122,13 @@ def background_collect_pip_ssh(
|
|
121
122
|
NOTE: by making this function sync, it will run within a thread - due to
|
122
123
|
starlette/fastapi handling of background tasks (see
|
123
124
|
https://github.com/encode/starlette/blob/master/starlette/background.py).
|
125
|
+
|
126
|
+
|
127
|
+
Arguments:
|
128
|
+
state_id:
|
129
|
+
task_pkg:
|
130
|
+
fractal_ssh:
|
131
|
+
tasks_base_dir:
|
124
132
|
"""
|
125
133
|
|
126
134
|
# Work within a temporary folder, where also logs will be placed
|
@@ -140,7 +148,6 @@ def background_collect_pip_ssh(
|
|
140
148
|
with next(get_sync_db()) as db:
|
141
149
|
try:
|
142
150
|
# Prepare replacements for task-collection scripts
|
143
|
-
settings = Inject(get_settings)
|
144
151
|
python_bin = get_python_interpreter_v2(
|
145
152
|
python_version=task_pkg.python_version
|
146
153
|
)
|
@@ -163,11 +170,12 @@ def background_collect_pip_ssh(
|
|
163
170
|
f"{install_string}=={task_pkg.package_version}"
|
164
171
|
)
|
165
172
|
package_env_dir = (
|
166
|
-
Path(
|
173
|
+
Path(tasks_base_dir)
|
167
174
|
/ ".fractal"
|
168
175
|
/ f"{task_pkg.package_name}{package_version}"
|
169
176
|
).as_posix()
|
170
177
|
logger.debug(f"{package_env_dir=}")
|
178
|
+
settings = Inject(get_settings)
|
171
179
|
replacements = [
|
172
180
|
("__PACKAGE_NAME__", task_pkg.package_name),
|
173
181
|
("__PACKAGE_ENV_DIR__", package_env_dir),
|
@@ -186,6 +194,7 @@ def background_collect_pip_ssh(
|
|
186
194
|
tmpdir=tmpdir,
|
187
195
|
logger_name=LOGGER_NAME,
|
188
196
|
fractal_ssh=fractal_ssh,
|
197
|
+
tasks_base_dir=tasks_base_dir,
|
189
198
|
)
|
190
199
|
|
191
200
|
fractal_ssh.check_connection()
|
@@ -332,7 +341,7 @@ def background_collect_pip_ssh(
|
|
332
341
|
)
|
333
342
|
fractal_ssh.remove_folder(
|
334
343
|
folder=package_env_dir,
|
335
|
-
safe_root=
|
344
|
+
safe_root=tasks_base_dir,
|
336
345
|
)
|
337
346
|
logger.info(
|
338
347
|
f"Deleted remoted folder {package_env_dir}"
|
@@ -1,12 +1,13 @@
|
|
1
|
-
fractal_server/__init__.py,sha256=
|
2
|
-
fractal_server/__main__.py,sha256=
|
1
|
+
fractal_server/__init__.py,sha256=V37BdMJAncuN7d1NxAYcAAW3NwjqA3Vl-LqN_PhaVrc,24
|
2
|
+
fractal_server/__main__.py,sha256=WcBAkmVE9aH5mDI6wGkVmPAql2N5Vyk0A-7zuUl8WX0,6122
|
3
3
|
fractal_server/alembic.ini,sha256=MWwi7GzjzawI9cCAK1LW7NxIBQDUqD12-ptJoq5JpP0,3153
|
4
4
|
fractal_server/app/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
5
5
|
fractal_server/app/db/__init__.py,sha256=81rK9w1__Z6PJ5cEcChPVc-wI9YOK4fN--_5Opry0MQ,4119
|
6
|
-
fractal_server/app/models/__init__.py,sha256=
|
6
|
+
fractal_server/app/models/__init__.py,sha256=aG7mf1zZbsgzDSp7GHEcZhdjHfW3TGPOLCI8MrvYhPw,500
|
7
7
|
fractal_server/app/models/linkusergroup.py,sha256=ufthlbLFAWMU_dJmsVZzVlQa_D9C9SmgydxypQ2Xq1U,309
|
8
8
|
fractal_server/app/models/linkuserproject.py,sha256=eQaourbGRshvlMVlKzLYJKHEjfsW1CbWws9yW4eHXhA,567
|
9
|
-
fractal_server/app/models/security.py,sha256=
|
9
|
+
fractal_server/app/models/security.py,sha256=DY1JGS11pdlFXTValt86hNcL6a6kLRZ5xkOhhZJ8c1U,3831
|
10
|
+
fractal_server/app/models/user_settings.py,sha256=0YXCAwoAVGqI2irRLdXgr9-JS0STtHhSaoFENigAnrk,1312
|
10
11
|
fractal_server/app/models/v1/__init__.py,sha256=hUI7dEbPaiZGN0IbHW4RSmSicyvtn_xeuevoX7zvUwI,466
|
11
12
|
fractal_server/app/models/v1/dataset.py,sha256=99GDgt7njx8yYQApkImqp_7bHA5HH3ElvbR6Oyj9kVI,2017
|
12
13
|
fractal_server/app/models/v1/job.py,sha256=QLGXcWdVRHaUHQNDapYYlLpEfw4K7QyD8TmcwhrWw2o,3304
|
@@ -28,40 +29,41 @@ fractal_server/app/routes/admin/v1.py,sha256=GIpZlwAwwwLGDWkBqywhtmp9TGsKLhGmZAd
|
|
28
29
|
fractal_server/app/routes/admin/v2.py,sha256=hoEbH_sRJ-MaKMwhFp8c7SNObP0-Kmtgw1zbs_Z3nLY,12971
|
29
30
|
fractal_server/app/routes/api/__init__.py,sha256=2IDheFi0OFdsUg7nbUiyahqybvpgXqeHUXIL2QtWrQQ,641
|
30
31
|
fractal_server/app/routes/api/v1/__init__.py,sha256=Y2HQdG197J0a7DyQEE2jn53IfxD0EHGhzK1I2JZuEck,958
|
31
|
-
fractal_server/app/routes/api/v1/_aux_functions.py,sha256=
|
32
|
+
fractal_server/app/routes/api/v1/_aux_functions.py,sha256=P9Q48thGH95w0h5cacYoibxqgiiLW4oqZ8rNJ2LIISY,13219
|
32
33
|
fractal_server/app/routes/api/v1/dataset.py,sha256=KVfKdp-bT8eB14kCjTSmpji4a2IPIHxGID8L10h3Wac,17282
|
33
34
|
fractal_server/app/routes/api/v1/job.py,sha256=0jGxvu0xNQnWuov2qnoo9yE7Oat37XbcVn4Ute-UsiE,5370
|
34
|
-
fractal_server/app/routes/api/v1/project.py,sha256=
|
35
|
-
fractal_server/app/routes/api/v1/task.py,sha256=
|
35
|
+
fractal_server/app/routes/api/v1/project.py,sha256=V-oeLiLs3vhD6STKiI2_mOyeB7FDUAcEXevHZbCWQ10,15956
|
36
|
+
fractal_server/app/routes/api/v1/task.py,sha256=eW89nMCjpD4G6tHXDo2qGBKqWaPirjH6M3hpdJQhfa0,6528
|
36
37
|
fractal_server/app/routes/api/v1/task_collection.py,sha256=VYxhtd_idBppgJM7-FCHikI2OKMAIz05fhV_TsJpWI8,9060
|
37
38
|
fractal_server/app/routes/api/v1/workflow.py,sha256=2T93DuEnSshaDCue-JPmjuvGCtbk6lt9pFMuPt783t8,11217
|
38
39
|
fractal_server/app/routes/api/v1/workflowtask.py,sha256=OYYConwJbmNULDw5I3T-UbSJKrbbBiAHbbBeVcpoFKQ,5785
|
39
40
|
fractal_server/app/routes/api/v2/__init__.py,sha256=301enf_GsL27_CnG6lSbMIeoz9-rrb3R2iDSs5pk4q8,1650
|
40
|
-
fractal_server/app/routes/api/v2/_aux_functions.py,sha256=
|
41
|
+
fractal_server/app/routes/api/v2/_aux_functions.py,sha256=mAsJs3QeCrIYKmkXo5aqhrGCbyvbPg_fqZWQNJ-vI8o,13746
|
41
42
|
fractal_server/app/routes/api/v2/dataset.py,sha256=Eilf_BAGjicIhqUiVwI86jlW45ineA5sVzxXW4b2GoQ,8329
|
42
43
|
fractal_server/app/routes/api/v2/images.py,sha256=JR1rR6qEs81nacjriOXAOBQjAbCXF4Ew7M7mkWdxBU0,7920
|
43
44
|
fractal_server/app/routes/api/v2/job.py,sha256=Bga2Kz1OjvDIdxZObWaaXVhNIhC_5JKhKRjEH2_ayEE,5157
|
44
45
|
fractal_server/app/routes/api/v2/project.py,sha256=eWYFJ7F2ZYQcpi-_n-rhPF-Q4gJhzYBsVGYFhHZZXAE,6653
|
45
46
|
fractal_server/app/routes/api/v2/status.py,sha256=6N9DSZ4iFqbZImorWfEAPoyoFUgEruo4Hweqo0x0xXU,6435
|
46
|
-
fractal_server/app/routes/api/v2/submit.py,sha256=
|
47
|
-
fractal_server/app/routes/api/v2/task.py,sha256=
|
48
|
-
fractal_server/app/routes/api/v2/task_collection.py,sha256=
|
49
|
-
fractal_server/app/routes/api/v2/task_collection_custom.py,sha256=
|
47
|
+
fractal_server/app/routes/api/v2/submit.py,sha256=SVTV9wGC_mrKWHHxWtjvsdtiRzOeSRlw2PlDYLk66Ew,9006
|
48
|
+
fractal_server/app/routes/api/v2/task.py,sha256=XDKNmin-gyLpA6eVgh89OdrNq92Vkrtxjr8VI-PIV2E,8548
|
49
|
+
fractal_server/app/routes/api/v2/task_collection.py,sha256=3ugtkrlrFWvLSHXomF0oOg2Ayg2ige1gr5F51BCQEL4,12950
|
50
|
+
fractal_server/app/routes/api/v2/task_collection_custom.py,sha256=Q9vVicfY_VJKLu7yBox2KnBSiPBDZxAnoxykWmwD8X0,6291
|
50
51
|
fractal_server/app/routes/api/v2/workflow.py,sha256=rMCcclz9aJAMSVLncUdSDGrgkKbn4KOCZTqZtqs2HDY,10428
|
51
52
|
fractal_server/app/routes/api/v2/workflowtask.py,sha256=-3-c8DDnxGjMwWbX_h5V5OLaC_iCLXYzwWKBUaL-5wE,7060
|
52
53
|
fractal_server/app/routes/auth/__init__.py,sha256=fao6CS0WiAjHDTvBzgBVV_bSXFpEAeDBF6Z6q7rRkPc,1658
|
53
|
-
fractal_server/app/routes/auth/_aux_auth.py,sha256=
|
54
|
-
fractal_server/app/routes/auth/current_user.py,sha256=
|
54
|
+
fractal_server/app/routes/auth/_aux_auth.py,sha256=a3DCj6_tekf4Bfu8Kax9uxVGbTuVsONgki7E6AJUN_8,3269
|
55
|
+
fractal_server/app/routes/auth/current_user.py,sha256=kJk6bONS8bwPoJh40mpmVGM2bb5qRrJ6Rf_p1_flvgI,3480
|
55
56
|
fractal_server/app/routes/auth/group.py,sha256=az8kRJJU5rA0L8GCX5kvRNuQhrsoGWPuvQ26z7iFQ3E,5388
|
56
57
|
fractal_server/app/routes/auth/group_names.py,sha256=zvYDfhxKlDmbSr-oLXYy6WUVkPPTvzH6ZJtuoNdGZbE,960
|
57
58
|
fractal_server/app/routes/auth/login.py,sha256=tSu6OBLOieoBtMZB4JkBAdEgH2Y8KqPGSbwy7NIypIo,566
|
58
59
|
fractal_server/app/routes/auth/oauth.py,sha256=AnFHbjqL2AgBX3eksI931xD6RTtmbciHBEuGf9YJLjU,1895
|
59
60
|
fractal_server/app/routes/auth/register.py,sha256=DlHq79iOvGd_gt2v9uwtsqIKeO6i_GKaW59VIkllPqY,587
|
60
61
|
fractal_server/app/routes/auth/router.py,sha256=zWoZWiO69U48QFQf5tLRYQDWu8PUCj7GacnaFeW1n_I,618
|
61
|
-
fractal_server/app/routes/auth/users.py,sha256=
|
62
|
+
fractal_server/app/routes/auth/users.py,sha256=63gOBjGaQpUfakVmqb9RzBcKdIafiFlmaN_ctUOA0fg,8356
|
62
63
|
fractal_server/app/routes/aux/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
63
64
|
fractal_server/app/routes/aux/_job.py,sha256=q-RCiW17yXnZKAC_0La52RLvhqhxuvbgQJ2MlGXOj8A,702
|
64
65
|
fractal_server/app/routes/aux/_runner.py,sha256=FdCVla5DxGAZ__aB7Z8dEJzD_RIeh5tftjrPyqkr8N8,895
|
66
|
+
fractal_server/app/routes/aux/validate_user_settings.py,sha256=Y8eubau0julkwVYB5nA83nDtxh_7RU9Iq0zAhb_dXLA,2351
|
65
67
|
fractal_server/app/runner/.gitignore,sha256=ytzN_oyHWXrGU7iFAtoHSTUbM6Rn6kG0Zkddg0xZk6s,16
|
66
68
|
fractal_server/app/runner/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
67
69
|
fractal_server/app/runner/async_wrap.py,sha256=_O6f8jftKYXG_DozkmlrDBhoiK9QhE9MablOyECq2_M,829
|
@@ -99,7 +101,7 @@ fractal_server/app/runner/v1/_slurm/_submit_setup.py,sha256=KO9c694d318adoPQh9UG
|
|
99
101
|
fractal_server/app/runner/v1/_slurm/get_slurm_config.py,sha256=6pQNNx997bLIfLp0guF09t_O0ZYRXnbEGLktSAcKnic,5999
|
100
102
|
fractal_server/app/runner/v1/common.py,sha256=_L-vjLnWato80VdlB_BFN4G8P4jSM07u-5cnl1T3S34,3294
|
101
103
|
fractal_server/app/runner/v1/handle_failed_job.py,sha256=bHzScC_aIlU3q-bQxGW6rfWV4xbZ2tho_sktjsAs1no,4684
|
102
|
-
fractal_server/app/runner/v2/__init__.py,sha256=
|
104
|
+
fractal_server/app/runner/v2/__init__.py,sha256=BkmaVbhh6XMK_Y2Suzz3bXm3Ff2l0JKbHqs8zp0hi8A,16965
|
103
105
|
fractal_server/app/runner/v2/_local/__init__.py,sha256=KTj14K6jH8fXGUi5P7u5_RqEE1zF4aXtgPxCKzw46iw,5971
|
104
106
|
fractal_server/app/runner/v2/_local/_local_config.py,sha256=9oi209Dlp35ANfxb_DISqmMKKc6DPaMsmYVWbZLseME,3630
|
105
107
|
fractal_server/app/runner/v2/_local/_submit_setup.py,sha256=MucNOo8Er0F5ZIwH7CnTeXgnFMc6d3pKPkv563QNVi0,1630
|
@@ -122,10 +124,11 @@ fractal_server/app/runner/v2/runner_functions.py,sha256=BLREIcQaE6FSc2AEJyZuiYk6
|
|
122
124
|
fractal_server/app/runner/v2/runner_functions_low_level.py,sha256=1fWvQ6YZUUnDhO_mipXC5hnaT-zK-GHxg8ayoxZX82k,3648
|
123
125
|
fractal_server/app/runner/v2/task_interface.py,sha256=myS-kT0DsJ8xIJZBVEzgD8g54VbiwL6i7Im3e1zcVHQ,1866
|
124
126
|
fractal_server/app/runner/versions.py,sha256=dSaPRWqmFPHjg20kTCHmi_dmGNcCETflDtDLronNanU,852
|
125
|
-
fractal_server/app/schemas/__init__.py,sha256=
|
127
|
+
fractal_server/app/schemas/__init__.py,sha256=stURAU_t3AOBaH0HSUbV-GKhlPKngnnIMoqWc3orFyI,135
|
126
128
|
fractal_server/app/schemas/_validators.py,sha256=1dTOYr1IZykrxuQSV2-zuEMZbKe_nGwrfS7iUrsh-sE,3461
|
127
|
-
fractal_server/app/schemas/user.py,sha256=
|
129
|
+
fractal_server/app/schemas/user.py,sha256=VNnAPnAVK6X0PZlw7XehocAshVNuUHdDwiZVWCCor6Y,2156
|
128
130
|
fractal_server/app/schemas/user_group.py,sha256=2f9XQ6kIar6NMY4UCN0yOnve6ZDHUVZaHv1dna1Vfjg,1446
|
131
|
+
fractal_server/app/schemas/user_settings.py,sha256=E9O4NAyxr1NpnO39MZ-AlYvEe-pielFYmerVLNJR9Do,2879
|
129
132
|
fractal_server/app/schemas/v1/__init__.py,sha256=CrBGgBhoemCvmZ70ZUchM-jfVAICnoa7AjZBAtL2UB0,1852
|
130
133
|
fractal_server/app/schemas/v1/applyworkflow.py,sha256=uuIh7fHlHEL4yLqL-dePI6-nfCsqgBYATmht7w_KITw,4302
|
131
134
|
fractal_server/app/schemas/v1/dataset.py,sha256=n71lNUO3JLy2K3IM9BZM2Fk1EnKQOTU7pm2s2rJ1FGY,3444
|
@@ -147,10 +150,12 @@ fractal_server/app/schemas/v2/task.py,sha256=XsN8w1Szs8BrxxRtKyWCHKjN4Od-Kmlhi76
|
|
147
150
|
fractal_server/app/schemas/v2/task_collection.py,sha256=8PG1bOqkfQqORMN0brWf6mHDmijt0bBW-mZsF7cSxUs,6129
|
148
151
|
fractal_server/app/schemas/v2/workflow.py,sha256=Zzx3e-qgkH8le0FUmAx9UrV5PWd7bj14PPXUh_zgZXM,1827
|
149
152
|
fractal_server/app/schemas/v2/workflowtask.py,sha256=TN-mdkuE_EWet9Wk-xFrUwIt_tXYcw88WOKMnUcchKk,5665
|
150
|
-
fractal_server/app/security/__init__.py,sha256=
|
151
|
-
fractal_server/
|
152
|
-
fractal_server/
|
153
|
+
fractal_server/app/security/__init__.py,sha256=V1NOWlmaFZHMR6SrkMl62jyAuqYONyo8lyGvR6UZesM,12312
|
154
|
+
fractal_server/app/user_settings.py,sha256=aZgQ3i0JkHfgwLGW1ee6Gzr1ae3IioFfJKKSsSS8Svk,1312
|
155
|
+
fractal_server/config.py,sha256=NucdVswA4MJpgeePDqSsU01I893Bn_hqWUrxrax83Ls,24257
|
156
|
+
fractal_server/data_migrations/2_6_0.py,sha256=Vl17mFiOF5jQsktOnog5vnaXXcUXOJRa-ljas9kUX0E,1863
|
153
157
|
fractal_server/data_migrations/README.md,sha256=_3AEFvDg9YkybDqCLlFPdDmGJvr6Tw7HRI14aZ3LOIw,398
|
158
|
+
fractal_server/data_migrations/tools.py,sha256=LeMeASwYGtEqd-3wOLle6WARdTGAimoyMmRbbJl-hAM,572
|
154
159
|
fractal_server/gunicorn_fractal.py,sha256=u6U01TLGlXgq1v8QmEpLih3QnsInZD7CqphgJ_GrGzc,1230
|
155
160
|
fractal_server/images/__init__.py,sha256=xO6jTLE4EZKO6cTDdJsBmK9cdeh9hFTaSbSuWgQg7y4,196
|
156
161
|
fractal_server/images/models.py,sha256=9ipU5h4N6ogBChoB-2vHoqtL0TXOHCv6kRR-fER3mkM,4167
|
@@ -173,6 +178,7 @@ fractal_server/migrations/versions/84bf0fffde30_add_dumps_to_applyworkflow.py,sh
|
|
173
178
|
fractal_server/migrations/versions/8f79bd162e35_add_docs_info_and_docs_link_to_task_.py,sha256=6pgODDtyAxevZvAJBj9IJ41inhV1RpwbpZr_qfPPu1A,1115
|
174
179
|
fractal_server/migrations/versions/97f444d47249_add_applyworkflow_project_dump.py,sha256=eKTZm3EgUgapXBxO0RuHkEfTKic-TZG3ADaMpGLuc0k,1057
|
175
180
|
fractal_server/migrations/versions/99ea79d9e5d2_add_dataset_history.py,sha256=0im6TxDr53sKKcjiPgeH4ftVRGnRXZSh2lPbRQ1Ir9w,883
|
181
|
+
fractal_server/migrations/versions/9c5ae74c9b98_add_user_settings_table.py,sha256=syONdZNf4-OnAcWIsbzXpYwpXPsXZ4SsmjwVvmVG0PU,2256
|
176
182
|
fractal_server/migrations/versions/9fd26a2b0de4_add_workflow_timestamp_created.py,sha256=4l1AHGUsa0ONoJVZlr3fTXw_xbbQ8O7wlD92Az2aRfM,1849
|
177
183
|
fractal_server/migrations/versions/a7f4d6137b53_add_workflow_dump_to_applyworkflow.py,sha256=ekDUML7ILpmdoqEclKbEUdyLi4uw9HSG_sTjG2hp_JE,867
|
178
184
|
fractal_server/migrations/versions/d4fe3708d309_make_applyworkflow_workflow_dump_non_.py,sha256=6cHEZFuTXiQg9yu32Y3RH1XAl71av141WQ6UMbiITIg,949
|
@@ -196,7 +202,7 @@ fractal_server/tasks/v2/_TaskCollectPip.py,sha256=kWQNMNZ8OEddkYhmhsk3E6ArcaD7qe
|
|
196
202
|
fractal_server/tasks/v2/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
197
203
|
fractal_server/tasks/v2/_venv_pip.py,sha256=6NCItfeWgO9BDnlfhoCfiUG5UCGGz_SJz4Mfn4Jg_nk,6489
|
198
204
|
fractal_server/tasks/v2/background_operations.py,sha256=CQwQon5RKAXrjsN255Okh5dcT0R45axgqoPW3EB-v_Q,11527
|
199
|
-
fractal_server/tasks/v2/background_operations_ssh.py,sha256=
|
205
|
+
fractal_server/tasks/v2/background_operations_ssh.py,sha256=K2_MLmHaYBIyT9PfeLsA5JpNH6V1SHczNdQI6hH71GM,14112
|
200
206
|
fractal_server/tasks/v2/endpoint_operations.py,sha256=gT38pl5TEH6WNWOtg4Itegt2lTJJI6YRa7fEj9Y4x2s,4226
|
201
207
|
fractal_server/tasks/v2/templates/_1_create_venv.sh,sha256=5uW0ETYxl5xiQEXP107zgq8V_-vf3k5NzMMj1hSLjas,1015
|
202
208
|
fractal_server/tasks/v2/templates/_2_upgrade_pip.sh,sha256=ca5Yng6JgJYu-a4QrsIsatwUmrLdRWBKw7_VJrY7WLY,555
|
@@ -207,8 +213,8 @@ fractal_server/tasks/v2/utils.py,sha256=JOyCacb6MNvrwfLNTyLwcz8y79J29YuJeJ2MK5kq
|
|
207
213
|
fractal_server/urls.py,sha256=5o_qq7PzKKbwq12NHSQZDmDitn5RAOeQ4xufu-2v9Zk,448
|
208
214
|
fractal_server/utils.py,sha256=b7WwFdcFZ8unyT65mloFToYuEDXpQoHRcmRNqrhd_dQ,2115
|
209
215
|
fractal_server/zip_tools.py,sha256=xYpzBshysD2nmxkD5WLYqMzPYUcCRM3kYy-7n9bJL-U,4426
|
210
|
-
fractal_server-2.
|
211
|
-
fractal_server-2.
|
212
|
-
fractal_server-2.
|
213
|
-
fractal_server-2.
|
214
|
-
fractal_server-2.
|
216
|
+
fractal_server-2.6.0a1.dist-info/LICENSE,sha256=QKAharUuhxL58kSoLizKJeZE3mTCBnX6ucmz8W0lxlk,1576
|
217
|
+
fractal_server-2.6.0a1.dist-info/METADATA,sha256=vgfTZcfqQkzjshalFqzIv5UXRWGbsd5rRLbxyJkFbL4,4630
|
218
|
+
fractal_server-2.6.0a1.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
219
|
+
fractal_server-2.6.0a1.dist-info/entry_points.txt,sha256=8tV2kynvFkjnhbtDnxAqImL6HMVKsopgGfew0DOp5UY,58
|
220
|
+
fractal_server-2.6.0a1.dist-info/RECORD,,
|
@@ -1,61 +0,0 @@
|
|
1
|
-
import logging
|
2
|
-
|
3
|
-
from packaging.version import parse
|
4
|
-
from sqlalchemy import select
|
5
|
-
|
6
|
-
import fractal_server
|
7
|
-
from fractal_server.app.db import get_sync_db
|
8
|
-
from fractal_server.app.models import LinkUserGroup
|
9
|
-
from fractal_server.app.models import UserGroup
|
10
|
-
from fractal_server.app.models import UserOAuth
|
11
|
-
from fractal_server.app.security import FRACTAL_DEFAULT_GROUP_NAME
|
12
|
-
|
13
|
-
|
14
|
-
def _check_current_version(*, expected_version: str):
|
15
|
-
# Check that this module matches with the current version
|
16
|
-
module_version = parse(expected_version)
|
17
|
-
current_version = parse(fractal_server.__VERSION__)
|
18
|
-
if (
|
19
|
-
current_version.major != module_version.major
|
20
|
-
or current_version.minor != module_version.minor
|
21
|
-
or current_version.micro != module_version.micro
|
22
|
-
):
|
23
|
-
raise RuntimeError(
|
24
|
-
f"{fractal_server.__VERSION__=} not matching with {__file__=}"
|
25
|
-
)
|
26
|
-
|
27
|
-
|
28
|
-
def fix_db():
|
29
|
-
logger = logging.getLogger("fix_db")
|
30
|
-
logger.warning("START execution of fix_db function")
|
31
|
-
_check_current_version(expected_version="2.4.0")
|
32
|
-
|
33
|
-
with next(get_sync_db()) as db:
|
34
|
-
# Find default group
|
35
|
-
stm = select(UserGroup).where(
|
36
|
-
UserGroup.name == FRACTAL_DEFAULT_GROUP_NAME
|
37
|
-
)
|
38
|
-
res = db.execute(stm)
|
39
|
-
default_group = res.scalar_one_or_none()
|
40
|
-
if default_group is None:
|
41
|
-
raise RuntimeError("Default group not found, exit.")
|
42
|
-
logger.warning(
|
43
|
-
"Default user group exists: "
|
44
|
-
f"{default_group.id=}, {default_group.name=}."
|
45
|
-
)
|
46
|
-
|
47
|
-
# Find
|
48
|
-
stm = select(UserOAuth)
|
49
|
-
users = db.execute(stm).scalars().unique().all()
|
50
|
-
for user in sorted(users, key=lambda x: x.id):
|
51
|
-
logger.warning(
|
52
|
-
f"START adding {user.id=} ({user.email=}) to default group."
|
53
|
-
)
|
54
|
-
link = LinkUserGroup(user_id=user.id, group_id=default_group.id)
|
55
|
-
db.add(link)
|
56
|
-
db.commit()
|
57
|
-
logger.warning(
|
58
|
-
f"END adding {user.id=} ({user.email=}) to default group."
|
59
|
-
)
|
60
|
-
|
61
|
-
logger.warning("END of execution of fix_db function")
|
File without changes
|
File without changes
|
File without changes
|