GitHub user Leemoonsoo opened a pull request:

    https://github.com/apache/incubator-zeppelin/pull/836

    [WIP] [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
    * [ ] - Make CI green
    * [ ] - Improve comment in source codes
    * [ ] - Documentation
    * [ ] - Examples
    * [ ] - 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


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/Leemoonsoo/incubator-zeppelin ZEPPELIN-732-up

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-zeppelin/pull/836.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #836
    
----
commit 7424af247b08afabbd9d080a288a88a7de4b7a1c
Author: Lee moon soo <m...@apache.org>
Date:   2016-03-05T06:08:19Z

    Remove resource on note / paragraph removal

commit 568ee541db31133ccd8f2d99d16ede60cb9433c1
Author: Lee moon soo <m...@apache.org>
Date:   2016-03-07T02:55:17Z

    ApplicationLoader

commit b891b98ee5a3bd9dde8c044b32c0dc09074cdcb0
Author: Lee moon soo <m...@apache.org>
Date:   2016-03-13T23:13:49Z

    HeliumRegistry

commit b239f1b96b01264b4f92aef0d5d05d5173794c3b
Author: Lee moon soo <m...@apache.org>
Date:   2016-03-19T15:25:30Z

    Helium application factory

commit 9f5c493e414e7c240abb08f2fa8600761514d63f
Author: Lee moon soo <m...@apache.org>
Date:   2016-04-01T18:41:57Z

    Application output

commit 4eaeea720561962766f25438b19d7a334a8cb0bc
Author: Lee moon soo <m...@apache.org>
Date:   2016-04-02T20:18:54Z

    sync -> async api

commit 7aeb64addf55e0712aa270e131f4af39d06f470c
Author: Lee moon soo <m...@apache.org>
Date:   2016-04-03T03:14:23Z

    Unload app on paragraph / note removal as well as interpreter unbind

commit 134bbe640ae2636bb847d9844b28f87409027d08
Author: Lee moon soo <m...@apache.org>
Date:   2016-04-06T01:32:47Z

    Change HeliumRegistry constructor argument type

commit 94b490d76c7875a8d2f1a30232a762ec374664b4
Author: Lee moon soo <m...@apache.org>
Date:   2016-04-06T01:35:37Z

    initial rest api impl

commit bd0f467d23aecd32adf0152b939d8ed8eea6f56f
Author: Lee moon soo <m...@apache.org>
Date:   2016-04-09T00:38:24Z

    Style

commit 6223cd44d9fb3b7190c2cf7e817a031e38b5eb6f
Author: Lee moon soo <m...@apache.org>
Date:   2016-04-12T01:10:58Z

    App output display

commit 16f68871daaf98b4d3d4ca759b3f750e597bf5a4
Author: Lee moon soo <m...@apache.org>
Date:   2016-04-12T04:53:34Z

    Angular object update for helium app

commit 412480a2d222e31c7bd74198c5a4249dfea7ba8b
Author: Lee moon soo <m...@apache.org>
Date:   2016-04-12T05:33:45Z

    Fix style

commit be3a1fa7b3da908051605945926790e1342ffd0a
Author: Lee moon soo <m...@apache.org>
Date:   2016-04-12T05:52:15Z

    Add license header

commit 5503f9c100bfde93f5c3eb2f12bf88e6e18ab65b
Author: Lee moon soo <m...@apache.org>
Date:   2016-04-12T12:13:16Z

    Improved

commit b47ca744b989d8644e7cafe4ec3f2d336b890f92
Author: Lee moon soo <m...@apache.org>
Date:   2016-04-12T22:46:45Z

    Fix tests

commit 98f3872c6a27e8699717b9fc20b353b8fe9a1d2d
Author: Lee moon soo <m...@apache.org>
Date:   2016-04-13T00:13:49Z

    Managed interpreter process and Running interpreter process

commit 024d7fc2c52c54a6b5925598330d6326194fa8b4
Author: Lee moon soo <m...@apache.org>
Date:   2016-04-13T08:37:40Z

    Dev mode

commit 71f814dce41113f71fdcfff4c7d468604cd35f4b
Author: Lee moon soo <m...@apache.org>
Date:   2016-04-13T12:29:34Z

    Better way to find resource dir for InterpreterOutput watcher

commit f2ab95dcd37e2968c9c7c75f595d32bc2ef56dee
Author: Lee moon soo <m...@apache.org>
Date:   2016-04-13T22:22:45Z

    Prevent unnecessary output update

commit b4ff52fbcf7f0d7dbeac3d56f8ab4f4c283cdeba
Author: Lee moon soo <m...@apache.org>
Date:   2016-04-14T00:05:54Z

    Put last value of scala repl into resource pool

commit ec2fdea60bcd7e10438e2cc8d888d6995a2151f8
Author: Lee moon soo <m...@apache.org>
Date:   2016-04-14T00:26:33Z

    Match classname correctly

commit 0e4d81c841791ea4a4bd580478e57051d61a8b10
Author: Lee moon soo <m...@apache.org>
Date:   2016-04-14T00:26:51Z

    Remove unnecessary log

commit fade3c1f0f04603d28ce594a672f35e9558b7499
Author: Lee moon soo <m...@apache.org>
Date:   2016-04-14T02:48:10Z

    Handle output update in angular mode

commit 03be3a12056ae96e47de128d32a00860ac0786a3
Author: Lee moon soo <m...@apache.org>
Date:   2016-04-14T04:24:43Z

    Pass required resource to run() method

commit c30f53c7bb77c84c9fc07bf72674811bae04a064
Author: Lee moon soo <m...@apache.org>
Date:   2016-04-14T05:03:35Z

    null check

commit 864bea14025465d6f98bdc854ccf2c007f57b0d1
Author: Lee moon soo <m...@apache.org>
Date:   2016-04-14T05:23:19Z

    Merge branch 'master' into ZEPPELIN-732-up

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to