2

We use shinyproxy to host and run our apps. So far we only deployed R Shiny apps and now I want to try bokeh as well.

Is this generally possible or does it only work for dash?

As entry point for the docker I use:

#!/bin/bash
set -e
cd /bokeh-app
exec /opt/conda/bin/bokeh serve . \
--port 81 \
--address 0.0.0.0 \
--use-xheaders \
--allow-websocket-origin=*

within the docker the entrypoint is located in /usr/local/bin/entrypoint.sh

in the .yml file I specified the link to the app (under specs) as:

  - id: bokeh_test_app
    display-name: Bokeh Test App
    container-image: bokeh-test-app:latest

concerning the container-cmd I am not sure how to start the container via the entrypoint or via a command. I guess

container-cmd: ["sh", "usr/local/bin/entrypoint.sh"]

is wrong. When I start shinyproxy I get the error

Container unresponsive

any help appreciated!

horseshoe
  • 1,437
  • 14
  • 42
  • 1
    Does shinyproxy handle proxying websockets? (Just a random speculation since I don't know anything about shinyproxy at all, we use Docker and Elastic Beanstalk to deploy the [Bokeh demo site](https://demo.bokeh.org/), but whatever proxy you use will need to be able to handle websockets.) – bigreddot Nov 08 '19 at 17:28
  • 1
    In the past I was running Bokeh server using docker image file. At the end in your `Dockerfile` you need to start the server like you do in your entry point file + you need to expose the port that Bokeh is using (e.g. `EXPOSE 81`). Then you run Docker with `-p 5006:81` (port mapping) option where you refer to your internal Bokeh port – Tony Nov 08 '19 at 19:02
  • thx. I did not show that part, but the EXPOSE and the mapping of the ports was already included. If I start the docker that contains the bokeh app alone its also no problem. I assume that its either the call within shinyproxy that is somewhat wrong or that shiny proxy is not dealing with bokeh at all. According to https://www.openanalytics.eu/blog/2018/03/25/shinyproxy-1.1.0/ a dash python code can be called as `docker-cmd: ["python", "app.py"]` – horseshoe Nov 09 '19 at 13:55
  • ok one problem was that shinyproxy uses the port 3838 internally and port 81 was reserved for shinyproy so I had to switch from port 81 to 3838 for the bokeh app. I now use the mapping 81:8080 to access the shinyproxy page. The bokeh container starts, runs internally on 3838 and is then mapped via shiny proxy. Now the container starts but I get an 404 error. – horseshoe Nov 09 '19 at 14:39
  • 1
    Port 3838 is configurable, so you can also define `port: 81` in the app specification. For the `container-cmd` you don't have to specify it, if you have `CMD` in your Dockefile (I guess `ENTRYPOINT` should also work) You can also post on https://support.openanalytics.eu with more details, e.g. reproducible example (including Dockerfile) – Max Nov 14 '19 at 11:34

1 Answers1

0

A colleague of mine fonud the solution: Bokeh adds the folder name of the location where the app is located which cannot be located by shinyproxy. The main file of the bokeh app thus needs to be copied to the /root. In the docker I copied the application to the container via:

COPY bokeh_test/* /bokeh_test/

but it should be:

COPY bokeh_test/* /
horseshoe
  • 1,437
  • 14
  • 42