fractal-server 1.3.12a4__tar.gz → 1.3.13__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 (78) hide show
  1. {fractal_server-1.3.12a4 → fractal_server-1.3.13}/PKG-INFO +2 -4
  2. fractal_server-1.3.13/fractal_server/__init__.py +1 -0
  3. {fractal_server-1.3.12a4 → fractal_server-1.3.13}/fractal_server/app/db/__init__.py +11 -3
  4. {fractal_server-1.3.12a4 → fractal_server-1.3.13}/fractal_server/app/models/dataset.py +3 -1
  5. {fractal_server-1.3.12a4 → fractal_server-1.3.13}/fractal_server/app/runner/__init__.py +2 -3
  6. {fractal_server-1.3.12a4 → fractal_server-1.3.13}/fractal_server/config.py +5 -0
  7. {fractal_server-1.3.12a4 → fractal_server-1.3.13}/fractal_server/migrations/script.py.mako +0 -1
  8. fractal_server-1.3.13/fractal_server/migrations/versions/99ea79d9e5d2_add_dataset_history.py +36 -0
  9. {fractal_server-1.3.12a4 → fractal_server-1.3.13}/fractal_server/tasks/collection.py +2 -2
  10. {fractal_server-1.3.12a4 → fractal_server-1.3.13}/pyproject.toml +5 -7
  11. fractal_server-1.3.12a4/fractal_server/__init__.py +0 -1
  12. fractal_server-1.3.12a4/fractal_server/migrations/versions/5c4ff7526508_add_dataset_history.py +0 -35
  13. {fractal_server-1.3.12a4 → fractal_server-1.3.13}/LICENSE +0 -0
  14. {fractal_server-1.3.12a4 → fractal_server-1.3.13}/README.md +0 -0
  15. {fractal_server-1.3.12a4 → fractal_server-1.3.13}/fractal_server/__main__.py +0 -0
  16. {fractal_server-1.3.12a4 → fractal_server-1.3.13}/fractal_server/alembic.ini +0 -0
  17. {fractal_server-1.3.12a4 → fractal_server-1.3.13}/fractal_server/app/__init__.py +0 -0
  18. {fractal_server-1.3.12a4 → fractal_server-1.3.13}/fractal_server/app/api/__init__.py +0 -0
  19. {fractal_server-1.3.12a4 → fractal_server-1.3.13}/fractal_server/app/api/v1/__init__.py +0 -0
  20. {fractal_server-1.3.12a4 → fractal_server-1.3.13}/fractal_server/app/api/v1/_aux_functions.py +0 -0
  21. {fractal_server-1.3.12a4 → fractal_server-1.3.13}/fractal_server/app/api/v1/dataset.py +0 -0
  22. {fractal_server-1.3.12a4 → fractal_server-1.3.13}/fractal_server/app/api/v1/job.py +0 -0
  23. {fractal_server-1.3.12a4 → fractal_server-1.3.13}/fractal_server/app/api/v1/project.py +0 -0
  24. {fractal_server-1.3.12a4 → fractal_server-1.3.13}/fractal_server/app/api/v1/task.py +0 -0
  25. {fractal_server-1.3.12a4 → fractal_server-1.3.13}/fractal_server/app/api/v1/task_collection.py +0 -0
  26. {fractal_server-1.3.12a4 → fractal_server-1.3.13}/fractal_server/app/api/v1/workflow.py +0 -0
  27. {fractal_server-1.3.12a4 → fractal_server-1.3.13}/fractal_server/app/api/v1/workflowtask.py +0 -0
  28. {fractal_server-1.3.12a4 → fractal_server-1.3.13}/fractal_server/app/models/__init__.py +0 -0
  29. {fractal_server-1.3.12a4 → fractal_server-1.3.13}/fractal_server/app/models/job.py +0 -0
  30. {fractal_server-1.3.12a4 → fractal_server-1.3.13}/fractal_server/app/models/linkuserproject.py +0 -0
  31. {fractal_server-1.3.12a4 → fractal_server-1.3.13}/fractal_server/app/models/project.py +0 -0
  32. {fractal_server-1.3.12a4 → fractal_server-1.3.13}/fractal_server/app/models/security.py +0 -0
  33. {fractal_server-1.3.12a4 → fractal_server-1.3.13}/fractal_server/app/models/state.py +0 -0
  34. {fractal_server-1.3.12a4 → fractal_server-1.3.13}/fractal_server/app/models/task.py +0 -0
  35. {fractal_server-1.3.12a4 → fractal_server-1.3.13}/fractal_server/app/models/workflow.py +0 -0
  36. {fractal_server-1.3.12a4 → fractal_server-1.3.13}/fractal_server/app/runner/.gitignore +0 -0
  37. {fractal_server-1.3.12a4 → fractal_server-1.3.13}/fractal_server/app/runner/_common.py +0 -0
  38. {fractal_server-1.3.12a4 → fractal_server-1.3.13}/fractal_server/app/runner/_local/__init__.py +0 -0
  39. {fractal_server-1.3.12a4 → fractal_server-1.3.13}/fractal_server/app/runner/_local/_local_config.py +0 -0
  40. {fractal_server-1.3.12a4 → fractal_server-1.3.13}/fractal_server/app/runner/_local/_submit_setup.py +0 -0
  41. {fractal_server-1.3.12a4 → fractal_server-1.3.13}/fractal_server/app/runner/_local/executor.py +0 -0
  42. {fractal_server-1.3.12a4 → fractal_server-1.3.13}/fractal_server/app/runner/_slurm/.gitignore +0 -0
  43. {fractal_server-1.3.12a4 → fractal_server-1.3.13}/fractal_server/app/runner/_slurm/__init__.py +0 -0
  44. {fractal_server-1.3.12a4 → fractal_server-1.3.13}/fractal_server/app/runner/_slurm/_batching.py +0 -0
  45. {fractal_server-1.3.12a4 → fractal_server-1.3.13}/fractal_server/app/runner/_slurm/_executor_wait_thread.py +0 -0
  46. {fractal_server-1.3.12a4 → fractal_server-1.3.13}/fractal_server/app/runner/_slurm/_slurm_config.py +0 -0
  47. {fractal_server-1.3.12a4 → fractal_server-1.3.13}/fractal_server/app/runner/_slurm/_submit_setup.py +0 -0
  48. {fractal_server-1.3.12a4 → fractal_server-1.3.13}/fractal_server/app/runner/_slurm/_subprocess_run_as_user.py +0 -0
  49. {fractal_server-1.3.12a4 → fractal_server-1.3.13}/fractal_server/app/runner/_slurm/executor.py +0 -0
  50. {fractal_server-1.3.12a4 → fractal_server-1.3.13}/fractal_server/app/runner/_slurm/remote.py +0 -0
  51. {fractal_server-1.3.12a4 → fractal_server-1.3.13}/fractal_server/app/runner/common.py +0 -0
  52. {fractal_server-1.3.12a4 → fractal_server-1.3.13}/fractal_server/app/runner/handle_failed_job.py +0 -0
  53. {fractal_server-1.3.12a4 → fractal_server-1.3.13}/fractal_server/app/schemas/__init__.py +0 -0
  54. {fractal_server-1.3.12a4 → fractal_server-1.3.13}/fractal_server/app/schemas/_validators.py +0 -0
  55. {fractal_server-1.3.12a4 → fractal_server-1.3.13}/fractal_server/app/schemas/applyworkflow.py +0 -0
  56. {fractal_server-1.3.12a4 → fractal_server-1.3.13}/fractal_server/app/schemas/dataset.py +0 -0
  57. {fractal_server-1.3.12a4 → fractal_server-1.3.13}/fractal_server/app/schemas/manifest.py +0 -0
  58. {fractal_server-1.3.12a4 → fractal_server-1.3.13}/fractal_server/app/schemas/project.py +0 -0
  59. {fractal_server-1.3.12a4 → fractal_server-1.3.13}/fractal_server/app/schemas/state.py +0 -0
  60. {fractal_server-1.3.12a4 → fractal_server-1.3.13}/fractal_server/app/schemas/task.py +0 -0
  61. {fractal_server-1.3.12a4 → fractal_server-1.3.13}/fractal_server/app/schemas/task_collection.py +0 -0
  62. {fractal_server-1.3.12a4 → fractal_server-1.3.13}/fractal_server/app/schemas/user.py +0 -0
  63. {fractal_server-1.3.12a4 → fractal_server-1.3.13}/fractal_server/app/schemas/workflow.py +0 -0
  64. {fractal_server-1.3.12a4 → fractal_server-1.3.13}/fractal_server/app/security/__init__.py +0 -0
  65. {fractal_server-1.3.12a4 → fractal_server-1.3.13}/fractal_server/logger.py +0 -0
  66. {fractal_server-1.3.12a4 → fractal_server-1.3.13}/fractal_server/main.py +0 -0
  67. {fractal_server-1.3.12a4 → fractal_server-1.3.13}/fractal_server/migrations/README +0 -0
  68. {fractal_server-1.3.12a4 → fractal_server-1.3.13}/fractal_server/migrations/env.py +0 -0
  69. {fractal_server-1.3.12a4 → fractal_server-1.3.13}/fractal_server/migrations/versions/4c308bcaea2b_add_task_args_schema_and_task_args_.py +0 -0
  70. {fractal_server-1.3.12a4 → fractal_server-1.3.13}/fractal_server/migrations/versions/50a13d6138fd_initial_schema.py +0 -0
  71. {fractal_server-1.3.12a4 → fractal_server-1.3.13}/fractal_server/migrations/versions/70e77f1c38b0_add_applyworkflow_first_task_index_and_.py +0 -0
  72. {fractal_server-1.3.12a4 → fractal_server-1.3.13}/fractal_server/migrations/versions/8f79bd162e35_add_docs_info_and_docs_link_to_task_.py +0 -0
  73. {fractal_server-1.3.12a4 → fractal_server-1.3.13}/fractal_server/migrations/versions/a7f4d6137b53_add_workflow_dump_to_applyworkflow.py +0 -0
  74. {fractal_server-1.3.12a4 → fractal_server-1.3.13}/fractal_server/migrations/versions/f384e1c0cf5d_drop_task_default_args_columns.py +0 -0
  75. {fractal_server-1.3.12a4 → fractal_server-1.3.13}/fractal_server/py.typed +0 -0
  76. {fractal_server-1.3.12a4 → fractal_server-1.3.13}/fractal_server/syringe.py +0 -0
  77. {fractal_server-1.3.12a4 → fractal_server-1.3.13}/fractal_server/tasks/__init__.py +0 -0
  78. {fractal_server-1.3.12a4 → fractal_server-1.3.13}/fractal_server/utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: fractal-server
3
- Version: 1.3.12a4
3
+ Version: 1.3.13
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
@@ -15,7 +15,6 @@ Classifier: Programming Language :: Python :: 3.11
15
15
  Provides-Extra: gunicorn
16
16
  Provides-Extra: postgres
17
17
  Provides-Extra: slurm
18
- Requires-Dist: SQLAlchemy-Utils (>=0.38.3,<0.39.0)
19
18
  Requires-Dist: aiosqlite (>=0.17.0,<0.18.0)
20
19
  Requires-Dist: alembic (>=1.9.1,<2.0.0)
21
20
  Requires-Dist: asyncpg (>=0.27.0,<0.28.0) ; extra == "postgres"
@@ -23,12 +22,11 @@ Requires-Dist: cloudpickle (>=2.2.1,<2.3.0) ; extra == "slurm"
23
22
  Requires-Dist: clusterfutures (>=0.5,<0.6) ; extra == "slurm"
24
23
  Requires-Dist: fastapi (>=0.103.0,<0.104.0)
25
24
  Requires-Dist: fastapi-users[oauth] (>=12.1.0,<13.0.0)
26
- Requires-Dist: greenlet
27
25
  Requires-Dist: gunicorn (>=20.1.0,<21.0.0) ; extra == "gunicorn"
28
26
  Requires-Dist: psycopg2 (>=2.9.5,<3.0.0) ; extra == "postgres"
29
27
  Requires-Dist: pydantic (>=1.10.8,<2)
30
28
  Requires-Dist: python-dotenv (>=0.20.0,<0.21.0)
31
- Requires-Dist: sqlalchemy (>=1.4,<2.0)
29
+ Requires-Dist: sqlalchemy[asyncio] (>=1.4,<2.0)
32
30
  Requires-Dist: sqlmodel (>=0.0.8,<0.0.9)
33
31
  Requires-Dist: uvicorn (>=0.20.0,<0.21.0)
34
32
  Project-URL: Changelog, https://github.com/fractal-analytics-platform/fractal-server/blob/main/CHANGELOG.md
@@ -0,0 +1 @@
1
+ __VERSION__ = "1.3.13"
@@ -6,6 +6,7 @@ from typing import AsyncGenerator
6
6
  from typing import Generator
7
7
 
8
8
  from sqlalchemy import create_engine
9
+ from sqlalchemy import event
9
10
  from sqlalchemy.ext.asyncio import AsyncSession
10
11
  from sqlalchemy.ext.asyncio import create_async_engine
11
12
  from sqlalchemy.orm import Session as DBSyncSession
@@ -49,9 +50,9 @@ class DB:
49
50
 
50
51
  if settings.DB_ENGINE == "sqlite":
51
52
  logger.warning(
52
- "SQLite is supported but discouraged in production. Given its "
53
- "partial support for ForeignKey constraints, consistency of "
54
- "the database cannot be guaranteed."
53
+ "SQLite is supported (for version >=3.37) but discouraged "
54
+ "in production. Given its partial support for ForeignKey "
55
+ "constraints, database consistency cannot be guaranteed."
55
56
  )
56
57
 
57
58
  # Set some sqlite-specific options
@@ -86,6 +87,13 @@ class DB:
86
87
  bind=cls._engine_sync, autocommit=False, autoflush=False
87
88
  )
88
89
 
90
+ @event.listens_for(cls._engine_sync, "connect")
91
+ def set_sqlite_pragma(dbapi_connection, connection_record):
92
+ if settings.DB_ENGINE == "sqlite":
93
+ cursor = dbapi_connection.cursor()
94
+ cursor.execute("PRAGMA journal_mode=WAL")
95
+ cursor.close()
96
+
89
97
  @classmethod
90
98
  async def get_db(cls) -> AsyncGenerator[AsyncSession, None]:
91
99
  """
@@ -43,7 +43,9 @@ class Dataset(_DatasetBase, SQLModel, table=True):
43
43
  }
44
44
  )
45
45
  meta: dict[str, Any] = Field(sa_column=Column(JSON), default={})
46
- history: list[dict[str, Any]] = Field(sa_column=Column(JSON), default=[])
46
+ history: list[dict[str, Any]] = Field(
47
+ sa_column=Column(JSON, server_default="[]", nullable=False)
48
+ )
47
49
 
48
50
  class Config:
49
51
  arbitrary_types_allowed = True
@@ -248,9 +248,8 @@ async def submit_workflow(
248
248
  )
249
249
  logger.debug(f'END workflow "{workflow.name}"')
250
250
 
251
- # Replace output_dataset.meta with output_dataset_meta, while handling
252
- # the history property in a special way (i.e. appending to and
253
- # existing entry rather than replacing it)
251
+ # Replace output_dataset.meta and output_dataset.history with their
252
+ # up-to-date versions, obtained within process_workflow
254
253
  output_dataset.history = output_dataset_meta_hist.pop("history")
255
254
  output_dataset.meta = output_dataset_meta_hist.pop("metadata")
256
255
 
@@ -419,4 +419,9 @@ class Settings(BaseSettings):
419
419
 
420
420
 
421
421
  def get_settings(settings=Settings()) -> Settings:
422
+ logging.debug("Fractal Settings:")
423
+ for key, value in settings.dict().items():
424
+ if any(s in key.upper() for s in ["PASSWORD", "SECRET"]):
425
+ value = "*****"
426
+ logging.debug(f"{key}: {value}")
422
427
  return settings
@@ -7,7 +7,6 @@ Create Date: ${create_date}
7
7
  """
8
8
  from alembic import op
9
9
  import sqlalchemy as sa
10
- import sqlalchemy_utils
11
10
  import sqlmodel
12
11
  ${imports if imports else ""}
13
12
 
@@ -0,0 +1,36 @@
1
+ """Add Dataset.history
2
+
3
+ Revision ID: 99ea79d9e5d2
4
+ Revises: 8f79bd162e35
5
+ Create Date: 2023-10-16 09:45:15.132185
6
+
7
+ """
8
+ import sqlalchemy as sa
9
+ from alembic import op
10
+
11
+
12
+ # revision identifiers, used by Alembic.
13
+ revision = "99ea79d9e5d2"
14
+ down_revision = "8f79bd162e35"
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("dataset", schema=None) as batch_op:
22
+ batch_op.add_column(
23
+ sa.Column(
24
+ "history", sa.JSON(), server_default="[]", nullable=False
25
+ )
26
+ )
27
+
28
+ # ### end Alembic commands ###
29
+
30
+
31
+ def downgrade() -> None:
32
+ # ### commands auto generated by Alembic - please adjust! ###
33
+ with op.batch_alter_table("dataset", schema=None) as batch_op:
34
+ batch_op.drop_column("history")
35
+
36
+ # ### end Alembic commands ###
@@ -83,7 +83,7 @@ def get_absolute_venv_path(venv_path: Path) -> Path:
83
83
  package_path = venv_path
84
84
  else:
85
85
  settings = Inject(get_settings)
86
- package_path = settings.FRACTAL_TASKS_DIR / venv_path # type: ignore
86
+ package_path = settings.FRACTAL_TASKS_DIR / venv_path
87
87
  return package_path
88
88
 
89
89
 
@@ -214,7 +214,7 @@ def create_package_dir_pip(
214
214
  "with `version=None`."
215
215
  )
216
216
  package_dir = f"{task_pkg.package}{task_pkg.package_version}"
217
- venv_path = settings.FRACTAL_TASKS_DIR / user / package_dir # type: ignore
217
+ venv_path = settings.FRACTAL_TASKS_DIR / user / package_dir
218
218
  if create:
219
219
  venv_path.mkdir(exist_ok=False, parents=True)
220
220
  return venv_path
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "fractal-server"
3
- version = "1.3.12a4"
3
+ version = "1.3.13"
4
4
  description = "Server component of the Fractal analytics platform"
5
5
  authors = [
6
6
  "Jacopo Nespolo <jacopo.nespolo@exact-lab.it>",
@@ -29,13 +29,11 @@ aiosqlite = "^0.17.0"
29
29
  fastapi-users = {extras = ["oauth"], version = "^12.1.0"}
30
30
  alembic = "^1.9.1"
31
31
  uvicorn = "^0.20.0"
32
- sqlalchemy = "^1.4"
33
- SQLAlchemy-Utils = "^0.38.3"
34
- greenlet = "*"
32
+ sqlalchemy = {extras = ["asyncio"], version = "^1.4"}
35
33
  pydantic = ">=1.10.8,<2"
36
34
 
37
35
  clusterfutures = { version = "^0.5", optional = true}
38
- cloudpickle = {version = ">=2.2.1 <2.3.0", optional = true}
36
+ cloudpickle = {version = ">=2.2.1,<2.3.0", optional = true}
39
37
 
40
38
  asyncpg = { version = "^0.27.0", optional = true }
41
39
  psycopg2 = { version = "^2.9.5", optional = true }
@@ -84,7 +82,7 @@ filterwarnings = [
84
82
  ]
85
83
 
86
84
  [tool.bumpver]
87
- current_version = "1.3.12a4"
85
+ current_version = "1.3.13"
88
86
  version_pattern = "MAJOR.MINOR.PATCH[PYTAGNUM]"
89
87
  commit_message = "bump version {old_version} -> {new_version}"
90
88
  commit = true
@@ -109,5 +107,5 @@ relative_files = true
109
107
  omit = ["tests/*"]
110
108
 
111
109
  [[tool.mypy.overrides]]
112
- module = ["devtools", "uvicorn", "sqlalchemy_utils"]
110
+ module = ["devtools", "uvicorn"]
113
111
  ignore_missing_imports = true
@@ -1 +0,0 @@
1
- __VERSION__ = "1.3.12a4"
@@ -1,35 +0,0 @@
1
- """Add Dataset.history
2
-
3
- Revision ID: 5c4ff7526508
4
- Revises: 8f79bd162e35
5
- Create Date: 2023-10-13 14:26:07.955329
6
-
7
- """
8
- import sqlalchemy as sa
9
- from alembic import op
10
- from sqlalchemy.sql import column
11
- from sqlalchemy.sql import table
12
-
13
-
14
- # revision identifiers, used by Alembic.
15
- revision = "5c4ff7526508"
16
- down_revision = "8f79bd162e35"
17
- branch_labels = None
18
- depends_on = None
19
-
20
-
21
- def upgrade() -> None:
22
- with op.batch_alter_table("dataset", schema=None) as batch_op:
23
- batch_op.add_column(sa.Column("history", sa.JSON(), nullable=True))
24
-
25
- with op.batch_alter_table("dataset", schema=None) as batch_op:
26
- dataset = table("dataset", column("history"))
27
- batch_op.execute(dataset.update().values(history=sa.JSON([])))
28
-
29
- with op.batch_alter_table("dataset", schema=None) as batch_op:
30
- batch_op.alter_column("dataset", nullable=False)
31
-
32
-
33
- def downgrade() -> None:
34
- with op.batch_alter_table("dataset", schema=None) as batch_op:
35
- batch_op.drop_column("history")