Also, instead of a magic SystemProperty, I would prefer something more explicit--maybe an optional parameter to the SparkContext constructor, or calling a setter on a SparkConfig that gets passed to SparkContext. 

...huh, I suppose just using the existing SparkContext(environment) parameter (which goes to sc.executorEnvs) would be about the same thing.