Skip to content

Commit

Permalink
Add minimal htcondor CI support (#420)
Browse files Browse the repository at this point in the history
  • Loading branch information
riedel committed May 5, 2020
1 parent 84d315a commit 1652acc
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ matrix:
- python: "3.6"
env:
- JOBQUEUE=slurm
- python: "3.6"
env:
- JOBQUEUE=htcondor

before_install:
- set -e
Expand Down
42 changes: 42 additions & 0 deletions ci/htcondor.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/usr/bin/env bash

function jobqueue_before_install {
docker version

docker run -d --name jobqueue-htcondor-mini htcondor/mini:el7 # might fail if called as script

docker ps -a
docker images
}
[[ "${BASH_SOURCE[0]}" != "${0}" ]] || jobqueue_before_install # excute if called as script

function jobqueue_install {
docker exec --user root jobqueue-htcondor-mini /bin/bash -c "
rm -rf /dask-jobqueue
"
docker cp . jobqueue-htcondor-mini:/dask-jobqueue

docker exec --user root jobqueue-htcondor-mini /bin/bash -c "
python3 -c 'import psutil' 2>/dev/null || yum -y install python3-psutil; # psutil has no wheel , install gcc even slower
cd /dask-jobqueue;
pip3 install -e .;
pip3 install pytest;
rm -f /var/log/condor/*
chown -R submituser:submituser /dask-jobqueue
"
}
[[ "${BASH_SOURCE[0]}" != "${0}" ]] || jobqueue_install # excute if called as script

function jobqueue_script {
docker exec --user=submituser jobqueue-htcondor-mini /bin/bash -c "
cd /dask-jobqueue;
pytest dask_jobqueue --verbose -s -E htcondor"
}
[[ "${BASH_SOURCE[0]}" != "${0}" ]] || jobqueue_script # excute if called as script

function jobqueue_after_script {
docker exec --user root jobqueue-htcondor-mini /bin/bash -c "
grep -R \"\" /var/log/condor/
"
}
[[ "${BASH_SOURCE[0]}" != "${0}" ]] || jobqueue_after_script # excute if called as script
7 changes: 2 additions & 5 deletions dask_jobqueue/tests/test_htcondor.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,10 @@ def test_basic(loop):
cluster.scale(2)

start = time()
while not (cluster.pending_jobs or cluster.running_jobs):
sleep(0.100)
assert time() < start + QUEUE_WAIT
client.wait_for_workers(2)

future = client.submit(lambda x: x + 1, 10)
assert future.result(QUEUE_WAIT) == 11
assert cluster.running_jobs

workers = list(client.scheduler_info()["workers"].values())
w = workers[0]
Expand All @@ -73,7 +70,7 @@ def test_basic(loop):
cluster.scale(0)

start = time()
while cluster.running_jobs:
while client.scheduler_info()["workers"]:
sleep(0.100)
assert time() < start + QUEUE_WAIT

Expand Down

0 comments on commit 1652acc

Please sign in to comment.