fractal-server 1.4.0a9__tar.gz → 1.4.0a10__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 (83) hide show
  1. {fractal_server-1.4.0a9 → fractal_server-1.4.0a10}/PKG-INFO +1 -1
  2. fractal_server-1.4.0a10/fractal_server/__init__.py +1 -0
  3. {fractal_server-1.4.0a9 → fractal_server-1.4.0a10}/fractal_server/app/routes/admin.py +39 -0
  4. {fractal_server-1.4.0a9 → fractal_server-1.4.0a10}/fractal_server/app/routes/api/v1/job.py +0 -40
  5. {fractal_server-1.4.0a9 → fractal_server-1.4.0a10}/pyproject.toml +2 -2
  6. fractal_server-1.4.0a9/fractal_server/__init__.py +0 -1
  7. {fractal_server-1.4.0a9 → fractal_server-1.4.0a10}/LICENSE +0 -0
  8. {fractal_server-1.4.0a9 → fractal_server-1.4.0a10}/README.md +0 -0
  9. {fractal_server-1.4.0a9 → fractal_server-1.4.0a10}/fractal_server/__main__.py +0 -0
  10. {fractal_server-1.4.0a9 → fractal_server-1.4.0a10}/fractal_server/alembic.ini +0 -0
  11. {fractal_server-1.4.0a9 → fractal_server-1.4.0a10}/fractal_server/app/__init__.py +0 -0
  12. {fractal_server-1.4.0a9 → fractal_server-1.4.0a10}/fractal_server/app/db/__init__.py +0 -0
  13. {fractal_server-1.4.0a9 → fractal_server-1.4.0a10}/fractal_server/app/models/__init__.py +0 -0
  14. {fractal_server-1.4.0a9 → fractal_server-1.4.0a10}/fractal_server/app/models/dataset.py +0 -0
  15. {fractal_server-1.4.0a9 → fractal_server-1.4.0a10}/fractal_server/app/models/job.py +0 -0
  16. {fractal_server-1.4.0a9 → fractal_server-1.4.0a10}/fractal_server/app/models/linkuserproject.py +0 -0
  17. {fractal_server-1.4.0a9 → fractal_server-1.4.0a10}/fractal_server/app/models/project.py +0 -0
  18. {fractal_server-1.4.0a9 → fractal_server-1.4.0a10}/fractal_server/app/models/security.py +0 -0
  19. {fractal_server-1.4.0a9 → fractal_server-1.4.0a10}/fractal_server/app/models/state.py +0 -0
  20. {fractal_server-1.4.0a9 → fractal_server-1.4.0a10}/fractal_server/app/models/task.py +0 -0
  21. {fractal_server-1.4.0a9 → fractal_server-1.4.0a10}/fractal_server/app/models/workflow.py +0 -0
  22. {fractal_server-1.4.0a9 → fractal_server-1.4.0a10}/fractal_server/app/routes/__init__.py +0 -0
  23. {fractal_server-1.4.0a9 → fractal_server-1.4.0a10}/fractal_server/app/routes/api/__init__.py +0 -0
  24. {fractal_server-1.4.0a9 → fractal_server-1.4.0a10}/fractal_server/app/routes/api/v1/__init__.py +0 -0
  25. {fractal_server-1.4.0a9 → fractal_server-1.4.0a10}/fractal_server/app/routes/api/v1/_aux_functions.py +0 -0
  26. {fractal_server-1.4.0a9 → fractal_server-1.4.0a10}/fractal_server/app/routes/api/v1/dataset.py +0 -0
  27. {fractal_server-1.4.0a9 → fractal_server-1.4.0a10}/fractal_server/app/routes/api/v1/project.py +0 -0
  28. {fractal_server-1.4.0a9 → fractal_server-1.4.0a10}/fractal_server/app/routes/api/v1/task.py +0 -0
  29. {fractal_server-1.4.0a9 → fractal_server-1.4.0a10}/fractal_server/app/routes/api/v1/task_collection.py +0 -0
  30. {fractal_server-1.4.0a9 → fractal_server-1.4.0a10}/fractal_server/app/routes/api/v1/workflow.py +0 -0
  31. {fractal_server-1.4.0a9 → fractal_server-1.4.0a10}/fractal_server/app/routes/api/v1/workflowtask.py +0 -0
  32. {fractal_server-1.4.0a9 → fractal_server-1.4.0a10}/fractal_server/app/routes/auth.py +0 -0
  33. {fractal_server-1.4.0a9 → fractal_server-1.4.0a10}/fractal_server/app/runner/.gitignore +0 -0
  34. {fractal_server-1.4.0a9 → fractal_server-1.4.0a10}/fractal_server/app/runner/__init__.py +0 -0
  35. {fractal_server-1.4.0a9 → fractal_server-1.4.0a10}/fractal_server/app/runner/_common.py +0 -0
  36. {fractal_server-1.4.0a9 → fractal_server-1.4.0a10}/fractal_server/app/runner/_local/__init__.py +0 -0
  37. {fractal_server-1.4.0a9 → fractal_server-1.4.0a10}/fractal_server/app/runner/_local/_local_config.py +0 -0
  38. {fractal_server-1.4.0a9 → fractal_server-1.4.0a10}/fractal_server/app/runner/_local/_submit_setup.py +0 -0
  39. {fractal_server-1.4.0a9 → fractal_server-1.4.0a10}/fractal_server/app/runner/_local/executor.py +0 -0
  40. {fractal_server-1.4.0a9 → fractal_server-1.4.0a10}/fractal_server/app/runner/_slurm/.gitignore +0 -0
  41. {fractal_server-1.4.0a9 → fractal_server-1.4.0a10}/fractal_server/app/runner/_slurm/__init__.py +0 -0
  42. {fractal_server-1.4.0a9 → fractal_server-1.4.0a10}/fractal_server/app/runner/_slurm/_batching.py +0 -0
  43. {fractal_server-1.4.0a9 → fractal_server-1.4.0a10}/fractal_server/app/runner/_slurm/_executor_wait_thread.py +0 -0
  44. {fractal_server-1.4.0a9 → fractal_server-1.4.0a10}/fractal_server/app/runner/_slurm/_slurm_config.py +0 -0
  45. {fractal_server-1.4.0a9 → fractal_server-1.4.0a10}/fractal_server/app/runner/_slurm/_submit_setup.py +0 -0
  46. {fractal_server-1.4.0a9 → fractal_server-1.4.0a10}/fractal_server/app/runner/_slurm/_subprocess_run_as_user.py +0 -0
  47. {fractal_server-1.4.0a9 → fractal_server-1.4.0a10}/fractal_server/app/runner/_slurm/executor.py +0 -0
  48. {fractal_server-1.4.0a9 → fractal_server-1.4.0a10}/fractal_server/app/runner/_slurm/remote.py +0 -0
  49. {fractal_server-1.4.0a9 → fractal_server-1.4.0a10}/fractal_server/app/runner/common.py +0 -0
  50. {fractal_server-1.4.0a9 → fractal_server-1.4.0a10}/fractal_server/app/runner/handle_failed_job.py +0 -0
  51. {fractal_server-1.4.0a9 → fractal_server-1.4.0a10}/fractal_server/app/schemas/__init__.py +0 -0
  52. {fractal_server-1.4.0a9 → fractal_server-1.4.0a10}/fractal_server/app/schemas/_validators.py +0 -0
  53. {fractal_server-1.4.0a9 → fractal_server-1.4.0a10}/fractal_server/app/schemas/applyworkflow.py +0 -0
  54. {fractal_server-1.4.0a9 → fractal_server-1.4.0a10}/fractal_server/app/schemas/dataset.py +0 -0
  55. {fractal_server-1.4.0a9 → fractal_server-1.4.0a10}/fractal_server/app/schemas/json_schemas/manifest.json +0 -0
  56. {fractal_server-1.4.0a9 → fractal_server-1.4.0a10}/fractal_server/app/schemas/manifest.py +0 -0
  57. {fractal_server-1.4.0a9 → fractal_server-1.4.0a10}/fractal_server/app/schemas/project.py +0 -0
  58. {fractal_server-1.4.0a9 → fractal_server-1.4.0a10}/fractal_server/app/schemas/state.py +0 -0
  59. {fractal_server-1.4.0a9 → fractal_server-1.4.0a10}/fractal_server/app/schemas/task.py +0 -0
  60. {fractal_server-1.4.0a9 → fractal_server-1.4.0a10}/fractal_server/app/schemas/task_collection.py +0 -0
  61. {fractal_server-1.4.0a9 → fractal_server-1.4.0a10}/fractal_server/app/schemas/user.py +0 -0
  62. {fractal_server-1.4.0a9 → fractal_server-1.4.0a10}/fractal_server/app/schemas/workflow.py +0 -0
  63. {fractal_server-1.4.0a9 → fractal_server-1.4.0a10}/fractal_server/app/security/__init__.py +0 -0
  64. {fractal_server-1.4.0a9 → fractal_server-1.4.0a10}/fractal_server/config.py +0 -0
  65. {fractal_server-1.4.0a9 → fractal_server-1.4.0a10}/fractal_server/logger.py +0 -0
  66. {fractal_server-1.4.0a9 → fractal_server-1.4.0a10}/fractal_server/main.py +0 -0
  67. {fractal_server-1.4.0a9 → fractal_server-1.4.0a10}/fractal_server/migrations/README +0 -0
  68. {fractal_server-1.4.0a9 → fractal_server-1.4.0a10}/fractal_server/migrations/env.py +0 -0
  69. {fractal_server-1.4.0a9 → fractal_server-1.4.0a10}/fractal_server/migrations/script.py.mako +0 -0
  70. {fractal_server-1.4.0a9 → fractal_server-1.4.0a10}/fractal_server/migrations/versions/4c308bcaea2b_add_task_args_schema_and_task_args_.py +0 -0
  71. {fractal_server-1.4.0a9 → fractal_server-1.4.0a10}/fractal_server/migrations/versions/50a13d6138fd_initial_schema.py +0 -0
  72. {fractal_server-1.4.0a9 → fractal_server-1.4.0a10}/fractal_server/migrations/versions/70e77f1c38b0_add_applyworkflow_first_task_index_and_.py +0 -0
  73. {fractal_server-1.4.0a9 → fractal_server-1.4.0a10}/fractal_server/migrations/versions/84bf0fffde30_add_dumps_to_applyworkflow.py +0 -0
  74. {fractal_server-1.4.0a9 → fractal_server-1.4.0a10}/fractal_server/migrations/versions/8f79bd162e35_add_docs_info_and_docs_link_to_task_.py +0 -0
  75. {fractal_server-1.4.0a9 → fractal_server-1.4.0a10}/fractal_server/migrations/versions/99ea79d9e5d2_add_dataset_history.py +0 -0
  76. {fractal_server-1.4.0a9 → fractal_server-1.4.0a10}/fractal_server/migrations/versions/a7f4d6137b53_add_workflow_dump_to_applyworkflow.py +0 -0
  77. {fractal_server-1.4.0a9 → fractal_server-1.4.0a10}/fractal_server/migrations/versions/e75cac726012_make_applyworkflow_start_timestamp_not_.py +0 -0
  78. {fractal_server-1.4.0a9 → fractal_server-1.4.0a10}/fractal_server/migrations/versions/f384e1c0cf5d_drop_task_default_args_columns.py +0 -0
  79. {fractal_server-1.4.0a9 → fractal_server-1.4.0a10}/fractal_server/py.typed +0 -0
  80. {fractal_server-1.4.0a9 → fractal_server-1.4.0a10}/fractal_server/syringe.py +0 -0
  81. {fractal_server-1.4.0a9 → fractal_server-1.4.0a10}/fractal_server/tasks/__init__.py +0 -0
  82. {fractal_server-1.4.0a9 → fractal_server-1.4.0a10}/fractal_server/tasks/collection.py +0 -0
  83. {fractal_server-1.4.0a9 → fractal_server-1.4.0a10}/fractal_server/utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: fractal-server
3
- Version: 1.4.0a9
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
@@ -0,0 +1 @@
1
+ __VERSION__ = "1.4.0a10"
@@ -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
  [tool.poetry]
2
2
  name = "fractal-server"
3
- version = "1.4.0a9"
3
+ version = "1.4.0a10"
4
4
  description = "Server component of the Fractal analytics platform"
5
5
  authors = [
6
6
  "Jacopo Nespolo <jacopo.nespolo@exact-lab.it>",
@@ -82,7 +82,7 @@ filterwarnings = [
82
82
  ]
83
83
 
84
84
  [tool.bumpver]
85
- current_version = "1.4.0a9"
85
+ current_version = "1.4.0a10"
86
86
  version_pattern = "MAJOR.MINOR.PATCH[PYTAGNUM]"
87
87
  commit_message = "bump version {old_version} -> {new_version}"
88
88
  commit = true
@@ -1 +0,0 @@
1
- __VERSION__ = "1.4.0a9"