Trouble Setting Code Env for Plugin Webapp

Options
gblack686
gblack686 Partner, Registered Posts: 62 Partner

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

  • Alex_Combessie
    Alex_Combessie Alpha Tester, Dataiker Alumni Posts: 539 ✭✭✭✭✭✭✭✭✭
    Answer ✓
    Options

    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

Answers

  • Alex_Combessie
    Alex_Combessie Alpha Tester, Dataiker Alumni Posts: 539 ✭✭✭✭✭✭✭✭✭
    Options

    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
    Clément_Stenac Dataiker, Dataiku DSS Core Designer Posts: 753 Dataiker
    Options

    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
    fchataigner2 Dataiker Posts: 355 Dataiker
    Options

    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
    gblack686 Partner, Registered Posts: 62 Partner
    Options

    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
    gblack686 Partner, Registered Posts: 62 Partner
    Options

    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.

Setup Info
    Tags
      Help me…