I have taken an alternative approach, by packaging the Bokeh app in a container, like the demo.bokeh.org. After a couple of hours of reading up on how GAE works, I have got it to work by adding the following app.yaml:
runtime: custom
env: flex
And two changes in the Dockerfile
EXPOSE 8080 as this is the port GAE listens to (I have removed ports 5006 and 80 just to be sure)
CMD bokeh serve --port 8080 ... (rest unchanged) so Bokeh also listens on 8080.
That did the trick for me, and am happy that for small projects and proof-of-concept stuff I can run a Bokeh app on GAE now. Thought it is useful to share it here for future benefit.
@dkapitan This is great information. If you would ever like to write up a small step-by-step “howto” addition to the main docs site, please let me know and I am happy to help/advise.
@dkapitan The demo.bokeh.org repo is first and foremost to service the deployment of the actual running demo.bokeh.org site. I would like to avoid encumbering it with things not directly related to that deployment. Some other ideas:
In fact this entire subdirectory really needs to be cleaned up. I am not a Docker expert so I don’t really trust my own judgment here. It would be great for an experienced Docker user to re-organize that entire subdirectory in whatever way they deem most useful.
This would involve editing the Sphinx docs sources. If the Dockerfile is not large presumably it could just be included whle in the docs (or linked in to from the main repo if the above task is also done)
This would be a great addition to the docs for all users, please let me know what you think and how I can assist.
@Bryan
I feel the second option, i.e. enhancing docker-tools in the source code, is do-able for me. Have just read the DevGuide. It’s not clear to me which Git workflow you use (apart from the hooks). My idea is to fork the repo, make changes in docker-tools and submit a PR? Since I won’t be doing anything with the JS side of things, I can safely skip the build tests, right?
@dkapitan That’s exactly right. The docker-tools directory is fairly isolated from all the rest of things. The only reason you might need to run tests is if you wanted to work on update the “dev” dockerfiles that I think are there. They are probably out of date now that we have switched over to GH CI. But for now what’s there currently could also just be re-organized as-is, into whatever new overall structure you think is appropriate.
Updating service [default] (this may take several minutes)…failed.
ERROR: (gcloud.app.deploy) Error Response: [9]
Application startup error:
ERROR: Path for Bokeh server application does not exist: /dashboard.py
My guess is that CMD bokeh serve dashboard.py won’t work in Dockerfile?
@BryceWayne
Not sure if I understand you correctly, but if you want more control on the layout, best way is to use the templating function. This is a good tutorial: “Data Visualization with Bokeh in Python, Part III: Making a Complete Dashboard” by Will Koehrsen https://link.medium.com/dWPUiRks62.
This is a good reference. Thank you. My question was about how to link to the Bokeh Dashboard inside the html file; precisely like in your github repo. I deployed my dashboard on GCP/GAE and everything runs great. You really helped a lot.