Skip to content

Add minimal htcondor CI support - #420

Merged
lesteve merged 4 commits into
dask:masterfrom
riedel:247_condor_ci
May 5, 2020
Merged

lesteve merged 4 commits into
dask:masterfrom
riedel:247_condor_ci

Conversation

@riedel

@riedel riedel commented Apr 25, 2020 •

Copy link
Copy Markdown
Member

I set up a really minimal ci/htcondor.sh to address #247. No other files needed sofar.

A test fails, but this seems to be actually a real issue:

'HTCondorCluster' object has no attribute 'pending_jobs'

Please give it a try!

I thought I'd rather do sth if you add me to the team ;)

using minicondor image and single docker

Signed-off-by: Till Riedel <[email protected]>
@riedel riedel changed the title add minimal htcondor ci support (addressing #247) add minimal htcondor ci support Apr 25, 2020
@mivade

mivade commented Apr 25, 2020

Copy link
Copy Markdown

I can give this a try in the next few days.

@lesteve

lesteve commented Apr 27, 2020

Copy link
Copy Markdown
Member

I thought I'd rather do sth if you add me to the team ;)

I count that as a very nice side-effect !

@lesteve

lesteve commented Apr 27, 2020

Copy link
Copy Markdown
Member

pending_jobs is old IIRC so yes not a real problem at all !

@mrocklin

mrocklin commented Apr 27, 2020 via email

Copy link
Copy Markdown
Member

@lesteve

lesteve commented Apr 27, 2020

Copy link
Copy Markdown
Member

Adding CI to a project should give someone immediate commit rights :)

I remember now that was one of your criterion. This definitely makes sense!

@mrocklin while you are around, governance-wise is there some formal process I have to follow as a Dask sub-project when I want to give some commit rights to some people for Dask-Jobqueue ?

Also just a FYI, I was going to use the recently created Dask-Jobqueue teams to give permissions for Issue triaging and things like that, but I have not managed to find the time to do that yet !

@mrocklin

mrocklin commented Apr 27, 2020 via email

Copy link
Copy Markdown
Member

@mivade

mivade commented Apr 27, 2020

Copy link
Copy Markdown

I tried this out locally inside a Docker container but after the first two tests pass the third errors and everything seems to be hanging:

root@d42767487542:/opt/dask# jobqueue_script
============================= test session starts ==============================
platform linux -- Python 3.6.8, pytest-5.4.1, py-1.8.1, pluggy-0.13.1 -- /usr/bin/python3
cachedir: .pytest_cache
rootdir: /dask-jobqueue
collecting ... collected 142 items

dask_jobqueue/tests/test_htcondor.py::test_header PASSED
dask_jobqueue/tests/test_htcondor.py::test_job_script PASSED
dask_jobqueue/tests/test_htcondor.py::test_basic distributed.utils - ERROR - addresses should be strings or tuples, got None
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/distributed/utils.py", line 664, in log_errors
    yield
  File "/usr/local/lib/python3.6/site-packages/distributed/scheduler.py", line 2169, in remove_worker
    address = self.coerce_address(address)
  File "/usr/local/lib/python3.6/site-packages/distributed/scheduler.py", line 4883, in coerce_address
    raise TypeError("addresses should be strings or tuples, got %r" % (addr,))
TypeError: addresses should be strings or tuples, got None
distributed.core - ERROR - addresses should be strings or tuples, got None
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/distributed/core.py", line 399, in handle_comm
    result = handler(comm, **msg)
  File "/usr/local/lib/python3.6/site-packages/distributed/scheduler.py", line 2169, in remove_worker
    address = self.coerce_address(address)
  File "/usr/local/lib/python3.6/site-packages/distributed/scheduler.py", line 4883, in coerce_address
    raise TypeError("addresses should be strings or tuples, got %r" % (addr,))
TypeError: addresses should be strings or tuples, got None
distributed.utils - ERROR - addresses should be strings or tuples, got None
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/distributed/utils.py", line 664, in log_errors
    yield
  File "/usr/local/lib/python3.6/site-packages/distributed/scheduler.py", line 2169, in remove_worker
    address = self.coerce_address(address)
  File "/usr/local/lib/python3.6/site-packages/distributed/scheduler.py", line 4883, in coerce_address
    raise TypeError("addresses should be strings or tuples, got %r" % (addr,))
TypeError: addresses should be strings or tuples, got None
distributed.core - ERROR - addresses should be strings or tuples, got None
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/distributed/core.py", line 399, in handle_comm
    result = handler(comm, **msg)
  File "/usr/local/lib/python3.6/site-packages/distributed/scheduler.py", line 2169, in remove_worker
    address = self.coerce_address(address)
  File "/usr/local/lib/python3.6/site-packages/distributed/scheduler.py", line 4883, in coerce_address
    raise TypeError("addresses should be strings or tuples, got %r" % (addr,))
TypeError: addresses should be strings or tuples, got None

@lesteve

lesteve commented Apr 27, 2020 •

Copy link
Copy Markdown
Member

Yep this one looks like a real error (that was in the CI build as well after I pushed a fix for the .pending_jobs thing), not sure why this would happen ...

@lesteve

lesteve commented Apr 27, 2020 •

Copy link
Copy Markdown
Member

Maybe something you can do is to look at test_slurm.py and see whether you can take some inspiration.

It could well be that there is some async pattern that you are not following in test_htcondor.py (e.g. a missing await so that the scheduler address has a None address)

@riedel

riedel commented May 2, 2020

Copy link
Copy Markdown
Member Author

Actually the 2 submitted workers die silently when run.

This is really strange: If I enable debug and run them manually with exactly the same submit file the whole test starts to run again. All the assertions actually seem to work and I can run the whole ci successfully.

Besides the point, that the workers should not die (will have to insert some more logging), there probably should be some timeout/retry/detection mechanism. The script waits even as there are no jobs in the queue anymore...

@riedel

riedel commented May 2, 2020

Copy link
Copy Markdown
Member Author

Actually one more strange thing (possible unrelated), the dask worker alias seems to be set to "--name 0" . When I used condor_run for debugging strangly the client would not start if I would not chose another name.


condor_run /usr/bin/python3 -m distributed.cli.dask_worker tcp://172.17.0.2:34233 --nthreads 1 --memory-limit 100.00MB --name 0 -
-nanny --death-timeout 60
Error: --name option requires an argument

will run if you set name to 1. So 0 might be interpreted as None...

@riedel

riedel commented May 2, 2020 •

Copy link
Copy Markdown
Member Author

Seems fixed now: did not have file permission. HTCondor was even faster than none :)

(I think there are quite some things to do to make error handling better and debugging a bit easier. )

Signed-off-by: Till Riedel <[email protected]>
@riedel

riedel commented May 3, 2020

Copy link
Copy Markdown
Member Author

@mivade, can you review it again now that all checks actually pass? I corrected both the error in the CI and some the legacy stuff in the test.

@mivade

mivade commented May 4, 2020

Copy link
Copy Markdown

Looks good to me.

@lesteve

lesteve commented May 5, 2020

Copy link
Copy Markdown
Member

That looks good. I am going to merge this one, thanks a lot! Also welcome to HTCondor as a first class citizen in Dask-Jobqueue.

In an ideal world, it would be great if HTCondor CI was a bit closer to the other CI, in particular:

  • have a Dockerfile with the dependencies (dask, distributed etc ...) installed in the Dockerfile
  • maybe follow start-slurm.sh etc ... convention but maybe this is overkill since HTCondor use a single Docker image rather than a docker-compose setup so I am a bit undecided on this last point.

In any case that can certainly be done in a separate PR.

Also I am curious about

[[ "${BASH_SOURCE[0]}" != "${0}" ]] || jobqueue_before_install # excute if called as script

Was that useful to test your script locallly ? Does that differentiate between source my-script.sh and bash my-script.sh ?

@lesteve lesteve changed the title add minimal htcondor ci support Add minimal htcondor CI support May 5, 2020
@lesteve
lesteve merged commit 1652acc into dask:master May 5, 2020
@riedel

riedel commented May 5, 2020 •

Copy link
Copy Markdown
Member Author

Thanks alot for merging!!

have a Dockerfile with the dependencies (dask, distributed etc ...) installed in the Dockerfile

I can do that easily. I saw a huge benefit in having everything in one file. But some stuff also turned out to be a bit stupid (e.g. when rerunning the script).

It gives a little bit better speed when executing the CI (otherwise it is largely equivalent, it just does not create any layers in the docker image as a Dockerfile would do)

maybe follow start-slurm.sh etc ... convention

I am happy to do this, if it brings along any advantage either running or debugging the CI. As said before I like my single file ;). Actually starting the scheduler seperately would mean just running the docker image and this would mean implicitly passing parameters between the scripts (e.g. the name of the image/container), which I do not like.

Was that useful to test your script locallly ? Does that differentiate between source my-script.sh and bash my-script.sh ?

Yes, made it a lot easier for me to run the CI locally. Exactly: runs command only if executed, not if sourced. Repeating to source and then executing the step led to me being utterly confused if I really did everything in the right order on my local shell.

Will do the changes with the Dokerfile in a combined PR with implementing better debuggability.

@riedel
riedel deleted the 247_condor_ci branch May 6, 2020 10:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants