-
-
Notifications
You must be signed in to change notification settings - Fork 136
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
LSF: Accept use_stdin in the constructor #360
Conversation
7f948a4
to
03d3d67
Compare
OK, I got the tests passing, but I'm seeing intermittent failures from Travis (unrelated to this PR). FWIW, here's the error:
At first this error appeared in the I'll force-push one more time to see if I can get lucky with a successful build. |
03d3d67
to
b524b3e
Compare
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.
Thanks very much @stuarteberg, that looks very good!
Just one little thing, could you add a test thats shows that lsf_job.use_stdin can be modified according to the constructor argument you added?
@stuarteberg do you think we should default to Also for further reference could you answer these two questions:
|
b524b3e
to
ee6fb77
Compare
OK, done. |
Disclaimer: I am not an LSF expert, and I only have experience with one LSF cluster, of which I am merely a user, not an administrator.
Yes, I think we should. If
Unless When using Again, I'm not an expert, but if In any case, I don't think our current default heuristic is correct, because
Yes, both of those work for me, as long as |
None of us are LSF experts even less LSF administrators ... as someone who has access to a LSF cluster and from your earlier comments I think you qualify as the dask-jobqueue LSF expert ;-). Thanks a lot your feed-back, it is extremely useful! Also it aligns very much with my understanding of the problem so I think we should switch to use_stdin=True by default. |
OK, assuming @guillaumeeb agrees, would you like me to open a separate PR for that, or simply change it now, as part of this PR? |
@@ -27,3 +29,18 @@ def pytest_runtest_setup(item): | |||
if envnames: | |||
if item.config.getoption("-E") not in envnames: | |||
pytest.skip("test requires env in %r" % envnames) | |||
|
|||
|
|||
@pytest.fixture(autouse=True) |
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.
Would it be possible to not use autouse
here, so that the fixture is explicitly used in test_use_stdin? My preference would be to avoid pytest magic if possible.
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.
Since lsf_version()
is called by default (unless use-stdin
is specified in the config), then this monkey-patch is needed by all tests that instantiate LSFCluster()
. That includes every test in test_lsf.py
and also half of the tests in test_jobqueue_core.py
.
I'm not a pytest
expert, but IIUC, we need to use autouse=True
or we need to add this fixture to every test that needs it in those two files. Is there some better mechanism I'm missing?
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.
BTW, in the future, if we simply use use-stdin: true
by default, then we can forbid use-stdin: null
. At that point, there will be no need for lsf_version()
anyway. We can delete it, along with this test fixture.
In other words, it's probably not worth debating the technical details of this fixture if we're going to delete it soon, anyway.
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.
Right I missed that. I think we can keep it like this for this PR.
When we switch to use_stdin=True, we should remove the lsid
logic (and so this autouse fixture). Basically, we thought there was a change in behaviour linked to LSF 10 and my current understanding is that this is not the case but is linked to some quirks on Summit ...
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.
Looks like our messages crossed, oh well ... looks like we agree anyway.
If you don't mind, a separate PR would be preferrable. This PR is adding the use_stdin parameter, which was an oversight of #307. Changing to |
I'll open a PR once this one is merged. (It will touch the same files as this one.) |
Thanks I'll merge this one, since this seems perfectly reasonable to me. @guillaumeeb don't hesitate to comment if you think we missed something. |
My current thinking is that there are a few fixes that would be nice to include in a release in the near future (say 1-2 weeks) and |
Right now, all LSF options can be specified either in the config OR in the constructor arguments, except the new
use-stdin
option (introduced in #347). Unlike all the others, that option may only be specified in the config (not the constructor).I don't see why we'd want
use-stdin
to be different from all the other LSF options, so this PR allows the user to passuse_stdin
to theLSFCluster
constructor if she wants to. (As usual, the config is used if no value was passed in the constructor.)Side note: I suspect this new setting will be needed by many, if not most, LSF users, so I added some verbose documentation for it.
FWIW, I tested these changes on my LSF cluster, and they work as expected.