GitHub user nickwallen opened a pull request: https://github.com/apache/metron/pull/884
METRON-1382 Run Stellar in a Zeppelin Notebook ## Stellar in a Zeppelin Notebook The goal of this effort was to have the shell-like experience of the command-line driven REPL, but inside a web-based Zeppelin Notebook. This makes the existing functionality provided by the REPL more accessible and approachable for the average user. This also opens up interesting additional scenarios like "executable" use cases or plotting profile data. Definitely more work to do on those fronts, but this is a first step. ### Changes 1. There was a good amount of refactoring that I needed to do to achieve this. Prior to this effort different aspects of the REPL's functionality were tied together in the `StellarShell` class. To be able to have the same shell-like experience in both the REPL and Zeppelin, I needed to factor this logic out separately to allow for reuse. This included the following bits. * Console logic tied to the AESH library * Stellar execution logic * Autocomplete logic * Variable assignment (only available in the shell) * Magics * Docstrings * Comments * `quit` 1. We had very few automated tests around the shell/REPL, primarily because all these bits were tied together, which made testing difficult. Separating out this logic allowed me to add a large number of unit tests around each of these pieces of logic. 1. This also adds a separate project `metron-stellar/stellar-zeppelin` that provides a Zeppelin interpreter that allow you to run Stellar in a notebook. The interpreter acts as the front-end that then re-uses all of the bits that I refactored as described above. ### What does this do? This allows you to run Stellar expressions in a Zeppelin Notebook. This provides auto-complete in the Zeppelin Notebook using "CTRL + ." ### What does this not do? This does not automatically prepare the Zeppelin environment to run Stellar. Meaning it does not install the Stellar interpreter in Zeppelin. You have to manually install the zinterpreter in Zeppelin by following the directions described in the `metron-stellar/stellar-zepelin` README. ### Testing Run Stellar in Notebook 1. Build Metron. 1. Follow the instructions in `metron-stellar/stellar-zepelin/README.md` to download/run Zeppelin locally. 1. Follow the same instructions to execute Stellar expressions in a Zeppelin Notebook. 1. Use CTRL+. to try out autocomplete. Validate the CLI REPL 1. Deploy Full Dev 1. Run the existing CLI-driven REPL 1. Validate that we have feature parity ## Pull Request Checklist - [ ] Is there a JIRA ticket associated with this PR? If not one needs to be created at [Metron Jira](https://issues.apache.org/jira/browse/METRON/?selectedTab=com.atlassian.jira.jira-projects-plugin:summary-panel). - [ ] Does your PR title start with METRON-XXXX where XXXX is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character. - [ ] Has your PR been rebased against the latest commit within the target branch (typically master)? - [ ] Have you included steps to reproduce the behavior or problem that is being changed or addressed? - [ ] Have you included steps or a guide to how the change may be verified and tested manually? - [ ] Have you ensured that the full suite of tests and checks have been executed in the root metron folder via: - [ ] Have you written or updated unit tests and or integration tests to verify your changes? - [ ] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under [ASF 2.0](http://www.apache.org/legal/resolved.html#category-a)? - [ ] Have you verified the basic functionality of the build by building and running locally with Vagrant full-dev environment or the equivalent? You can merge this pull request into a Git repository by running: $ git pull https://github.com/nickwallen/metron METRON-1382 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/metron/pull/884.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 #884 ---- commit 49fba6a6a02239c1ed797699e5052777288cc3be Author: Nick Allen <nick@...> Date: 2017-12-18T16:52:00Z METRON-1382 Run Stellar in a Zeppelin Notebook ---- ---