Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions bin/install-interpreter.sh
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 ${@}
35 changes: 35 additions & 0 deletions conf/interpreter-list
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
1 change: 1 addition & 0 deletions dev/create_release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ function make_binary_release() {
git_clone
make_source_package
make_binary_release all "-Pspark-1.6 -Phadoop-2.4 -Pyarn -Ppyspark -Psparkr -Pr"
make_binary_release netinst "-Pspark-1.6 -Phadoop-2.4 -Pyarn -Ppyspark -pl !alluxio,!angular,!cassandra,!elasticsearch,!file,!flink,!hbase,!ignite,!jdbc,!kylin,!lens,!livy,!markdown,!postgresql,!python,!shell"

# remove non release files and dirs
rm -rf "${WORKING_DIR}/zeppelin"
Expand Down
6 changes: 4 additions & 2 deletions docs/_includes/themes/zeppelin/_navigation.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
<li><a href="{{BASE_PATH}}/index.html">What is Apache Zeppelin ?</a></li>
<li role="separator" class="divider"></li>
<li class="title"><span><b>Getting Started</b><span></li>
<li><a href="{{BASE_PATH}}/install/install.html">Quick Start</a></li>
<li><a href="{{BASE_PATH}}/install/install.html#zeppelin-configuration">Configuration</a></li>
<li><a href="{{BASE_PATH}}/install/install.html">Install</a></li>
<li><a href="{{BASE_PATH}}/install/install.html#apache-zeppelin-configuration">Configuration</a></li>
<li><a href="{{BASE_PATH}}/quickstart/explorezeppelinui.html">Explore Zeppelin UI</a></li>
<li><a href="{{BASE_PATH}}/quickstart/tutorial.html">Tutorial</a></li>
<li role="separator" class="divider"></li>
Expand All @@ -42,6 +42,7 @@
<li><a href="{{BASE_PATH}}/manual/interpreters.html">Overview</a></li>
<li role="separator" class="divider"></li>
<li class="title"><span><b>Usage</b><span></li>
<li><a href="{{BASE_PATH}}/manual/interpreterinstallation.html">Interpreter Installation</a></li>
<li><a href="{{BASE_PATH}}/manual/dynamicinterpreterload.html">Dynamic Interpreter Loading</a></li>
<li><a href="{{BASE_PATH}}/manual/dependencymanagement.html">Interpreter Dependency Management</a></li>
<li role="separator" class="divider"></li>
Expand Down Expand Up @@ -110,3 +111,4 @@
</nav><!--/.navbar-collapse -->
</div>
</div>

5 changes: 4 additions & 1 deletion docs/install/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ Although it can be unstable somehow since it is on development status, you can e
### Downloading Binary Package

If you want to install Apache Zeppelin with a stable binary package, please visit [Apache Zeppelin download Page](http://zeppelin.apache.org/download.html).

If you have downloaded `netinst` binary, [install additional interpreters](../manual/interpreterinstallation.html) before you start Zeppelin. Or simply run `./bin/install-interpreter.sh --all`.

After unpacking, jump to [Starting Apache Zeppelin with Command Line](#starting-apache-zeppelin-with-command-line) section.

### Building from Source
Expand Down Expand Up @@ -388,4 +391,4 @@ You can configure Apache Zeppelin with both **environment variables** in `conf/z
<td>1024000</td>
<td>Size in characters of the maximum text message to be received by websocket.</td>
</tr>
</table>
</table>
164 changes: 164 additions & 0 deletions docs/manual/interpreterinstallation.md
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 --artifact groupId1:artifact1:version1
```

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 --artifact groupId1:artifact1:version1,groupId2:artifact2:version2
```

`--name` and `--artifact` arguments will recieve comma separated list.

## 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
Expand Up @@ -17,6 +17,7 @@

package org.apache.zeppelin.dep;

import java.net.URL;
import java.util.Collection;
import java.util.Iterator;
import java.util.LinkedList;
Expand All @@ -25,6 +26,7 @@
import org.sonatype.aether.RepositorySystem;
import org.sonatype.aether.RepositorySystemSession;
import org.sonatype.aether.repository.Authentication;
import org.sonatype.aether.repository.Proxy;
import org.sonatype.aether.repository.RemoteRepository;
import org.sonatype.aether.repository.RepositoryPolicy;
import org.sonatype.aether.resolution.ArtifactResult;
Expand All @@ -44,6 +46,16 @@ public AbstractDependencyResolver(String localRepoPath) {
repos.add(Booter.newLocalRepository());
}

public void setProxy(URL proxyUrl, String proxyUser, String proxyPassword) {
Authentication auth = new Authentication(proxyUser, proxyPassword);
Proxy proxy = new Proxy(proxyUrl.getProtocol(), proxyUrl.getHost(), proxyUrl.getPort(), auth);
synchronized (repos) {
for (RemoteRepository repo : repos) {
repo.setProxy(proxy);
}
}
}

public List<RemoteRepository> getRepos() {
return this.repos;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)) {
Expand All @@ -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 {
Copy link
Member

Choose a reason for hiding this comment

The 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)
Copy link
Member

Choose a reason for hiding this comment

The 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);
Expand Down
Loading