Skip to content
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

[ZEPPELIN-1143] Interpreter dependencies are not downloaded on zeppelin start #1155

Closed
wants to merge 6 commits into from

Conversation

prabhjyotsingh
Copy link
Contributor

@prabhjyotsingh prabhjyotsingh commented Jul 9, 2016

What is this PR for?

While saving interpreter setting, if zeppelin server crashed/killed/restarted by user or there was some internet/download related (intermittent issue) because of which, or any other issue because of which dependencies were not downloaded.
In any such condition, when zeppelin is started/restarted, server should try and download dependencies.

What type of PR is it?

[Improvement]

What is the Jira issue?

SCREENSHOT

zeppelin-1143

How should this be tested?

  • Put a dependency (say "org.apache.commons:commons-csv:1.1") in any of the interpreter.
  • from command line delete local-repo directory
  • restart zeppelin server

expectation is local-repo should be recreated with all the dependencies that were mentioned in any of the interpreters.

Questions:

  • Does the licenses files need update? n/a
  • Is there breaking changes for older versions? n/a
  • Does this needs documentation? n/a

@prabhjyotsingh prabhjyotsingh changed the title [ZEPPELIN-1143] Interpreter dependencies are not downloaded on zeppelin… [ZEPPELIN-1143] Interpreter dependencies are not downloaded on zeppelin start Jul 9, 2016
@jongyoul
Copy link
Member

jongyoul commented Jul 10, 2016

@prabhjyotsingh How to deal with the case of getting error while downloading deps? Just edit and save it again?

@prabhjyotsingh
Copy link
Contributor Author

Yes, so far that is the only way we can download the dependency again.

@ghost
Copy link

ghost commented Jul 11, 2016

LGTM

logger.error("Error while downloading repos for interpreter group :" +
intpSetting.getGroup(), e);
} catch (IOException e) {
logger.error("Error while downloading repos for interpreter group :" +
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you could combine the two catch clauses? or I would suggest having a different text log message for the exception

@prabhjyotsingh
Copy link
Contributor Author

Merging this if no more discussion.

@jongyoul
Copy link
Member

LGTM

@karuppayya
Copy link
Contributor

A similar fix was made with https://github.com/apache/zeppelin/pull/755/files
Should we attempt to try to download dependencies when the interpreter process starts(as mentioned in the conversation).?

}
}
};
t.start();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be synchronous?
If there are number of deps, the download might take a longer time. But the interpreter will be ready to take the paras.
If the code executed depends on these deps, it will fail I guess(until the time it is downloaded). And pass again after it is downloaded. Which will be kind of unexpected behaviour.

@jongyoul
Copy link
Member

I also think @karup1990's way is proper.

setting.getGroup(), setting.getInterpreterInfos(), setting.getProperties(),
setting.getDependencies(), setting.getOption());

try {
synchronized (interpreterSettings) {
loadInterpreterDependencies(intpSetting);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue that i faced when loading interpreters synchronously:
The dependencies can take some time(time to download from mvn , erroneous scenarios etc). This will block loading other interpreters(since it is load method).

But the Notebook websocket server is running. The notebooks web UI will render properly. But when a para is run, the UI will seems to not respond(the para status will not change), because the interpreter might not have got loaded or in the process of being loaded.

It is good to show some UI feedback in these cases.
@prabhjyotsingh

# Conflicts:
#	zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/InterpreterFactory.java
@prabhjyotsingh
Copy link
Contributor Author

@karup1990 have tried to implement the behaviour that you were asking about, can you take a look. Have added a GIF in PR description.

@karuppayya
Copy link
Contributor

Thanks for addressing the feedbacks @prabhjyotsingh ..
I cannot see the GIF In the description of the PR .

if (isDownloading) {
$timeout(function() {
getInterpreterSettings();
}, 2000);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This timeout period will vary based on the number of dependencies.
Should we have Zeppelin broadcast a message when it is done with the downloading?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I thought about it, but I'll take care of this in another PR, where instead of doing a get call, migrate this web-sockets.

@prabhjyotsingh
Copy link
Contributor Author

Have uploaded the GIF again, I think it would have failed last time.

@@ -26,6 +26,7 @@ angular.module('zeppelinWebApp').controller('InterpreterCtrl',
var getInterpreterSettings = function() {
$http.get(baseUrlSrv.getRestApiBase() + '/interpreter/setting').success(function(data, status, headers, config) {
$scope.interpreterSettings = data.body;
checkDownloadingDependencies();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This loop getInterpreterSettings<> checkDownloadingDependencies(this in turn iterates through setting) will be executed until the dependencies are downloaded.
Should be fine?
Otherwise, lgtm

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have added another condition that will check for route url, and if it is not /interpreter stop requesting for getInterpreterSettings().

@prabhjyotsingh
Copy link
Contributor Author

Will merge this if no more discussion.

@asfgit asfgit closed this in 21a084b Jul 25, 2016
PhilippGrulich pushed a commit to SWC-SENSE/zeppelin that referenced this pull request Aug 8, 2016
…in start

### What is this PR for?
While saving interpreter setting, if zeppelin server crashed/killed/restarted by user or there was some internet/download related (intermittent issue) because of which, or any other issue because of which dependencies were not downloaded.
In any such condition, when zeppelin is started/restarted, server should try and download dependencies.

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

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

### SCREENSHOT
![zeppelin-1143](https://cloud.githubusercontent.com/assets/674497/17025872/7d94d3e4-4f7b-11e6-9182-3e84f0badbab.gif)

### How should this be tested?

 - Put a dependency (say "org.apache.commons:commons-csv:1.1") in any of the interpreter.
 - from command line delete `local-repo` directory
 - restart zeppelin server

expectation is `local-repo` should be recreated with all the dependencies that were mentioned in any of the interpreters.

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

Author: Prabhjyot Singh <prabhjyotsingh@gmail.com>

Closes apache#1155 from prabhjyotsingh/ZEPPELIN-1143 and squashes the following commits:

36cc81d [Prabhjyot Singh] on change of route, stop requesting for getInterpreterSettings()
5aefc5c [Prabhjyot Singh] show update of interpreter dependencies in UI
4f2484a [Prabhjyot Singh] Merge remote-tracking branch 'origin/master' into ZEPPELIN-1143
c12c43d [Prabhjyot Singh] address @karup1990 feedback
6ad14a7 [Prabhjyot Singh] Address @felixcheung feedback
fb869e8 [Prabhjyot Singh] ZEPPELIN-1143 Interpreter dependencies are not downloaded on zeppelin start
beriaanirudh pushed a commit to beriaanirudh/zeppelin that referenced this pull request Mar 8, 2017
…in start

While saving interpreter setting, if zeppelin server crashed/killed/restarted by user or there was some internet/download related (intermittent issue) because of which, or any other issue because of which dependencies were not downloaded.
In any such condition, when zeppelin is started/restarted, server should try and download dependencies.

[Improvement]

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

![zeppelin-1143](https://cloud.githubusercontent.com/assets/674497/17025872/7d94d3e4-4f7b-11e6-9182-3e84f0badbab.gif)

 - Put a dependency (say "org.apache.commons:commons-csv:1.1") in any of the interpreter.
 - from command line delete `local-repo` directory
 - restart zeppelin server

expectation is `local-repo` should be recreated with all the dependencies that were mentioned in any of the interpreters.

* Does the licenses files need update? n/a
* Is there breaking changes for older versions? n/a
* Does this needs documentation? n/a

Author: Prabhjyot Singh <prabhjyotsingh@gmail.com>

Closes apache#1155 from prabhjyotsingh/ZEPPELIN-1143 and squashes the following commits:

36cc81d [Prabhjyot Singh] on change of route, stop requesting for getInterpreterSettings()
5aefc5c [Prabhjyot Singh] show update of interpreter dependencies in UI
4f2484a [Prabhjyot Singh] Merge remote-tracking branch 'origin/master' into ZEPPELIN-1143
c12c43d [Prabhjyot Singh] address @karup1990 feedback
6ad14a7 [Prabhjyot Singh] Address @felixcheung feedback
fb869e8 [Prabhjyot Singh] ZEPPELIN-1143 Interpreter dependencies are not downloaded on zeppelin start

(cherry picked from commit 21a084b)
@prabhjyotsingh prabhjyotsingh deleted the ZEPPELIN-1143 branch February 25, 2018 03:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants