Skip to content

Add preload script to conf#2325

Merged
mrocklin merged 2 commits into
dask:masterfrom
guillaumeeb:preload_script_config
Nov 9, 2018
Merged

Add preload script to conf#2325
mrocklin merged 2 commits into
dask:masterfrom
guillaumeeb:preload_script_config

Conversation

@guillaumeeb

Copy link
Copy Markdown
Member

Fixes #2121.

Still trying to dive inside codebase, so I pick up some simple issues. Two questions for this one:

  • Did not find any test about preload scripts. Don't know how to build one... Should we?
  • For Scheduler, preload script are only loaded in cli.dask_scheduler, so I made the modification here, is this OK?

@mrocklin mrocklin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There may be some tests here (though I haven't explored much):

$ git grep test.*preload
distributed/cli/tests/test_dask_scheduler.py:def test_preload_file(loop):
distributed/cli/tests/test_dask_scheduler.py:def test_preload_module(loop):
distributed/cli/tests/test_dask_scheduler.py:def test_preload_command(loop):
distributed/cli/tests/test_dask_scheduler.py:def test_preload_command_default(loop):
distributed/tests/test_preload.py:def test_worker_preload_file(loop):
distributed/tests/test_preload.py:def test_worker_preload_module(loop):

I agree that it's odd the preload is only in the CLI. I think that it would be good to move this within the Scheduler and Worker classes. That change would be welcome here, or we could mark it as future work in an issue.

Comment thread distributed/cli/dask_scheduler.py Outdated
if not preload:
preload = dask.config.get('distributed.scheduler.preloads')
if not preload_argv:
preload_argv = dask.config.get('distributed.scheduler.preloads-argv')

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thoughts on preload vs preloads? I'm not sure if we should pluralize this word, given the single-ness of the --preload CLI keyword.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fine by me to go with preload, I'll update the PR accordingly.

@guillaumeeb

Copy link
Copy Markdown
Member Author

I think that it would be good to move this within the Scheduler and Worker classes

For Worker this is already the case. For Scheduler, there seems to be some reason about it, thus I'm not sure this is a trivial change. I did not find a simple way to do it when I looked at it.

@mrocklin

mrocklin commented Nov 3, 2018

Copy link
Copy Markdown
Member

Test failures here seem unrelated. See #2331

@mrocklin mrocklin merged commit e973e5b into dask:master Nov 9, 2018
@mrocklin

mrocklin commented Nov 9, 2018

Copy link
Copy Markdown
Member

Sorry for the delay on this. TLS issues were fixed in other PRs. Things are green now. Merging.

@guillaumeeb

Copy link
Copy Markdown
Member Author

No problem, I was planning to look at the tests you mentioned to see if I can add something. But this seems simple enough to merge it as it is, hopefully I did not messed up with default kwargs 🙂

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.

2 participants