Browse Source

Python task specifies path execution update

pull/2/head
qiaozhanwei 6 years ago
parent
commit
10ba69db5d
  1. 2
      escheduler-server/src/main/java/cn/escheduler/server/worker/task/PythonCommandExecutor.java
  2. 12
      script/env/escheduler_env.py

2
escheduler-server/src/main/java/cn/escheduler/server/worker/task/PythonCommandExecutor.java

@ -86,7 +86,7 @@ public class PythonCommandExecutor extends AbstractCommandExecutor {
@Override
protected String commandType() {
String envPath = System.getProperty("user.dir") + Constants.SINGLE_SLASH + "conf "+
String envPath = System.getProperty("user.dir") + Constants.SINGLE_SLASH + "conf"+
Constants.SINGLE_SLASH +"env" + Constants.SINGLE_SLASH + Constants.ESCHEDULER_ENV_SH;
String pythonHome = getPythonHome(envPath);
if (StringUtils.isEmpty(pythonHome)){

12
script/env/escheduler_env.py vendored

@ -1,12 +0,0 @@
import os
HADOOP_HOME="/opt/soft/hadoop"
SPARK_HOME1="/opt/soft/spark1"
SPARK_HOME2="/opt/soft/spark2"
PYTHON_HOME="/opt/soft/python"
JAVA_HOME="/opt/soft/java"
HIVE_HOME="/opt/soft/hive"
PATH=os.environ['PATH']
PATH="%s/bin:%s/bin:%s/bin:%s/bin:%s/bin:%s/bin:%s"%(HIVE_HOME,HADOOP_HOME,SPARK_HOME1,SPARK_HOME2,JAVA_HOME,PYTHON_HOME,PATH)
os.putenv('PATH','%s'%PATH)
Loading…
Cancel
Save