Trouble Setting Code Env for Plugin Webapp

Solved!
gblack686
Level 4
Trouble Setting Code Env for Plugin Webapp

I have an existing plugin, and I recently added a bokeh webapp component. However, I need the newest version of bokeh. I've tried to find help here, but keep failing to load the webapp with the newest version.  I've reloaded the plugin and regenerated the webapp to no avail.  My files are as follows:

Requirements.txt and Environment.spec both look the same

bokeh==2.0.2

 Requirements.json 

{    "python" : [
        {"name":"pandas", "version":">=0.16.2"},
        {"name":"sqlalchemy", "version":">=0.1"},
        {"name":"bokeh", "version":"==2.0.2"}       ]}

Webapp.json

    "baseType": "BOKEH", // WARNING: do not change
    "hasBackend": "true",
    "standardWebAppLibraries": null,

 

1 Solution
Alex_Combessie
Dataiker Alumni

Hi,

One the plugin code-env has added from the plugin screen, it is used automatically by all components within the plugin: recipe, webapps, etc. There is no need to "select the code-env", just add it and fill the requirements.txt and/or desc.json files:

Screenshot 2020-09-09 at 22.29.55.png

Hope it helps,

Alex

View solution in original post

6 Replies
Alex_Combessie
Dataiker Alumni

Hi,

I would not recommend adding/modifying requirements.json as this is linked to the built-in DSS python environment. Environment.spec is not necessary if you don't use conda.

Ideally, you only need to specify your required packages in the "requirements.txt" file. The desc.json is used to specify the python version and if you need base packages (including pandas).

You can use this GitHub repo as an example: https://github.com/dataiku/dss-plugin-timeseries-preparation/tree/master/code-env/python

Hope it helps,

Alex

Clรฉment_Stenac

Hi,

As a side note to Alex's answer, I want to stress that we have not yet validated whether DSS webapps work with Bokeh 2. Our previous experience with Bokeh shows that there tends to be significant variations between versions that may require specific supporting code in DSS.

fchataigner2
Dataiker

About the error(s?): bokeh 2.0.2 is not available to python2.7 environments (that's a decision of the bokeh devs), so you'd need to force the list of possible python versions in the code env of the plugin, by filling the acceptedPythonInterpreters field, like:

{
  "acceptedPythonInterpreters": ["PYTHON36"],
  "forceConda": false,
  "installCorePackages": true,
  "installJupyterSupport": false
}

 

gblack686
Level 4
Author

Still can't seem to serve with bokeh 2

2020-05-07 14:34:09,986 Starting Bokeh server version 0.12.16 (running on Tornado 5.1.1)

It works in my webapp editor which is running in a custom Bokeh2 code environment. 

Can I load this webapp plugin with this custom code environment somehow?

gblack686
Level 4
Author

Just bumping this. 

Looking to put some webapps into production, but can't find where to select the code environment from within the plugin using "Add code environment". I only see options for selecting containers. 

0 Kudos
Alex_Combessie
Dataiker Alumni

Hi,

One the plugin code-env has added from the plugin screen, it is used automatically by all components within the plugin: recipe, webapps, etc. There is no need to "select the code-env", just add it and fill the requirements.txt and/or desc.json files:

Screenshot 2020-09-09 at 22.29.55.png

Hope it helps,

Alex