-
Notifications
You must be signed in to change notification settings - Fork 5
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-41543: Adds Reporting Exit Code Information to bps report #157
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Introduced the ``--return-exit-codes`` flag to bps report, which provides a summary of exit code counts and exit codes for non-payload errors. This currently only works for PanDA. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,13 +35,13 @@ | |
|
||
from lsst.utils import doImport | ||
|
||
from .bps_reports import DetailedRunReport, SummaryRunReport | ||
from .bps_reports import DetailedRunReport, ExitCodesReport, SummaryRunReport | ||
from .wms_service import WmsStates | ||
|
||
_LOG = logging.getLogger(__name__) | ||
|
||
|
||
def report(wms_service, run_id, user, hist_days, pass_thru, is_global=False): | ||
def report(wms_service, run_id, user, hist_days, pass_thru, is_global=False, return_exit_codes=False): | ||
"""Print out summary of jobs submitted for execution. | ||
|
||
Parameters | ||
|
@@ -63,6 +63,13 @@ def report(wms_service, run_id, user, hist_days, pass_thru, is_global=False): | |
|
||
Only applicable in the context of a WMS using distributed job queues | ||
(e.g., HTCondor). | ||
return_exit_codes : `bool`, optional | ||
If set, return exit codes related to jobs with a | ||
non-success status. Defaults to False, which means that only | ||
the summary state is returned. | ||
|
||
Only applicable in the context of a WMS with associated | ||
handlers to return exit codes from jobs. | ||
""" | ||
wms_service_class = doImport(wms_service) | ||
wms_service = wms_service_class({}) | ||
|
@@ -87,6 +94,7 @@ def report(wms_service, run_id, user, hist_days, pass_thru, is_global=False): | |
("RUN", "S"), | ||
] | ||
) | ||
|
||
if run_id: | ||
fields = [(" ", "S")] + [(state.name, "i") for state in WmsStates] + [("EXPECTED", "i")] | ||
run_report = DetailedRunReport(fields) | ||
|
@@ -103,6 +111,19 @@ def report(wms_service, run_id, user, hist_days, pass_thru, is_global=False): | |
print("\n") | ||
print(run_report) | ||
|
||
if return_exit_codes: | ||
fields = [ | ||
(" ", "S"), | ||
("PAYLOAD ERROR COUNT", "i"), | ||
("INFRASTRUCTURE ERROR COUNT", "i"), | ||
("INFRASTRUCTURE ERROR CODES", "S"), | ||
] | ||
run_exits_report = ExitCodesReport(fields) | ||
run_exits_report.add(run, use_global_id=is_global) | ||
print("\n") | ||
print(run_exits_report) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we add |
||
run_exits_report.clear() | ||
|
||
run_brief.clear() | ||
run_report.clear() | ||
if not runs and not message: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it would be worthwhile adding a comment that we're taking advantage of the fact that payloads always return 1 on failure here (right?).