GitHub user mateiz opened a pull request:

    https://github.com/apache/spark/pull/664

    [SPARK-1549] Add Python support to spark-submit

    This PR updates spark-submit to allow submitting Python scripts (currently 
only with deploy-mode=client, but that's all that was supported before) and 
updates the PySpark code to properly find various paths, etc. One significant 
change is that we assume we can always find the Python files either from the 
Spark assembly JAR (which will happen with the Maven assembly build in 
make-distribution.sh) or from SPARK_HOME (which will exist in local mode even 
if you use sbt assembly, and should be enough for testing). This means we no 
longer need a weird hack to modify the environment for YARN.
    
    This patch also updates the Python worker manager to run python with -u, 
which means unbuffered output (send it to our logs right away instead of 
waiting a while after stuff was written); this should simplify debugging.
    
    In addition, it fixes https://issues.apache.org/jira/browse/SPARK-1709, 
setting the main class from a JAR's Main-Class attribute if not specified by 
the user, and fixes a few help strings and style issues in spark-submit.
    
    In the future we may want to make the `pyspark` shell use spark-submit as 
well, but it seems unnecessary for 1.0.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/mateiz/spark py-submit

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/spark/pull/664.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #664
    
----
commit d4375bddd41542bdf94bd08a40b073f7046720e3
Author: Matei Zaharia <[email protected]>
Date:   2014-05-04T22:49:12Z

    Clean up description of spark-submit args a bit and add Python ones

commit 47c0655da0ef53fc37b2c41a4cfa0030fc85d84b
Author: Matei Zaharia <[email protected]>
Date:   2014-05-05T07:52:22Z

    More work to make spark-submit work with Python:
    
    - Launch Py4J gateway server in-process and execute Python main class
    - Redirect its output to PythonRunner
    - Various misc fixes to messages and error reporting in SparkSubmit

commit 15f8e1ef7eead23922aaec5e63e439c054355911
Author: Matei Zaharia <[email protected]>
Date:   2014-05-05T23:59:47Z

    Set PYTHONPATH in PythonWorkerFactory in case it wasn't set from outside

commit 4650412c7794a0002a80b82831e29c8b095c206f
Author: Matei Zaharia <[email protected]>
Date:   2014-05-06T08:43:02Z

    Add pyFiles to PYTHONPATH in executors, remove old YARN stuff, add tests

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to