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,
Best Answer
-
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:
Hope it helps,
Alex
Answers
-
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
-
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.
-
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 }
-
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?
-
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.