fractal-server 1.2.3a0__py3-none-any.whl → 1.2.3a2__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/app/api/v1/project.py +4 -3
- fractal_server/app/api/v1/task.py +12 -3
- fractal_server/app/runner/__init__.py +4 -0
- fractal_server/app/security/__init__.py +1 -0
- {fractal_server-1.2.3a0.dist-info → fractal_server-1.2.3a2.dist-info}/METADATA +1 -1
- {fractal_server-1.2.3a0.dist-info → fractal_server-1.2.3a2.dist-info}/RECORD +10 -10
- {fractal_server-1.2.3a0.dist-info → fractal_server-1.2.3a2.dist-info}/LICENSE +0 -0
- {fractal_server-1.2.3a0.dist-info → fractal_server-1.2.3a2.dist-info}/WHEEL +0 -0
- {fractal_server-1.2.3a0.dist-info → fractal_server-1.2.3a2.dist-info}/entry_points.txt +0 -0
fractal_server/__init__.py
CHANGED
@@ -1 +1 @@
|
|
1
|
-
__VERSION__ = "1.2.
|
1
|
+
__VERSION__ = "1.2.3a2"
|
@@ -216,7 +216,6 @@ async def apply_workflow(
|
|
216
216
|
project = output["project"]
|
217
217
|
|
218
218
|
workflow = db_sync.get(Workflow, apply_workflow.workflow_id)
|
219
|
-
db_sync.close()
|
220
219
|
if not workflow:
|
221
220
|
raise HTTPException(
|
222
221
|
status_code=status.HTTP_404_NOT_FOUND,
|
@@ -295,7 +294,6 @@ async def apply_workflow(
|
|
295
294
|
db.add(job)
|
296
295
|
await db.commit()
|
297
296
|
await db.refresh(job)
|
298
|
-
await db.close()
|
299
297
|
|
300
298
|
background_tasks.add_task(
|
301
299
|
submit_workflow,
|
@@ -308,6 +306,9 @@ async def apply_workflow(
|
|
308
306
|
user_cache_dir=user.cache_dir,
|
309
307
|
)
|
310
308
|
|
309
|
+
await db.close()
|
310
|
+
db_sync.close()
|
311
|
+
|
311
312
|
return job
|
312
313
|
|
313
314
|
|
@@ -408,7 +409,7 @@ async def get_job_list(
|
|
408
409
|
stm = select(ApplyWorkflow).where(ApplyWorkflow.project_id == project_id)
|
409
410
|
res = await db.execute(stm)
|
410
411
|
job_list = res.scalars().all()
|
411
|
-
|
412
|
+
await db.close()
|
412
413
|
return job_list
|
413
414
|
|
414
415
|
|
@@ -48,7 +48,9 @@ router = APIRouter()
|
|
48
48
|
|
49
49
|
|
50
50
|
async def _background_collect_pip(
|
51
|
-
|
51
|
+
state_id: int,
|
52
|
+
venv_path: Path,
|
53
|
+
task_pkg: _TaskCollectPip,
|
52
54
|
) -> None:
|
53
55
|
"""
|
54
56
|
Install package and collect tasks
|
@@ -59,6 +61,12 @@ async def _background_collect_pip(
|
|
59
61
|
In case of error, copy the log into the state and delete the package
|
60
62
|
directory.
|
61
63
|
"""
|
64
|
+
|
65
|
+
# Note: anext(get_db()) is only available for python>=3.10
|
66
|
+
db = await get_db().__anext__()
|
67
|
+
|
68
|
+
state: State = await db.get(State, state_id)
|
69
|
+
|
62
70
|
logger_name = task_pkg.package.replace("/", "_")
|
63
71
|
logger = set_logger(
|
64
72
|
logger_name=logger_name,
|
@@ -110,6 +118,7 @@ async def _background_collect_pip(
|
|
110
118
|
logger.debug("Task-collection status: OK")
|
111
119
|
logger.info("Background task collection completed successfully")
|
112
120
|
close_logger(logger)
|
121
|
+
await db.close()
|
113
122
|
|
114
123
|
except Exception as e:
|
115
124
|
# Write last logs to file
|
@@ -124,6 +133,7 @@ async def _background_collect_pip(
|
|
124
133
|
state.data = data.sanitised_dict()
|
125
134
|
await db.merge(state)
|
126
135
|
await db.commit()
|
136
|
+
await db.close()
|
127
137
|
|
128
138
|
# Delete corrupted package dir
|
129
139
|
shell_rmtree(venv_path)
|
@@ -240,10 +250,9 @@ async def collect_tasks_pip(
|
|
240
250
|
|
241
251
|
background_tasks.add_task(
|
242
252
|
_background_collect_pip,
|
243
|
-
|
253
|
+
state_id=state.id,
|
244
254
|
venv_path=venv_path,
|
245
255
|
task_pkg=task_pkg,
|
246
|
-
db=db,
|
247
256
|
)
|
248
257
|
logger.debug(
|
249
258
|
"Task-collection endpoint: start background collection "
|
@@ -207,6 +207,10 @@ async def submit_workflow(
|
|
207
207
|
worker_init=worker_init,
|
208
208
|
)
|
209
209
|
|
210
|
+
logger.info(
|
211
|
+
f'End execution of workflow "{workflow.name}"; '
|
212
|
+
f"more logs at {str(log_file_path)}"
|
213
|
+
)
|
210
214
|
logger.debug(f'END workflow "{workflow.name}"')
|
211
215
|
|
212
216
|
db_sync.merge(output_dataset)
|
@@ -1,13 +1,13 @@
|
|
1
1
|
fractal_server/.gitignore,sha256=9swdobOQ_Celjt2OgRUpy9oEpNqTBn-1NRUFfJU4rps,69
|
2
|
-
fractal_server/__init__.py,sha256=
|
2
|
+
fractal_server/__init__.py,sha256=YVtB2kEziyfiwQ28AUVU4Yh9khootFg2QyizaaNDKHs,24
|
3
3
|
fractal_server/__main__.py,sha256=znijcImbcEC4P26ICOhEJ9VY3_5vWdMwQcl-WP25sYA,2202
|
4
4
|
fractal_server/alembic.ini,sha256=MWwi7GzjzawI9cCAK1LW7NxIBQDUqD12-ptJoq5JpP0,3153
|
5
5
|
fractal_server/app/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
6
6
|
fractal_server/app/api/__init__.py,sha256=A_RS6hUnnFef2dcWbvG0kLmQdNs26g9W47fAbWc_WXo,887
|
7
7
|
fractal_server/app/api/v1/__init__.py,sha256=2HMymr1YkUk39V8iof7KENyLnre4ghouOSvNZ_kF1ec,24
|
8
8
|
fractal_server/app/api/v1/job.py,sha256=UldY2tt904rF95JXaMf7yIkEK0BIVI1k7YchJVr847o,2783
|
9
|
-
fractal_server/app/api/v1/project.py,sha256=
|
10
|
-
fractal_server/app/api/v1/task.py,sha256=
|
9
|
+
fractal_server/app/api/v1/project.py,sha256=WxSnUaY6Xhn1sHlNVKih7iUp6uEJeHzrucfka4heAl8,22441
|
10
|
+
fractal_server/app/api/v1/task.py,sha256=Gbk0mcyQeUb7ebhl5MWHONAFD4pbc81ZcTfbB7Hjm5E,12203
|
11
11
|
fractal_server/app/api/v1/workflow.py,sha256=DPmDgS3Thf1HS46FZCEni9vQEDkA7wPj0BmBa-T2wU0,11503
|
12
12
|
fractal_server/app/db/__init__.py,sha256=Ont7FOvNEEx8-_GFsJ5Lv_5nbxySs_bEpLTdKEzOqDM,2724
|
13
13
|
fractal_server/app/models/__init__.py,sha256=MyHn6KDfdPvBpfvcR2QrhWuP1qle3St3e_YzNYcu9y8,372
|
@@ -18,7 +18,7 @@ fractal_server/app/models/state.py,sha256=uVMwkpalARAni7DNbOQ44v9LikRHJqR7MWlsGy
|
|
18
18
|
fractal_server/app/models/task.py,sha256=3lTZMmHcQK0CgWLjcceyOANdqRt-89n1_z1AMEL2L2Q,1080
|
19
19
|
fractal_server/app/models/workflow.py,sha256=Tf4sT4kciDMhGRCTUFWDtEfTvNj3mdWhCx6fURJp9Vc,5371
|
20
20
|
fractal_server/app/runner/.gitignore,sha256=ytzN_oyHWXrGU7iFAtoHSTUbM6Rn6kG0Zkddg0xZk6s,16
|
21
|
-
fractal_server/app/runner/__init__.py,sha256=
|
21
|
+
fractal_server/app/runner/__init__.py,sha256=dvv6hAQwMGDuJ1S8AiuiCayIX1BDwQC95ywY8VGTmjc,8991
|
22
22
|
fractal_server/app/runner/_common.py,sha256=PoiBIaCclo1DqjqrIY4qbEAvnRgxQ4MgN3x7xfqXUNw,19294
|
23
23
|
fractal_server/app/runner/_local/__init__.py,sha256=JuwhEinF-Yu5C7kkXKqs5cl3OYzCWSSl8uz1HK2eIYY,5460
|
24
24
|
fractal_server/app/runner/_local/_local_config.py,sha256=tz93dzmG2NtgQiCO3k81QgDzNbC1x38_tOjNKNyqYEY,3273
|
@@ -34,7 +34,7 @@ fractal_server/app/runner/_slurm/_subprocess_run_as_user.py,sha256=k7JWKJ5oSM-WE
|
|
34
34
|
fractal_server/app/runner/_slurm/executor.py,sha256=AgmDD3qXVyyI8FWU-udQLS3PAuc1V84oZC7HoYM6q3o,40272
|
35
35
|
fractal_server/app/runner/_slurm/remote.py,sha256=wLziIsGdSMiO-jIXM8x77JRK82g_2hx0iBKTiMghuIo,5852
|
36
36
|
fractal_server/app/runner/common.py,sha256=JvE0MICApdnuE3b0UeCr0A-GBk8XB1IpZM1tG_lUqko,9749
|
37
|
-
fractal_server/app/security/__init__.py,sha256=
|
37
|
+
fractal_server/app/security/__init__.py,sha256=MEOl7CN5nMQE-DhFclvSRtpzRVoY-sCqjkaQsIZNJ1c,7400
|
38
38
|
fractal_server/common/.git,sha256=Tc99_jnBzoLdeHxTTuFRz3i7bxoCBKM-WemKlGVThi8,49
|
39
39
|
fractal_server/common/.github/workflows/ci.yml,sha256=48COJi9_H9cyRV1kWyp54dtS64PoN9Bt9f8IWEYuZTE,717
|
40
40
|
fractal_server/common/.github/workflows/project-management.yml,sha256=Qe6bkHmZVGAIL1LP56mL8Aro0vpMElFY85Ozn6DtysY,364
|
@@ -75,8 +75,8 @@ fractal_server/syringe.py,sha256=3qSMW3YaMKKnLdgnooAINOPxnCOxP7y2jeAQYB21Gdo,278
|
|
75
75
|
fractal_server/tasks/__init__.py,sha256=Wzuxf5EoH1v0fYzRpAZHG_S-Z9f6DmbIsuSvllBCGvc,72
|
76
76
|
fractal_server/tasks/collection.py,sha256=hvZeOHenJwvjyFgxIxU7OqOwG8SdmCA9MTBuRAt_Onc,12782
|
77
77
|
fractal_server/utils.py,sha256=b7WwFdcFZ8unyT65mloFToYuEDXpQoHRcmRNqrhd_dQ,2115
|
78
|
-
fractal_server-1.2.
|
79
|
-
fractal_server-1.2.
|
80
|
-
fractal_server-1.2.
|
81
|
-
fractal_server-1.2.
|
82
|
-
fractal_server-1.2.
|
78
|
+
fractal_server-1.2.3a2.dist-info/entry_points.txt,sha256=8tV2kynvFkjnhbtDnxAqImL6HMVKsopgGfew0DOp5UY,58
|
79
|
+
fractal_server-1.2.3a2.dist-info/WHEEL,sha256=vVCvjcmxuUltf8cYhJ0sJMRDLr1XsPuxEId8YDzbyCY,88
|
80
|
+
fractal_server-1.2.3a2.dist-info/METADATA,sha256=67PqHNb5VRpj6J26ML8ixnb_qMG6jBUyY5dQRhcNWXQ,3591
|
81
|
+
fractal_server-1.2.3a2.dist-info/LICENSE,sha256=QKAharUuhxL58kSoLizKJeZE3mTCBnX6ucmz8W0lxlk,1576
|
82
|
+
fractal_server-1.2.3a2.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|