alibaba / pipcook

Machine learning platform for Web developers
https://alibaba.github.io/pipcook/
Apache License 2.0
2.54k stars 206 forks source link

meta: proposals for customized UI plugin for Pipboard #40

Open rickycao-qy opened 4 years ago

rickycao-qy commented 4 years ago

As discussed with @yorkie @wordcount , we would allow users to develop user-interface plugins to extend the ability of Pipboard. This issue will discuss the specification for ui-plugin.

Built-in Pipboard

Pipcook will provide a built-in web launcher and we name it as Pipboard as discussed in #29 , Basically default Pipboard will provide access to build pipeline, check logs and models. The basic structure is shown as below:

Customized UI Plugin

Customized user-interface plugin still belongs to pipcook plugin ecosystem (refer to #17 ). Currently plugins are categorized into:

Now for UI plugin, we will add the 8th category:

After the UI plugin is used, Pipboard will incorporate its user-interface into itself. For example, if a plugin called 'customize-demo' is developed, Pipboard will be shown as below and the content area will show contents of this plugin.

UI Plugin Developer Guide

The specification for UI plugin is as follows:

In case the UI will need to do some basic operations on local file system, we will provide several basic APIs to achieve this:

How to use UI Plugin

The user can follow these steps to use a specific plugin

I will provide a example plugin later on

Please help me have a review on this proposal @yorkie @wordcount

yorkie commented 4 years ago

Now for UI plugin, we will add the 8th category:

I think the UI should be an ability for plugins.

MUST have the structure as follows:

  1. Why do we have an index.js?
  2. Rename the config.json to plugin.json?

In case the UI will need to do some basic operations on local file system, we will provide several basic APIs to achieve this:

We SHOULD point out where do we provide these HTTP APIs.

How to use UI Plugin

I think user don't need to specify the plugin parameter, pipboard is able to load automatically.

yorkie commented 4 years ago

Meeting Summary:

  1. Rename the UI plugin, it's confused with our current plugins, maybe "Pipboard Extension"?
  2. Remove the index.js, and a new way to fetch the extension name by @utkobe
  3. Yes
  4. @utkobe'll answer this in details later.
yorkie commented 4 years ago

In details, we have the following pages and functionalities to be achieved:

To make extension works exactly, the below features/injections are needed:

Then let's see what's a Pipboard extension looks like:

{
  "name": "@pipcook/pipboard-tensorboard-extension",
  "pipboard": {
    "observe": [{
      "event": "model.visualization",
      "handler": "tensorboard.js#onselect"
    }, {
      "event": "pipeline.start",
      "handler": "tensorboard.js#onpipelinestart
    }]
  }
}

And tensorboard.js:

import pipboard from '@pipboard/pipboard-extension-api';

export onselect = (enabled, pipeline) => {
  if (enabled) {
    pipboard.getPluginByType('model-define').enableTensorboard('/path/to/your/log');
  }
};

export onpipelinestart = (options, pipeline) => {
  const tensorboard = pipboard.createWindow('/path/to/your/page/url');
  tensorboard.show();
}