Deploying a served-based bokeh app via heroku

I’m trying to do the same thing as in https://stackoverflow.com/questions/38417200/serving-interactive-bokeh-figure-on-heroku/38447618#38447618. But even after reading the answer, I can’t figure it out.

I’ve cloned the bokeh git repository and downloaded the data. Then, by executing the command

bokeh serve --show movies

(the python file is located in the movies subdirectory) in git bash, I can view the app locally on port 5006.

But what I really want is to deploy the app to the internet. I’m trying to use heroku to do this. This is a non-flask, non-django app.

For the procfile, I have

web: bokeh serve --port=$PORT --host=movies-rohan.herokuapp.com --host=* --address=0.0.0.0 --use-xheaders movies.py

Two questions about this:

  1. Should I specify the port number, or leave it as $PORT?

  2. Should I use “–allow-websocket-origin=” instead of “–host”? Does it make a difference?

Then there’s the requirements.txt file. As I understand, this lists the dependencies for the app. But I don’t know how to format this. Can anyone, please, provide a template for a requirements.txt file? As a sample requirements.txt, does this seem reasonable:

[[source]]

url = “https://pypi.python.org/simple

verify_ssl = true

[packages]

bokeh = “*”

[requires]

python_version = “3.6”

Besides the python file, the procfile, and requirements.txt, is anything else necessary? What about a pipfile or pipfile.lock? My understanding is that a pipfile is an alternative to requirements.txt.

Thank you!

Hi,

--host is deprecated, and no longer needed. It is currently a no-op but will be an error in the (near) future. Don't use it.

--allow-websocket-origin should be set to whatever the public URL that *users will navigate to* to get to the app is. I.e, if you run the server behind a reverse proxy that has a public URL "foo.com" then this value should be set to "foo.com", which tells Bokeh server to allow websocket connections from clients navigating to "foo.com" In this case, I'm guessing you might want something like:

  --host="movies-rohan.herokuapp.com:$PORT"

but I can't be certain, I am not especially familiar with Heroku. (I don't know anything about the pip question, e.g.)

Thanks,

Bryan

···

On Oct 9, 2017, at 18:11, Rohan Kadakia <[email protected]> wrote:

I'm trying to do the same thing as in https://stackoverflow.com/questions/38417200/serving-interactive-bokeh-figure-on-heroku/38447618#38447618. But even after reading the answer, I can't figure it out.

I've cloned the bokeh git repository and downloaded the data. Then, by executing the command

    bokeh serve --show movies

(the python file is located in the movies subdirectory) in git bash, I can view the app locally on port 5006.

But what I really want is to deploy the app to the internet. I'm trying to use heroku to do this. This is a non-flask, non-django app.

For the procfile, I have

    web: bokeh serve --port=$PORT --host=movies-rohan.herokuapp.com --host=* --address=0.0.0.0 --use-xheaders movies.py

Two questions about this:

1) Should I specify the port number, or leave it as $PORT?

2) Should I use "--allow-websocket-origin=" instead of "--host"? Does it make a difference?

Then there's the requirements.txt file. As I understand, this lists the dependencies for the app. But I don't know how to format this. Can anyone, please, provide a template for a requirements.txt file? As a sample requirements.txt, does this seem reasonable:

    [[source]]
    url = "https://pypi.python.org/simple"
    verify_ssl = true

    [packages]
    bokeh = "*"

    [requires]
    python_version = "3.6"

Besides the python file, the procfile, and requirements.txt, is anything else necessary? What about a pipfile or pipfile.lock? My understanding is that a pipfile is an alternative to requirements.txt.

Thank you!

--
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/e722bbdd-426d-4f99-bf5f-9e3afad9eb88%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

  1. I’m guessing I should be listing additional dependences under [packages] in my pipfile. I’m just not sure what to list.

  2. This same deployment issue is discussed at https://github.com/bokeh/bokeh/issues/2191. But I still can’t figure it out!

Looking at my heroku logs, I see:

2017-10-09T23:45:42.153241+00:00 heroku[web.1]: Starting process with command bokeh serve --log-level=debug --port=12736 -—allow-websocket-origin=movies-rohan.herokuapp.com:12736 —-allow-websocket-origin=* use-xheaders /Users/kadakia/bokeh/examples/app/movies/main.py

2017-10-09T23:45:48.951031+00:00 heroku[web.1]: Process exited with status 2

2017-10-09T23:45:48.725586+00:00 app[web.1]: usage: /app/.heroku/python/bin/bokeh [-h] [-v]

2017-10-09T23:45:48.725615+00:00 app[web.1]: {html,info,json,png,sampledata,secret,serve,static,svg}

2017-10-09T23:45:48.725616+00:00 app[web.1]: …

2017-10-09T23:45:48.725819+00:00 app[web.1]: /app/.heroku/python/bin/bokeh: error: unrecognized arguments: -—allow-websocket-origin:12736=movies-rohan.herokuapp.com

2017-10-09T23:45:48.984139+00:00 heroku[web.1]: State changed from starting to crashed

Thanks in advance for all your help!

···

On Monday, October 9, 2017 at 7:11:58 PM UTC-4, Rohan Kadakia wrote:

I’m trying to do the same thing as in https://stackoverflow.com/questions/38417200/serving-interactive-bokeh-figure-on-heroku/38447618#38447618. But even after reading the answer, I can’t figure it out.

I’ve cloned the bokeh git repository and downloaded the data. Then, by executing the command

bokeh serve --show movies

(the python file is located in the movies subdirectory) in git bash, I can view the app locally on port 5006.

But what I really want is to deploy the app to the internet. I’m trying to use heroku to do this. This is a non-flask, non-django app.

For the procfile, I have

web: bokeh serve --port=$PORT --host=movies-rohan.herokuapp.com --host=* --address=0.0.0.0 --use-xheaders movies.py

Two questions about this:

  1. Should I specify the port number, or leave it as $PORT?
  1. Should I use “–allow-websocket-origin=” instead of “–host”? Does it make a difference?

Then there’s the requirements.txt file. As I understand, this lists the dependencies for the app. But I don’t know how to format this. Can anyone, please, provide a template for a requirements.txt file? As a sample requirements.txt, does this seem reasonable:

[[source]]

url = “https://pypi.python.org/simple

verify_ssl = true

[packages]

bokeh = “*”

[requires]

python_version = “3.6”

Besides the python file, the procfile, and requirements.txt, is anything else necessary? What about a pipfile or pipfile.lock? My understanding is that a pipfile is an alternative to requirements.txt.

Thank you!

Hi,

If you use it, —-allow-websocket-origin=* probably needs quotes, i.e. —-allow-websocket-origin="*" to avoid the shell expanding the "*' right there in the command line. But setting this argument to "*" is not advised because it opens potential security risks.

Your use-xheaders is missing --, it should be --use-xheaders

Thanks,

Bryan

···

On Oct 9, 2017, at 18:51, Rohan Kadakia <[email protected]> wrote:

1) I'm guessing I should be listing additional dependences under [packages] in my pipfile. I'm just not sure what to list.

2) This same deployment issue is discussed at https://github.com/bokeh/bokeh/issues/2191. But I still can't figure it out!

Looking at my heroku logs, I see:

2017-10-09T23:45:42.153241+00:00 heroku[web.1]: Starting process with command `bokeh serve --log-level=debug --port=12736 -—allow-websocket-origin:12736=movies-rohan.herokuapp.com —-allow-websocket-origin=* use-xheaders /Users/kadakia/bokeh/examples/app/movies/main.py`

2017-10-09T23:45:48.951031+00:00 heroku[web.1]: Process exited with status 2

2017-10-09T23:45:48.725586+00:00 app[web.1]: usage: /app/.heroku/python/bin/bokeh [-h] [-v]

2017-10-09T23:45:48.725615+00:00 app[web.1]: {html,info,json,png,sampledata,secret,serve,static,svg}

2017-10-09T23:45:48.725616+00:00 app[web.1]: ...

2017-10-09T23:45:48.725819+00:00 app[web.1]: /app/.heroku/python/bin/bokeh: error: unrecognized arguments: -—allow-websocket-origin:12736=movies-rohan.herokuapp.com

2017-10-09T23:45:48.984139+00:00 heroku[web.1]: State changed from starting to crashed

Thanks in advance for all your help!

On Monday, October 9, 2017 at 7:11:58 PM UTC-4, Rohan Kadakia wrote:
I'm trying to do the same thing as in https://stackoverflow.com/questions/38417200/serving-interactive-bokeh-figure-on-heroku/38447618#38447618. But even after reading the answer, I can't figure it out.

I've cloned the bokeh git repository and downloaded the data. Then, by executing the command

    bokeh serve --show movies

(the python file is located in the movies subdirectory) in git bash, I can view the app locally on port 5006.

But what I really want is to deploy the app to the internet. I'm trying to use heroku to do this. This is a non-flask, non-django app.

For the procfile, I have

    web: bokeh serve --port=$PORT --host=movies-rohan.herokuapp.com --host=* --address=0.0.0.0 --use-xheaders movies.py

Two questions about this:

1) Should I specify the port number, or leave it as $PORT?

2) Should I use "--allow-websocket-origin=" instead of "--host"? Does it make a difference?

Then there's the requirements.txt file. As I understand, this lists the dependencies for the app. But I don't know how to format this. Can anyone, please, provide a template for a requirements.txt file? As a sample requirements.txt, does this seem reasonable:

    [[source]]
    url = "https://pypi.python.org/simple"
    verify_ssl = true

    [packages]
    bokeh = "*"

    [requires]
    python_version = "3.6"

Besides the python file, the procfile, and requirements.txt, is anything else necessary? What about a pipfile or pipfile.lock? My understanding is that a pipfile is an alternative to requirements.txt.

Thank you!

--
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/126fb1a6-1397-4c32-bcef-bf1660086c65%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Also to be honest the other error messages are confusing, but I have no explanation. The usage statement is only for when you give an invalid command, i.e.

❯ bokeh junk
usage: /Users/bryan/anaconda/bin/bokeh [-h] [-v]
                                       {html,info,json,png,sampledata,secret,serve,static,svg}
                                       ...
/Users/bryan/anaconda/bin/bokeh: error: invalid choice: 'junk' (choose from 'html', 'info', 'json', 'png', 'sampledata', 'secret', 'serve', 'static', 'svg')

but "serve" is a valid command. So I don't know what weirdness is going on on Heroku.

Bryan

···

On Oct 9, 2017, at 19:12, Bryan Van de ven <[email protected]> wrote:

Hi,

If you use it, —-allow-websocket-origin=* probably needs quotes, i.e. —-allow-websocket-origin="*" to avoid the shell expanding the "*' right there in the command line. But setting this argument to "*" is not advised because it opens potential security risks.

Your use-xheaders is missing --, it should be --use-xheaders

Thanks,

Bryan

On Oct 9, 2017, at 18:51, Rohan Kadakia <[email protected]> wrote:

1) I'm guessing I should be listing additional dependences under [packages] in my pipfile. I'm just not sure what to list.

2) This same deployment issue is discussed at https://github.com/bokeh/bokeh/issues/2191. But I still can't figure it out!

Looking at my heroku logs, I see:

2017-10-09T23:45:42.153241+00:00 heroku[web.1]: Starting process with command `bokeh serve --log-level=debug --port=12736 -—allow-websocket-origin:12736=movies-rohan.herokuapp.com —-allow-websocket-origin=* use-xheaders /Users/kadakia/bokeh/examples/app/movies/main.py`

2017-10-09T23:45:48.951031+00:00 heroku[web.1]: Process exited with status 2

2017-10-09T23:45:48.725586+00:00 app[web.1]: usage: /app/.heroku/python/bin/bokeh [-h] [-v]

2017-10-09T23:45:48.725615+00:00 app[web.1]: {html,info,json,png,sampledata,secret,serve,static,svg}

2017-10-09T23:45:48.725616+00:00 app[web.1]: ...

2017-10-09T23:45:48.725819+00:00 app[web.1]: /app/.heroku/python/bin/bokeh: error: unrecognized arguments: -—allow-websocket-origin:12736=movies-rohan.herokuapp.com

2017-10-09T23:45:48.984139+00:00 heroku[web.1]: State changed from starting to crashed

Thanks in advance for all your help!

On Monday, October 9, 2017 at 7:11:58 PM UTC-4, Rohan Kadakia wrote:
I'm trying to do the same thing as in https://stackoverflow.com/questions/38417200/serving-interactive-bokeh-figure-on-heroku/38447618#38447618. But even after reading the answer, I can't figure it out.

I've cloned the bokeh git repository and downloaded the data. Then, by executing the command

   bokeh serve --show movies

(the python file is located in the movies subdirectory) in git bash, I can view the app locally on port 5006.

But what I really want is to deploy the app to the internet. I'm trying to use heroku to do this. This is a non-flask, non-django app.

For the procfile, I have

   web: bokeh serve --port=$PORT --host=movies-rohan.herokuapp.com --host=* --address=0.0.0.0 --use-xheaders movies.py

Two questions about this:

1) Should I specify the port number, or leave it as $PORT?

2) Should I use "--allow-websocket-origin=" instead of "--host"? Does it make a difference?

Then there's the requirements.txt file. As I understand, this lists the dependencies for the app. But I don't know how to format this. Can anyone, please, provide a template for a requirements.txt file? As a sample requirements.txt, does this seem reasonable:

   [[source]]
   url = "https://pypi.python.org/simple"
   verify_ssl = true

   [packages]
   bokeh = "*"

   [requires]
   python_version = "3.6"

Besides the python file, the procfile, and requirements.txt, is anything else necessary? What about a pipfile or pipfile.lock? My understanding is that a pipfile is an alternative to requirements.txt.

Thank you!

--
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/126fb1a6-1397-4c32-bcef-bf1660086c65%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.