Repository navigation
Conversation
|
Thanks for your PR. Full disclosure: I don't know anything about Condor (and I think this is the case of most maintainers in I am going to ping the people involved in the original HTCondor PR #245 and wait for their informed feed-back: @matyasselmeci @cloudronin @mivade. It would be great if some of you could test it quickly on your HTCondor cluster. import time
from dask.distributed import Client
from dask_jobqueue import HTCondorCluster
cluster = HTCondorCluster(your_arguments_go_here)
client = Client(cluster)
while len(client.scheduler_info()['workers']) < 1:
print('No workers connected yet')
time.sleep(5)
future = client.submit(lambda x: x, 1)
print('Got result: ', future.result()) |
|
@riedel I see you have pushed an additional commit recently so I am guessing you are still working on this PR. I would suggest you let us know when this stabilizes and you think this PR is ready for feed-back. |
|
I can test this out once it's ready for review. |
matyasselmeci
left a comment
There was a problem hiding this comment.
You should shell-escape schedd in your submit_command. In order for the suggestions I made to work, you'll also need to add this at the top:
try:
from shlex import quote as shell_quote # Python 3.3 and newer
except ImportError:
from pipes import quote as shell_quote # Python 2 to 3.2
| if self.job_extra: | ||
| self.job_header_dict.update(self.job_extra) | ||
| if schedd: | ||
| self.submit_command += " -name "+schedd |
There was a problem hiding this comment.
| self.submit_command += " -name "+schedd | |
| self.submit_command += " -name "+shell_quote(schedd) |
Thanks for the review @matyasselmeci, note that we have dropped Python 2 support, since from shlex import quote |
5d7e281 to
8a9c06f
Compare
|
@riedel can you look at the build failures? Quickly looking at it:
|
|
One issue I'm seeing is that I get a Traceback (most recent call last):
File "condor.py", line 7, in <module>
cluster = HTCondorCluster(disk="1 GB", cores=8, memory="1 GB")
File "/Users/michael.depalatis/tmp/dask-condor/dask-jobqueue/dask_jobqueue/htcondor.py", line 77, in __init__
schedd = dask.config.get("jobqueue.%s.schedd" % config_name)
File "/Users/michael.depalatis/miniconda3/envs/dask-condor/lib/python3.7/site-packages/dask/config.py", line 456, in get
result = result[k]
KeyError: 'schedd'It would be nice to have that as optional for cases where you're submitting to the |
Definitively, I set the default to null in the yaml to get that effect, but I guess I needed to set a default in the code too, because I think it makes no sense to "fix" a test (I could not run them on my development system, so I forgot). Some config options set explicit defaults in the code, others not. |
|
Thanks a lot for this! One question (I could not figure it out in 5 minutes of googling): is it possible to put the It would be really great to add a test in `tests. The simplest thing to do would be to something like: cluster = HTCondor(cores=1, memory='1GB', schedd='my-schedd-name')
# pretty sure I the quoting is wrong but you see what I mean
assert `-name my-schedd-name' in cluster.submit_command
assert `-name my-schedd-name' in cluster.cancel_command
For tests that don't need a cluster to run, you can run them locally (i.e. no need to be on the cluster). |
|
Also I opened #324 to add a CONTRIBUTING.md with "how to run tests". |
My first intuituition would be "no" but there might actually be sth, I have never tested (I am not an condor expert at all):
(What I thought could be done is to change the shebang and call just the script.) But as you said, the problem then is that you also need to pass it to BTW: the Should I add those as well to simply be complete? (I currently have no use for them, but actually it might be interesting) I can add a test. |
From reading the
I would at least add the |
I would only add a feature if someone has a use for it now rather than because someone may need it one day. In other words: YAGNI (You Aren't Going to Need It). |
|
Unless |
|
Thanks for the details! In case it was not clear enough already, I completely defer to people involved in this PR for what kind of parameter makes sense to add for Something I would say I think the minimal requirement for adding a parameter is that:
Another thing we could do is to have a cluster = HTCondor(condor_command_extra=['-name', 'my_schedd'])This way we don't have to decide which arguments we need to include in this PR and this is more future-proof. If some of the parameters we are talking about are not symmetric between |
|
Can we split out 97ff9ab (the -file fix) and merge that for now? I didn't see any controversy over that fix and is actually biting people in the wild. |
|
As for specifying the schedd, I think @lesteve's suggestion of |
|
I opened a ticket referencing this pull request. Would be too messy to update it (was messed up from the beginning because I accidentally merged two pull requests, one of which was resolved!) |
The -file argument was introduced in recent versions of HTCondor otherwise the script argument is positional. This adds support for older versions commonly in the wild. (Would only generate a problem if more than one job is queued at once)