-
Notifications
You must be signed in to change notification settings - Fork 14
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
ENH: small tune ups to "jobs -s" output in case of missing external (datalad) #516
base: master
Are you sure you want to change the base?
Conversation
…xternalDependency Otherwise str() of that exception looks like DataLad is required for orchestrator datalad-pair-run is missing. and it is impossible to obtain the "name" of the missing external module. Well, ideally this exception should have kept msg as the first arg instead of making it into the "name", but oh well -- that is how it is now
…s mising Instead of crashing altogether demanding to install the needed dependency. Since it is just a show_oneline, and not programmable interface, I thought it would be better to report that something is missing but continue otherwise so other jobs statuses could be seen
That would make it obvious although not as pretty, but would not require each and other exception differential handling examples: $> reproman --dbg jobs -s 2020-05-25 20:31:09,793 [WARNING] datalad is missing. Required for orchestrator 'datalad-pair-run' [orchestrators.py:__init__:488] [status: N/A] 20200107-213600-f814 on smaug via condor$ '{inputs}' '{outputs}' participant --participan... $> reproman --dbg jobs -s [status: succeeded] 20200108-124152-a708 on smaug via condor$ '{inputs}' '{outputs}' participant --participan... 2020-05-25 20:32:59,254 [WARNING] [Errno 2] No such file or directory: '/home/yoh/.reproman/run-root/07ce9f04-9eb5-11ea-be9b-ff519d1f6bc9' [subprocess.py:_execute_child:1702] [status: N/A] 20200525-142526-10f0 on local via local$ '{inputs}' '{outputs}' participant --participan...
Codecov Report
@@ Coverage Diff @@
## master #516 +/- ##
==========================================
+ Coverage 89.47% 89.59% +0.11%
==========================================
Files 148 148
Lines 12290 12295 +5
==========================================
+ Hits 10997 11016 +19
+ Misses 1293 1279 -14
Continue to review full report at Codecov.
|
@@ -486,7 +486,8 @@ def __init__(self, resource, submission_type, job_spec=None, | |||
resurrection=False): | |||
if not external_versions["datalad"]: | |||
raise MissingExternalDependency( |
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.
Just a note: the datalad-bump branch already switched this over to external_versions.check()
, which results results in .name
being set in the MissingExternalDependency
instance.
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.
Oh cool, One more reason to have that pr merged, which I guess I will do with adding datalad rc into some dependency within setup.py .
@@ -16,6 +16,7 @@ | |||
|
|||
from reproman.dochelpers import exc_str | |||
from reproman.interface.base import Interface | |||
from reproman.support.external_versions import MissingExternalDependency |
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.
Left-over import from earlier commit
if orc_status == queried_status: | ||
# Drop repeated status (e.g., our and condor's "running"). | ||
queried_status = None | ||
except Exception as exc: |
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.
As the failing tests indicate, this interferes with the expected error handling in the outer level. So I think the options are (1) broaden the existing handling to catch either the MissingExternalDependency
you were originally interested in (my preference) or a blanket exception or (2) more comprehensively rework the handling around orc resurrection/status query, adjust the tests, maybe rethink the outer handling. I don't see a big advantage of the latter, so I'd lean to the narrow variant of 1.
If 2 is the choice, show
should also be considered.
See individual commits. Now (original version) would show
instead of immediately crashing with
edit1: pushed fb4e2a6 which would just catch all exceptions and issue warning while providing NA for the status