fractal-server 2.0.1__py3-none-any.whl → 2.0.2__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.
@@ -1 +1 @@
1
- __VERSION__ = "2.0.1"
1
+ __VERSION__ = "2.0.2"
@@ -398,7 +398,7 @@ async def apply_workflow(
398
398
  user_email=user.email,
399
399
  input_dataset_dump=dict(
400
400
  **input_dataset.model_dump(
401
- exclude={"resource_list", "timestamp_created"}
401
+ exclude={"resource_list", "history", "timestamp_created"}
402
402
  ),
403
403
  timestamp_created=_encode_as_utc(input_dataset.timestamp_created),
404
404
  resource_list=[
@@ -408,7 +408,7 @@ async def apply_workflow(
408
408
  ),
409
409
  output_dataset_dump=dict(
410
410
  **output_dataset.model_dump(
411
- exclude={"resource_list", "timestamp_created"}
411
+ exclude={"resource_list", "history", "timestamp_created"}
412
412
  ),
413
413
  timestamp_created=_encode_as_utc(output_dataset.timestamp_created),
414
414
  resource_list=[
@@ -7,6 +7,7 @@ from fastapi import Depends
7
7
  from fastapi import HTTPException
8
8
  from fastapi import status
9
9
 
10
+ from .....logger import set_logger
10
11
  from ....db import AsyncSession
11
12
  from ....db import get_async_db
12
13
  from ....models.v2 import JobV2
@@ -21,6 +22,8 @@ from fractal_server.app.runner.filenames import HISTORY_FILENAME
21
22
 
22
23
  router = APIRouter()
23
24
 
25
+ logger = set_logger(__name__)
26
+
24
27
 
25
28
  @router.get(
26
29
  "/project/{project_id}/status/",
@@ -113,7 +116,22 @@ async def get_workflowtask_status(
113
116
 
114
117
  # The last workflow task that is included in the submitted job is also
115
118
  # the positional-last workflow task to be included in the response.
116
- last_valid_wftask_id = workflow.task_list[end - 1]
119
+ try:
120
+ last_valid_wftask_id = workflow.task_list[end - 1].id
121
+ except IndexError as e:
122
+ logger.warning(
123
+ f"Handled IndexError in `get_workflowtask_status` ({str(e)})."
124
+ )
125
+ logger.warning(
126
+ "Additional information: "
127
+ f"{running_job.first_task_index=}; "
128
+ f"{running_job.last_task_index=}; "
129
+ f"{len(workflow.task_list)=}; "
130
+ f"{dataset_id=}; "
131
+ f"{workflow_id=}."
132
+ )
133
+ last_valid_wftask_id = None
134
+ logger.warning(f"Now setting {last_valid_wftask_id=}.")
117
135
 
118
136
  # Highest priority: Read status updates coming from the running-job
119
137
  # temporary file. Note: this file only contains information on
@@ -146,7 +146,9 @@ async def apply_workflow(
146
146
  workflow_id=workflow_id,
147
147
  user_email=user.email,
148
148
  dataset_dump=dict(
149
- **dataset.model_dump(exclude={"images", "timestamp_created"}),
149
+ **dataset.model_dump(
150
+ exclude={"images", "history", "timestamp_created"}
151
+ ),
150
152
  timestamp_created=_encode_as_utc(dataset.timestamp_created),
151
153
  ),
152
154
  workflow_dump=dict(
@@ -70,14 +70,14 @@ class WorkflowTaskDumpV2(BaseModel):
70
70
  return values
71
71
 
72
72
 
73
- class WorkflowDumpV2(BaseModel):
73
+ class WorkflowDumpV2(BaseModel, extra=Extra.forbid):
74
74
  id: int
75
75
  name: str
76
76
  project_id: int
77
77
  timestamp_created: str
78
78
 
79
79
 
80
- class DatasetDumpV2(BaseModel):
80
+ class DatasetDumpV2(BaseModel, extra=Extra.forbid):
81
81
  id: int
82
82
  name: str
83
83
  project_id: int
fractal_server/config.py CHANGED
@@ -441,9 +441,4 @@ class Settings(BaseSettings):
441
441
 
442
442
 
443
443
  def get_settings(settings=Settings()) -> Settings:
444
- logging.debug("Fractal Settings:")
445
- for key, value in settings.dict().items():
446
- if any(s in key.upper() for s in ["PASSWORD", "SECRET"]):
447
- value = "*****"
448
- logging.debug(f"{key}: {value}")
449
444
  return settings
fractal_server/main.py CHANGED
@@ -19,6 +19,8 @@ from fastapi import FastAPI
19
19
 
20
20
  from .app.security import _create_first_user
21
21
  from .config import get_settings
22
+ from .logger import reset_logger_handlers
23
+ from .logger import set_logger
22
24
  from .syringe import Inject
23
25
 
24
26
 
@@ -62,6 +64,14 @@ def check_settings() -> None:
62
64
  settings = Inject(get_settings)
63
65
  settings.check()
64
66
 
67
+ logger = set_logger("fractal_server_settings")
68
+ logger.debug("Fractal Settings:")
69
+ for key, value in settings.dict().items():
70
+ if any(s in key.upper() for s in ["PASSWORD", "SECRET"]):
71
+ value = "*****"
72
+ logger.debug(f" {key}: {value}")
73
+ reset_logger_handlers(logger)
74
+
65
75
 
66
76
  async def __on_startup() -> None:
67
77
  """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: fractal-server
3
- Version: 2.0.1
3
+ Version: 2.0.2
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
@@ -1,4 +1,4 @@
1
- fractal_server/__init__.py,sha256=JTWFDLKimtlT6mPcm6_e8XrP61UXaA7yz2ycXya7oVs,22
1
+ fractal_server/__init__.py,sha256=gs_vt2BGew5iMLZDjM9dN_UiSCo9swvJzExXe0z6N7w,22
2
2
  fractal_server/__main__.py,sha256=CocbzZooX1UtGqPi55GcHGNxnrJXFg5tUU5b3wyFCyo,4958
3
3
  fractal_server/alembic.ini,sha256=MWwi7GzjzawI9cCAK1LW7NxIBQDUqD12-ptJoq5JpP0,3153
4
4
  fractal_server/app/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -30,7 +30,7 @@ fractal_server/app/routes/api/v1/__init__.py,sha256=Y2HQdG197J0a7DyQEE2jn53IfxD0
30
30
  fractal_server/app/routes/api/v1/_aux_functions.py,sha256=KoSefKiBXximu0df4fJ3l9bKsGaLO8rb3z6xhD8PWj4,11973
31
31
  fractal_server/app/routes/api/v1/dataset.py,sha256=HRE-8vPmVkeXf7WFYkI19mDtbY-iJZeJ7PmMiV0LMgY,16923
32
32
  fractal_server/app/routes/api/v1/job.py,sha256=NwXyhvvzdPDor0ts8Im__9-I0P1H943s4NXIRgaz7PM,5436
33
- fractal_server/app/routes/api/v1/project.py,sha256=4wlxcc-bR45bns6Yy0WyjA9Qv9eiMscATLZKjVhSd1k,15777
33
+ fractal_server/app/routes/api/v1/project.py,sha256=tb1M2hhAKyHeToV0RwAQQx0ptIDeX6sEjM7dkfjCpXQ,15799
34
34
  fractal_server/app/routes/api/v1/task.py,sha256=udbKnenzc-Q10elYCVB9JmOPWATraa9tZi0AaByvWo0,6129
35
35
  fractal_server/app/routes/api/v1/task_collection.py,sha256=mFaYyCWtCPRqvs3j6zx_zaiDXn31Uzoa7UHZS-Lu_L0,8882
36
36
  fractal_server/app/routes/api/v1/workflow.py,sha256=7r9IoIevg_rvYCrerMOsIsUabSOQatxdPCfLdkP0dRs,10942
@@ -41,8 +41,8 @@ fractal_server/app/routes/api/v2/dataset.py,sha256=_HjKNP9XsMGoqyubGdF2ZyeW7vXC3
41
41
  fractal_server/app/routes/api/v2/images.py,sha256=4r_HblPWyuKSZSJZfn8mbDaLv1ncwZU0gWdKneZcNG4,7894
42
42
  fractal_server/app/routes/api/v2/job.py,sha256=BtaxErBDbLwjY2zgGD1I6eRpsffoMonifcS1CMEXmLU,5325
43
43
  fractal_server/app/routes/api/v2/project.py,sha256=qyvizYZ4aUFgF3tGdfp4z8AwWgfo19N_KbFEljfUaC8,5594
44
- fractal_server/app/routes/api/v2/status.py,sha256=3bqQejJ3TnIMan5wK6jr9sv4ypsQr9WWU8xqlvTgDCE,5739
45
- fractal_server/app/routes/api/v2/submit.py,sha256=63nfaPr3rCiMXCITJ0TWBqqSuZdLrQ7vcfzJonU5nHk,6899
44
+ fractal_server/app/routes/api/v2/status.py,sha256=osLexiMOSqmYcEV-41tlrwt9ofyFbtRm5HmPS5BU0t4,6394
45
+ fractal_server/app/routes/api/v2/submit.py,sha256=svI1Oa2zIxUEAomzRt7-M66xKC4Pb9NEGcXNrtN6b5g,6940
46
46
  fractal_server/app/routes/api/v2/task.py,sha256=gJ0LruSk-Q1iMw8ZOX8C0wrZ4S4DGlQTr_5SdJJud0Q,7130
47
47
  fractal_server/app/routes/api/v2/task_collection.py,sha256=eN3NkZaZHkrqnLGRKE7Xd5mo0cHc8aK2lojCt26ErOQ,8988
48
48
  fractal_server/app/routes/api/v2/task_legacy.py,sha256=P_VJv9v0yzFUBuS-DQHhMVSOe20ecGJJcFBqiiFciOM,1628
@@ -111,7 +111,7 @@ fractal_server/app/schemas/v1/task_collection.py,sha256=uvq9bcMaGD_qHsh7YtcpoSAk
111
111
  fractal_server/app/schemas/v1/workflow.py,sha256=tuOs5E5Q_ozA8if7YPZ07cQjzqB_QMkBS4u92qo4Ro0,4618
112
112
  fractal_server/app/schemas/v2/__init__.py,sha256=IssDWR6q_mgNkaAxfhSnEZZLZRZIqOsr9SM7RvN1IsY,1852
113
113
  fractal_server/app/schemas/v2/dataset.py,sha256=dLT52tV4dSf2HrFNak4vdQEn8PT_04IUrGnd2z-AXIU,2599
114
- fractal_server/app/schemas/v2/dumps.py,sha256=IpIT_2KxJd7qTgW2NllDknGeP7vBAJDfyz1I5p3TytU,2023
114
+ fractal_server/app/schemas/v2/dumps.py,sha256=Qg7n0WNfqCV5DBFwfYIKP-OrBjyMZETnNZyoL-EqIco,2063
115
115
  fractal_server/app/schemas/v2/job.py,sha256=zfF9K3v4jWUJ7M482ta2CkqUJ4tVT4XfVt60p9IRhP0,3250
116
116
  fractal_server/app/schemas/v2/manifest.py,sha256=N37IWohcfO3_y2l8rVM0h_1nZq7m4Izxk9iL1vtwBJw,6243
117
117
  fractal_server/app/schemas/v2/project.py,sha256=u7S4B-bote1oGjzAGiZ-DuQIyeRAGqJsI71Tc1EtYE0,736
@@ -121,13 +121,13 @@ fractal_server/app/schemas/v2/task_collection.py,sha256=sY29NQfJrbjiidmVkVjSIH-2
121
121
  fractal_server/app/schemas/v2/workflow.py,sha256=Zzx3e-qgkH8le0FUmAx9UrV5PWd7bj14PPXUh_zgZXM,1827
122
122
  fractal_server/app/schemas/v2/workflowtask.py,sha256=atVuVN4aXsVEOmSd-vyg-8_8OnPmqx-gT75rXcn_AlQ,6552
123
123
  fractal_server/app/security/__init__.py,sha256=wxosoHc3mJYPCdPMyWnRD8w_2OgnKYp2aDkdmwrZh5k,11203
124
- fractal_server/config.py,sha256=CA8ASObADaME5chDiBXawAJZ3MvjTRpCKP0jvdYtSh8,15080
124
+ fractal_server/config.py,sha256=2vw5M78aAogELsWut9X5sxxUz2lirNFpgqP6OynmKOQ,14859
125
125
  fractal_server/data_migrations/README.md,sha256=_3AEFvDg9YkybDqCLlFPdDmGJvr6Tw7HRI14aZ3LOIw,398
126
126
  fractal_server/images/__init__.py,sha256=xO6jTLE4EZKO6cTDdJsBmK9cdeh9hFTaSbSuWgQg7y4,196
127
127
  fractal_server/images/models.py,sha256=9ipU5h4N6ogBChoB-2vHoqtL0TXOHCv6kRR-fER3mkM,4167
128
128
  fractal_server/images/tools.py,sha256=gxeniYy4Z-cp_ToK2LHPJUTVVUUrdpogYdcBUvBuLiY,2209
129
129
  fractal_server/logger.py,sha256=AuCmrwIydaFWpotMTM_tGRNJbExQO5fP8Xolo82Vdbg,4178
130
- fractal_server/main.py,sha256=7CpwPfCsHxBAo5fWuXPCsYOFCpbBI0F7Z0jsgCQdou8,3001
130
+ fractal_server/main.py,sha256=u_MngsZWI-1uKrBpNDUYXKyLgaYodyAEw2dKZrIzS_U,3381
131
131
  fractal_server/migrations/README,sha256=4rQvyDfqodGhpJw74VYijRmgFP49ji5chyEemWGHsuw,59
132
132
  fractal_server/migrations/env.py,sha256=bsl0HGZpjhommztgcs7wQ94sJzI1Orgnij97K8P_uyo,2630
133
133
  fractal_server/migrations/script.py.mako,sha256=oMXw9LC3zRbinWWPPDgeZ4z9FJrV2zhRWiYdS5YgNbI,526
@@ -162,8 +162,8 @@ fractal_server/tasks/v2/background_operations.py,sha256=MAMBn6W2bhkdK59kfUGiD7a1
162
162
  fractal_server/tasks/v2/get_collection_data.py,sha256=Qhf2T_aaqAfqu9_KpUSlXsS7EJoZQbEPEreHHa2jco8,502
163
163
  fractal_server/urls.py,sha256=5o_qq7PzKKbwq12NHSQZDmDitn5RAOeQ4xufu-2v9Zk,448
164
164
  fractal_server/utils.py,sha256=b7WwFdcFZ8unyT65mloFToYuEDXpQoHRcmRNqrhd_dQ,2115
165
- fractal_server-2.0.1.dist-info/LICENSE,sha256=QKAharUuhxL58kSoLizKJeZE3mTCBnX6ucmz8W0lxlk,1576
166
- fractal_server-2.0.1.dist-info/METADATA,sha256=P7zEZwNFrYKxiIHHc24m3XGNKnjrYiY7xabRv7vwz5A,4202
167
- fractal_server-2.0.1.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
168
- fractal_server-2.0.1.dist-info/entry_points.txt,sha256=8tV2kynvFkjnhbtDnxAqImL6HMVKsopgGfew0DOp5UY,58
169
- fractal_server-2.0.1.dist-info/RECORD,,
165
+ fractal_server-2.0.2.dist-info/LICENSE,sha256=QKAharUuhxL58kSoLizKJeZE3mTCBnX6ucmz8W0lxlk,1576
166
+ fractal_server-2.0.2.dist-info/METADATA,sha256=ykUREKoZndksb0goOo27hM14j41SvTljFa5P7eR9zTU,4202
167
+ fractal_server-2.0.2.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
168
+ fractal_server-2.0.2.dist-info/entry_points.txt,sha256=8tV2kynvFkjnhbtDnxAqImL6HMVKsopgGfew0DOp5UY,58
169
+ fractal_server-2.0.2.dist-info/RECORD,,