dask / distributed

A distributed task scheduler for Dask
https://distributed.dask.org
BSD 3-Clause "New" or "Revised" License
1.58k stars 718 forks source link

Bokeh session ID options #2286

Open rcthomas opened 6 years ago

rcthomas commented 6 years ago

Could we add options to control Bokeh session ID settings?

The bokeh serve --session-ids command allows "no setting," unsigned, signed, and external-signed values. The serve subcommand maps these to Server arguments for sign_sessions and generate_session_idshere.

If it is somehow important to have Dask options passed along to Bokeh look like options to bokeh serve then the same logic has to be ported over. If that is not considered very important then the sign_sessions and generate_session_ids options could be exposed directly. The only issue is the environment-variable controlled option for sign_sessions that Bokeh supports.

Either way I'd be happy to try to put this together as a PR if it makes sense.

mrocklin commented 6 years ago

It would be nice to have some pass-through argument that allowed people to send any options down to bokeh. I think that I would prefer to avoid having to do this for every possible option.

This is made slightly more complex because we don't use bokeh serve. Instead we create a bokeh Server object in Python.

Help with this would be welcome. I suspect that this may require more thinking before a solution presents itself.

On Wed, Oct 3, 2018 at 12:51 PM R. C. Thomas notifications@github.com wrote:

Could we add options to control Bokeh session ID settings? https://bokeh.pydata.org/en/latest/docs/reference/command/subcommands/serve.html#session-id-options

The bokeh serve --session-ids command allows "no setting," unsigned, signed, and external-signed values. The serve subcommand maps these to Server arguments for sign_sessions and generate_session_idshere. https://github.com/bokeh/bokeh/blob/master/bokeh/command/subcommands/serve.py#L553-L572

If it is somehow important to have Dask options passed along to Bokeh look like options to bokeh serve then the same logic has to be ported over. If that is not considered very important then the sign_sessions and generate_session_ids options could be exposed directly. The only issue is the environment-variable controlled option for sign_sessions that Bokeh supports.

Either way I'd be happy to try to put this together as a PR if it makes sense.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/dask/distributed/issues/2286, or mute the thread https://github.com/notifications/unsubscribe-auth/AASszGH_bsCORnXGrsOn35WYND1kGLU5ks5uhOr9gaJpZM4XGcRR .

rcthomas commented 6 years ago

Yes, the mapping from that serve argument to the parameters Server takes is a bit complicated. Perhaps a PR to Bokeh that enables setting generate_session_ids via environment variable as is already done for sign_sessions? Then these could be controlled without pass-through at all.

mrocklin commented 6 years ago

We could also put server_kwargs into our configuration

https://github.com/dask/distributed/blob/a2d3fff94cb9dcf1b998cde572b00369245ab744/distributed/bokeh/core.py#L31-L36

http://docs.dask.org/en/latest/configuration.html

In this situation users could add special keywords either into their personal ~/.config/dask/distributed.yaml config, or system administrators could put something into /etc/dask/bokeh.yaml or something similar.