Install Python Packages at Runtime for use with PySpark
The following code can be used to install packages on each executor node at runtime.
Note: This functionality is not available on a non-root BDC deployment (including OpenShift). This installation is temporary, and must be performed each time a new Spark session is invoked.
If you want to use this from CU5 upwards, you must add two settings pre-deployment.
In contron.json, add (under security):
"allowRunAsRoot": true
In BDC.json, add (under spec.services.spark.settings):
"yarn-site.yarn.nodemanager.container-executor.class": "org.apache.hadoop.yarn.server.nodemanager.DefaultContainerExecutor"