Wondering - is there any reason not to make SPARK_YARN_MODE into a SparkConf value. E.g. spark.yarnMode? It seems like we only use it in places where spark conf is visible. Look, for instance at spark.driver.host and so on where we detect it at the driver and then set it to be passed to executors. It would be nice to try and standardize on SparkConf as the way of doing this unless there is some reason it won't work (which there may be...).