Commit graph

10 commits

Author SHA1 Message Date
1ambda
f35d5de7d6 [ZEPPELIN-2069] Helium Package Configuration
### What is this PR for?

Supporting helium package configurations. I attached screenshots.

#### Implementation details.

In case of spell, spell developer can create config spec in their `package.json` and it will be part of `helium.json` which is consumed by Zeppelin.

```
  "config": {
    "repeat": {
      "type": "number",
      "description": "How many times to repeat",
      "defaultValue": 1
    }
  },
```

1. Persists conf per `package namepackage version` since each version can require different configs even if they are the same package.
2. Saves key-value config only. Since config spec (e.g `type`, `desc`, `defaultValue`) can be provided. So it's not efficient save both of them.
3. Extracts config related functions to `helium.service.js` since it can be used not only in `helium.controller.js` for view but also should be used in `paragraph.controller.js`, `result.controller.js` for executing spell.

### What type of PR is it?
[Feature]

### Todos
* [x] - create config view in `/helium`
* [x] - persist config per `packageversion`
* [x] - pass config to spell

### What is the Jira issue?

[ZEPPELIN-2069](https://issues.apache.org/jira/browse/ZEPPELIN-2069)

### How should this be tested?

- Build with examples `mvn clean package -Phelium-dev -Pexamples -DskipTests;`
- Open `/helium` page
- Update the `echo-spell` config
- Execute the spell like the screenshot below. (you don't need to refresh the page, since executing spell will fetch config from server)

### Screenshots (if appropriate)

![config](https://cloud.githubusercontent.com/assets/4968473/22678867/a66db8ae-ed40-11e6-910b-f81e50a62ba4.gif)

### Questions:
* Does the licenses files need update? - NO
* Is there breaking changes for older versions? - NO
* Does this needs documentation? - NO

Author: 1ambda <1amb4a@gmail.com>

Closes #1982 from 1ambda/ZEPPELIN-2069/helium-package-configuration and squashes the following commits:

dbc4f10 [1ambda] fix: Add getAllPackageInfoWithoutRefresh
ce5f8c0 [1ambda] fix: Remove version 'local'
696f7f8 [1ambda] fix: DON'T serialize version field in HeliumPackage
e599ab9 [1ambda] feat: Close spell config panel after saving
c9b0145 [1ambda] feat: Make spell execution transactional
d9e87a8 [1ambda] refactor: Create API call for config
453016b [1ambda] fix: configExists
e6d5181 [1ambda] fix: Lint error
33a2bd8 [1ambda] refactor: HeliumService
f31bf3c [1ambda] feat: Add disabled class to cfg button while fetching
76d50ca [1ambda] fix: Use artifact as key of config
729c5ba [1ambda] fix: Remove digest from para ctrl
4d3c2c7 [1ambda] feat: Add config to framework, examples
70ebe29 [1ambda] feat: Pass confs to spell interpret()
115191e [1ambda] refactor: Extact spell related code to helium
3aa6c54 [1ambda] feat: Support helium conf in frontend
dea2929 [1ambda] chore: Add conf to example spells
6910e97 [1ambda] feat: Support config for helium pkg in backend
0a0c565 [1ambda] feat: Support config, version field for helium pkg
2017-03-02 13:06:54 +09:00
1ambda
0589e27e7b [ZEPPELIN-2008] Introduce Spell
### What is this PR for?

Implemented **Spell** as one of Helium categories. *Technically, it's the frontend interpreter* runs on browser not backend.

Spell can provide many benefits.

1. Anyone can install, remove easily using helium package registry by #1936
2. Implementing spell is extremely easier rather than adding backend interpreter
3. Can use existing javsacript libraries. (e.g [flowchart.js](http://flowchart.js.org/), [sequence diagram js](https://github.com/bramp/js-sequence-diagrams), ...). This enable us to add many visualization tools. Imagine that you can implement some custom interpreters with few lines of code like [flowchart-spell-example](https://github.com/apache/zeppelin/compare/master...1ambda:ZEPPELIN-2008/introduce-spell?expand=1#diff-364845b20d68e4d94688e44fef03da98)
4. The most important thing is, spell is not only interpreter but also display system. Because it runs on browser. So we can use spell display system with another spell **Display System with Spell** (see the screenshot section below)

 **In future**, we will be able to combine existing backend interpreters with spell like (**not supported in this PR cause we need to modify backend code a lot**)

```
// if we have markdown spell, we can use `%markdown` display in the spark interpreter

%spark

val calculated = doSomething()
println(s"%markdown _${calculated})
```

I added some examples. Checkout `echo`, `markdown`, `translator`, `flowchart` spells.

### What type of PR is it?
[Feature]

### Todos
* [x] - Add `SPELL` as one of Helium categories.
* [x] - Implement framework code (`zeppelin-spell`)
* [x] - Make some examples (flowchart, google translator, markdown, echo)
* [x] - Support custom display system
* [x] - Fix some bugs in `HeliumBundleFactory`
* [x] - Save spell rendering result into `note.json` while broadcasting to other websocket clients
* [x] - Fix `renderText` for stream output

### What is the Jira issue?

[ZEPPELIN-2008](https://issues.apache.org/jira/browse/ZEPPELIN-2008)

### How should this be tested?

- Build `mvn clean package -Phelium-dev -Pexamples -DskipTests;`
- Go to helium page `http://localhost:8080/#/helium`
- Enable all spells
- Go to a notebook and refresh
- Follow actions in the screenshots below.

### Screenshots (if appropriate)

#### Flowchart Spell (Sample)

![flowchart-spell](https://cloud.githubusercontent.com/assets/4968473/22275041/305f0eb8-e2ed-11e6-846a-9f1263ae46bc.gif)

#### Google Translator Spell (Sample)

![translator-spell](https://cloud.githubusercontent.com/assets/4968473/22280993/9820c238-e317-11e6-90f4-0e483312a09a.gif)

#### Display System with Spell

![display-spell](https://cloud.githubusercontent.com/assets/4968473/22275044/33694b78-e2ed-11e6-9ef0-188f4038381f.gif)

### Questions:
* Does the licenses files need update - NO
* Is there breaking changes for older versions? - NO
* Does this needs documentation? - YES, but framework can be enhanced so i would like to defer to write document right now.

Author: 1ambda <1amb4a@gmail.com>

Closes #1940 from 1ambda/ZEPPELIN-2008/introduce-spell and squashes the following commits:

c1b5356 [1ambda] fix: RAT issues
e07ecd3 [1ambda] fix: Set width for spell usage
6c91892 [1ambda] feat: Display magic, usage for spell
5be2890 [1ambda] feat: Support spell info
822a1d8 [1ambda] style: Remove useless func wrap for helium
35d0fcc [1ambda] fix: Update desc for spell examples
49e03fc [1ambda] fix: List visualziation bundles only in order
4029c02 [1ambda] fix: ParagraphIT, parameterizedQueryForm
08eba10 [1ambda] refactor: renderGraph in result.controller.js
69ce880 [1ambda] fix: Resolve append (stream) output
0f2d8b6 [1ambda] fix: Resolve output issue
fc4389e [1ambda] fix: Resolve RAT issues
c8c8f0e [1ambda] fix: Add setErrorMessage method to Job
4fec44c [1ambda] refactor: NotebookServer.java
1227d7d [1ambda] refactor: result controller retry
9fb7438 [1ambda] feat: Save spell result and propagate
3cdf2da [1ambda] fix: NPM installation error
72aadbf [1ambda] feat: Enhance translator spell
bd2b3ef [1ambda] style: Rename generator -> data
cac0667 [1ambda] style: Rename to Spell
e81cb03 [1ambda] example: Add echo, markdown
0fa7eda [1ambda] feat: Support custom display
c906da6 [1ambda] feat: Update examples to use single FrontIntpRes
5c49e6e [1ambda] feat: Automated display type checking in result
5810bf1 [1ambda] feat: Apply frontend interpreter to paragraph
a163044 [1ambda] feat: Add flowchart, translator examples
247d00f [1ambda] feat: Add frontend interpreter framework
e925967 [1ambda] feat: Support FRONTEND_INTERPRETER type in frontend
c02d00a [1ambda] feat: Support FRONTEND_INTERPRETER type in backend
2017-02-02 08:33:48 +09:00
Mina Lee
61aeeaf10f Bump up version to 0.8.0-SNAPSHOT
### What is this PR for?
Bump up version to 0.8.0-SNAPSHOT

Author: Mina Lee <minalee@apache.org>

Closes #1883 from minahlee/0.8.0-SNAPSHOT and squashes the following commits:

b28ebe8 [Mina Lee] Bump up table/visualization plugin package version
fcaaa46 [Mina Lee] Bump up helium-dev version
180d2c6 [Mina Lee] Bump up version to 0.8.0-SNAPSHOT
2017-01-19 02:04:24 +09:00
Lee moon soo
300f753234 [ZEPPELIN-1619] Load js package as a plugin visualization
### What is this PR for?
Current helium plugin application api (experimental) requires create library in java class, and need to create both backend / frontend code in the package. Which is good if your plugin requires both frontend and backend code running.

However, when user just want to make new visualization which completely runs on front-end side in javascript, creating helium application in java project and taking care of backend code can be bit of overhead and barrier for javascript developers.

This PR adds capability to load pure javascript package as a visualization.

### how it works

1. create (copy, download) 'helium package json' file into `ZEPPELIN_HOME/helium` directory.
  The json file point visualization js package in npm repository or local file system in `artifact` field.
  `type` field in the json file need to be `VISUALIZATION`

Here's an example (zeppelin-examples/zeppelin-example-horizontalbar/zeppelin-example-horizontalbar.json)
```
{
  "type" : "VISUALIZATION",
  "name" : "zeppelin_horizontalbar",
  "description" : "Horizontal Bar chart (example)",
  "artifact" : "./zeppelin-examples/zeppelin-example-horizontalbar",
  "icon" : "<i class='fa fa-bar-chart rotate90flipX'></i>"
}
```

2. Go to helium GUI menu. (e.g. http://localhost:8080/#/helium).
  The menu will list all available packages.
<img width="796" alt="writing_visualization_helium_menu" src="https://cloud.githubusercontent.com/assets/1540981/21749660/0f401c10-d558-11e6-9961-b6d0a9c023d8.png">

3. click 'enable' in any package want to use.
Once a visualization package is enabled, `HeliumVisualizationFactory` will collect all enabled visualizations and create js bundle on the fly.

4. js bundle will be loaded on notebook and additional visualization becomes available
![image](https://cloud.githubusercontent.com/assets/1540981/21749729/709b2b3e-d559-11e6-8318-7f2871e7c39a.png)

### Programming API to create new plugin visualization.

Simply extends [visualization.js](https://github.com/apache/zeppelin/blob/master/zeppelin-web/src/app/visualization/visualization.js) and overrides some methods, such as

```
  /**
   * get transformation
   */
  getTransformation() {
    // override this
  };

  /**
   * Method will be invoked when data or configuration changed
   */
  render(tableData) {
    // override this
  };

  /**
   * Refresh visualization.
   */
  refresh() {
    // override this
  };

  /**
   * method will be invoked when visualization need to be destroyed.
   * Don't need to destroy this.targetEl.
   */
  destroy() {
    // override this
  };

  /**
   * return {
   *   template : angular template string or url (url should end with .html),
   *   scope : an object to bind to template scope
   * }
   */
  getSetting() {
    // override this
  };
```

This is exactly the same api that built-in visualization uses.

an example implementation included `zeppelin-examples/zeppelin-example-horizontalbar/horizontalbar.js`.
Actually [all built-in visualizations](https://github.com/apache/zeppelin/tree/master/zeppelin-web/src/app/visualization/builtins) are example

### Packaging and publishing visualization

Each visualization will need `package.json` file (e.g. `zeppelin-examples/zeppelin-example-horizontalbar/package.json`) to be packaged.
Package can be published in npm repository or package can be deployed to the local filesystem.

`zeppelin-examples/zeppelin-example-horizontalbar/` is an example package that is deployed in the local filesystem

### Development mode

First, locally install and enable your development package by setting `artifact` field to the development directory.
Then run zeppelin-web in visualization development mode with following command
```
cd zeppelin-web
npm run visdev
```
When you have change in your local development package, just reload your notebook. Then Zeppelin will automatically rebuild / reload the package.

Any feedback would be appreciated!

### What type of PR is it?
Feature

### Todos
* [x] - Load plugin visualization js package on runtime
* [x] - Make the feature works in zeppelin Binary package
* [x] - Show loading indicator while 'enable' / 'disable' package
* [x] - Add document
* [x] - Add license of new dependency
* [x] - Development mode
* [x] - Propagate error to front-end
* [x] - Display multiple versions of a package.

### What is the Jira issue?
https://issues.apache.org/jira/browse/ZEPPELIN-1619

### How should this be tested?
Build Zeppelin with `-Pexamples` flag. That'll install example visualization package `horizontalbar`.
You'll able to select `horizontalbar` along with other built-in visualizations
![image](https://cloud.githubusercontent.com/assets/1540981/21655057/27d61740-d26d-11e6-88f2-02c653e102c6.png)

To test npm online package install capability,  Place [zeppelin-bubble.json](https://github.com/Leemoonsoo/zeppelin-bubble/blob/master/zeppelin-bubble.json) in hour local registry (`ZEPPELIN_HOME/helium`) and enable it in Helium gui menu.
And then zeppelin will download package from npm repository and load.
![bubblechart](https://cloud.githubusercontent.com/assets/1540981/21749717/280aa430-d559-11e6-9209-889a4f86d7e2.gif)

### Questions:
* Does the licenses files need update? yes
* Is there breaking changes for older versions? no
* Does this needs documentation? yes

Author: Lee moon soo <moon@apache.org>

Closes #1842 from Leemoonsoo/ZEPPELIN-1619-rebased and squashes the following commits:

7c49bbb [Lee moon soo] Let Zeppelin continue to bootstrap on offline
816bdec [Lee moon soo] Display license of package when enabling
28fb37d [Lee moon soo] beautifulize helium menu
295768e [Lee moon soo] fix drag and drop visualization reorder
bb304db [Lee moon soo] Sort version in decreasing order
e7f18f1 [Lee moon soo] fix english in docs and labels
c7b187f [Lee moon soo] Merge branch 'master' into ZEPPELIN-1619-rebased
4c87983 [Lee moon soo] Merge remote-tracking branch 'apache-github/master' into ZEPPELIN-1619-rebased
ecd925b [Lee moon soo] Merge remote-tracking branch 'apache-github/master' into ZEPPELIN-1619-rebased
a92cadd [Lee moon soo] Use minifiable syntax
cec534c [Lee moon soo] Reduce log message
f373f1d [Lee moon soo] Ignore removed package
e18d9a4 [Lee moon soo] Ability to customize order of visualization package display
cd74396 [Lee moon soo] Add rest api doc
9de5d6d [Lee moon soo] exclude .npmignore and package.json from zeppelin-web rat check
08abded [Lee moon soo] exclude package.json from rat check
661c26b [Lee moon soo] update screenshot and keep experimental tag only in docs
4515805 [Lee moon soo] Display multiple versions of a package
408c512 [Lee moon soo] Make unittest test bundling with proper vis package on npm registry
fb7a147 [Lee moon soo] display svg icon
47de6d9 [Lee moon soo] Propagate bundle error to the front-end
0fe5e00 [Lee moon soo] visualization development mode
022e8f6 [Lee moon soo] exclude zeppelin-examples/zeppelin-example-horizontalbar/package.json file from rat check
2ef3b69 [Lee moon soo] Add new dependency license
f943d33 [Lee moon soo] Add doc
f494dbd [Lee moon soo] package npm dependency module in binary package
b655fa6 [Lee moon soo] use any version of dependency in example. so zeppelin version bumpup doesn't need to take care of them
2aec52d [Lee moon soo] show loading indicator while enable/disable package
6c380f6 [Lee moon soo] refactor code to fix HeliumTest
e142336 [Lee moon soo] update unittest
7d5e0ae [Lee moon soo] Resolve dependency conflict
c50a524 [Lee moon soo] Add conf/helium.json in .gitignore
1c7b73a [Lee moon soo] add result.css
d2823ad [Lee moon soo] load visualization and tabledata module from source instead npm if accessible
4e1b061 [Lee moon soo] Convert horizontalbar to VISUALIZATION example
a5a935b [Lee moon soo] connect visualization factory with restapi
4b21252 [Lee moon soo] initial implementation of helium menu
0c4da2e [Lee moon soo] pass bundled visualization to result.controller.js
f5ce99e [Lee moon soo] import helium service js
1663582 [Lee moon soo] initial implementation of helium menu
74d52d4 [Lee moon soo] bundle visualization package from npm repository on the fly
2017-01-14 10:27:17 -08:00
Jongyoul Lee
e32ccf35d7 ZEPPELIN-1862 Move packages related Helium into a new module named helium-dev
### What is this PR for?
Reducing zeppelin-interpreter by moving helium files into a new module

### What type of PR is it?
[Improvement]

### Todos
* [x] - Move files into a new module

### What is the Jira issue?
* https://issues.apache.org/jira/browse/ZEPPELIN-1862

### How should this be tested?
If you develop a new helium application, you have to depend helium-dev into your package

### Screenshots (if appropriate)
N/A

### Questions:
* Does the licenses files need update? N/A
* Is there breaking changes for older versions? N/A, AFAIK, there's no helium application for now
* Does this needs documentation? Yes, I'll make a new PR for handling it

Author: Jongyoul Lee <jongyoul@gmail.com>

Closes #1871 from jongyoul/ZEPPELIN-1862 and squashes the following commits:

fa3d086 [Jongyoul Lee] Fixed travis Added ASF license
14aebd1 [Jongyoul Lee] Fixed to set DevInterpreter into interpreter variable
61d9971 [Jongyoul Lee] Fixed classpath into new packages
28cf7a6 [Jongyoul Lee] Removed DevInterpreter from zeppelin-zengine
08d7c4e [Jongyoul Lee] Made new package for helium-dev Moved some classes
2017-01-11 15:26:48 +09:00
1ambda
ad3586450a [ZEPPELIN-1695] Centralize libs, plugin versions in all pom.xml
### What is this PR for?

**First of all, this PR doesn't affect on runtime application behaivor and existing build processes. Just abstracting variables in pom.xml**

The main goal of this PR is bringing consistency and maintainability in all pom.xml.  I referred these 2 projects.

- [apache/spark: pom.xml](https://github.com/apache/spark/blob/master/pom.xml)
- [apache/storm: pom.xml](https://github.com/apache/storm/blob/master/pom.xml)

Currently, all libraries and plugins have duplicated version fields since we are not using `dependencyManagement`, `pluginManagement` efficiently in pom.xml

This results in

- unmanaged plugin, library versions (someone might update only a child's library version. it happend in our pom.xml files)
- so many duplicated code blocks (bad)
- fragmented plugin, library versions (some project uses junit 4.11 while another uses 4.12)

These are some examples

```xml
// hard coded, non consistent version management

      <dependency>
        <groupId>org.apache.thrift</groupId>
        <artifactId>libthrift</artifactId>
        <version>${libthrift.version}</version>
      </dependency>

      <dependency>
        <groupId>org.apache.httpcomponents</groupId>
        <artifactId>httpcore</artifactId>
        <version>4.3.3</version>
      </dependency>
```

```xml
// a/pom.xml
              <plugin>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>1.3.1</version>

              <plugin>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>2.8</version>

// b/pom.xml
              <plugin>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>1.3.1</version>

              <plugin>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>2.8</version>

// c/pom.xml
              <plugin>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>1.3.1</version>

              <plugin>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>2.8</version>
```

### What type of PR is it?

[Refactoring]

### Todos

- [x] refactor all pom.xml

### What is the Jira issue?

[ZEPPELIN-1695](https://issues.apache.org/jira/browse/ZEPPELIN-1695)

### How should this be tested?

Since this PR doesn't affect runtime behavior at all, CI test would be enough.

### Questions:
* Does the licenses files need update - NO
* Is there breaking changes for older versions - NO
* Does this needs documentation - NO

Author: 1ambda <1amb4a@gmail.com>

Closes #1668 from 1ambda/chore/centralize-maven-pom-versions and squashes the following commits:

5a9c966 [1ambda] fix: Use shared download plugin version
7ef8a7b [1ambda] fix: Clean zeppelin-zengine/pom.xml
dee3723 [1ambda] fix: Clean zeppelin-web/pom.xml
4f8ecc9 [1ambda] fix: Clean zeppelin-server/pom.xml
b9f3a78 [1ambda] fix: Clean interpreter/pom.xml
c0d6ff2 [1ambda] fix: Clean distribution/pom.xml
acf59fa [1ambda] fix: Clean zeppelin-display/pom.xml
9301585 [1ambda] fix: Clean spark-dependencies/pom.xml
893bffa [1ambda] fix: Clean spark/pom.xml
ff91207 [1ambda] fix: Clean shell/pom.xml
5b37857 [1ambda] fix: Clean scio/pom.xml
c0dbe9b [1ambda] fix: Clean scalding/pom.xml
e6c661b [1ambda] fix: Clean r/pom.xml
e80388e [1ambda] fix: Clean postgres/pom.xml
cc61c68 [1ambda] fix: Clean pig/pom.xml
1fe71f9 [1ambda] fix: Clean markdown/pom.xml
96a9f07 [1ambda] fix: Clean livy/pom.xml
4cc4e37 [1ambda] fix: Clean lens/pom.xml
6d834bc [1ambda] fix: Clean kylin/pom.xml
b14bb3f [1ambda] fix: Clean jdbc/pom.xml
8b3a3ed [1ambda] fix: Clean ignite/pom.xml
1b3fdbb [1ambda] fix: Clean hbase/pom.xml
faad4be [1ambda] fix: Clean geode/pom.xml
c9e42e7 [1ambda] fix: Clean flink/pom.xml
647249d [1ambda] fix: Clean file/pom.xml
be0a4e7 [1ambda] fix: Clean elasticsearch/pom.xml
f80c172 [1ambda] fix: Clean cassandra/pom.xml
1b9c8c1 [1ambda] fix: Clean bigquery/pom.xml
b6749a6 [1ambda] fix: library versions in beam/pom.xml
fd01b3a [1ambda] fix: Remove plugin versions in beam/pom.xml
ec75b40 [1ambda] fix: Clean angular/pom.xml
c61b56e [1ambda] fix: Clean alluxio/pom.xml
28d10a7 [1ambda] fix: Clean root pom.xml
2016-12-01 14:56:50 +09:00
Luciano Resende
f9bc7a9fcc [ZEPPELIN-1409] Refactor RAT build on Travis.CI configuration
### What is this PR for?
Create a specific build for checking license compliance with RAT
and avoid running these checks on every build that compose the
PR build.
As for normal development builds, this follows  the same pattern
used for maven tests, RAT is enabled to run by default, but now
there is support disabling it with -DskipRat.
Travis CI will run RAT once, on the RAT build, and disable RAT
checks on all other build profiles.

### What type of PR is it?
[Enhancement]

### What is the Jira issue?
* [ZEPPELIN-1409](https://issues.apache.org/jira/browse/ZEPPELIN-1409)

Author: Luciano Resende <lresende@apache.org>

Closes #1401 from lresende/build and squashes the following commits:

f755979 [Luciano Resende] [[ZEPPELIN-1409]] Add support for skipping RAT check with -DskipRat
0189991 [Luciano Resende] [ZEPPELIN-1409] Refactor RAT build on Travis.CI configuration
2016-09-06 17:12:37 +09:00
Mina Lee
04da56403b [MINOR] Change url in pom.xml files
### What is this PR for?
Set project url to `http://zeppelin.apache.org` in pom.xml files

### What type of PR is it?
Refactoring

### Questions:
* Does the licenses files need update? no
* Is there breaking changes for older versions? no
* Does this needs documentation? no

Author: Mina Lee <minalee@apache.org>

Closes #1221 from minahlee/pom_url and squashes the following commits:

10de8cb [Mina Lee] Remove child url
ef0ef04 [Mina Lee] Change main class package name
ead4064 [Mina Lee] Use consistent url in pom.xml
2016-07-31 16:41:56 +09:00
Mina Lee
e0f77d68e8 Bump up version to 0.7.0-SNAPSHOT
### What is this PR for?
Bump up version to 0.7.0-SNAPSHOT

Author: Mina Lee <minalee@apache.org>

Closes #1016 from minahlee/0.7.0-SNAPSHOT and squashes the following commits:

541e1b3 [Mina Lee] Bump up zeppelin-examples version to 0.7.0-SNAPSHOT
ea8c0ad [Mina Lee] Bump up version to 0.7.0-SNAPSHOT
2016-07-06 04:45:48 +09:00
Lee moon soo
9463fb8547 [ZEPPELIN-732] Helium Application
### What is this PR for?
This PR implements pluggable Application Framework.

Here's summary of the change.

**Applicaiton**

Base class of user application. User application should extends `org.apache.zeppelin.helium.Application`.

It looks like

```java
public abstract class Application {

  /**
   * When application loaded
   * params context Application context
   */
  public Application(ApplicationContext context) {
    this.context = context;
  }

  /**
   * This method can be invoked multiple times before unload(),
   * Invoked just after application loaded or when paragraph output is updated
   * param args Required resources from paragraph
   */
  public abstract void run(ResourceSet args)
      throws ApplicationException, IOException;

  /**
   * this method is invoked just before application is removed
   */
  public abstract void unload() throws ApplicationException;
}
```

**HeliumPackage**

`org.apache.zeppelin.helium.HeliumPackage` keeps information of application package.
Package informations includes

```
{
  type : "APPLICATION",                            // type of this package
  name : "zeppelin.app",                           // application name. [organizationName].[appName] format
  description : "App description",                 // description
  artifact : "groupId:artifactId:version",         // artifact name for maven repository
  className : "org.apache.zeppelin.helium.MyApp",  // application class that extends org.apache.zeppelin.helium.Application
  resources : [[]],                                // required resource
  icon : '<i class="fa fa-clock-o"></i>'           // icon
}
```

`resources` field defines what kind of data this application requires, from ResourcePool.
"resourceName" and ":className" works in the array.
inner array combines each resourceName, :className with 'AND'
outer array combines inner array with 'OR'.

For example,

```
resources : [
    [ "name1", ":java.util.Date"],
    [ "name1", "name2"]
]
```

Then Zeppelin searches ResourcePool, first for resource name "name1" and resource type "java.util.Date" from resourcePool then resource name "name1" and "name2".

Once resources are found, they'll be passed to `Application.run()` method

**Package Registry**

`org.apache.zeppelin.helium.HeliumRegistry` provides list of available HeliumPackages.
Currently `HeliumLocalRegistry` is implemented and it provides list by reading HeliumPackage json files under ./helium directory in the file system. Later there will be some class like `HeliumOnlineRegistry'  which reads available package from a community managed online central registry.

**Development mode**
`org.apache.zeppelin.interpreter.dev.*` package is provided for development support.
Developer can run their app inside of their IDE, that connects to running Zeppelin instance and display output.

**Application Suggestion**
Once paragraph becomes FINISHED status after run, Zeppelin searches resources from ResourcesPool that belongs to current paragraph. And compare all HeliumPackage if these resources satisfies their requirements ('resources' field). If there're available app, Helium button will be displayed.

![image](https://cloud.githubusercontent.com/assets/1540981/14518452/d8f85d5a-020f-11e6-8313-00b37eb4f077.png)

User can see and select available application for this paragraph.
![image](https://cloud.githubusercontent.com/assets/1540981/14518465/ee607fce-020f-11e6-8ad4-fe98723c7c94.png)

**Application selection**
After application is loaded, application icon will be displayed. So user can select and switch between apps.

![image](https://cloud.githubusercontent.com/assets/1540981/14518547/6f3fd766-0210-11e6-9a08-0dc2ba6d15e3.png)

if built-in visualization is available, application icon will be displayed next to built-in visualizations
![image](https://cloud.githubusercontent.com/assets/1540981/14518500/27505746-0210-11e6-9738-fb514376b906.png)

**Experimental**

While this is new feature and API and specification may change, i'd suggest mark this feature as a experimental for a while.

### What type of PR is it?
Feature

### Todos
* [x] - Helium Application framework
* [x] - App launcher
* [x] - App display and selectors
* [x] - Package registry
* [x] - Development mode
* [x] - Make CI green
* [x] - Improve comment in source codes
* [x] - Documentation
* [x] - Examples
* [x] - Mark experimental
* [ ] - Review

### What is the Jira issue?
https://issues.apache.org/jira/browse/ZEPPELIN-732

### How should this be tested?
Will be updated with examples

### Screenshots (if appropriate)
![helium](https://cloud.githubusercontent.com/assets/1540981/14518685/49c2a788-0211-11e6-81c8-6cae48bf8a48.gif)

### Questions:
* Does the licenses files need update? no
* Is there breaking changes for older versions? no
* Does this needs documentation? yes

Author: Lee moon soo <moon@apache.org>

Closes #836 from Leemoonsoo/ZEPPELIN-732-up and squashes the following commits:

3577777 [Lee moon soo] Address Ahyoung's comment
0665380 [Lee moon soo] Merge branch 'master' into ZEPPELIN-732-up
83b529c [Lee moon soo] Update unittest
e1b0e79 [Lee moon soo] Update unittest
6785441 [Lee moon soo] interpreter order changed
3249ddb [Lee moon soo] Remove incubating
4030fff [Lee moon soo] Merge branch 'master' into ZEPPELIN-732-up
4e98cfe [Lee moon soo] Update DependencyResolver
c714a19 [Lee moon soo] Merge branch 'master' into ZEPPELIN-732-up
d558591 [Lee moon soo] Merge branch 'master' into ZEPPELIN-732-up
0467077 [Lee moon soo] update test
d43ab57 [Lee moon soo] Merge branch 'master' into ZEPPELIN-732-up
f999f71 [Lee moon soo] Update getParagraphXpath
eaa68c6 [Lee moon soo] print processes
5b5f6c8 [Lee moon soo] trigger ci
1bdea70 [Lee moon soo] Print error message in the test
562f083 [Lee moon soo] CLose interpreter after test
385dab3 [Lee moon soo] Fix xpath in the SparkParagraphIt test
ac963ff [Lee moon soo] Remove unnecessary stacktrace and provide more meaningful message
644add4 [Lee moon soo] Takecare csv/tsv download button position after merge
6a5a19e [Lee moon soo] Merge branch 'master' into ZEPPELIN-732-up
5bef173 [Lee moon soo] Update NoteTest
e54d633 [Lee moon soo] Merge branch 'master' into ZEPPELIN-732-up
88dbc71 [Lee moon soo] change style
6f1343f [Lee moon soo] add license header
4571781 [Lee moon soo] double quote the keys in json
710487b [Lee moon soo] fix syntax error
6c5019e [Lee moon soo] Merge branch 'master' into ZEPPELIN-732-up
3619afd [Lee moon soo] Exclude test data file from rat check
b6811a6 [Lee moon soo] set SPARK_HOME to find bin/interpreter.sh
9110897 [Lee moon soo] arrange buttons
14efb6c [Lee moon soo] Merge branch 'master' into ZEPPELIN-732-up
76de11c [Lee moon soo] Merge branch 'master' into ZEPPELIN-732-up
bff2217 [Lee moon soo] Fix SparkParagraphIT
e60cd8e [Lee moon soo] Add docs
7f174e3 [Lee moon soo] Add more comments
0671dfd [Lee moon soo] Fix compile error
bfcdf34 [Lee moon soo] Fix style
1dc4409 [Lee moon soo] Remove incubating from example pom.xml
e36d2fb [Lee moon soo] Merge branch 'master' into ZEPPELIN-732-up
e0a2046 [Lee moon soo] Add annotation to api
93fa766 [Lee moon soo] Merge branch 'master' into ZEPPELIN-732-up
99dd0b0 [Lee moon soo] Merge branch 'master' into ZEPPELIN-732-up
e89177e [Lee moon soo] Merge branch 'master' into ZEPPELIN-732-up
f782fb0 [Lee moon soo] clean pom.xml file
b974eb1 [Lee moon soo] Add horizontal bar visualization example
5225551 [Lee moon soo] let instead of var
b068065 [Lee moon soo] Replace . to _
b6e4141 [Lee moon soo] helper for printing javascript and inject $z
8186daf [Lee moon soo] Update Application Status from RemoteInterpreterProcess event
f07ada1 [Lee moon soo] Construct classpath correctly
7451479 [Lee moon soo] Merge branch 'master' into ZEPPELIN-732-up
ab1de03 [Lee moon soo] Merge branch 'master' into ZEPPELIN-732-up
51fc113 [Lee moon soo] Include examples in CI build
83eba98 [Lee moon soo] UnloadApp on interpreter restart
3b891de [Lee moon soo] Provide resource pool for testing
0730ece [Lee moon soo] Add license into package json
620f79f [Lee moon soo] Merge branch 'master' into ZEPPELIN-732-up
01a1646 [Lee moon soo] Add example
1f1a3b5 [Lee moon soo] Fix test
864bea1 [Lee moon soo] Merge branch 'master' into ZEPPELIN-732-up
c30f53c [Lee moon soo] null check
03be3a1 [Lee moon soo] Pass required resource to run() method
fade3c1 [Lee moon soo] Handle output update in angular mode
0e4d81c [Lee moon soo] Remove unnecessary log
ec2fdea [Lee moon soo] Match classname correctly
b4ff52f [Lee moon soo] Put last value of scala repl into resource pool
f2ab95d [Lee moon soo] Prevent unnecessary output update
71f814d [Lee moon soo] Better way to find resource dir for InterpreterOutput watcher
024d7fc [Lee moon soo] Dev mode
98f3872 [Lee moon soo] Managed interpreter process and Running interpreter process
b47ca74 [Lee moon soo] Fix tests
5503f9c [Lee moon soo] Improved
be3a1fa [Lee moon soo] Add license header
412480a [Lee moon soo] Fix style
16f6887 [Lee moon soo] Angular object update for helium app
6223cd4 [Lee moon soo] App output display
bd0f467 [Lee moon soo] Style
94b490d [Lee moon soo] initial rest api impl
134bbe6 [Lee moon soo] Change HeliumRegistry constructor argument type
7aeb64a [Lee moon soo] Unload app on paragraph / note removal as well as interpreter unbind
4eaeea7 [Lee moon soo] sync -> async api
9f5c493 [Lee moon soo] Application output
b239f1b [Lee moon soo] Helium application factory
b891b98 [Lee moon soo] HeliumRegistry
568ee54 [Lee moon soo] ApplicationLoader
7424af2 [Lee moon soo] Remove resource on note / paragraph removal
2016-07-04 08:35:07 -07:00