Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DM-37020: Replace "requirements" with "constraint" in HTCondor Python function calls in ctrl_bps_htcondor #19

Merged
merged 9 commits into from Sep 14, 2023

Conversation

mxk62
Copy link
Collaborator

@mxk62 mxk62 commented Jun 2, 2023

Checklist

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

@codecov
Copy link

codecov bot commented Jun 2, 2023

Codecov Report

Patch coverage: 25.58% and project coverage change: +0.24% 🎉

Comparison is base (3570882) 15.38% compared to head (5dde25f) 15.62%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #19      +/-   ##
==========================================
+ Coverage   15.38%   15.62%   +0.24%     
==========================================
  Files           4        4              
  Lines        1313     1318       +5     
  Branches      279      276       -3     
==========================================
+ Hits          202      206       +4     
- Misses       1109     1110       +1     
  Partials        2        2              
Files Changed Coverage Δ
python/lsst/ctrl/bps/htcondor/htcondor_service.py 9.68% <0.00%> (+0.01%) ⬆️
python/lsst/ctrl/bps/htcondor/lssthtc.py 18.68% <22.50%> (+0.56%) ⬆️
python/lsst/ctrl/bps/htcondor/__init__.py 100.00% <100.00%> (+33.33%) ⬆️

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

Copy link
Contributor

@MichelleGower MichelleGower left a comment

Choose a reason for hiding this comment

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

It probably would be better to support both versions. If none of the external LSST folks use the older HTCondor, then it won't matter. For a future ticket, we may want to add a version check at the beginning (older than X not supported, X-Y supported, and warning Y+ may or may not work)

@timj
Copy link
Member

timj commented Jun 5, 2023

Do we have to change the pin in requirements.txt and pyproject.toml? Currently it states >= 8.8. We might need to change the rubin-env pin as well.

@mxk62
Copy link
Collaborator Author

mxk62 commented Jun 5, 2023

The changes I made need HTCondor version 9.0 or greater to work. So yes, we should update the minimum required versions in requirements.txt, pyproject.toml, and the pin in rubinenv if we want these changes in. If we still want to support older versions of HTCondor I will need to redo the ticket implementing the logic Michelle described in her comment.

Copy link
Contributor

@MichelleGower MichelleGower left a comment

Choose a reason for hiding this comment

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

Thanks for updating it to work with multiple versions. Mostly comments about comments and one do we need a default value here. Merge approved.

doc/changes/DM-37020.misc.rst Outdated Show resolved Hide resolved
python/lsst/ctrl/bps/htcondor/lssthtc.py Outdated Show resolved Hide resolved
python/lsst/ctrl/bps/htcondor/lssthtc.py Show resolved Hide resolved
python/lsst/ctrl/bps/htcondor/lssthtc.py Show resolved Hide resolved
for job_ad in query.nextAdsNonBlocking():
yield schedd_name, job_ad


Copy link
Contributor

Choose a reason for hiding this comment

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

Which version does the htc_version return if python API is different than service version? If this returns python API version, do we want to change this to use packaging.version? If this actually returns the service version, please change the docstring to be more explicit.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

As far as I can tell htcondor.version() (and in turn htc_version()) returns the client side version of HTCondor API in use. So if you don't object, I can rewritehtc_version() to just return HTC_VER instead of parsing the output of the htcondor.version() or get rid of it entirely (it is used once).

def condor_q(constraint=None, schedds=None):
"""Query HTCondor for current jobs.
def condor_q(constraint=None, schedds=None, **kwargs):
"""Get information about running jobs from HTCondor.
Copy link
Contributor

Choose a reason for hiding this comment

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

It doesn't return information about pending jobs?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It does. Wrong wording. Unless you have a better suggestion, I'll change it to

Get information about the jobs in HTCondor job queue(s).

job_info[schedd_name][id_] = dict(job_ad)
_LOG.debug("condor_q returned %d jobs", sum(len(val) for val in job_info.values()))
def condor_history(constraint=None, schedds=None, **kwargs):
"""Get information about completed jobs from HTCondor history.
Copy link
Contributor

Choose a reason for hiding this comment

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

Nitpicking about word again (that was the same way in code previously). "completed" It includes deleted jobs too?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'll change it to

Get information about the jobs from HTCondor history records.

The named argument in `htcondor.Schedd` methods, `requirements' was
deprecated by HTCondor team in favor of `constraint` and was triggering
deprecation warnings, e.g., when one was using `bps report`.  Replaced
it with its contemporary equivalent to get rid of those warnings.
By popular demand (see https://ls.st/090 for details) I removed
the try-except guard in module's __init__.py.
htc_version() was parsing the string returned by htcondor.version(). Now
it just returns a string representation of HTC_VERSION.
@mxk62 mxk62 merged commit 228b919 into main Sep 14, 2023
11 checks passed
@mxk62 mxk62 deleted the tickets/DM-37020 branch September 14, 2023 16:53
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.

None yet

3 participants