Skip to content

Commit

Permalink
Don't source env file in task, this will override tenant's environment (
Browse files Browse the repository at this point in the history
  • Loading branch information
ruanwenjun authored Nov 28, 2022
1 parent a0eb45b commit 32a8241
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,21 +95,13 @@ protected void createCommandFileIfNotExists(String execCommand, String commandFi
sb.append("cd /d %~dp0").append(System.lineSeparator());
if (StringUtils.isNotBlank(taskRequest.getEnvironmentConfig())) {
sb.append(taskRequest.getEnvironmentConfig()).append(System.lineSeparator());
} else {
if (taskRequest.getEnvFile() != null) {
sb.append("call ").append(taskRequest.getEnvFile()).append(System.lineSeparator());
}
}
} else {
sb.append("#!/bin/bash").append(System.lineSeparator());
sb.append("BASEDIR=$(cd `dirname $0`; pwd)").append(System.lineSeparator());
sb.append("cd $BASEDIR").append(System.lineSeparator());
if (StringUtils.isNotBlank(taskRequest.getEnvironmentConfig())) {
sb.append(taskRequest.getEnvironmentConfig()).append(System.lineSeparator());
} else {
if (taskRequest.getEnvFile() != null) {
sb.append("source ").append(taskRequest.getEnvFile()).append(System.lineSeparator());
}
}
}
sb.append(execCommand);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,11 +166,6 @@ public class TaskExecutionContext implements Serializable {
*/
private String taskParams;

/**
* envFile
*/
private String envFile;

/**
* environmentConfig
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,10 +196,6 @@ protected void initializeTask() {
taskExecutionContext.setStartTime(taskStartTime);
logger.info("Set task startTime: {}", taskStartTime);

String systemEnvPath = CommonUtils.getSystemEnvPath();
taskExecutionContext.setEnvFile(systemEnvPath);
logger.info("Set task envFile: {}", systemEnvPath);

String taskAppId = String.format("%s_%s", taskExecutionContext.getProcessInstanceId(),
taskExecutionContext.getTaskInstanceId());
taskExecutionContext.setTaskAppId(taskAppId);
Expand Down
16 changes: 0 additions & 16 deletions script/env/dolphinscheduler_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,10 @@
# limitations under the License.
#

# JAVA_HOME, will use it to start DolphinScheduler server
export JAVA_HOME=${JAVA_HOME:-/opt/java/openjdk}

# Never put sensitive config such as database password here in your production environment,
# this file will be sourced everytime a new task is executed.

# Tasks related configurations, need to change the configuration if you use the related tasks.
export HADOOP_HOME=${HADOOP_HOME:-/opt/soft/hadoop}
export HADOOP_CONF_DIR=${HADOOP_CONF_DIR:-/opt/soft/hadoop/etc/hadoop}
export SPARK_HOME=${SPARK_HOME:-/opt/soft/spark}
export PYTHON_HOME=${PYTHON_HOME:-/opt/soft/python}
export HIVE_HOME=${HIVE_HOME:-/opt/soft/hive}
export FLINK_HOME=${FLINK_HOME:-/opt/soft/flink}
export DATAX_HOME=${DATAX_HOME:-/opt/soft/datax}
export SEATUNNEL_HOME=${SEATUNNEL_HOME:-/opt/soft/seatunnel}
export CHUNJUN_HOME=${CHUNJUN_HOME:-/opt/soft/chunjun}
export LINKIS_HOME=${LINKIS_HOME:-/opt/soft/linkis}

export PATH=$HADOOP_HOME/bin:$SPARK_HOME/bin:$PYTHON_HOME/bin:$JAVA_HOME/bin:$HIVE_HOME/bin:$FLINK_HOME/bin:$DATAX_HOME/bin:$SEATUNNEL_HOME/bin:$CHUNJUN_HOME/bin:$PATH

# applicationId auto collection related configuration, the following configurations are unnecessary if setting appId.collect=log
#export HADOOP_CLASSPATH=`hadoop classpath`:${DOLPHINSCHEDULER_HOME}/tools/libs/*
#export SPARK_DIST_CLASSPATH=$HADOOP_CLASSPATH:$SPARK_DIST_CLASS_PATH
Expand Down

0 comments on commit 32a8241

Please sign in to comment.