Mango Python Examples

Note: Python 2.7 is dropping support January 1, 2020. For this reason, Mango no longer supports Python 2.

Running Mango Notebook Locally

Once Mango and Mango python is built, you can run the following command to view Mango notebook.

./bin/mango-notebook

Mango notebook depends on Jupyter notebook. To install all dependencies for Mango notebook in a virtual environment, see installation instructions.

One Mango notebook is running, you can view local results at localhost:<port>, where <port> is the open port assigned by Jupyter notebook. There are three notebooks that can be viewed as examples in the Mango repository:

Running the Mango Notebook with Parameters

The Mango Notebook can be run with Apache Spark parameters and Jupyter notebook parameters. To run Mango notebook with user specified parameters, run

./bin/mango-notebook <Spark-parameters> -- <Jupyter-notebook-parameters>

Running the Mango Notebook on YARN

YARN is a resource management system for clusters. The Mango notebook can run on YARN clusters, and requires jars for org.apache.parquet:parquet-hadoop:1.8.3. To run the Mango browser on YARN, download parquet-hadoop jar:

Then include the jar in spark.driver.extraClassPath:

wget http://central.maven.org/maven2/org/apache/parquet/parquet-hadoop/1.8.3/parquet-hadoop-1.8.3.jar
./bin/mango-notebook --master yarn \
  --conf spark.driver.extraClassPath=<path_to_jar>/parquet-hadoop-1.8.3.jar \
   -- <Jupyter-notebook-parameters>