Browse Source

YARN-9160. [Submarine] Document 'PYTHONPATH' environment variable setting when using -localization options. (Zhankun Tang via wangda)

Change-Id: I115b6710eb11501e21ab3e9e7cd1a87f322e5cf8
(cherry picked from commit 2c02aa6ec259128934cc5468cf66104a624d88a7)
Wangda Tan 6 năm trước cách đây
mục cha
commit
cffe5c1ba0

+ 18 - 0
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-submarine/src/site/markdown/QuickStart.md

@@ -87,6 +87,24 @@ usage: job run
                               -localization "/user/yarn/mydir3:/opt/mydir3"
                               -localization "./mydir1:."
 ```
+
+#### Notes:
+When using `localization` option to make a collection of dependency Python 
+scripts available to entry python script in the container, you may also need to
+ set `PYTHONPATH` environment variable as below to avoid module import error 
+reported from `entry_script.py`.
+
+```
+... job run
+  # the entry point
+  --localization entry_script.py:<path>/entry_script.py
+  # the dependency Python scripts of the entry point
+  --localization other_scripts_dir:<path>/other_scripts_dir
+  # the PYTHONPATH env to make dependency available to entry script
+  --env PYTHONPATH="<path>/other_scripts_dir"
+  --worker_launch_cmd "python <path>/entry_script.py ..."
+```
+
 ### Submarine Configuration
 
 For submarine internal configuration, please create a `submarine.xml` which should be placed under `$HADOOP_CONF_DIR`.