On Mar 4, 2016, at 9:08 AM, Peter Wang <[email protected]> wrote:
Hey Matthew,
A Heroku template or HOWTO would be immensely helpful and deeply appreciated!
Thanks,
Peter
On Friday, March 4, 2016, <[email protected]> wrote:
Hi Bryan
Thank you for your response, the nginx functions are extremely helpful. I've managed to get the system up and running by splitting the flask app and bokeh server onto two separate app instances, using the allow-origin to ensure the system works. I'd be happy to share a code skeleton if you think it would be useful. Essentially, the bokeh server needs to be started with the $PORT Heroku variable and the pull_session performed on port 80.
The output from autoload_server, i.e. "tag", has http://localhost:5006/, automatically written in by default and I needed to do a str.replace() operation add the correct hostname.
On Thursday, 3 March 2016 19:25:38 UTC+2, Bryan Van de ven wrote:
Hi Matt,
Unfortunately I don't have any experience with Heroku, but in case it is useful there is some information about setting up a Bokeh server behind an (Nginx) proxy here:
Bokeh server — Bokeh 3.3.2 Documentation
Note that if the Bokeh server and the Flask server doing the autoload_server are on different machines, then you will also need to add --extra-websocket-origin to tell the Bokeh server to accept websocket connections from the Flask server machine (it sounds like you have everything on one VM tho).
Bryan
> On Mar 1, 2016, at 5:35 AM, mattad...@gmail.com wrote:
>
> Hi,
>
> First, I want to say what a wonderful tool Bokeh is. Now, my question. I have set up a small Flask app on a Heroku web dyno that connects to a Bokeh server instance running on a worker dyno. I use Honcho to allow me to run both processes on a single (free) dyno. The Flask app connects to the bokeh server with:
>
> @app.route('/plot')
> def interactive():
> session = pull_session(session_id=None, url='http://localhost:5006/script/'\)
>
> tag = autoload_server(next(iter(session.document.roots)), session_id=session.id,
> app_path='/script')
> session.close()
>
> return render_template('interactive_app.html', tag=tag)
>
> Here "script" is the name of the script launched with "bokeh serve". The whole setup works fine on my local setup (with accept-origin set correctly for local use), however, when run through Heroku the pull_session call looks for a bokeh server instance on my host machine, which makes some sense. I was wondering if anyone has any suggestions on how to correctly proxy the pull_session call to connect to the bokeh server running on the remote worker dyno? I fear my web-application knowledge is rather lacking.
>
> I am currently using bokeh version 0.11.1.
>
>
> --
> 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 bokeh+un...@continuum.io.
> To post to this group, send email to bo...@continuum.io.
> To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/067d1821-5939-4b21-94fb-85e46a8ec46d%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/9ab807e3-75d7-4e63-8add-1cce193ecb8e%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.
--
Peter Wang
CTO, Co-founder
--
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/CABGrp%2B_Jf0Bc7ZWm8FUpOeSyyDA1RJkMHxsh0cXnhzJofyWqLQ%40mail.gmail.com\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.