Skip to content

Support preload modules in Nanny - #3678

Merged
jrbourbeau merged 6 commits into
dask:masterfrom
mrocklin:preload-nanny
Apr 8, 2020
Merged

jrbourbeau merged 6 commits into
dask:masterfrom
mrocklin:preload-nanny

Conversation

@mrocklin

@mrocklin mrocklin commented Apr 7, 2020

Copy link
Copy Markdown
Member

Today we can run preload modules on workers or the scheduler, but not on the Nanny.

Now we can also run preload scripts on the nanny

dask-worker ... --preload-nanny my_module

@jrbourbeau jrbourbeau 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.

Thanks @mrocklin, the changes here generally LGTM. Left a few small comments/questions

Comment thread distributed/nanny.py Resolved
Comment thread distributed/worker.py
# TODO: it is unfortunate that we special-case inproc here
if not host and not interface and not scheduler_addr.startswith("inproc://"):
host = get_ip(get_address_host(scheduler_addr))
host = get_ip(get_address_host(scheduler_addr.split("://")[-1]))

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.

Why was this change needed?

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.

It's not entirely related. I was testing this with another workload and ran into a small bug here.

Comment on lines +219 to +226
@click.option(
"--preload-nanny",
type=str,
multiple=True,
is_eager=True,
help="Module that should be loaded by each nanny "
'like "foo.bar" or "/path/to/foo.py"',
)

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.

Currently preload_nanny_argv can't be specified on the command line. Do you have any thoughts on how we could support a --preload-nanny-argv CLI option? To be clear, I suspect this may be difficult with our current click setup and don't think the lack of a --preload-nanny-argv option should stop us from merging this PR

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.

Yeah, I wasn't sure how to pass things through from click. My sense is that we probably have to point users to the configuration to handle this.

I've added dask/dask#6077 to help with documentation here.

Co-Authored-By: James Bourbeau <[email protected]>
mrocklin added a commit to mrocklin/dask that referenced this pull request Apr 8, 2020
Include notes on configuration, types of inputs, and nannies

Accompanies dask/distributed#3678
Comment thread distributed/distributed.yaml Outdated
terminate: 0.95 # fraction at which we terminate the worker

nanny:
preload: []

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.

Most entries have a comment describing them

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.

Thanks for flagging this.

I've gone ahead and added brief comments that mostly just point to documentation (I don't think that we can reasonably describe this in one line). Ben and I are planning to play with larger descriptions for documentation later this week though.

@jrbourbeau jrbourbeau 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.

Thanks @mrocklin, the changes here LGTM

@jrbourbeau
jrbourbeau merged commit 2aa3ee7 into dask:master Apr 8, 2020
jcrist pushed a commit to dask/dask that referenced this pull request Apr 20, 2020
Include notes on configuration, types of inputs, and nannies

Accompanies dask/distributed#3678
@mrocklin
mrocklin deleted the preload-nanny branch April 29, 2020 19:53
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.

3 participants