title: scheduling pyspark notebooks
body: <p>I have an ipython notebook that contains some PySpark code on a cluster. Currently we are using oozie to run these notebooks on Hadoop via HUE. The setup feels less than ideal and we were wondering if there is an alternative. </p>
  
  <p>We first convert the <code>.ipynb</code> file into a <code>.py</code> file and move it to hdfs. Along with this file we also create a <code>.sh</code> file that calls the python file. The contents are similar to:</p>
  
  <pre><code>#!/bin/sh
  set -e
  
  [ -r     /usr/local/virtualenv/pyspark/bin/activate ] &amp;&amp;
  source /usr/local/virtualenv/pyspark/bin/activate
  
  spark-submit --master yarn-client --&lt;setting&gt; &lt;setting_val&gt;  &lt;filename&gt;.py
  </code></pre>
  
  <p>Next we have Oozie point to this <code>.sh</code> file. This flow feels a bit cumbersome and Oozie doesn't give us great insight in what goes wrong when something fails. We do like it how Oozie knows how to run tasks in parallell or serial depending on your configuration. </p>
  
  <p>Is there a better, smoother way of just scheduling pyspark notebooks? </p>