Skip to content

DM-53494: Add code needed to run submit processes as jobs. - #83

Open
MichelleGower wants to merge 7 commits into
mainfrom
tickets/DM-53494
Open

DM-53494: Add code needed to run submit processes as jobs.#83
MichelleGower wants to merge 7 commits into
mainfrom
tickets/DM-53494

Conversation

@MichelleGower

@MichelleGower MichelleGower commented Feb 20, 2026

Copy link
Copy Markdown
Contributor

Note: Limited to same cluster with shared filesystems. Includes handling of lazy subdags.

Checklist

  • ran Jenkins
  • added a release note for user-visible changes to doc/changes

@codecov

codecov Bot commented Feb 20, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.68576% with 43 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.06%. Comparing base (b120d64) to head (37d9867).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
python/lsst/ctrl/bps/htcondor/prepare_utils.py 83.43% 18 Missing and 9 partials ⚠️
python/lsst/ctrl/bps/htcondor/lssthtc.py 72.22% 9 Missing and 1 partial ⚠️
python/lsst/ctrl/bps/htcondor/report_utils.py 42.85% 4 Missing ⚠️
python/lsst/ctrl/bps/htcondor/htcondor_service.py 95.45% 1 Missing ⚠️
tests/dag_test_utils.py 97.67% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #83      +/-   ##
==========================================
+ Coverage   85.26%   88.06%   +2.80%     
==========================================
  Files          19       21       +2     
  Lines        4417     4994     +577     
  Branches      463      498      +35     
==========================================
+ Hits         3766     4398     +632     
+ Misses        575      506      -69     
- Partials       76       90      +14     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

Note:  Limited to same cluster with shared filesystems.  Includes
handling of lazy subdags.
@MichelleGower
MichelleGower marked this pull request as ready for review July 29, 2026 21:18
---------------------------

When BPS uses batch jobs for the submission process, there isn't much
different in how HTC handles them vs the payload jobs. There will be

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about changing

When BPS uses batch jobs for the submission process, there isn't much different in how HTC handles them vs the payload jobs.

to

When BPS uses batch jobs for submission, HTC handles them much the same way it handles payload jobs.


Noticable differences in the HTCondor-level details include a second
``*.dag`` file in the submit directory and a second ``condor_dagman``
job in the queue. This is subDAG handles the payload workflow and

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"This is subDAG handles" -> "This sub-DAG handles"



def read_dag_info(wms_path: str | os.PathLike) -> dict[str, dict[str, Any]]:
def read_dag_info(wms_path: str | os.PathLike) -> tuple[str, dict[Path, dict[str, Any]]]:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't the type hint for the return value be tuple[Path, dict[str, dict[str, Any]]]?

rescue_dags = list(path.glob("*.rescue[0-9][0-9][0-9]"))
# If using control DAG, don't want to include nested DAGs.
rescue_dags = list(path.glob("*_ctrl.dag.rescue[0-9][0-9][0-9]"))
if len(rescue_dags) == 0:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we rewrite this condition as:

if not rescue_dags:
    ...

Returns
-------
filename : `pathlib.Path`
Name of the file where the information was written.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't mind changing the order of the parameters. However, I don't understand why you made the filename parameter optional and needed to include some ad hoc mechanism for creating the name for the output file if it is not provided. I think making the caller always responsible for generating the output filename will result in the code that is easier to follow. After all, write_dag_info(info, filename) convey the information what is written where much better than just write_dag_info(info).

Also, this function appears three times in the plugin's code. Unless I missed something, only a single call uses the fact that filename is an optional parameter now (line 184 in htcondor_service.py). So I don't see any reason why generating the filename can't happen there, in the caller, as in other two cases.

placeholder_dag = HTCDag(name=placeholder_dag_name)
_LOG.debug("dag name = %s", placeholder_dag.graph["name"])
placeholder_dag.add_attribs(generic_workflow.run_attrs)
placeholder_dag.add_job(job1)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we rename job1 to just job?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants