How to configure bokeh-server for multiple simultaneous users?

Hi:

I have been trying to configure a bokeh server for multiple simultaneous users accessing my plot from several computers on my intranet. I am having trouble.

Is there a clear, step-by-step recipe describing how to do this anywhere?

My plot works well in server single user mode.

I have read most of the posts in this group, including:

Bokeh server production deployment

My program is based on the example data_tables_server.py. Its init method looks like:

···

url = “http://localhost:5006/?public=true

def __init__(self):
    self.document = Document()
    self.session = Session(root_url=url,load_from_config=False)

    #self.session.register('ross','ross')
    self.session.login('ross','ross')

    self.session.use_doc('rad_sched_server')
    self.session.load_document(self.document)
    self.document.clear()

    self.source = ColumnDataSource()

    # create the plot layout
    self.document.add(self.create())
    self.update_doc()

def update_doc(self):
    # load a pandas dataframe...
    df = self.get_df()
    self.source.data = ColumnDataSource.from_df(df)

    self.session.store_document(self.document)

``


When I run this (after registering user ‘ross’ the first time), I get a login screen with a link to my plot. The link does not work. If I cut and paste the link that is printed to the console when my program launches, then the plot appears.

Confusing.

If I register another user, I have to edit my source code to login that user, then follow the link copy/paste, above, to see the plot as a 2nd user. That means the first user ‘ross’ can no longer see the plot.

If I add the command:

output_server(‘rad_sched_server’)

to my code, I get an error on launch that a json object could not be decoded.

All very confusing.

Any help appreciated!

Hi Ross,

I am afraid at the moment, I can't give you very good advice, because I'm not sure there is anyone (devs included) that have much real practical experience using the (current) server in this capacity. That is one of the reasons for the lack of docs in this particular area, but also the reticence has been based on uncertainty about whether the current server design and architecture is something that we want to truly wanted to commit to. And in fact, it is not. We had looked at pushing incremental improvements to the current server over the summer, but those efforts ultimately did not pan out. So let me try to update you (and everyone) as best I can:

Work has started on pure tornado based server. Think more along the lines of the jupyter/ipython notebook server. The new server:

* will use mixed binary protocol over web sockets for basically all communication. There will be a python client that supports real callbacks and streaming updates (no more ugly polling) and a JS client for BokehJS (much, much more efficient passage of data directly into typed arrays in the browser).

* will only cache session data based on tabs that connect to it, not on requests, so it can be scale far more simply (just run more servers).

* will not deal with auth at all, instead relying on user-defined auth facilities deployed in front of the Bokeh server (an LDAP authenticating reverse proxy, say). This greatly simplifies the bokeh server considerably, and is actually what most users have asked for anyhow.

* will be used for a "real deployment" of the Bokeh Server Gallery, and this deployment, with all settings, configs, and automatations (for supervisord, nginx, auth with a proxy, etc.) will be documented and made available. Would very much like to have other "canned and ready to go deployments" added over time.

The good news is, based on our experiences of the past year or so, the design and requirements for a new server architecture seem very clear and more sensible. I can actually imaging explaining and documenting them, which is my personal "smell test" for whether the design is on the right track.

The bad news, of course, is that it does not exist yet. As I said, work has started. It's not quite in a place where I am ready to push a preliminary branch or PR but I hope to be able to do so soon. My goal is to have this ready for the late September 0.10 release, but I cannot guarantee this. One limiting factor is that coming in mine and the teams tornado and redis experience is not extensive, and we are still climbing a learning curve there.

  *** If there are tornado/redis experts interested in helping accelerate this development, please let us know ***

So that is where things stand. My best advice would be "hold tight". But I understand you may need to get something working on a shorter time frame. I would suggest in the short term, if you have current auth facilities in place, use those and put them in front of a single user server. If you really are interested or pressed to get the current server working, please email directly and perhaps we can try to work out some suggestions based on your specific setup.

Thanks,

Bryan

···

On Aug 12, 2015, at 4:17 PM, Ross Mitchell <[email protected]> wrote:

Hi:

I have been trying to configure a bokeh server for multiple simultaneous users accessing my plot from several computers on my intranet. I am having trouble.

Is there a clear, step-by-step recipe describing how to do this anywhere?

My plot works well in server single user mode.

I have read most of the posts in this group, including:

Bokeh server production deployment

My program is based on the example data_tables_server.py. Its __init__ method looks like:

---

url = "http://localhost:5006/?public=true&quot;

    def __init__(self):
        self.document = Document()
        self.session = Session(root_url=url,load_from_config=False)

        #self.session.register('ross','ross')
        self.session.login('ross','ross')

        self.session.use_doc('rad_sched_server')
        self.session.load_document(self.document)
        self.document.clear()

        self.source = ColumnDataSource()

        # create the plot layout
        self.document.add(self.create())
        self.update_doc()

    def update_doc(self):
        # load a pandas dataframe...
        df = self.get_df()
        self.source.data = ColumnDataSource.from_df(df)

        self.session.store_document(self.document)

---

When I run this (after registering user 'ross' the first time), I get a login screen with a link to my plot. The link does not work. If I cut and paste the link that is printed to the console when my program launches, then the plot appears.

Confusing.

If I register another user, I have to edit my source code to login that user, then follow the link copy/paste, above, to see the plot as a 2nd user. That means the first user 'ross' can no longer see the plot.

If I add the command:
    output_server('rad_sched_server')

to my code, I get an error on launch that a json object could not be decoded.

All very confusing.

Any help appreciated!

--
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/d3084e18-ffd4-4ad1-b2b5-ee4fbced41d6%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

Thanks for sharing this Bryan. A much appreciated reference point.

···

On Thu, Aug 13, 2015 at 6:18 PM, Bryan Van de Ven [email protected] wrote:

Hi Ross,

I am afraid at the moment, I can’t give you very good advice, because I’m not sure there is anyone (devs included) that have much real practical experience using the (current) server in this capacity. That is one of the reasons for the lack of docs in this particular area, but also the reticence has been based on uncertainty about whether the current server design and architecture is something that we want to truly wanted to commit to. And in fact, it is not. We had looked at pushing incremental improvements to the current server over the summer, but those efforts ultimately did not pan out. So let me try to update you (and everyone) as best I can:

Work has started on pure tornado based server. Think more along the lines of the jupyter/ipython notebook server. The new server:

  • will use mixed binary protocol over web sockets for basically all communication. There will be a python client that supports real callbacks and streaming updates (no more ugly polling) and a JS client for BokehJS (much, much more efficient passage of data directly into typed arrays in the browser).

  • will only cache session data based on tabs that connect to it, not on requests, so it can be scale far more simply (just run more servers).

  • will not deal with auth at all, instead relying on user-defined auth facilities deployed in front of the Bokeh server (an LDAP authenticating reverse proxy, say). This greatly simplifies the bokeh server considerably, and is actually what most users have asked for anyhow.

  • will be used for a “real deployment” of the Bokeh Server Gallery, and this deployment, with all settings, configs, and automatations (for supervisord, nginx, auth with a proxy, etc.) will be documented and made available. Would very much like to have other “canned and ready to go deployments” added over time.

The good news is, based on our experiences of the past year or so, the design and requirements for a new server architecture seem very clear and more sensible. I can actually imaging explaining and documenting them, which is my personal “smell test” for whether the design is on the right track.

The bad news, of course, is that it does not exist yet. As I said, work has started. It’s not quite in a place where I am ready to push a preliminary branch or PR but I hope to be able to do so soon. My goal is to have this ready for the late September 0.10 release, but I cannot guarantee this. One limiting factor is that coming in mine and the teams tornado and redis experience is not extensive, and we are still climbing a learning curve there.

    *** If there are tornado/redis experts interested in helping accelerate this development, please let us know ***

So that is where things stand. My best advice would be “hold tight”. But I understand you may need to get something working on a shorter time frame. I would suggest in the short term, if you have current auth facilities in place, use those and put them in front of a single user server. If you really are interested or pressed to get the current server working, please email directly and perhaps we can try to work out some suggestions based on your specific setup.

Thanks,

Bryan

On Aug 12, 2015, at 4:17 PM, Ross Mitchell [email protected] wrote:

Hi:

I have been trying to configure a bokeh server for multiple simultaneous users accessing my plot from several computers on my intranet. I am having trouble.

Is there a clear, step-by-step recipe describing how to do this anywhere?

My plot works well in server single user mode.

I have read most of the posts in this group, including:

Bokeh server production deployment

My program is based on the example data_tables_server.py. Its init method looks like:


url = “http://localhost:5006/?public=true

def __init__(self):
    self.document = Document()
    self.session = Session(root_url=url,load_from_config=False)
    #self.session.register('ross','ross')
    self.session.login('ross','ross')
    self.session.use_doc('rad_sched_server')
    self.session.load_document(self.document)
    self.document.clear()
    self.source = ColumnDataSource()
    # create the plot layout
    self.document.add(self.create())
    self.update_doc()
def update_doc(self):
    # load a pandas dataframe...
    df = self.get_df()
    self.source.data = ColumnDataSource.from_df(df)
    self.session.store_document(self.document)

When I run this (after registering user ‘ross’ the first time), I get a login screen with a link to my plot. The link does not work. If I cut and paste the link that is printed to the console when my program launches, then the plot appears.

Confusing.

If I register another user, I have to edit my source code to login that user, then follow the link copy/paste, above, to see the plot as a 2nd user. That means the first user ‘ross’ can no longer see the plot.

If I add the command:

output_server('rad_sched_server')

to my code, I get an error on launch that a json object could not be decoded.

All very confusing.

Any help appreciated!

You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].

To post to this group, send email to [email protected].

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/d3084e18-ffd4-4ad1-b2b5-ee4fbced41d6%40continuum.io.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.

You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].

To post to this group, send email to [email protected].

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/2877B4F1-A8DD-4960-B8ED-AECBBBEFA46F%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Hi Bryan:

Thanks very much for the reply. My apologies for not responding sooner.

I think that your plan makes perfect sense. I too am looking for an LDAP authentication process.

In my particular case, I will see if I can delay the deployment of this tool until the new bokeh server is in place. If I get pushed to deploy sooner, I may take you up on your offer.

Happy to help beta-test the new system, and provide a canned demo if need be.

Sincerely,

Ross Mitchell

···

Hi:

I have been trying to configure a bokeh server for multiple simultaneous users accessing my plot from several computers on my intranet. I am having trouble.

Is there a clear, step-by-step recipe describing how to do this anywhere?

My plot works well in server single user mode.

I have read most of the posts in this group, including:

Bokeh server production deployment

My program is based on the example data_tables_server.py. Its init method looks like:


url = “http://localhost:5006/?public=true

def __init__(self):
    self.document = Document()
    self.session = Session(root_url=url,load_from_config=False)


    #self.session.register('ross','ross')
    self.session.login('ross','ross')


    self.session.use_doc('rad_sched_server')
    self.session.load_document(self.document)
    self.document.clear()


    self.source = ColumnDataSource()


    # create the plot layout
    self.document.add(self.create())
    self.update_doc()




def update_doc(self):
    # load a pandas dataframe...
    df = self.get_df()
    self.source.data = ColumnDataSource.from_df(df)

    self.session.store_document(self.document)

``


When I run this (after registering user ‘ross’ the first time), I get a login screen with a link to my plot. The link does not work. If I cut and paste the link that is printed to the console when my program launches, then the plot appears.

Confusing.

If I register another user, I have to edit my source code to login that user, then follow the link copy/paste, above, to see the plot as a 2nd user. That means the first user ‘ross’ can no longer see the plot.

If I add the command:

output_server(‘rad_sched_server’)

to my code, I get an error on launch that a json object could not be decoded.

All very confusing.

Any help appreciated!

If you want a plot to be seen by multiple users you have to publish it

The reason why output server isn’t working is because in multiuser mode your session needs to be logged in to work with the doc. You should be able to pass a session into output server iirc

···

On Aug 12, 2015 5:17 PM, “Ross Mitchell” [email protected] wrote:

Hi:

I have been trying to configure a bokeh server for multiple simultaneous users accessing my plot from several computers on my intranet. I am having trouble.

Is there a clear, step-by-step recipe describing how to do this anywhere?

My plot works well in server single user mode.

I have read most of the posts in this group, including:

Bokeh server production deployment

My program is based on the example data_tables_server.py. Its init method looks like:


url = “http://localhost:5006/?public=true

def __init__(self):
    self.document = Document()
    self.session = Session(root_url=url,load_from_config=False)


    #self.session.register('ross','ross')
    self.session.login('ross','ross')


    self.session.use_doc('rad_sched_server')
    self.session.load_document(self.document)
    self.document.clear()


    self.source = ColumnDataSource()


    # create the plot layout
    self.document.add(self.create())
    self.update_doc()




def update_doc(self):
    # load a pandas dataframe...
    df = self.get_df()
    self.source.data = ColumnDataSource.from_df(df)

    self.session.store_document(self.document)

``


When I run this (after registering user ‘ross’ the first time), I get a login screen with a link to my plot. The link does not work. If I cut and paste the link that is printed to the console when my program launches, then the plot appears.

Confusing.

If I register another user, I have to edit my source code to login that user, then follow the link copy/paste, above, to see the plot as a 2nd user. That means the first user ‘ross’ can no longer see the plot.

If I add the command:

output_server(‘rad_sched_server’)

to my code, I get an error on launch that a json object could not be decoded.

All very confusing.

Any help appreciated!

You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].

To post to this group, send email to [email protected].

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/d3084e18-ffd4-4ad1-b2b5-ee4fbced41d6%40continuum.io.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Thank you for this information. Would you mind providing more details, perhaps the statements involved?

Sincerely,

Ross