fractal-server 1.4.0a8__py3-none-any.whl → 1.4.0a10__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/db/__init__.py +8 -2
- fractal_server/app/routes/admin.py +39 -0
- fractal_server/app/routes/api/v1/job.py +0 -40
- {fractal_server-1.4.0a8.dist-info → fractal_server-1.4.0a10.dist-info}/METADATA +4 -3
- {fractal_server-1.4.0a8.dist-info → fractal_server-1.4.0a10.dist-info}/RECORD +9 -9
- {fractal_server-1.4.0a8.dist-info → fractal_server-1.4.0a10.dist-info}/WHEEL +1 -1
- {fractal_server-1.4.0a8.dist-info → fractal_server-1.4.0a10.dist-info}/LICENSE +0 -0
- {fractal_server-1.4.0a8.dist-info → fractal_server-1.4.0a10.dist-info}/entry_points.txt +0 -0
fractal_server/__init__.py
CHANGED
@@ -1 +1 @@
|
|
1
|
-
__VERSION__ = "1.4.
|
1
|
+
__VERSION__ = "1.4.0a10"
|
@@ -82,11 +82,17 @@ class DB:
|
|
82
82
|
)
|
83
83
|
|
84
84
|
cls._async_session_maker = sessionmaker(
|
85
|
-
cls._engine_async,
|
85
|
+
cls._engine_async,
|
86
|
+
class_=AsyncSession,
|
87
|
+
expire_on_commit=False,
|
88
|
+
future=True,
|
86
89
|
)
|
87
90
|
|
88
91
|
cls._sync_session_maker = sessionmaker(
|
89
|
-
bind=cls._engine_sync,
|
92
|
+
bind=cls._engine_sync,
|
93
|
+
autocommit=False,
|
94
|
+
autoflush=False,
|
95
|
+
future=True,
|
90
96
|
)
|
91
97
|
|
92
98
|
@event.listens_for(cls._engine_sync, "connect")
|
@@ -6,6 +6,8 @@ from typing import Optional
|
|
6
6
|
|
7
7
|
from fastapi import APIRouter
|
8
8
|
from fastapi import Depends
|
9
|
+
from fastapi import HTTPException
|
10
|
+
from fastapi import status as fastapi_status
|
9
11
|
from sqlalchemy import func
|
10
12
|
from sqlmodel import select
|
11
13
|
|
@@ -18,6 +20,7 @@ from ..models import Project
|
|
18
20
|
from ..models import Workflow
|
19
21
|
from ..models.security import UserOAuth as User
|
20
22
|
from ..schemas import ApplyWorkflowRead
|
23
|
+
from ..schemas import ApplyWorkflowUpdate
|
21
24
|
from ..schemas import DatasetRead
|
22
25
|
from ..schemas import ProjectRead
|
23
26
|
from ..schemas import WorkflowRead
|
@@ -212,3 +215,39 @@ async def view_job(
|
|
212
215
|
await db.close()
|
213
216
|
|
214
217
|
return job_list
|
218
|
+
|
219
|
+
|
220
|
+
@router_admin.patch(
|
221
|
+
"/job/{job_id}/",
|
222
|
+
response_model=ApplyWorkflowRead,
|
223
|
+
)
|
224
|
+
async def update_job(
|
225
|
+
job_update: ApplyWorkflowUpdate,
|
226
|
+
job_id: int,
|
227
|
+
user: User = Depends(current_active_superuser),
|
228
|
+
db: AsyncSession = Depends(get_db),
|
229
|
+
) -> Optional[ApplyWorkflowRead]:
|
230
|
+
"""
|
231
|
+
Change the status of an existing job.
|
232
|
+
|
233
|
+
This endpoint is only open to superusers, and it does not apply
|
234
|
+
project-based access-control to jobs.
|
235
|
+
"""
|
236
|
+
job = await db.get(ApplyWorkflow, job_id)
|
237
|
+
if job is None:
|
238
|
+
raise HTTPException(
|
239
|
+
status_code=fastapi_status.HTTP_404_NOT_FOUND,
|
240
|
+
detail=f"Job {job_id} not found",
|
241
|
+
)
|
242
|
+
|
243
|
+
if job_update.status != JobStatusType.FAILED:
|
244
|
+
raise HTTPException(
|
245
|
+
status_code=fastapi_status.HTTP_422_UNPROCESSABLE_ENTITY,
|
246
|
+
detail=f"Cannot set job status to {job_update.status}",
|
247
|
+
)
|
248
|
+
|
249
|
+
setattr(job, "status", job_update.status)
|
250
|
+
await db.commit()
|
251
|
+
await db.refresh(job)
|
252
|
+
await db.close()
|
253
|
+
return job
|
@@ -15,12 +15,8 @@ from .....config import get_settings
|
|
15
15
|
from .....syringe import Inject
|
16
16
|
from ....db import AsyncSession
|
17
17
|
from ....db import get_db
|
18
|
-
from ....models import ApplyWorkflow
|
19
18
|
from ....runner._common import SHUTDOWN_FILENAME
|
20
19
|
from ....schemas import ApplyWorkflowRead
|
21
|
-
from ....schemas import ApplyWorkflowUpdate
|
22
|
-
from ....schemas import JobStatusType
|
23
|
-
from ....security import current_active_superuser
|
24
20
|
from ....security import current_active_user
|
25
21
|
from ....security import User
|
26
22
|
from ._aux_functions import _get_job_check_owner
|
@@ -200,39 +196,3 @@ async def stop_job(
|
|
200
196
|
f.write(f"Trigger executor shutdown for {job.id=}, {project_id=}.")
|
201
197
|
|
202
198
|
return Response(status_code=status.HTTP_204_NO_CONTENT)
|
203
|
-
|
204
|
-
|
205
|
-
@router.patch(
|
206
|
-
"/job/{job_id}/",
|
207
|
-
response_model=ApplyWorkflowRead,
|
208
|
-
)
|
209
|
-
async def update_job(
|
210
|
-
job_update: ApplyWorkflowUpdate,
|
211
|
-
job_id: int,
|
212
|
-
user: User = Depends(current_active_superuser),
|
213
|
-
db: AsyncSession = Depends(get_db),
|
214
|
-
) -> Optional[ApplyWorkflowRead]:
|
215
|
-
"""
|
216
|
-
Change the status of an existing job.
|
217
|
-
|
218
|
-
This endpoint is only open to superusers, and it does not apply
|
219
|
-
project-based access-control to jobs.
|
220
|
-
"""
|
221
|
-
job = await db.get(ApplyWorkflow, job_id)
|
222
|
-
if job is None:
|
223
|
-
raise HTTPException(
|
224
|
-
status_code=status.HTTP_404_NOT_FOUND,
|
225
|
-
detail=f"Job {job_id} not found",
|
226
|
-
)
|
227
|
-
|
228
|
-
if job_update.status != JobStatusType.FAILED:
|
229
|
-
raise HTTPException(
|
230
|
-
status_code=status.HTTP_422_UNPROCESSABLE_ENTITY,
|
231
|
-
detail=f"Cannot set job status to {job_update.status}",
|
232
|
-
)
|
233
|
-
|
234
|
-
setattr(job, "status", job_update.status)
|
235
|
-
await db.commit()
|
236
|
-
await db.refresh(job)
|
237
|
-
await db.close()
|
238
|
-
return job
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: fractal-server
|
3
|
-
Version: 1.4.
|
3
|
+
Version: 1.4.0a10
|
4
4
|
Summary: Server component of the Fractal analytics platform
|
5
5
|
Home-page: https://github.com/fractal-analytics-platform/fractal-server
|
6
6
|
License: BSD-3-Clause
|
@@ -12,6 +12,7 @@ Classifier: Programming Language :: Python :: 3
|
|
12
12
|
Classifier: Programming Language :: Python :: 3.9
|
13
13
|
Classifier: Programming Language :: Python :: 3.10
|
14
14
|
Classifier: Programming Language :: Python :: 3.11
|
15
|
+
Classifier: Programming Language :: Python :: 3.12
|
15
16
|
Provides-Extra: gunicorn
|
16
17
|
Provides-Extra: postgres
|
17
18
|
Provides-Extra: slurm
|
@@ -26,8 +27,8 @@ Requires-Dist: gunicorn (>=20.1.0,<21.0.0) ; extra == "gunicorn"
|
|
26
27
|
Requires-Dist: psycopg2 (>=2.9.5,<3.0.0) ; extra == "postgres"
|
27
28
|
Requires-Dist: pydantic (>=1.10.8,<2)
|
28
29
|
Requires-Dist: python-dotenv (>=0.20.0,<0.21.0)
|
29
|
-
Requires-Dist: sqlalchemy[asyncio] (
|
30
|
-
Requires-Dist: sqlmodel (>=0.0.
|
30
|
+
Requires-Dist: sqlalchemy[asyncio] (>=2.0.23,<2.1)
|
31
|
+
Requires-Dist: sqlmodel (>=0.0.12,<0.0.13)
|
31
32
|
Requires-Dist: uvicorn (>=0.20.0,<0.21.0)
|
32
33
|
Project-URL: Changelog, https://github.com/fractal-analytics-platform/fractal-server/blob/main/CHANGELOG.md
|
33
34
|
Project-URL: Documentation, https://fractal-analytics-platform.github.io/fractal-server
|
@@ -1,8 +1,8 @@
|
|
1
|
-
fractal_server/__init__.py,sha256=
|
1
|
+
fractal_server/__init__.py,sha256=tmgA-5yDN48QJckSZGFd4ui39osD9xIRrN6v7Z3LX9U,25
|
2
2
|
fractal_server/__main__.py,sha256=znijcImbcEC4P26ICOhEJ9VY3_5vWdMwQcl-WP25sYA,2202
|
3
3
|
fractal_server/alembic.ini,sha256=MWwi7GzjzawI9cCAK1LW7NxIBQDUqD12-ptJoq5JpP0,3153
|
4
4
|
fractal_server/app/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
5
|
-
fractal_server/app/db/__init__.py,sha256=
|
5
|
+
fractal_server/app/db/__init__.py,sha256=gJCmPYNVg8UEjvtPWLupM3yzZRpt3wvHjZuUsn1DBXk,3781
|
6
6
|
fractal_server/app/models/__init__.py,sha256=RuxWH8fsmkTWsjLhYjrxSt-mvk74coCilAQlX2Q6OO0,353
|
7
7
|
fractal_server/app/models/dataset.py,sha256=fcZkb2y7PXlFJAyZtndJ7Gf4c8VpkWjZe47iMybv1aE,2109
|
8
8
|
fractal_server/app/models/job.py,sha256=DbX7OMx88eC-232C_OdYOpNeyN0tma7p8J3x7HB43os,2768
|
@@ -13,12 +13,12 @@ fractal_server/app/models/state.py,sha256=rSTjYPfPZntEfdQudKp6yu5vsdyfHA7nMYNRIB
|
|
13
13
|
fractal_server/app/models/task.py,sha256=APndtea9A7EF7TtpVK8kWapBM01a6nk3FFCrQbbioI8,2632
|
14
14
|
fractal_server/app/models/workflow.py,sha256=r_bdKxzGgRjiwJW2fMYV9pvqcAs2swh1xg_q8pvXSbE,5328
|
15
15
|
fractal_server/app/routes/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
16
|
-
fractal_server/app/routes/admin.py,sha256=
|
16
|
+
fractal_server/app/routes/admin.py,sha256=70A9YVRtrAw0Npetr6WD8o1eW8d6MOlxdrSgCMVa53I,8369
|
17
17
|
fractal_server/app/routes/api/__init__.py,sha256=EVyZrEq3I_1643QGTPCC5lgCp4xH_auYbrFfogTm4pc,315
|
18
18
|
fractal_server/app/routes/api/v1/__init__.py,sha256=V4nhYyMIqhlJxbotLTYikq_ghb6KID0ZKOOYaOq7C-g,944
|
19
19
|
fractal_server/app/routes/api/v1/_aux_functions.py,sha256=qaeTsfSk78FHSsMVNkGdPIPBjeKOEd1sq0KhY0SQ1l0,10095
|
20
20
|
fractal_server/app/routes/api/v1/dataset.py,sha256=_P8SUXEs5Gh-a82QR06xyZ_F6eX6R_CxmBduNXEeERY,14968
|
21
|
-
fractal_server/app/routes/api/v1/job.py,sha256=
|
21
|
+
fractal_server/app/routes/api/v1/job.py,sha256=07nrsWvPcV-DkFybiMKgHLVDp_CFeFx6pnEKnBNrvL4,5382
|
22
22
|
fractal_server/app/routes/api/v1/project.py,sha256=uP-p9rghQBQ_vRZ2hUw_bT21WVLpqdgJNdxN6z367YI,11417
|
23
23
|
fractal_server/app/routes/api/v1/task.py,sha256=iT45B_NXvBilp-aclWuONsNAWvpczrEWO21K9DOJsZ0,5504
|
24
24
|
fractal_server/app/routes/api/v1/task_collection.py,sha256=bMnhrMkI_45Bttd6J9j_CEmpjQZCV5mTy8_j1Ca8xQg,11724
|
@@ -76,8 +76,8 @@ fractal_server/syringe.py,sha256=3qSMW3YaMKKnLdgnooAINOPxnCOxP7y2jeAQYB21Gdo,278
|
|
76
76
|
fractal_server/tasks/__init__.py,sha256=Wzuxf5EoH1v0fYzRpAZHG_S-Z9f6DmbIsuSvllBCGvc,72
|
77
77
|
fractal_server/tasks/collection.py,sha256=POKvQyS5G5ySybH0r0v21I_ZQ5AREe9kAqr_uFfGyaU,17627
|
78
78
|
fractal_server/utils.py,sha256=b7WwFdcFZ8unyT65mloFToYuEDXpQoHRcmRNqrhd_dQ,2115
|
79
|
-
fractal_server-1.4.
|
80
|
-
fractal_server-1.4.
|
81
|
-
fractal_server-1.4.
|
82
|
-
fractal_server-1.4.
|
83
|
-
fractal_server-1.4.
|
79
|
+
fractal_server-1.4.0a10.dist-info/LICENSE,sha256=QKAharUuhxL58kSoLizKJeZE3mTCBnX6ucmz8W0lxlk,1576
|
80
|
+
fractal_server-1.4.0a10.dist-info/METADATA,sha256=LwAeB6fkG05EJSvzDBC245TNhCKHkVcDuIPx_Zv8MiU,3828
|
81
|
+
fractal_server-1.4.0a10.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
|
82
|
+
fractal_server-1.4.0a10.dist-info/entry_points.txt,sha256=8tV2kynvFkjnhbtDnxAqImL6HMVKsopgGfew0DOp5UY,58
|
83
|
+
fractal_server-1.4.0a10.dist-info/RECORD,,
|
File without changes
|
File without changes
|