-
-
Notifications
You must be signed in to change notification settings - Fork 135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Setting distributed
configuration is not considered in the workers/nanny
#679
Comments
Config from the client is not automatically passed to the workers. I would expect you to use an option like Here's an example of environment variables being set https://jobqueue.dask.org/en/latest/clusters-example-deployments.html#slurm-deployment-low-priority-node-usage |
Ok, thanks. If you see in my example, I am also doing, but they get overriden by the default dask configuration. The way I'm doing it now is by using the longer variables like However, say I wanted to entirely override a section like |
Have you considered using the YAML config method instead of environment variables? As you're on a SLURM system I expect that all nodes will have access to your home directory, so you could put YAML configuration in |
Yes, and unfortunately it is not an option: it would be "system-wide", and we might want to modulate those variables per submission, instead. |
I should also mention that we want to distribute the code to users that won't necessarily be able to change/edit/locate configuration files themselves. This means that we should not mess with their global configuration files, and that they might not even be able to do it themselves if needed. Moreover, the local dask configuration is visible by Using environment variables is more of a workaround, but it has to properly work for all the configuration options. Otherwise, it is not feasible. |
Sure, you don't have to do it in the global config. You could create a separate YAML file and point to it with Generally the YAML config is the first-class citizen of Dask's config, with env vars and inline configs being secondary due to their limitations. |
OK, thanks, that is already a better solution, but very tedious to work with in our scenario: We would like to adapt the number of OpenMP threads based on the machines, available resources, function, etc. This would require fiddling with temporary config files. It is not too complicated with Moreover, I also agree that passing the whole configuration through a swarm of environment files might not be ideal. In the end, by more thouroughly looking through the documentation I could find a slightly more convenient way for us, through the use of the with dask.config.set({"distributed.nanny.pre-spawn-environ": my_env}):
serialized_conf = dask.config.serialize(dask.config.global_config)
with SLURMCluster(
**kwds,
job_script_prologue=f"export DASK_INTERNAL_INHERIT_CONFIG={serialized_conf}"
) as cluster: It does the job quite nicely, except for the fact that it is still impossible to erase fields from the default configuration. |
Sure that can be a good solution. Some other cluster managers like We did run into problems like dask/dask-cloudprovider#249 where the config in some cases was too large to send via the job scheduler (in this case EC2 VM launch parameters). Not a blocker but a gotcha to watch out for. The other confusion can be that changes to the config made after the cluster is created do not get propagated to the workers. |
OK, thanks, good to know! I'll test this internally first. Possibly, down the line, I could work on a simple PR for that. It would be cool to have it out of the box. Anyway, this closes the issue for me. Thanks for the useful discussion! |
Just want to cross refernece that this config sending is also done in |
Description:
If I for instance set the
pre-spawn-environ
configuration, it is not taken into account when the jobs/workers/nanny are spawned.Minimal Complete Verifiable Example:
And the output is the default:
The
job_script_prologue
seems to not have an effect either... How are we supposed to pass these variables?Environment:
The text was updated successfully, but these errors were encountered: