You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zeppelin.apache.org by astroshim <gi...@git.apache.org> on 2015/11/24 06:26:04 UTC

[GitHub] incubator-zeppelin pull request: Add job operation API

GitHub user astroshim opened a pull request:

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

    Add job operation API

    This PR is related to https://issues.apache.org/jira/browse/ZEPPELIN-137.
    I added some notebook job operations.
    
    Here is the examples.
    * Get notebook job status.
    ```
    ]# curl -XGET http://121.156.59.2:8080/api/notebook/job/2B3Z5BXJA
    {"status":"OK","body":[{"id":"20151121-212654_766735423","status":"FINISHED","finished":"Tue Nov 24 14:21:40 KST 2015","started":"Tue Nov 24 14:21:39 KST 2015"},{"id":"20151121-212657_730976687","status":"FINISHED","finished":"Tue Nov 24 14:21:40 KST 2015","started":"Tue Nov 24 14:21:40 KST 2015"},{"id":"20151121-235508_752057578","status":"FINISHED","finished":"Tue Nov 24 14:21:40 KST 2015","started":"Tue Nov 24 14:21:40 KST 2015"},{"id":"20151121-235900_1491052248","status":"FINISHED","finished":"Tue Nov 24 14:21:41 KST 2015","started":"Tue Nov 24 14:21:40 KST 2015"},{"id":"20151121-235909_1520022794","status":"RUNNING","finished":"Tue Nov 24 02:53:51 KST 2015","started":"Tue Nov 24 14:21:41 KST 2015"}]}
    ```
    
    * Run notebook job.
    ```
    ]# curl -XDELETE http://121.156.59.2:8080/api/notebook/job/2B3Z5BXJA
    {"status":"ACCEPTED"}
    ```
    
    * Stop(Delete) notebook job.
    ```
    ]# curl -XDELETE http://121.156.59.2:8080/api/notebook/job/2B3Z5BXJA
    {"status":"ACCEPTED"}
    ```
    
    * Run requested paragraph job.
    ```
    ]# curl -XPOST http://121.156.59.2:8080/api/notebook/job/2B3Z5BXJA/20151121-212654_766735423
    {"status":"ACCEPTED"}
    ```
    
    * Stop(Delete) requested paragraph job.
    ```
    ]# curl -XDELETE http://121.156.59.2:8080/api/notebook/job/2B3Z5BXJA/20151121-212654_766735423
    {"status":"ACCEPTED"}
    ```


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

    $ git pull https://github.com/astroshim/incubator-zeppelin improve/addApis

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

    https://github.com/apache/incubator-zeppelin/pull/465.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 #465
    
----
commit 1255674531d09c2f069d5a83e9307f10242b2330
Author: astroshim <hs...@nflabs.com>
Date:   2015-11-24T04:59:07Z

    add job operation api

commit 6c1acf3c0bdcfa8eb4ef23b6f3cb60f98407338f
Author: astroshim <hs...@nflabs.com>
Date:   2015-11-24T05:24:28Z

    fix result message.

----


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-zeppelin pull request: Add job operation API

Posted by astroshim <gi...@git.apache.org>.
Github user astroshim commented on the pull request:

    https://github.com/apache/incubator-zeppelin/pull/465#issuecomment-159808250
  
    I added cron job api's 
    
    - Add cron job
    ```
    ]# curl -XPOST http://121.156.59.2:8080/api/notebook/cron/2B79J5UQB -d '{"cron":"* * * * * ?" }'
    {"status":"ACCEPTED"}
    ```
    
    - get cron job
    ```
    ]# curl -XGET http://121.156.59.2:8080/api/notebook/cron/2B79J5UQB
    {"status":"OK","body":"* * * * * ?"}
    ```
    
    - remove cron job
    ```
    ]# curl -XDELETE http://121.156.59.2:8080/api/notebook/cron/2B79J5UQB
    {"status":"ACCEPTED"}
    ```



---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-zeppelin pull request: Add job operation API

Posted by springml <gi...@git.apache.org>.
Github user springml commented on the pull request:

    https://github.com/apache/incubator-zeppelin/pull/465#issuecomment-159172052
  
    That is correct.  I want to be able to pass a parameter (e.g. jobid) when calling the api to execute the  notebook.  Something like this would be great:
    ]# curl -XDELETE http://121.156.59.2:8080/api/notebook/job/2B3Z5BXJA?jobid=1001
    {"status":"ACCEPTED"}


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-zeppelin pull request: Add job operation API

Posted by astroshim <gi...@git.apache.org>.
Github user astroshim commented on the pull request:

    https://github.com/apache/incubator-zeppelin/pull/465#issuecomment-159196978
  
    @springml I am going to add more APIs related to scehdule job. That could be solution.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-zeppelin pull request: Add job operation API

Posted by astroshim <gi...@git.apache.org>.
Github user astroshim commented on the pull request:

    https://github.com/apache/incubator-zeppelin/pull/465#issuecomment-159170573
  
    @bzz Thank you for your comment.
    But I don't understand what you mean the java style, could you tell me more detail?


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-zeppelin pull request: Add job operation API

Posted by bzz <gi...@git.apache.org>.
Github user bzz commented on the pull request:

    https://github.com/apache/incubator-zeppelin/pull/465#issuecomment-159154873
  
    Great contribution! 
    Could you please check that it also follows project's [java styleguide](https://google.github.io/styleguide/javaguide.html#s4.6.2-horizontal-whitespace) ?


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-zeppelin pull request: Add job operation API

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

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


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-zeppelin pull request: Add job operation API

Posted by astroshim <gi...@git.apache.org>.
Github user astroshim commented on the pull request:

    https://github.com/apache/incubator-zeppelin/pull/465#issuecomment-162895268
  
    @Leemoonsoo @bzz Thank you for your review!
    I totally agree with your idea about consistent statuses. I'll fix them.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-zeppelin pull request: Add job operation API

Posted by springml <gi...@git.apache.org>.
Github user springml commented on the pull request:

    https://github.com/apache/incubator-zeppelin/pull/465#issuecomment-159166983
  
    Thank you for the contribution.
    Is it possible to pass a runtime parameter to the "Run notebook" api?


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-zeppelin pull request: Add job operation API

Posted by bzz <gi...@git.apache.org>.
Github user bzz commented on the pull request:

    https://github.com/apache/incubator-zeppelin/pull/465#issuecomment-163572633
  
    Looks awesome to me!
    Merging if there is no further discussion.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-zeppelin pull request: Add job operation API

Posted by Leemoonsoo <gi...@git.apache.org>.
Github user Leemoonsoo commented on the pull request:

    https://github.com/apache/incubator-zeppelin/pull/465#issuecomment-161920760
  
    Notebook Rest API returns,
    
    ```
    CREATED, on createNote
    OK,      on deleteNote
    CREATED, on cloneNote
    ```
    
    Interpreter Rest API returns
    
    ```
    CREATED, on newSetting
    OK,      on updateSetting
    OK,      on removeSetting
    OK,      on restartSetting
    ```
    
    This PR adds 8 more APIs
    
    ```
    ACCEPTED, on runNoteJobs
    ACCEPTED, on stopNoteJobs
    OK,       on getNoteJobStatus
    ACCEPTED, on runParagraph
    ACCEPTED, on stopParagraph
    ACCEPTED, on registerCronJob
    ACCEPTED, on removeCronJob
    OK,       on getCronJob
    ```
    
    I think return Status need to be little bit more consistent.
    For example, removeCronJob returns `ACCEPTED`, but deleteNote returns `OK`.
    
    So, i think changing `ACCEPTED` to `OK` for all new APIs makes api more consistent.
    What do you think?



---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-zeppelin pull request: Add job operation API

Posted by astroshim <gi...@git.apache.org>.
Github user astroshim commented on the pull request:

    https://github.com/apache/incubator-zeppelin/pull/465#issuecomment-159463022
  
    @bzz Your comment is very helpful. Thank you very much!!


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-zeppelin pull request: Add job operation API

Posted by bzz <gi...@git.apache.org>.
Github user bzz commented on the pull request:

    https://github.com/apache/incubator-zeppelin/pull/465#issuecomment-159809761
  
    @astroshim looks great!
    
    Could you also please update the [REST API docs](http://zeppelin.incubator.apache.org/docs/0.6.0-incubating-SNAPSHOT/rest-api/rest-notebook.html), by adding a description of new API there?
    
    Docs sources are in https://github.com/apache/incubator-zeppelin/blob/master/docs/rest-api/rest-notebook.md and here are the [instructions](http://zeppelin.incubator.apache.org/docs/0.6.0-incubating-SNAPSHOT/development/howtocontributewebsite.html) on how to build/update them.
    
    BTW there may be a small typo in PR description:
    >Run notebook job.
    >$ curl -XDELETE http://121.156.59.2:8080/api/notebook/job/2B3Z5BXJA
    {"status":"ACCEPTED"}
    
    Instead of `curl -XPOST ...`


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-zeppelin pull request: Add job operation API

Posted by bzz <gi...@git.apache.org>.
Github user bzz commented on the pull request:

    https://github.com/apache/incubator-zeppelin/pull/465#issuecomment-162734744
  
    +1 for consistent statuses as well as updating the [REST API docs](http://zeppelin.incubator.apache.org/docs/0.6.0-incubating-SNAPSHOT/rest-api/rest-notebook.html), by adding a description of this API there


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-zeppelin pull request: Add job operation API

Posted by bzz <gi...@git.apache.org>.
Github user bzz commented on the pull request:

    https://github.com/apache/incubator-zeppelin/pull/465#issuecomment-159453621
  
    @astroshim Sure! Zeppelin project agreed to adhere this styleguide for Java language https://google.github.io/styleguide/javaguide.html 
    
    We encourage all contributors to read this document carefully.
    
    It means that all the code in the project should be formatted according rules of that guide. 
    Some of them are enforced through the build system (using checkstyle maven plugin), like max length of the line - that is why you had "whitespace\lineLength build error". 
    
    Some rules are not enforced automatically, but are a good practices to follow. This is one of the reasons to have a "code review" in PullRequests here.
    
    Your code looks great, but there are still a few cases where formatting that can be improved before merging, i.e [horizontal whitespaing](https://google.github.io/styleguide/javaguide.html#s4.6.2-horizontal-whitespace)
    
    Things like
    ```java
    while(paragraph.getStatus() == Status.PENDING) ...
    ```
    
    according to the link above should look like
    ```java
    while (paragraph.getStatus() == Status.PENDING) ...
    ```
    
    Another thing to check is [vertical whitespace](https://google.github.io/styleguide/javaguide.html#s4.6.1-vertical-whitespace) - an empty line between two consecutive method fields of the class (fields, methods).
    
    Please let me know if it that helps!


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-zeppelin pull request: Add job operation API

Posted by astroshim <gi...@git.apache.org>.
Github user astroshim commented on the pull request:

    https://github.com/apache/incubator-zeppelin/pull/465#issuecomment-163287793
  
    @bzz I updated REST API docs, could you review?
    Thanks.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-zeppelin pull request: Add job operation API

Posted by Leemoonsoo <gi...@git.apache.org>.
Github user Leemoonsoo commented on the pull request:

    https://github.com/apache/incubator-zeppelin/pull/465#issuecomment-163378097
  
    LGTM


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-zeppelin pull request: Add job operation API

Posted by astroshim <gi...@git.apache.org>.
Github user astroshim commented on the pull request:

    https://github.com/apache/incubator-zeppelin/pull/465#issuecomment-159171649
  
    @springml Thank you for your comment.
    What is the runtime parameter? Is runtime you mean is the time will be executed?


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---