-
Notifications
You must be signed in to change notification settings - Fork 2.8k
[ZEPPELIN-1046] bin/install-interpreter.sh for netinst package #1042
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
Changes from 22 commits
38e2556
47f5706
78a7c52
2c81a3f
ec7d152
1b558fd
49f0568
7b1b36a
6ee06b8
d547551
aebca17
1077296
9079580
4c1f029
13899fb
5d0a971
03c664e
13f2d04
0eedd2a
7e749ad
7307c67
049bc89
f81d16e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| #!/bin/bash | ||
| # | ||
| # Licensed to the Apache Software Foundation (ASF) under one | ||
| # or more contributor license agreements. See the NOTICE file | ||
| # distributed with this work for additional information | ||
| # regarding copyright ownership. The ASF licenses this file | ||
| # to you under the Apache License, Version 2.0 (the | ||
| # "License"); you may not use this file except in compliance | ||
| # with the License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
| # | ||
| # Run Zeppelin | ||
| # | ||
|
|
||
| bin=$(dirname "${BASH_SOURCE-$0}") | ||
| bin=$(cd "${bin}">/dev/null; pwd) | ||
|
|
||
| . "${bin}/common.sh" | ||
|
|
||
|
|
||
| ZEPPELIN_INSTALL_INTERPRETER_MAIN=org.apache.zeppelin.interpreter.install.InstallInterpreter | ||
| ZEPPELIN_LOGFILE="${ZEPPELIN_LOG_DIR}/install-interpreter.log" | ||
| JAVA_OPTS+=" -Dzeppelin.log.file=${ZEPPELIN_LOGFILE}" | ||
|
|
||
| if [[ -d "${ZEPPELIN_HOME}/zeppelin-zengine/target/classes" ]]; then | ||
| ZEPPELIN_CLASSPATH+=":${ZEPPELIN_HOME}/zeppelin-zengine/target/classes" | ||
| fi | ||
| addJarInDir "${ZEPPELIN_HOME}/zeppelin-server/target/lib" | ||
|
|
||
| if [[ -d "${ZEPPELIN_HOME}/zeppelin-interpreter/target/classes" ]]; then | ||
| ZEPPELIN_CLASSPATH+=":${ZEPPELIN_HOME}/zeppelin-interpreter/target/classes" | ||
| fi | ||
| addJarInDir "${ZEPPELIN_HOME}/zeppelin-interpreter/target/lib" | ||
|
|
||
| addJarInDir "${ZEPPELIN_HOME}/lib" | ||
|
|
||
| CLASSPATH+=":${ZEPPELIN_CLASSPATH}" | ||
| $ZEPPELIN_RUNNER $JAVA_OPTS -cp $CLASSPATH $ZEPPELIN_INSTALL_INTERPRETER_MAIN ${@} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| # Licensed to the Apache Software Foundation (ASF) under one | ||
| # or more contributor license agreements. See the NOTICE file | ||
| # distributed with this work for additional information | ||
| # regarding copyright ownership. The ASF licenses this file | ||
| # to you under the Apache License, Version 2.0 (the | ||
| # "License"); you may not use this file except in compliance | ||
| # with the License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
| # | ||
| # | ||
| # [name] [maven artifact] [description] | ||
|
|
||
| alluxio org.apache.zeppelin:zeppelin-alluxio:0.6.0 Alluxio interpreter | ||
| angular org.apache.zeppelin:zeppelin-angular:0.6.0 HTML and AngularJS view rendering | ||
| cassandra org.apache.zeppelin:zeppelin-cassandra:0.6.0 Cassandra interpreter | ||
| elasticsearch org.apache.zeppelin:zeppelin-elasticsearch:0.6.0 Elasticsearch interpreter | ||
| file org.apache.zeppelin:zeppelin-file:0.6.0 HDFS file interpreter | ||
| flink org.apache.zeppelin:zeppelin-flink:0.6.0 Flink interpreter | ||
| hbase org.apache.zeppelin:zeppelin-hbase:0.6.0 Hbase interpreter | ||
| ignite org.apache.zeppelin:zeppelin-ignite:0.6.0 Ignite interpreter | ||
| jdbc org.apache.zeppelin:zeppelin-jdbc:0.6.0 Jdbc interpreter | ||
| kylin org.apache.zeppelin:zeppelin-kylin:0.6.0 Kylin interpreter | ||
| lens org.apache.zeppelin:zeppelin-lens:0.6.0 Lens interpreter | ||
| livy org.apache.zeppelin:zeppelin-livy:0.6.0 Livy interpreter | ||
| md org.apache.zeppelin:zeppelin-markdown:0.6.0 Markdown support | ||
| postgresql org.apache.zeppelin:zeppelin-postgresql:0.6.0 Postgresql interpreter | ||
| python org.apache.zeppelin:zeppelin-python:0.6.0 Python interpreter | ||
| shell org.apache.zeppelin:zeppelin-shell:0.6.0 Shell command |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,164 @@ | ||
| --- | ||
| layout: page | ||
| title: "Interpreter Installation" | ||
| description: "" | ||
| group: manual | ||
| --- | ||
| <!-- | ||
| Licensed under the Apache License, Version 2.0 (the "License"); | ||
| you may not use this file except in compliance with the License. | ||
| You may obtain a copy of the License at | ||
|
|
||
| http://www.apache.org/licenses/LICENSE-2.0 | ||
|
|
||
| Unless required by applicable law or agreed to in writing, software | ||
| distributed under the License is distributed on an "AS IS" BASIS, | ||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| See the License for the specific language governing permissions and | ||
| limitations under the License. | ||
| --> | ||
| {% include JB/setup %} | ||
|
|
||
| # Interpreter Installation | ||
|
|
||
| Apache Zeppelin provides **Interpreter Installation** mechanism for whom downloaded Zeppelin `netinst` binary package, or just want to install another 3rd party interpreters. | ||
|
|
||
| ## Community managed interpreters | ||
| Apache Zeppelin provides several interpreters as [community managed interpreters](#available-community-managed-interpreters). | ||
| If you downloaded `netinst` binary package, you need to install by using below commands. | ||
|
|
||
| #### Install all community managed interpreters | ||
|
|
||
| ``` | ||
| ./bin/install-interpreter.sh --all | ||
| ``` | ||
|
|
||
| #### Install specific interpreters | ||
|
|
||
| ``` | ||
| ./bin/install-interpreter.sh --name md,shell,jdbc,python | ||
| ``` | ||
|
|
||
| You can get full list of community managed interpreters by running | ||
|
|
||
| ``` | ||
| ./bin/install-interpreter.sh --list | ||
| ``` | ||
|
|
||
| Once you have installed interpreters, you need to restart Zeppelin. And then [create interpreter setting](../manual/interpreters.html#what-is-zeppelin-interpreter) and [bind it with your notebook](../manual/interpreters.html#what-is-zeppelin-interpreter-setting). | ||
|
|
||
|
|
||
| ## 3rd party interpreters | ||
|
|
||
| You can also install 3rd party interpreters located in the maven repository by using below commands. | ||
|
|
||
| #### Install 3rd party interpreters | ||
|
|
||
| ``` | ||
| ./bin/install-interpreter.sh --name interpreter1 --repository groupId1:artifact1:version1 | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| ``` | ||
|
|
||
| The above command will download maven artifact `groupId1:artifact1:version1` and all of it's transitive dependencies into `interpreter/interpreter1` directory. | ||
|
|
||
| Once you have installed interpreters, you'll need to add interpreter class name into `zeppelin.interpreters` property in [configuration](../install/install.html#apache-zeppelin-configuration). | ||
| And then restart Zeppelin, [create interpreter setting](../manual/interpreters.html#what-is-zeppelin-interpreter) and [bind it with your notebook](../manual/interpreters.html#what-is-zeppelin-interpreter-setting). | ||
|
|
||
|
|
||
| #### Install multiple 3rd party interpreters at once | ||
|
|
||
| ``` | ||
| ./bin/install-interpreter.sh --name interpreter1,interpreter2 --repository groupId1:artifact1:version1,groupId2:artifact2:version2 | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| ``` | ||
|
|
||
| `--name` and `--repository` arguments will recieve comma separated list. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
|
||
| ## Available community managed interpreters | ||
|
|
||
| You can also find the below community managed interpreter list in `conf/interpreter-list` file. | ||
| <table class="table-configuration"> | ||
| <tr> | ||
| <th>Name</th> | ||
| <th>Maven Artifact</th> | ||
| <th>Description</th> | ||
| </tr> | ||
| <tr> | ||
| <td>alluxio</td> | ||
| <td>org.apache.zeppelin:zeppelin-alluxio:0.6.0</td> | ||
| <td>Alluxio interpreter</td> | ||
| </tr> | ||
| <tr> | ||
| <td>angular</td> | ||
| <td>org.apache.zeppelin:zeppelin-angular:0.6.0</td> | ||
| <td>HTML and AngularJS view rendering</td> | ||
| </tr> | ||
| <tr> | ||
| <td>cassandra</td> | ||
| <td>org.apache.zeppelin:zeppelin-cassandra:0.6.0</td> | ||
| <td>Cassandra interpreter</td> | ||
| </tr> | ||
| <tr> | ||
| <td>elasticsearch</td> | ||
| <td>org.apache.zeppelin:zeppelin-elasticsearch:0.6.0</td> | ||
| <td>Elasticsearch interpreter</td> | ||
| </tr> | ||
| <tr> | ||
| <td>file</td> | ||
| <td>org.apache.zeppelin:zeppelin-file:0.6.0</td> | ||
| <td>HDFS file interpreter</td> | ||
| </tr> | ||
| <tr> | ||
| <td>flink</td> | ||
| <td>org.apache.zeppelin:zeppelin-flink:0.6.0</td> | ||
| <td>Flink interpreter</td> | ||
| </tr> | ||
| <tr> | ||
| <td>hbase</td> | ||
| <td>org.apache.zeppelin:zeppelin-hbase:0.6.0</td> | ||
| <td>Hbase interpreter</td> | ||
| </tr> | ||
| <tr> | ||
| <td>ignite</td> | ||
| <td>org.apache.zeppelin:zeppelin-ignite:0.6.0</td> | ||
| <td>Ignite interpreter</td> | ||
| </tr> | ||
| <tr> | ||
| <td>jdbc</td> | ||
| <td>org.apache.zeppelin:zeppelin-jdbc:0.6.0</td> | ||
| <td>Jdbc interpreter</td> | ||
| </tr> | ||
| <tr> | ||
| <td>kylin</td> | ||
| <td>org.apache.zeppelin:zeppelin-kylin:0.6.0</td> | ||
| <td>Kylin interpreter</td> | ||
| </tr> | ||
| <tr> | ||
| <td>lens</td> | ||
| <td>org.apache.zeppelin:zeppelin-lens:0.6.0</td> | ||
| <td>Lens interpreter</td> | ||
| </tr> | ||
| <tr> | ||
| <td>livy</td> | ||
| <td>org.apache.zeppelin:zeppelin-livy:0.6.0</td> | ||
| <td>Livy interpreter</td> | ||
| </tr> | ||
| <tr> | ||
| <td>md</td> | ||
| <td>org.apache.zeppelin:zeppelin-markdown:0.6.0</td> | ||
| <td>Markdown support</td> | ||
| </tr> | ||
| <tr> | ||
| <td>postgresql</td> | ||
| <td>org.apache.zeppelin:zeppelin-postgresql:0.6.0</td> | ||
| <td>Postgresql interpreter</td> | ||
| </tr> | ||
| <tr> | ||
| <td>python</td> | ||
| <td>org.apache.zeppelin:zeppelin-python:0.6.0</td> | ||
| <td>Python interpreter</td> | ||
| </tr> | ||
| <tr> | ||
| <td>shell</td> | ||
| <td>org.apache.zeppelin:zeppelin-shell:0.6.0</td> | ||
| <td>Shell command</td> | ||
| </tr> | ||
| </table> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,6 +19,7 @@ | |
|
|
||
| import java.io.File; | ||
| import java.io.IOException; | ||
| import java.net.URL; | ||
| import java.util.Arrays; | ||
| import java.util.Collection; | ||
| import java.util.Iterator; | ||
|
|
@@ -63,11 +64,6 @@ public List<File> load(String artifact) | |
| return load(artifact, new LinkedList<String>()); | ||
| } | ||
|
|
||
| public List<File> load(String artifact, String destPath) | ||
| throws RepositoryException, IOException { | ||
| return load(artifact, new LinkedList<String>(), destPath); | ||
| } | ||
|
|
||
| public synchronized List<File> load(String artifact, Collection<String> excludes) | ||
| throws RepositoryException, IOException { | ||
| if (StringUtils.isBlank(artifact)) { | ||
|
|
@@ -85,25 +81,20 @@ public synchronized List<File> load(String artifact, Collection<String> excludes | |
| return libs; | ||
| } | ||
| } | ||
|
|
||
| public List<File> load(String artifact, Collection<String> excludes, String destPath) | ||
|
|
||
| public List<File> load(String artifact, File destPath) throws IOException, RepositoryException { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Seems like this method with same signature already exists above. |
||
| return load(artifact, new LinkedList<String>(), destPath); | ||
| } | ||
|
|
||
| public List<File> load(String artifact, Collection<String> excludes, File destPath) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here |
||
| throws RepositoryException, IOException { | ||
| List<File> libs = new LinkedList<File>(); | ||
|
|
||
| if (StringUtils.isNotBlank(artifact)) { | ||
| libs = load(artifact, excludes); | ||
|
|
||
| // find home dir | ||
| String home = System.getenv("ZEPPELIN_HOME"); | ||
| if (home == null) { | ||
| home = System.getProperty("zeppelin.home"); | ||
| } | ||
| if (home == null) { | ||
| home = ".."; | ||
| } | ||
|
|
||
| for (File srcFile : libs) { | ||
| File destFile = new File(home + "/" + destPath, srcFile.getName()); | ||
| File destFile = new File(destPath, srcFile.getName()); | ||
| if (!destFile.exists() || !FileUtils.contentEquals(srcFile, destFile)) { | ||
| FileUtils.copyFile(srcFile, destFile); | ||
| logger.info("copy {} to {}", srcFile.getAbsolutePath(), destPath); | ||
|
|
||
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.
Single quote in front of
!alluxioshould be removed here