-
Notifications
You must be signed in to change notification settings - Fork 2.8k
ZEPPELIN-804 Refactoring registration mechanism on Interpreters #835
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
This is the first step to reduce cost for initialisation and to loose coupling between server and interpreter. At first, I'll adjust it to Spark*Interpreter and then, do it to all other interpreters. Finally, I'll remove registeredInterpreters' mechanism. |
|
I tried to do my best to conserve existing codes for backward compatibility. |
|
@Leemoonsoo Ready to review |
|
Thanks @jongyoul for taking care of the issue. I think this subject is related to ZEPPELIN-598 and ZEPPELIN-533. ZEPPELIN-598 try to load interpreter dynamically, from maven repository. Considering ZEPPELIN-598 and ZEPPELIN-533, i think source of interpreter information need to be packaged and distributed with interpreter, rather than placed in For example Helium Application, each application provides separate json file that keeps informations of application, to helium package registry. I was thinking the same deploy model for Interpreter and NotebookRepo. Deploy,
Use,
What do you think? |
|
@Leemoonsoo Basically, the idea of Helium is very good and promising, and I also think my implementation is a little bit over-sized patch for solving problem. But to solve the problem of using |
|
Maybe i didn't explained very well. :-) I think having another mechanism that register interpreter based on information in json file, in addition to current In short, Instead of single |
|
@Leemoonsoo Thanks for explaining what the problem is. But And about Helium, I've reviewed that codes, and get to know that it has a different structure and doesn't break current one, thus this PR doesn't conflict on registering interpreter. And I'm also willing to move forward to merge a new mechanism in Helium structure after Helium is merged. I think the first step is to move |
|
@Leemoonsoo I've update the description with more information about initialization steps. Please review it. |
|
After this PR is accepted, I'll adopt a new mechanism to all other interpreter with separate PRs for easy review |
| init(); | ||
| } | ||
|
|
||
| private void init() throws InterpreterException, IOException, RepositoryException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method now is quite big and may be hard to follow. How do you think, would that be possible/make sense to extract few high-level methods here and make it call them?
It might aid the readability and simplify understanding of new interpreter registration process.
What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bzz I agree with you. I'll divide this methods into several ones.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks very good now!
|
@jongyoul thank you for an awesome update - static interpreter registration was a hack and it's great to see a better, testeble way to do it. Could you please help me understand, do all the interpreter implementations need to be eventually refactored one by one to the new registration system? If so, do you think there should be an approach we are aiming for toget there, I.e create JIRA issues for each, mark as entry-level task we use jira label |
|
@jongyoul Sounds like a good plan! Thanks for the explanation. |
|
@bzz "Personally", I think static initialization is the final way, thus I want to change all of them. And it sounds like a great idea to make them as beginners' tasks, and which are very clear and help them understand backend of Zeppelin. |
|
re-trigger |
|
again |
- Added a new initialization mechanism to use interpreter-setting.json - Adjusted new mechanism to SparkInterpreter for verification
- Fixed the style
- Changed Spark*Interpreter to use interpreter-setting.json
- Fixed test environments
- Fixed test environments
- Excluded interpreter-setting.json from rat check
- Excluded interpreter-setting.json from rat check
- Extracted new initialization logic into another methods
- Fixed logic to check for supporting legacy mechanism
- Checked if path exists or not
- Checked if path exists or not
- Fixed some unicode characters in interpreter-setting.json
- Changed logger setting only for test. This will be reverted after test
|
@echarles Hi, I have a problem for testing SparkRInterpreter of what you code. Could you please help solve this issue below? It looks like that the result is correct but that output messages are not same as expected. I think the output format of R is related to |
|
@jongyoul your conclusion are correct. I would also say there is something happeing with the zeppelin.R.render.options Here, it seems the R result is returned with the given command. |
|
@echarles Thanks for the advices and I've found the reason why zeppelin.R.render.options. This is because |
|
@jongyoul Building with both -Pr -Pspark may lead to unexpected behavior, even without the changes you brought... |
|
@echarles You're right but we need to pass the CI first. :-) I don't think this is a real case and I'll handle it through another PR which may be about changing CI. |
- Reverted log4j setting
- Ignored while registering a new interpreter with existing interpreter key
|
re-trigger |
|
Finally, I've passed CI. Summary of changes,
It never break to use any existing interpreter, thus we can change it without side effect. @bzz I'll make sub tasks of ZEPPELIN-804 with a tag for beginner to move initialization mechanism from old to new @Leemoonsoo @bzz Please review this PR |
|
The code looks great to me. Are there any potential side-effects of this change for the existing users? |
|
@jongyoul Code looks good to me. |
|
@Leemoonsoo Sure. I'll update it. |
- Added documentation
|
@bzz In my opinion, there's no side-effects of this feature. |
|
Merging if there's no more discussion. |
|
|
### What is this PR for? Currently available interpreter list is not shown in `Creating New Interpreter` section. It seems this bug was generated after #835 was merged. So I temporally deactivated [3 SerializedName code lines](6d7f1bc). ### What type of PR is it? Bug Fix ### Todos * [x] - Fix interpreter listing bug when creating new interpreter ### What is the Jira issue? [ZEPPELIN-931](https://issues.apache.org/jira/browse/ZEPPELIN-931) ### How should this be tested? 1. Build latest master branch and browse Zeppelin home 2. Create new interpreter -> You can not see the available interpreter list in this step like below attached screenshot 3. Apply this patch 4. Build again and browse -> You can see the available interpreter list as normal ### Screenshots (if appropriate) - **Before** <img width="1273" alt="screen shot 2016-06-01 at 12 36 42 pm" src="https://cloud.githubusercontent.com/assets/10060731/15723066/9082435e-27f5-11e6-9783-df44638dbbec.png"> - **After** <img width="1273" alt="screen shot 2016-06-01 at 12 33 06 pm" src="https://cloud.githubusercontent.com/assets/10060731/15723067/92bcc8ce-27f5-11e6-82f5-6c0db7b4342c.png"> ### Questions: * Does the licenses files need update? No * Is there breaking changes for older versions? No * Does this needs documentation? No Author: AhyoungRyu <[email protected]> Author: Jongyoul Lee <[email protected]> Author: Ah young <[email protected]> Closes #945 from AhyoungRyu/ZEPPELIN-931 and squashes the following commits: 711eb54 [Ah young] Merge pull request #2 from jongyoul/ZEPPELIN-931 6121f9b [Jongyoul Lee] - Fixed documentation 6e7dac9 [Ah young] Merge pull request #1 from jongyoul/ZEPPELIN-931 fed1b40 [Jongyoul Lee] - Fixed fieldName in interpreter-setting.json 6d7f1bc [AhyoungRyu] ZEPPELIN-931: fix interpreter listing bug
What is this PR for?
This PR enable Zeppelin server register Interpreters without any dependencies of their own. For instance, we should build
sparkwithspark-dependencieseven we use our own Spark cluster because current initialisation mechanism needs to all of its dependencies.What type of PR is it?
[Improvement]
Todos
What is the Jira issue?
How should this be tested?
sc.versionScreenshots (if appropriate)
Questions:
Description
This PR introduce three initialisation mechanism including current one.
Initialization step