Repository navigation
Add submit_command_extra and cancel_command_extra arguments - #434
matyasselmeci wants to merge 10 commits into
Conversation
`submit_command_extra` and `cancel_command_extra` (config options `jobqueue.X.submit-command-extra` and `jobqueue.X.cancel-command-extra`) are lists of strings that are arguments passed on as-is to `condor_submit` and `condor_rm` when submitting or removing HTCondor jobs.
There was a problem hiding this comment.
Works fine for me (tested it with "-name" on our cluster to chose another schedd) . I made minor comments regarding adding another function and testing a list argument with one item. But otherwise LGTM.
Thanks!! now I will be finally close my fork for our cluster :)
| ) | ||
|
|
||
| self.cancel_command = ( | ||
| HTCondorJob.cancel_command + " " + shell_quote_list(cancel_command_extra) |
There was a problem hiding this comment.
not so sure if I see the benefit over directly calling " ".join(shlex.quote(arg) for arg in cancel_command_extra)
|
I tested a bit more and have a problem I cannot understand. strangely leaves stale jobs. Any clue? |
riedel
left a comment
There was a problem hiding this comment.
I rechecked and there seems to be really a strange problem:
In [6]: cluster.scale(0)
DEBUG:dask_jobqueue.core:Stopping worker: 0 job: 10139.0
DEBUG:dask_jobqueue.core:Executing the following command to command line
condor_rm 10139.0
In [12]: cluster._dummy_job.cancel_command
Out[12]: 'condor_rm -name notebooks.sdil.kit.edu'
So checking cluster._dummy_job.cancel_command seems to be not enough ???!?
|
@matyasselmeci , can you reproduce my problem with the "-name" argument? Any clue how to effectively check that the params have been passed? Your idea from #411 (comment) was actually really good I think. But this won't do for the cancel_command I guess. |
|
|
Sorry I missed this one (don't hesitate to ping me if you need input in general), no objection to make it a normal method rather than a class method. For example, I would expect something like this to work fine for any cluster class: cluster = FooCluster(**some_kwargs)
# this custom cancel command should be used to cancel the job
cluster.cancel_command = 'some_custom_cancel_command' |
|
Sounds good, thanks! One idea for a test case for cancel_command is to add |
… cancel_command in the instance
Some htcondor parameters (e.g. "-name" to specify a schedd name) expect to be given an FQDN (or something that looks like one) and will fail if not given a parameter with a `.` in it.
i# On branch pr/411-extra-commands
- htcondor with a broken submit command - htcondor with working submit/cancel commands with extra arguments - htcondor with a broken cancel command
|
thx!! Ping me or remove the draft status, if you like me to review/test it . |
|
One thought: It might make sense to split this PR and merge it in 2 batches to see that the tests are working as expected, but I can also manually revert the class variable part and test it locally. I think it might be a bit of a hassle otherwise, as all this is logically connected. Maybe the title of the PR should mention that this only adds the commands to HTCondor (should maybe add more tickets to remind the other groups to add this to their schedulers if it makes sense or track the status across schedulers in the ticket and ask for comments,) |
It seems to me that this is very HTCondor specific and I have not seen anyone express a need for more flexibility along this axis in other job schedulers. I agree there it would be great to keep some uniformity between schedulers (mostly for stability/maintenance reasons) but at the same time I think it is fine having some scheduler-specific developments if there is a strong use case behind it. |
(assuming no other workers are running -- it would be even better if I had the job IDs of the workers from the cluster. Also don't wait so long. A remove is quicker than a submit.
| memory="100MB", | ||
| disk="100MB", | ||
| loop=loop, | ||
| submit_command_extra=["-name", schedd_name], |
|
LGTM. Tested it on our cluster with the sched arg manually. Anything left to do? If you remove the draft status the CI should also run. Can't wait for the merge... |
|
seems like there are some side effects to making the method an instance method: #442 (I just cherry-picked your commit, anyone working on this should probably do the same to distangle the problem). There seem to be some unwanted leftovers: I didn't see that when manually testing if the arguments work (calling the cancel command seemed to work fine for me...) BTW: @lesteve: can we turn on github actions for draft PRs? |
It seems like the CI ran fine. Did you mean "turn off" rather than "turn on"? |
it ran after @matyasselmeci marked it as ready for review. That is why the problem with the instance method only became apparent now. It did not run until deccacb but on ee54cd6. But don't mind, I looked at the CI and this seems to be a problem with Github actions recently: https://github.community/t/github-actions-not-being-triggered-on-draft-pr/16390 . I guess it also OK to put [WIP] in the title if you want CI but no merge until this is fixed. |
4d181fe to
26a0e70
Compare
|
Anybody still planning to work on this? |
|
Just to document it, the workaround why I personally gave up was that HTCondor can actually handle crucial extra-args that cannot be passed via the job description also via the the environment variable so I am doing this instead:
Still the problem that @matyasselmeci ran into are really strange and it seems like some kind of bug that should be documented (maybe even in dask distributed). It for sure needs some in depth debugging effort. Should I open a ticket regarding the problem of making job_close an instance method? And then rather close this PR for now (can be reopened if ticket is then fixed) |
You think it could come from dask.distributed?
Do we need this now for anything else that this problem? Or is this just because you think it would be cleaner? |
Actually it was good that you asked! It triggered me to look into the design. I actually now figured out a way to do this in #514 . It seems that the I however now have the huge problem of getting @matyasselmeci tests to run properly. Everything seems to be just fine, however, the new test design that actually uses failing submit_commands is really a challenge, because I somehow cannt figure out a way how to really catch that. |
|
I hope it is OK if I close this one in favour of #514 , which includes the majority of changes and has been reviewed. |
|
👍 |
submit_command_extraandcancel_command_extra(config optionsjobqueue.X.submit-command-extraandjobqueue.X.cancel-command-extra)are lists of strings that are arguments passed on as-is to
condor_submitand
condor_rmwhen submitting or removing HTCondor jobs.Fixes #411.