Skip to content

Commit

Permalink
Fix command template for empty env_extra in HTCondor (dask#570)
Browse files Browse the repository at this point in the history
* Fix command template for empty `env_extra` in HTCondor

Due to config read with `default=[]`, `env_extra` will not stay `None`
but become an empty list. This resulted in a command template starting
with a semicolon.

Possibly related to dask#568

* formatting

* reenable HTCondor CI workflow

* DEBUG: downgrade click

* DEBUG: condor_q + condor logs

* DEBUG: more output

* DEBUG

* DEBUG

* test_basic[HTCondorCluster]: use 2GiB memory

* DEBUG more output

* test_basic[HTCondorCluster]: use 500MiB memory

* adapt assertion to 500MiB

* DEBUG: revert all debugging stuff

* test_basic[HTCondorCluster]: use 500MiB memory

* Revert "DEBUG: downgrade click"

This reverts commit 56e56d4.

* EMPTY to trigger CI

* Fix also test_extra_args_broken_cancel

* Re-add some debugging outputs for HTCondor CI just in case

Co-authored-by: Guillaume EB <[email protected]>
  • Loading branch information
jolange and guillaumeeb authored Aug 8, 2022
1 parent 50a6f39 commit 7ec9bd0
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ jobs:
strategy:
fail-fast: false
matrix:
#HTCondor disabled for now
jobqueue: ["pbs", "sge", "slurm", "none"]
jobqueue: ["htcondor", "pbs", "sge", "slurm", "none"]

steps:
- name: Cancel previous runs
Expand Down
5 changes: 3 additions & 2 deletions ci/htcondor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@ function jobqueue_script {

function jobqueue_after_script {
cd ./ci/htcondor
docker-compose exec -T submit /bin/bash -c "condor_q"
docker-compose exec -T --user submituser submit /bin/bash -c "condor_q"
docker-compose exec -T submit /bin/bash -c "condor_status"
docker-compose exec -T submit /bin/bash -c "condor_history"
docker-compose exec -T --user submituser submit /bin/bash -c "condor_history"
docker-compose exec -T --user submituser submit /bin/bash -c "cd; cat logs/*"
docker-compose exec -T cm /bin/bash -c " grep -R \"\" /var/log/condor/ "
cd -
}
4 changes: 1 addition & 3 deletions dask_jobqueue/htcondor.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,7 @@ def __init__(
# Overwrite command template: prepend commands from env_extra separated by semicolon.
# This is special for HTCondor, because lines to execute on the worker node cannot be
# simply added to the submit script like for other batch systems.
self._command_template = (
"; ".join(env_extra) + "; " + self._command_template
)
self._command_template = "; ".join(env_extra + [self._command_template])

self.job_header_dict = {
"MY.DaskWorkerName": '"htcondor--$F(MY.JobId)--"',
Expand Down
11 changes: 7 additions & 4 deletions dask_jobqueue/tests/test_htcondor.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ def test_job_script():

@pytest.mark.env("htcondor")
def test_basic(loop):
with HTCondorCluster(cores=1, memory="100MiB", disk="100MiB", loop=loop) as cluster:
with HTCondorCluster(
cores=1, memory="500MiB", disk="100MiB", log_directory="logs", loop=loop
) as cluster:
with Client(cluster) as client:
cluster.scale(2)

Expand All @@ -78,7 +80,7 @@ def test_basic(loop):

workers = list(client.scheduler_info()["workers"].values())
w = workers[0]
assert w["memory_limit"] == 100 * 1024**2
assert w["memory_limit"] == 500 * 1024**2
assert w["nthreads"] == 1

cluster.scale(0)
Expand All @@ -93,8 +95,9 @@ def test_basic(loop):
def test_extra_args_broken_cancel(loop):
with HTCondorCluster(
cores=1,
memory="100MB",
disk="100MB",
memory="500MiB",
disk="500MiB",
log_directory="logs",
loop=loop,
cancel_command_extra=["-name", "wrong.docker"],
) as cluster:
Expand Down

0 comments on commit 7ec9bd0

Please sign in to comment.