lsst-ctrl-bps-htcondor 29.2025.2200__py3-none-any.whl → 29.2025.3500__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.
@@ -38,3 +38,8 @@ provisioning:
38
38
 
39
39
  # By default, disable automatic provisioning of resources.
40
40
  provisionResources: false
41
+
42
+ # Whether automatic job retries overwrite stdout/stderr of previous attempt.
43
+ overwriteJobFiles: true
44
+ finalJob:
45
+ overwriteJobFiles: false
@@ -706,14 +706,25 @@ def _create_job(subdir_template, cached_values, generic_workflow, gwjob, out_pre
706
706
  htc_job_cmds.update(_translate_job_cmds(cached_values, generic_workflow, gwjob))
707
707
 
708
708
  # job stdout, stderr, htcondor user log.
709
- for key in ("output", "error", "log"):
710
- htc_job_cmds[key] = f"{gwjob.name}.$(Cluster).{key[:3]}"
709
+ for key in ("output", "error"):
710
+ if cached_values["overwriteJobFiles"]:
711
+ htc_job_cmds[key] = f"{gwjob.name}.$(Cluster).{key[:3]}"
712
+ else:
713
+ htc_job_cmds[key] = f"{gwjob.name}.$(Cluster).$$([NumJobStarts ?: 0]).{key[:3]}"
711
714
  _LOG.debug("HTCondor %s = %s", key, htc_job_cmds[key])
712
715
 
716
+ key = "log"
717
+ htc_job_cmds[key] = f"{gwjob.name}.$(Cluster).{key[:3]}"
718
+ _LOG.debug("HTCondor %s = %s", key, htc_job_cmds[key])
719
+
713
720
  htc_job_cmds.update(
714
721
  _handle_job_inputs(generic_workflow, gwjob.name, cached_values["bpsUseShared"], out_prefix)
715
722
  )
716
723
 
724
+ htc_job_cmds.update(
725
+ _handle_job_outputs(generic_workflow, gwjob.name, cached_values["bpsUseShared"], out_prefix)
726
+ )
727
+
717
728
  # Add the job cmds dict to the job object.
718
729
  htc_job.add_job_cmds(htc_job_cmds)
719
730
 
@@ -946,13 +957,7 @@ def _replace_file_vars(use_shared, arguments, workflow, gwjob):
946
957
  # Have shared filesystems and jobs can share file.
947
958
  uri = gwfile.src_uri
948
959
  else:
949
- # Taking advantage of inside knowledge. Not future-proof.
950
- # Temporary fix until have job wrapper that pulls files
951
- # within job.
952
- if gwfile.name == "butlerConfig" and Path(gwfile.src_uri).suffix != ".yaml":
953
- uri = "butler.yaml"
954
- else:
955
- uri = os.path.basename(gwfile.src_uri)
960
+ uri = os.path.basename(gwfile.src_uri)
956
961
  else: # Using push transfer
957
962
  uri = os.path.basename(gwfile.src_uri)
958
963
  arguments = arguments.replace(f"<FILE:{gwfile.name}>", uri)
@@ -1001,7 +1006,9 @@ def _replace_cmd_vars(arguments, gwjob):
1001
1006
  return arguments
1002
1007
 
1003
1008
 
1004
- def _handle_job_inputs(generic_workflow: GenericWorkflow, job_name: str, use_shared: bool, out_prefix: str):
1009
+ def _handle_job_inputs(
1010
+ generic_workflow: GenericWorkflow, job_name: str, use_shared: bool, out_prefix: str
1011
+ ) -> dict[str, str]:
1005
1012
  """Add job input files from generic workflow to job.
1006
1013
 
1007
1014
  Parameters
@@ -1020,7 +1027,6 @@ def _handle_job_inputs(generic_workflow: GenericWorkflow, job_name: str, use_sha
1020
1027
  htc_commands : `dict` [`str`, `str`]
1021
1028
  HTCondor commands for the job submission script.
1022
1029
  """
1023
- htc_commands = {}
1024
1030
  inputs = []
1025
1031
  for gwf_file in generic_workflow.get_job_inputs(job_name, data=True, transfer_only=True):
1026
1032
  _LOG.debug("src_uri=%s", gwf_file.src_uri)
@@ -1030,38 +1036,68 @@ def _handle_job_inputs(generic_workflow: GenericWorkflow, job_name: str, use_sha
1030
1036
  # Note if use_shared and job_shared, don't need to transfer file.
1031
1037
 
1032
1038
  if not use_shared: # Copy file using push to job
1033
- inputs.append(str(uri.relative_to(out_prefix)))
1039
+ inputs.append(str(uri))
1034
1040
  elif not gwf_file.job_shared: # Jobs require own copy
1035
1041
  # if using shared filesystem, but still need copy in job. Use
1036
1042
  # HTCondor's curl plugin for a local copy.
1037
-
1038
- # Execution butler is represented as a directory which the
1039
- # curl plugin does not handle. Taking advantage of inside
1040
- # knowledge for temporary fix until have job wrapper that pulls
1041
- # files within job.
1042
- if gwf_file.name == "butlerConfig":
1043
- # The execution butler directory doesn't normally exist until
1044
- # the submit phase so checking for suffix instead of using
1045
- # is_dir(). If other non-yaml file exists they would have a
1046
- # different gwf_file.name.
1047
- if uri.suffix == ".yaml": # Single file, so just copy.
1048
- inputs.append(f"file://{uri}")
1049
- else:
1050
- inputs.append(f"file://{uri / 'butler.yaml'}")
1051
- inputs.append(f"file://{uri / 'gen3.sqlite3'}")
1052
- elif uri.is_dir():
1043
+ if uri.is_dir():
1053
1044
  raise RuntimeError(
1054
1045
  f"HTCondor plugin cannot transfer directories locally within job {gwf_file.src_uri}"
1055
1046
  )
1056
- else:
1057
- inputs.append(f"file://{uri}")
1047
+ inputs.append(f"file://{uri}")
1058
1048
 
1049
+ htc_commands = {}
1059
1050
  if inputs:
1060
1051
  htc_commands["transfer_input_files"] = ",".join(inputs)
1061
1052
  _LOG.debug("transfer_input_files=%s", htc_commands["transfer_input_files"])
1062
1053
  return htc_commands
1063
1054
 
1064
1055
 
1056
+ def _handle_job_outputs(
1057
+ generic_workflow: GenericWorkflow, job_name: str, use_shared: bool, out_prefix: str
1058
+ ) -> dict[str, str]:
1059
+ """Add job output files from generic workflow to the job if any.
1060
+
1061
+ Parameters
1062
+ ----------
1063
+ generic_workflow : `lsst.ctrl.bps.GenericWorkflow`
1064
+ The generic workflow (e.g., has executable name and arguments).
1065
+ job_name : `str`
1066
+ Unique name for the job.
1067
+ use_shared : `bool`
1068
+ Whether job has access to files via shared filesystem.
1069
+ out_prefix : `str`
1070
+ The root directory into which all WMS-specific files are written.
1071
+
1072
+ Returns
1073
+ -------
1074
+ htc_commands : `dict` [`str`, `str`]
1075
+ HTCondor commands for the job submission script.
1076
+ """
1077
+ outputs = []
1078
+ output_remaps = []
1079
+ for gwf_file in generic_workflow.get_job_outputs(job_name, data=True, transfer_only=True):
1080
+ _LOG.debug("src_uri=%s", gwf_file.src_uri)
1081
+
1082
+ uri = Path(gwf_file.src_uri)
1083
+ if not use_shared:
1084
+ outputs.append(uri.name)
1085
+ output_remaps.append(f"{uri.name}={str(uri)}")
1086
+
1087
+ # Set to an empty string to disable and only update if there are output
1088
+ # files to transfer. Otherwise, HTCondor will transfer back all files in
1089
+ # the job’s temporary working directory that have been modified or created
1090
+ # by the job.
1091
+ htc_commands = {"transfer_output_files": '""'}
1092
+ if outputs:
1093
+ htc_commands["transfer_output_files"] = ",".join(outputs)
1094
+ _LOG.debug("transfer_output_files=%s", htc_commands["transfer_output_files"])
1095
+
1096
+ htc_commands["transfer_output_remaps"] = f'"{";".join(output_remaps)}"'
1097
+ _LOG.debug("transfer_output_remaps=%s", htc_commands["transfer_output_remaps"])
1098
+ return htc_commands
1099
+
1100
+
1065
1101
  def _get_status_from_id(
1066
1102
  wms_workflow_id: str, hist: float, schedds: dict[str, htcondor.Schedd]
1067
1103
  ) -> tuple[WmsStates, str]:
@@ -2342,6 +2378,12 @@ def _gather_label_values(config: BpsConfig, label: str) -> dict[str, Any]:
2342
2378
  if found:
2343
2379
  values["releaseExpr"] = value
2344
2380
 
2381
+ found, value = config.search("overwriteJobFiles", opt=search_opts)
2382
+ if found:
2383
+ values["overwriteJobFiles"] = value
2384
+ else:
2385
+ values["overwriteJobFiles"] = True
2386
+
2345
2387
  if profile_key and profile_key in config:
2346
2388
  for subkey, val in config[profile_key].items():
2347
2389
  if subkey.startswith("+"):
@@ -205,6 +205,7 @@ HTC_VALID_JOB_KEYS = {
205
205
  "transfer_executable",
206
206
  "transfer_input_files",
207
207
  "transfer_output_files",
208
+ "transfer_output_remaps",
208
209
  "request_cpus",
209
210
  "request_memory",
210
211
  "request_disk",
@@ -1,2 +1,2 @@
1
1
  __all__ = ["__version__"]
2
- __version__ = "29.2025.2200"
2
+ __version__ = "29.2025.3500"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: lsst-ctrl-bps-htcondor
3
- Version: 29.2025.2200
3
+ Version: 29.2025.3500
4
4
  Summary: HTCondor plugin for lsst-ctrl-bps.
5
5
  Author-email: Rubin Observatory Data Management <dm-admin@lists.lsst.org>
6
6
  License: BSD 3-Clause License
@@ -0,0 +1,19 @@
1
+ lsst/ctrl/bps/htcondor/__init__.py,sha256=1gTmOVLJILvBqgqHVECo8uqoX8e4fiTeH_dHBUXgDvY,1417
2
+ lsst/ctrl/bps/htcondor/final_post.sh,sha256=chfaQV6Q7rGsK-8Hx58ch52m-PofvBanrl7VwCssHec,248
3
+ lsst/ctrl/bps/htcondor/handlers.py,sha256=2gM3Ac00in4ob9ckcP331W1LSEjs9UDKIqt4MULA4bg,11196
4
+ lsst/ctrl/bps/htcondor/htcondor_config.py,sha256=c4lCiYEwEXFdxgbMfEkbDm4LrvkRMF31SqLtQqzqIV4,1523
5
+ lsst/ctrl/bps/htcondor/htcondor_service.py,sha256=WKN6bC5cJu8X9UpN5DNMDxb8V0gBOWCthvFyEWUkU7s,96467
6
+ lsst/ctrl/bps/htcondor/lssthtc.py,sha256=MOxY30jCwbW1efgVcWtN4x13OO8monW95t6IidDf86Y,80515
7
+ lsst/ctrl/bps/htcondor/provisioner.py,sha256=hPN8YJUtwNHQylw68kfskF1S2vCeQvztF8W0d_QKqqM,7851
8
+ lsst/ctrl/bps/htcondor/version.py,sha256=UwJkYVJhfyZPaD0yyjLkfsS3KQL2uaxZwFIeRntHr30,55
9
+ lsst/ctrl/bps/htcondor/etc/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
+ lsst/ctrl/bps/htcondor/etc/htcondor_defaults.yaml,sha256=C6DKJKmKFKczukpXVXev9u1-vmv2IcgcdtjTtgJWDQM,1561
11
+ lsst_ctrl_bps_htcondor-29.2025.3500.dist-info/licenses/COPYRIGHT,sha256=Lc6NoAEFQ65v_SmtS9NwfHTOuSUtC2Umbjv5zyowiQM,61
12
+ lsst_ctrl_bps_htcondor-29.2025.3500.dist-info/licenses/LICENSE,sha256=pRExkS03v0MQW-neNfIcaSL6aiAnoLxYgtZoFzQ6zkM,232
13
+ lsst_ctrl_bps_htcondor-29.2025.3500.dist-info/licenses/bsd_license.txt,sha256=7MIcv8QRX9guUtqPSBDMPz2SnZ5swI-xZMqm_VDSfxY,1606
14
+ lsst_ctrl_bps_htcondor-29.2025.3500.dist-info/licenses/gpl-v3.0.txt,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
15
+ lsst_ctrl_bps_htcondor-29.2025.3500.dist-info/METADATA,sha256=QoiKn5Fu2uQs7vEdQy8tYFqnVTW_bg8twcXFzGT8lkI,2139
16
+ lsst_ctrl_bps_htcondor-29.2025.3500.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
17
+ lsst_ctrl_bps_htcondor-29.2025.3500.dist-info/top_level.txt,sha256=eUWiOuVVm9wwTrnAgiJT6tp6HQHXxIhj2QSZ7NYZH80,5
18
+ lsst_ctrl_bps_htcondor-29.2025.3500.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
19
+ lsst_ctrl_bps_htcondor-29.2025.3500.dist-info/RECORD,,
@@ -1,19 +0,0 @@
1
- lsst/ctrl/bps/htcondor/__init__.py,sha256=1gTmOVLJILvBqgqHVECo8uqoX8e4fiTeH_dHBUXgDvY,1417
2
- lsst/ctrl/bps/htcondor/final_post.sh,sha256=chfaQV6Q7rGsK-8Hx58ch52m-PofvBanrl7VwCssHec,248
3
- lsst/ctrl/bps/htcondor/handlers.py,sha256=2gM3Ac00in4ob9ckcP331W1LSEjs9UDKIqt4MULA4bg,11196
4
- lsst/ctrl/bps/htcondor/htcondor_config.py,sha256=c4lCiYEwEXFdxgbMfEkbDm4LrvkRMF31SqLtQqzqIV4,1523
5
- lsst/ctrl/bps/htcondor/htcondor_service.py,sha256=4_jm0lIZw3mYXyays1IWyg3pFwpODR_-g6CLIepXu7w,95330
6
- lsst/ctrl/bps/htcondor/lssthtc.py,sha256=pYxcA5jicuJs1RnhusSuMFrOU92Xy1fb-tleZ9m784Y,80485
7
- lsst/ctrl/bps/htcondor/provisioner.py,sha256=hPN8YJUtwNHQylw68kfskF1S2vCeQvztF8W0d_QKqqM,7851
8
- lsst/ctrl/bps/htcondor/version.py,sha256=RaoK8ADNKLNvY-bXCQnWhCS6HwZ0pWKOeKdmgzS7d6Y,55
9
- lsst/ctrl/bps/htcondor/etc/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
- lsst/ctrl/bps/htcondor/etc/htcondor_defaults.yaml,sha256=xDRts4vHKov2PE_JRh-0nF3jfuNJXtKBXZqveASp_iA,1422
11
- lsst_ctrl_bps_htcondor-29.2025.2200.dist-info/licenses/COPYRIGHT,sha256=Lc6NoAEFQ65v_SmtS9NwfHTOuSUtC2Umbjv5zyowiQM,61
12
- lsst_ctrl_bps_htcondor-29.2025.2200.dist-info/licenses/LICENSE,sha256=pRExkS03v0MQW-neNfIcaSL6aiAnoLxYgtZoFzQ6zkM,232
13
- lsst_ctrl_bps_htcondor-29.2025.2200.dist-info/licenses/bsd_license.txt,sha256=7MIcv8QRX9guUtqPSBDMPz2SnZ5swI-xZMqm_VDSfxY,1606
14
- lsst_ctrl_bps_htcondor-29.2025.2200.dist-info/licenses/gpl-v3.0.txt,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
15
- lsst_ctrl_bps_htcondor-29.2025.2200.dist-info/METADATA,sha256=Ls4Ipu4B4iFbZ4rozJhOoBeuOOR6Jg6E3X31dWa2qU0,2139
16
- lsst_ctrl_bps_htcondor-29.2025.2200.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
17
- lsst_ctrl_bps_htcondor-29.2025.2200.dist-info/top_level.txt,sha256=eUWiOuVVm9wwTrnAgiJT6tp6HQHXxIhj2QSZ7NYZH80,5
18
- lsst_ctrl_bps_htcondor-29.2025.2200.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
19
- lsst_ctrl_bps_htcondor-29.2025.2200.dist-info/RECORD,,