fractal-server 2.14.0a25__py3-none-any.whl → 2.14.0a27__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.14.0a25"
1
+ __VERSION__ = "2.14.0a27"
@@ -248,7 +248,7 @@ class BaseSlurmRunner(BaseRunner):
248
248
 
249
249
  # Always print output of `uname -n` and `pwd`
250
250
  script_lines.append('\necho "Hostname: $(uname -n)"')
251
- script_lines.append('echo "Current directory : $(pwd)"')
251
+ script_lines.append('echo "Current directory: $(pwd)"')
252
252
  script_lines.append(
253
253
  'echo "Start time: $(date +"%Y-%m-%dT%H:%M:%S%z")"'
254
254
  )
@@ -137,7 +137,7 @@ class SlurmSSHRunner(BaseSlurmRunner):
137
137
  self.fractal_ssh.run_command(cmd=tar_command)
138
138
  t_1_tar = time.perf_counter()
139
139
  logger.info(
140
- f"Remote archive {tarfile_path_remote} created"
140
+ f"[_fetch_artifacts] Remote archive {tarfile_path_remote} created"
141
141
  f" - elapsed: {t_1_tar - t_0_tar:.3f} s"
142
142
  )
143
143
 
@@ -149,7 +149,8 @@ class SlurmSSHRunner(BaseSlurmRunner):
149
149
  )
150
150
  t_1_get = time.perf_counter()
151
151
  logger.info(
152
- f"Subfolder archive transferred back to {tarfile_path_local}"
152
+ "[_fetch_artifacts] Subfolder archive transferred back "
153
+ f"to {tarfile_path_local}"
153
154
  f" - elapsed: {t_1_get - t_0_get:.3f} s"
154
155
  )
155
156
 
@@ -160,7 +161,7 @@ class SlurmSSHRunner(BaseSlurmRunner):
160
161
  Path(tarfile_path_local).unlink(missing_ok=True)
161
162
 
162
163
  t_1 = time.perf_counter()
163
- logger.info(f"[_get_subfolder_sftp] End - elapsed: {t_1 - t_0:.3f} s")
164
+ logger.info(f"[_fetch_artifacts] End - elapsed: {t_1 - t_0:.3f} s")
164
165
 
165
166
  def _send_inputs(self, jobs: list[SlurmJob]) -> None:
166
167
  """
@@ -406,7 +406,7 @@ def run_v2_task_compound(
406
406
  db.add(history_unit)
407
407
  db.commit()
408
408
  db.refresh(history_unit)
409
- history_unit_id = history_unit.id
409
+ init_history_unit_id = history_unit.id
410
410
  # Create one `HistoryImageCache` for each input image
411
411
  bulk_upsert_image_cache_fast(
412
412
  db=db,
@@ -415,7 +415,7 @@ def run_v2_task_compound(
415
415
  workflowtask_id=wftask.id,
416
416
  dataset_id=dataset_id,
417
417
  zarr_url=zarr_url,
418
- latest_history_unit_id=history_unit_id,
418
+ latest_history_unit_id=init_history_unit_id,
419
419
  )
420
420
  for zarr_url in input_image_zarr_urls
421
421
  ],
@@ -431,7 +431,7 @@ def run_v2_task_compound(
431
431
  parameters=function_kwargs,
432
432
  task_type=task_type,
433
433
  task_files=task_files_init,
434
- history_unit_id=history_unit_id,
434
+ history_unit_id=init_history_unit_id,
435
435
  config=runner_config_init,
436
436
  )
437
437
 
@@ -459,7 +459,7 @@ def run_v2_task_compound(
459
459
  # Mark the init-task `HistoryUnit` as "done"
460
460
  with next(get_sync_db()) as db:
461
461
  update_status_of_history_unit(
462
- history_unit_id=history_unit_id,
462
+ history_unit_id=init_history_unit_id,
463
463
  status=HistoryUnitStatus.DONE,
464
464
  db_sync=db,
465
465
  )
@@ -470,7 +470,7 @@ def run_v2_task_compound(
470
470
  if len(parallelization_list) == 0:
471
471
  with next(get_sync_db()) as db:
472
472
  update_status_of_history_unit(
473
- history_unit_id=history_unit_id,
473
+ history_unit_id=init_history_unit_id,
474
474
  status=HistoryUnitStatus.DONE,
475
475
  db_sync=db,
476
476
  )
@@ -525,30 +525,6 @@ def run_v2_task_compound(
525
525
  for history_unit in history_units:
526
526
  db.refresh(history_unit)
527
527
  history_unit_ids = [history_unit.id for history_unit in history_units]
528
- # Create one `HistoryImageCache` per `zarr_url`.
529
- with next(get_sync_db()) as db:
530
- visited_zarr_urls = set()
531
- history_image_caches = []
532
- for ind, history_unit in enumerate(history_units):
533
- _zarr_url = history_unit.zarr_urls[0]
534
- if _zarr_url in visited_zarr_urls:
535
- # Note: This `HistoryUnit` won't be associated to any
536
- # `HistoryImageCache`.
537
- pass
538
- else:
539
- visited_zarr_urls.add(_zarr_url)
540
- history_image_caches.append(
541
- dict(
542
- workflowtask_id=wftask.id,
543
- dataset_id=dataset_id,
544
- zarr_url=_zarr_url,
545
- latest_history_unit_id=history_unit.id,
546
- )
547
- )
548
- bulk_upsert_image_cache_fast(
549
- db=db,
550
- list_upsert_objects=history_image_caches,
551
- )
552
528
 
553
529
  results, exceptions = runner.multisubmit(
554
530
  functools.partial(
@@ -565,7 +541,7 @@ def run_v2_task_compound(
565
541
  config=runner_config_compute,
566
542
  )
567
543
 
568
- init_outcome = {}
544
+ compute_outcomes: dict[int, SubmissionOutcome] = {}
569
545
  failure = False
570
546
  for ind in range(len(list_function_kwargs)):
571
547
  if ind not in results.keys() and ind not in exceptions.keys():
@@ -576,10 +552,12 @@ def run_v2_task_compound(
576
552
  )
577
553
  logger.error(error_msg)
578
554
  raise RuntimeError(error_msg)
579
- init_outcome[ind] = _process_task_output(
555
+ compute_outcomes[ind] = _process_task_output(
580
556
  result=results.get(ind, None),
581
557
  exception=exceptions.get(ind, None),
582
558
  )
559
+ if compute_outcomes[ind].exception is not None:
560
+ failure = True
583
561
 
584
562
  # NOTE: For compound tasks, we update `HistoryUnit.status` from here,
585
563
  # rather than within the submit/multisubmit runner methods. This is
@@ -588,7 +566,7 @@ def run_v2_task_compound(
588
566
  with next(get_sync_db()) as db:
589
567
  if failure:
590
568
  bulk_update_status_of_history_unit(
591
- history_unit_ids=history_unit_ids,
569
+ history_unit_ids=history_unit_ids + [init_history_unit_id],
592
570
  status=HistoryUnitStatus.FAILED,
593
571
  db_sync=db,
594
572
  )
@@ -599,4 +577,4 @@ def run_v2_task_compound(
599
577
  db_sync=db,
600
578
  )
601
579
 
602
- return init_outcome, num_tasks
580
+ return compute_outcomes, num_tasks
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: fractal-server
3
- Version: 2.14.0a25
3
+ Version: 2.14.0a27
4
4
  Summary: Backend component of the Fractal analytics platform
5
5
  License: BSD-3-Clause
6
6
  Author: Tommaso Comparin
@@ -1,4 +1,4 @@
1
- fractal_server/__init__.py,sha256=-f2VHfuQvx-Yc-jvt6EsRwtcTp8dlvFHklFmfIV52Oo,26
1
+ fractal_server/__init__.py,sha256=CloicZW6sLyhonlS5tDSm-UfO9_zirGQq16Kn8P5ek0,26
2
2
  fractal_server/__main__.py,sha256=rkM8xjY1KeS3l63irB8yCrlVobR-73uDapC4wvrIlxI,6957
3
3
  fractal_server/alembic.ini,sha256=MWwi7GzjzawI9cCAK1LW7NxIBQDUqD12-ptJoq5JpP0,3153
4
4
  fractal_server/app/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -78,13 +78,13 @@ fractal_server/app/runner/executors/slurm_common/__init__.py,sha256=47DEQpj8HBSa
78
78
  fractal_server/app/runner/executors/slurm_common/_batching.py,sha256=ZY020JZlDS5mfpgpWTChQkyHU7iLE5kx2HVd57_C6XA,8850
79
79
  fractal_server/app/runner/executors/slurm_common/_job_states.py,sha256=nuV-Zba38kDrRESOVB3gaGbrSPZc4q7YGichQaeqTW0,238
80
80
  fractal_server/app/runner/executors/slurm_common/_slurm_config.py,sha256=qzWsMFUbcgxo2p5BltTlxDBLgGa6Z4gDKDdZioK3MB0,15979
81
- fractal_server/app/runner/executors/slurm_common/base_slurm_runner.py,sha256=Bd_yBt5Bu1Y_NKcQRYJXiPz7oipKQov5ff16w0zV7YY,30730
81
+ fractal_server/app/runner/executors/slurm_common/base_slurm_runner.py,sha256=vF2lAUgO7vbK9pR1Jd2dFsimO45ccw2OeJTJ0z1YWwQ,30729
82
82
  fractal_server/app/runner/executors/slurm_common/get_slurm_config.py,sha256=BW6fDpPyB0VH5leVxvwzkVH3r3hC7DuSyoWmRzHITWg,7305
83
83
  fractal_server/app/runner/executors/slurm_common/remote.py,sha256=FS_F8EaPp-A5eQT5_ZH3ICCHt0-C8b_2OSYcyRkXnb4,5851
84
84
  fractal_server/app/runner/executors/slurm_common/slurm_job_task_models.py,sha256=RoxHLKOn0_wGjnY0Sv0a9nDSiqxYZHKRoMkT3p9_G1E,3607
85
85
  fractal_server/app/runner/executors/slurm_common/utils_executors.py,sha256=naPyJI0I3lD-sYHbSXbMFGUBK4h_SggA5V91Z1Ch1Xg,1416
86
86
  fractal_server/app/runner/executors/slurm_ssh/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
87
- fractal_server/app/runner/executors/slurm_ssh/runner.py,sha256=tHdgSnEzIZAFvq23UcA8zBndDemMU0cdwW4R4VZfIfA,7137
87
+ fractal_server/app/runner/executors/slurm_ssh/runner.py,sha256=ULQYW8A12BwC4GK2_2RhS33DFOFJewZoxS6vn_80z8c,7187
88
88
  fractal_server/app/runner/executors/slurm_sudo/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
89
89
  fractal_server/app/runner/executors/slurm_sudo/_subprocess_run_as_user.py,sha256=O1bNg1DiSDJmQE0RmOk2Ii47DagiXp5ryd0R6KxO2OM,3177
90
90
  fractal_server/app/runner/executors/slurm_sudo/runner.py,sha256=WGGVHX_juqyC6OVhln9yg-YKjLiuAoWZhAGxBjhNkWw,5873
@@ -102,7 +102,7 @@ fractal_server/app/runner/v2/db_tools.py,sha256=Ots6-Da7A_5yetSYrUGi-_yV-2r21Nc6
102
102
  fractal_server/app/runner/v2/deduplicate_list.py,sha256=IVTE4abBU1bUprFTkxrTfYKnvkNTanWQ-KWh_etiT08,645
103
103
  fractal_server/app/runner/v2/merge_outputs.py,sha256=D1L4Taieq9i71SPQyNc1kMokgHh-sV_MqF3bv7QMDBc,907
104
104
  fractal_server/app/runner/v2/runner.py,sha256=sbBOH5gCErxK0fCPPGBWtLtqsSwtmrhTth5OLUGMeZQ,15658
105
- fractal_server/app/runner/v2/runner_functions.py,sha256=QZYmU-3mHgS4Jx73JQzsjm2HQP4j1w2oTDswH9neA84,18580
105
+ fractal_server/app/runner/v2/runner_functions.py,sha256=FsUkgnVC2Wb_YJzzMf_pAgVAwjfEGi6p6r4WLHtv-sw,17807
106
106
  fractal_server/app/runner/v2/runner_functions_low_level.py,sha256=9t1CHN3EyfsGRWfG257YPY5WjQ6zuztsw_KZrpEAFPo,3703
107
107
  fractal_server/app/runner/v2/submit_workflow.py,sha256=EDUyUuIPwZHb2zm7SCRRoFsGq2cN-b5OKw6CYkZ8kWk,13048
108
108
  fractal_server/app/runner/v2/task_interface.py,sha256=IXdQTI8rXFgXv1Ez0js4CjKFf3QwO2GCHRTuwiFtiTQ,2891
@@ -208,8 +208,8 @@ fractal_server/tasks/v2/utils_templates.py,sha256=Kc_nSzdlV6KIsO0CQSPs1w70zLyENP
208
208
  fractal_server/urls.py,sha256=QjIKAC1a46bCdiPMu3AlpgFbcv6a4l3ABcd5xz190Og,471
209
209
  fractal_server/utils.py,sha256=PMwrxWFxRTQRl1b9h-NRIbFGPKqpH_hXnkAT3NfZdpY,3571
210
210
  fractal_server/zip_tools.py,sha256=GjDgo_sf6V_DDg6wWeBlZu5zypIxycn_l257p_YVKGc,4876
211
- fractal_server-2.14.0a25.dist-info/LICENSE,sha256=QKAharUuhxL58kSoLizKJeZE3mTCBnX6ucmz8W0lxlk,1576
212
- fractal_server-2.14.0a25.dist-info/METADATA,sha256=VfnpA36svX36WiHYmOqhFuYv9TrddJwDxe62mmavhPE,4563
213
- fractal_server-2.14.0a25.dist-info/WHEEL,sha256=7dDg4QLnNKTvwIDR9Ac8jJaAmBC_owJrckbC0jjThyA,88
214
- fractal_server-2.14.0a25.dist-info/entry_points.txt,sha256=8tV2kynvFkjnhbtDnxAqImL6HMVKsopgGfew0DOp5UY,58
215
- fractal_server-2.14.0a25.dist-info/RECORD,,
211
+ fractal_server-2.14.0a27.dist-info/LICENSE,sha256=QKAharUuhxL58kSoLizKJeZE3mTCBnX6ucmz8W0lxlk,1576
212
+ fractal_server-2.14.0a27.dist-info/METADATA,sha256=C4cH5dZP3XZ1XpieeG5pOdYq24CGuSRrMkwXeUN6_BY,4563
213
+ fractal_server-2.14.0a27.dist-info/WHEEL,sha256=7dDg4QLnNKTvwIDR9Ac8jJaAmBC_owJrckbC0jjThyA,88
214
+ fractal_server-2.14.0a27.dist-info/entry_points.txt,sha256=8tV2kynvFkjnhbtDnxAqImL6HMVKsopgGfew0DOp5UY,58
215
+ fractal_server-2.14.0a27.dist-info/RECORD,,