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

Miscellaneous documentation fixes #2997

Closed
wants to merge 8 commits into from
4 changes: 3 additions & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,10 @@ If you wish to help us and contribute to Zeppelin Documentation, please look at
```

2. checkout ASF repo

```
svn co https://svn.apache.org/repos/asf/zeppelin asf-zeppelin
```

3. copy `zeppelin/docs/_site` to `asf-zeppelin/site/docs/[VERSION]`
4. ```svn commit```
4. `svn commit`
39 changes: 24 additions & 15 deletions docs/development/contribution/how_to_contribute_code.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ First of all, you need Zeppelin source code. The official location of Zeppelin i

Get the source code on your development machine using git.

```
```bash
git clone git://git.apache.org/zeppelin.git zeppelin
```

You may also want to develop against a specific branch. For example, for branch-0.5.6

```
```bash
git clone -b branch-0.5.6 git://git.apache.org/zeppelin.git zeppelin
```

Expand All @@ -69,19 +69,19 @@ Before making a pull request, please take a look [Contribution Guidelines](http:

### Build

```
```bash
mvn install
```

To skip test

```
```bash
mvn install -DskipTests
```

To build with specific spark / hadoop version

```
```bash
mvn install -Dspark.version=x.x.x -Dhadoop.version=x.x.x
```

Expand All @@ -93,18 +93,26 @@ For the further

1. Copy the `conf/zeppelin-site.xml.template` to `zeppelin-server/src/main/resources/zeppelin-site.xml` and change the configurations in this file if required
2. Run the following command
```

```bash
cd zeppelin-server
HADOOP_HOME=YOUR_HADOOP_HOME JAVA_HOME=YOUR_JAVA_HOME mvn exec:java -Dexec.mainClass="org.apache.zeppelin.server.ZeppelinServer" -Dexec.args=""
HADOOP_HOME=YOUR_HADOOP_HOME JAVA_HOME=YOUR_JAVA_HOME \
mvn exec:java -Dexec.mainClass="org.apache.zeppelin.server.ZeppelinServer" -Dexec.args=""
```

#### Option 2 - Daemon Script

> **Note:** Make sure you first run ```mvn clean install -DskipTests``` on your zeppelin root directory, otherwise your server build will fail to find the required dependencies in the local repro.
> **Note:** Make sure you first run

```bash
mvn clean install -DskipTests
```

in your zeppelin root directory, otherwise your server build will fail to find the required dependencies in the local repro.

or use daemon script

```
```bash
bin/zeppelin-daemon start
```

Expand All @@ -122,8 +130,7 @@ Some portions of the Zeppelin code are generated by [Thrift](http://thrift.apach

To regenerate the code, install **thrift-0.9.2** and then run the following command to generate thrift code.


```
```bash
cd <zeppelin_home>/zeppelin-interpreter/src/main/thrift
./genthrift.sh
```
Expand All @@ -132,14 +139,16 @@ cd <zeppelin_home>/zeppelin-interpreter/src/main/thrift

Zeppelin has [set of integration tests](https://github.com/apache/zeppelin/tree/master/zeppelin-server/src/test/java/org/apache/zeppelin/integration) using Selenium. To run these test, first build and run Zeppelin and make sure Zeppelin is running on port 8080. Then you can run test using following command

```
TEST_SELENIUM=true mvn test -Dtest=[TEST_NAME] -DfailIfNoTests=false -pl 'zeppelin-interpreter,zeppelin-zengine,zeppelin-server'
```bash
TEST_SELENIUM=true mvn test -Dtest=[TEST_NAME] -DfailIfNoTests=false \
-pl 'zeppelin-interpreter,zeppelin-zengine,zeppelin-server'
```

For example, to run [ParagraphActionIT](https://github.com/apache/zeppelin/blob/master/zeppelin-server/src/test/java/org/apache/zeppelin/integration/ParagraphActionsIT.java),

```
TEST_SELENIUM=true mvn test -Dtest=ParagraphActionsIT -DfailIfNoTests=false -pl 'zeppelin-interpreter,zeppelin-zengine,zeppelin-server'
```bash
TEST_SELENIUM=true mvn test -Dtest=ParagraphActionsIT -DfailIfNoTests=false \
-pl 'zeppelin-interpreter,zeppelin-zengine,zeppelin-server'
```

You'll need Firefox web browser installed in your development environment. While CI server uses [Firefox 31.0](https://ftp.mozilla.org/pub/firefox/releases/31.0/) to run selenium test, it is good idea to install the same version (disable auto update to keep the version).
Expand Down
2 changes: 1 addition & 1 deletion docs/development/contribution/how_to_contribute_website.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Documentation website is hosted in 'master' branch under `/docs/` dir.
First of all, you need the website source code. The official location of mirror for Zeppelin is [http://git.apache.org/zeppelin.git](http://git.apache.org/zeppelin.git).
Get the source code on your development machine using git.

```
```bash
git clone git://git.apache.org/zeppelin.git
cd docs
```
Expand Down
17 changes: 10 additions & 7 deletions docs/development/contribution/useful_developer_tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Check [zeppelin-web: Local Development](https://github.com/apache/zeppelin/tree/

this script would be helpful when changing JDK version frequently.

```
```bash
function setjdk() {
if [ $# -ne 0 ]; then
# written based on OSX.
Expand All @@ -59,7 +59,7 @@ you can use this function like `setjdk 1.8` / `setjdk 1.7`

### Building Submodules Selectively

```
```bash
# build `zeppelin-web` only
mvn clean -pl 'zeppelin-web' package -DskipTests;

Expand All @@ -71,15 +71,16 @@ mvn clean package -pl 'spark,spark-dependencies,zeppelin-server' --am -DskipTest

# build spark related modules with profiles: scala 2.11, spark 2.1 hadoop 2.7
./dev/change_scala_version.sh 2.11
mvn clean package -Pspark-2.1 -Phadoop-2.7 -Pscala-2.11 -pl 'spark,spark-dependencies,zeppelin-server' --am -DskipTests
mvn clean package -Pspark-2.1 -Phadoop-2.7 -Pscala-2.11 \
-pl 'spark,spark-dependencies,zeppelin-server' --am -DskipTests

# build `zeppelin-server` and `markdown` with dependencies
mvn clean package -pl 'markdown,zeppelin-server' --am -DskipTests
```

### Running Individual Tests

```
```bash
# run the `HeliumBundleFactoryTest` test class
mvn test -pl 'zeppelin-server' --am -DfailIfNoTests=false -Dtest=HeliumBundleFactoryTest
```
Expand All @@ -88,13 +89,15 @@ mvn test -pl 'zeppelin-server' --am -DfailIfNoTests=false -Dtest=HeliumBundleFac

Make sure that Zeppelin instance is started to execute integration tests (= selenium tests).

```
```bash
# run the `SparkParagraphIT` test class
TEST_SELENIUM="true" mvn test -pl 'zeppelin-server' --am -DfailIfNoTests=false -Dtest=SparkParagraphIT
TEST_SELENIUM="true" mvn test -pl 'zeppelin-server' --am \
-DfailIfNoTests=false -Dtest=SparkParagraphIT

# run the `testSqlSpark` test function only in the `SparkParagraphIT` class
# but note that, some test might be dependent on the previous tests
TEST_SELENIUM="true" mvn test -pl 'zeppelin-server' --am -DfailIfNoTests=false -Dtest=SparkParagraphIT#testSqlSpark
TEST_SELENIUM="true" mvn test -pl 'zeppelin-server' --am \
-DfailIfNoTests=false -Dtest=SparkParagraphIT#testSqlSpark
```


Expand Down
6 changes: 3 additions & 3 deletions docs/development/helium/writing_application.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,15 +147,15 @@ Resouce name is a string which will be compared with the name of objects in the

Application may require two or more resources. Required resources can be listed inside of the json array. For example, if the application requires object "name1", "name2" and "className1" type of object to run, resources field can be

```
```json
resources: [
[ "name1", "name2", ":className1", ...]
]
```

If Application can handle alternative combination of required resources, alternative set can be listed as below.

```
```json
resources: [
[ "name", ":className"],
[ "altName", ":altClassName1"],
Expand All @@ -165,7 +165,7 @@ resources: [

Easier way to understand this scheme is

```
```json
resources: [
[ 'resource' AND 'resource' AND ... ] OR
[ 'resource' AND 'resource' AND ... ] OR
Expand Down
4 changes: 2 additions & 2 deletions docs/development/helium/writing_visualization_basic.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,15 +190,15 @@ e.g.

#### 4. Run in dev mode

Place your __Helium package file__ in local registry (ZEPPELIN_HOME/helium).
Place your __Helium package file__ in local registry (`ZEPPELIN_HOME/helium`).
Run Zeppelin. And then run zeppelin-web in visualization dev mode.

```bash
cd zeppelin-web
yarn run dev:helium
```

You can browse localhost:9000. Everytime refresh your browser, Zeppelin will rebuild your visualization and reload changes.
You can browse `localhost:9000`. Everytime refresh your browser, Zeppelin will rebuild your visualization and reload changes.


#### 5. Publish your visualization
Expand Down
24 changes: 12 additions & 12 deletions docs/development/writing_zeppelin_interpreter.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ In 'Separate Interpreter(scoped / isolated) for each note' mode which you can se
Creating a new interpreter is quite simple. Just extend [org.apache.zeppelin.interpreter](https://github.com/apache/zeppelin/blob/master/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/Interpreter.java) abstract class and implement some methods.
For your interpreter project, you need to make `interpreter-parent` as your parent project and use plugin `maven-enforcer-plugin`, `maven-dependency-plugin` and `maven-resources-plugin`. Here's one sample pom.xml

```
```xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>

Expand Down Expand Up @@ -128,7 +128,7 @@ Here is an example of `interpreter-setting.json` on your own interpreter.

Finally, Zeppelin uses static initialization with the following:

```
```java
static {
Interpreter.register("MyInterpreterName", MyClassName.class.getName());
}
Expand Down Expand Up @@ -157,7 +157,7 @@ If you want to add a new set of syntax highlighting,
1. Add the `mode-*.js` file to <code>[zeppelin-web/bower.json](https://github.com/apache/zeppelin/blob/master/zeppelin-web/bower.json)</code> (when built, <code>[zeppelin-web/src/index.html](https://github.com/apache/zeppelin/blob/master/zeppelin-web/src/index.html)</code> will be changed automatically).
2. Add `language` field to `editor` object. Note that if you don't specify language field, your interpreter will use plain text mode for syntax highlighting. Let's say you want to set your language to `java`, then add:

```
```json
"editor": {
"language": "java"
}
Expand All @@ -166,7 +166,7 @@ If you want to add a new set of syntax highlighting,
### Edit on double click
If your interpreter uses mark-up language such as markdown or HTML, set `editOnDblClick` to `true` so that text editor opens on pargraph double click and closes on paragraph run. Otherwise set it to `false`.

```
```json
"editor": {
"editOnDblClick": false
}
Expand All @@ -177,7 +177,7 @@ By default, `Ctrl+dot(.)` brings autocompletion list in the editor.
Through `completionKey`, each interpreter can configure autocompletion key.
Currently `TAB` is only available option.

```
```json
"editor": {
"completionKey": "TAB"
}
Expand All @@ -201,7 +201,7 @@ To configure your interpreter you need to follow these steps:
Property value is comma separated [INTERPRETER\_CLASS\_NAME].
For example,

```
```xml
<property>
<name>zeppelin.interpreters</name>
<value>org.apache.zeppelin.spark.SparkInterpreter,org.apache.zeppelin.spark.PySparkInterpreter,org.apache.zeppelin.spark.SparkSqlInterpreter,org.apache.zeppelin.spark.DepInterpreter,org.apache.zeppelin.markdown.Markdown,org.apache.zeppelin.shell.ShellInterpreter,org.apache.zeppelin.hive.HiveInterpreter,com.me.MyNewInterpreter</value>
Expand All @@ -225,7 +225,7 @@ Note that the first interpreter configuration in zeppelin.interpreters will be t

For example,

```
```scala
%myintp

val a = "My interpreter"
Expand All @@ -235,27 +235,27 @@ println(a)
### 0.6.0 and later
Inside of a note, `%[INTERPRETER_GROUP].[INTERPRETER_NAME]` directive will call your interpreter.

You can omit either [INTERPRETER\_GROUP] or [INTERPRETER\_NAME]. If you omit [INTERPRETER\_NAME], then first available interpreter will be selected in the [INTERPRETER\_GROUP].
Likewise, if you skip [INTERPRETER\_GROUP], then [INTERPRETER\_NAME] will be chosen from default interpreter group.
You can omit either `[INTERPRETER\_GROUP]` or `[INTERPRETER\_NAME]`. If you omit `[INTERPRETER\_NAME]`, then first available interpreter will be selected in the `[INTERPRETER\_GROUP]`.
Likewise, if you skip `[INTERPRETER\_GROUP]`, then `[INTERPRETER\_NAME]` will be chosen from default interpreter group.


For example, if you have two interpreter myintp1 and myintp2 in group mygrp, you can call myintp1 like
For example, if you have two interpreter `myintp1` and `myintp2` in group `mygrp`, you can call myintp1 like

```
%mygrp.myintp1

codes for myintp1
```

and you can call myintp2 like
and you can call `myintp2` like

```
%mygrp.myintp2

codes for myintp2
```

If you omit your interpreter name, it'll select first available interpreter in the group ( myintp1 ).
If you omit your interpreter name, it'll select first available interpreter in the group ( `myintp1` ).

```
%mygrp
Expand Down
7 changes: 4 additions & 3 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ limitations under the License.
* [BigQuery](./interpreter/bigquery.html)
* [Cassandra](./interpreter/cassandra.html)
* [Elasticsearch](./interpreter/elasticsearch.html)
* [flink](./interpreter/flink.html)
* [Flink](./interpreter/flink.html)
* [Geode](./interpreter/geode.html)
* [Groovy](./interpreter/groovy.html)
* [HBase](./interpreter/hbase.html)
Expand All @@ -145,7 +145,8 @@ limitations under the License.
* [Kylin](./interpreter/kylin.html)
* [Lens](./interpreter/lens.html)
* [Livy](./interpreter/livy.html)
* [markdown](./interpreter/markdown.html)
* [Mahout](./interpreter/mahout.html)
* [Markdown](./interpreter/markdown.html)
* [Neo4j](./interpreter/neo4j.html)
* [Pig](./interpreter/pig.html)
* [Postgresql, HAWQ](./interpreter/postgresql.html)
Expand All @@ -154,7 +155,7 @@ limitations under the License.
* [SAP](./interpreter/sap.html)
* [Scalding](./interpreter/scalding.html)
* [Scio](./interpreter/scio.html)
* [Shell](./interpreter/Shell.html)
* [Shell](./interpreter/shell.html)
* [Spark](./interpreter/spark.html)

#### External Resources
Expand Down