Skip to content

Commit dba44dd

Browse files
authored
In the engineConnExec.sh script, replace the absolute path of CLASSPATH with a variable (#5276)
1 parent 12262ad commit dba44dd

File tree

4 files changed

+11
-9
lines changed

4 files changed

+11
-9
lines changed

linkis-computation-governance/linkis-engineconn-manager/linkis-engineconn-manager-core/src/main/scala/org/apache/linkis/ecm/core/launch/ProcessEngineConnLaunch.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ trait ProcessEngineConnLaunch extends EngineConnLaunch with Logging {
119119
environment.put(PREFER_IP_ADDRESS.toString, Configuration.PREFER_IP_ADDRESS.toString)
120120
case ENGINECONN_ENVKEYS =>
121121
environment.put(ENGINECONN_ENVKEYS.toString, GovernanceCommonConf.ENGINECONN_ENVKEYS)
122+
case LINKIS_HOME => putIfExists(LINKIS_HOME)
122123
case _ =>
123124
}
124125
}

linkis-computation-governance/linkis-engineconn/linkis-engineconn-plugin-core/src/main/scala/org/apache/linkis/manager/engineplugin/common/conf/EnvConfiguration.scala

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,8 @@ object EnvConfiguration {
7474

7575
val LOG4J2_XML_FILE = CommonVars[String]("wds.linkis.engineconn.log4j2.xml.file", "log4j2.xml")
7676

77-
val LINKIS_PUBLIC_MODULE_PATH = CommonVars(
78-
"wds.linkis.public_module.path",
79-
Configuration.getLinkisHome + "/lib/linkis-commons/public-module"
80-
)
77+
val LINKIS_PUBLIC_MODULE_PATH =
78+
CommonVars("wds.linkis.public_module.path", "/lib/linkis-commons/public-module")
8179

8280
val LINKIS_CONF_DIR = CommonVars("LINKIS_CONF_DIR", Configuration.getLinkisHome() + "/conf")
8381
}

linkis-computation-governance/linkis-engineconn/linkis-engineconn-plugin-core/src/main/scala/org/apache/linkis/manager/engineplugin/common/launch/process/Environment.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ object Environment extends Enumeration {
2323

2424
type Environment = Value
2525

26-
val USER, ECM_HOME, PWD, PATH, SHELL, JAVA_HOME, CLASSPATH, HADOOP_HOME, HADOOP_CONF_DIR,
27-
HIVE_CONF_DIR, LOG_DIRS, TEMP_DIRS, ECM_HOST, ECM_PORT, RANDOM_PORT, SERVICE_DISCOVERY,
28-
PREFER_IP_ADDRESS, UDF_JARS, ENGINECONN_ENVKEYS = Value
26+
val USER, ECM_HOME, PWD, PATH, SHELL, JAVA_HOME, LINKIS_HOME, CLASSPATH, HADOOP_HOME,
27+
HADOOP_CONF_DIR, HIVE_CONF_DIR, LOG_DIRS, TEMP_DIRS, ECM_HOST, ECM_PORT, RANDOM_PORT,
28+
SERVICE_DISCOVERY, PREFER_IP_ADDRESS, UDF_JARS, ENGINECONN_ENVKEYS = Value
2929

3030
def variable(environment: Environment): String =
3131
LaunchConstants.EXPANSION_MARKER_LEFT + environment + LaunchConstants.EXPANSION_MARKER_RIGHT

linkis-computation-governance/linkis-engineconn/linkis-engineconn-plugin-core/src/main/scala/org/apache/linkis/manager/engineplugin/common/launch/process/JavaProcessEngineConnLaunchBuilder.scala

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,12 +119,15 @@ abstract class JavaProcessEngineConnLaunchBuilder
119119
// first, add engineconn conf dirs.
120120
addPathToClassPath(environment, buildPath(Seq(variable(PWD), ENGINE_CONN_CONF_DIR_NAME)))
121121
// then, add LINKIS_CONF_DIR conf dirs.
122-
addPathToClassPath(environment, buildPath(Seq(EnvConfiguration.LINKIS_CONF_DIR.getValue)))
122+
addPathToClassPath(environment, buildPath(Seq(variable(LINKIS_HOME), "conf")))
123123
// then, add engineconn libs.
124124
addPathToClassPath(environment, buildPath(Seq(variable(PWD), ENGINE_CONN_LIB_DIR_NAME + "/*")))
125125
// then, add public modules.
126126
if (!enablePublicModule) {
127-
addPathToClassPath(environment, buildPath(Seq(LINKIS_PUBLIC_MODULE_PATH.getValue + "/*")))
127+
addPathToClassPath(
128+
environment,
129+
buildPath(Seq(variable(LINKIS_HOME), LINKIS_PUBLIC_MODULE_PATH.getValue + "/*"))
130+
)
128131
}
129132
// finally, add the suitable properties key to classpath
130133
val taskClassPathFiles = EnvConfiguration.ENGINE_CONN_CLASSPATH_FILES.getValue(

0 commit comments

Comments
 (0)