Repository navigation
Conversation
guillaumeeb
left a comment
There was a problem hiding this comment.
Hi @jolange,
Thanks for raising this PR. It's really appreciated.
In this case, I'm not sure it is needed: doesn't the env-extra kwarg already suites your need?
Or in the docs: https://jobqueue.dask.org/en/latest/generated/dask_jobqueue.SLURMCluster.html for example.
Maybe the name is not rightly chosen.
|
Hi @guillaumeeb , cluster = HTCondorCluster(cores=1, memory="2GB", disk="4GB", log_directory = 'logs',
env_extra=['TESTVAR=1', 'export TESTVAR2=2'],
)Generates this in an HTCondor submission file: But things like this env_extra=['cd ~/projects/dask-jobqueue/example', 'source venv/bin/activate'],simply get swallowed and do not appear anywhere. |
|
Addendum: |
|
OK, so this is a specific behavior from HTCondorCluster. I don't recall why things where made like this, must be some specificities of HTCondor. cc @riedel who maybe knows more. I would still try to see if we can improve thing in HTCondorCluster side, not adding a new feature for every other Cluster implementation that overlaps with existing feature. Maybe we should also make the |
|
I agree that we should not introduce a new parameter if the old one is supposed to do what I intent to, already. Maybe we can also ask @matyasselmeci who implemented this in #245. |
|
The way HTCondor submit files work I think it would be rather confusing to allow |
|
A common use case that I've had is to use The code here is customised but the use case is hopefully clear. |
What I got from the discussion so far is that the parameter rather is a misnomer.
Unfortunately that's not sufficient, because that's a symlink ( |
|
Got it, thanks for the clarification. I think I'd still be in favor of not using |
|
Either way would be fine for me. I guess it's up to the maintainers to decide here. |
|
Sorry for not replying last week
this code dates back to #245 and @mivade is right: htcondor submit files differ from slurm in that they are no scripts themselves but have their own syntax which makes things a bit different. However, I wouldn't have expected the behaviour behind the param for slurm here. I think what would make things easier to move htcondor closer to slurm in the sense that it also is a script that is submitted. one option could be to actually use use a script that submits itself to condor_submit (via stdin). Sth like: would that make htcondor more manageable? Edit: see next 2 comments |
|
Thanks @riedel for the feedback!
Right, this is why I prepend commands in the That being said, I don't fully get your proposal, yet:
|
|
too hot here, sorry (I edit the above, thanks to your comments)
I first thought to make the submit command blank or just It would be just a script that has two execution modes: one on the submit node and one on the execution nodes. I think protecting it via the _CONDOR_JOB_AD might not be too smart because it would probably give a few false positives when the Job is submitted from another (e.g. longer running, that hosts the scheduler) One could however use Disclaimer: this is just an idea, because I stumbled across this in other places (e.g. in the tests because the bangline was missing). I would only do it if others like the idea as well. |
|
Hi everyone, We all agree this is important for any queuing system to be able to run some commands before starting the Dask worker. Currently, this is supposed to be done using
For HTCondor, the command only add environment variables, probably because of a misunderstanding due to the kwarg name, and also because HTCondor is a bit specific. So I will probably reject this as is, but two things could be done:
Any thoughts? |
Sounds good.
I think that's not even necessary, because you can already use |
|
Wow, good catch for both issues @riedel, I did not remember those. So I'm closing this PR in favor of those two issues we need to fix. |
Before only environment variables were considered using HTCondor's `Environment =` feature, whereas the parameter description generally says "Other commands to add". If the `Environment =` is needed, one can still use the generic `job_extra` parameter to set it. fixes dask#393 related to dask#323 dask#556
* fix behaviour of `env_extra` for HTCondor Before only environment variables were considered using HTCondor's `Environment =` feature, whereas the parameter description generally says "Other commands to add". If the `Environment =` is needed, one can still use the generic `job_extra` parameter to set it. fixes #393 related to #323 #556 * adapt htcondor tests for new `env_extra` behaviour * adapt htcondor tests for new `env_extra` behaviour "export" is preserved now * docs: made "Moab Deployments" heading the same level as the others * docs: added description of HTCondorCluster + env_extra - example in the docstring - description in "example deployments"" - description in "advanced tops an tricks" * docs: removed the HTCondorCluster section from examples * formatting according to black and flake8
* fix behaviour of `env_extra` for HTCondor Before only environment variables were considered using HTCondor's `Environment =` feature, whereas the parameter description generally says "Other commands to add". If the `Environment =` is needed, one can still use the generic `job_extra` parameter to set it. fixes dask#393 related to dask#323 dask#556 * adapt htcondor tests for new `env_extra` behaviour * adapt htcondor tests for new `env_extra` behaviour "export" is preserved now * docs: made "Moab Deployments" heading the same level as the others * docs: added description of HTCondorCluster + env_extra - example in the docstring - description in "example deployments"" - description in "advanced tops an tricks" * docs: removed the HTCondorCluster section from examples * formatting according to black and flake8
…ob scripts (#560) * Use `--nworkers` in stead of deprecated `--nprocs` in the generated job scripts Fix #559. * Update the requirements for dask and distributed This is needed to support the `--nworkers` option. * Fix behaviour of `env_extra` for HTCondor (#563) * fix behaviour of `env_extra` for HTCondor Before only environment variables were considered using HTCondor's `Environment =` feature, whereas the parameter description generally says "Other commands to add". If the `Environment =` is needed, one can still use the generic `job_extra` parameter to set it. fixes #393 related to #323 #556 * adapt htcondor tests for new `env_extra` behaviour * adapt htcondor tests for new `env_extra` behaviour "export" is preserved now * docs: made "Moab Deployments" heading the same level as the others * docs: added description of HTCondorCluster + env_extra - example in the docstring - description in "example deployments"" - description in "advanced tops an tricks" * docs: removed the HTCondorCluster section from examples * formatting according to black and flake8 * Drop Python 3.7 (#562) * Drop Python 3.7 * Fix cleanup fixture probem (see fistributed#9137) * Override cleanup distributed fixture, and reconfigure dask-jobqueue when called * Use power of 2 for the memory checks in tests (see dask#7484) * Apply Black * Apply correct version of black... * conda install Python in HTCondor Docker image * Fix HTCondor Dockerfile * Fix PBS Issue * Add a timeout for every wait_for_workers call * Fix HTCondor tests, leave room for scheduling cycle to take place for HTCondor * flake check * debugging HTCondor tests on CI * Flake * reduce negotiator interval for faster job queuing, more debugging logs * move condor command at the right place * always run cleanup step, and print more things on HTCondor * Clean temporary debug and other not necessary modifications * Disable HTCondor CI for now * Import loop_in_thread fixture from distributed * Override method from distributed to make tests pass Co-authored-by: Johannes Lange <[email protected]> Co-authored-by: Guillaume Eynard-Bontemps <[email protected]>
This allows to specify additional commands to be run before the actual
"%(python)s -m distributed.cli.dask_worker"-call that starts the worker. This can be used to set up/source a virtual environment (or conda, mamba, ...), load a module, or whatever setup is needed.Example usage for a venv: