-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #284 from chaogefeng/master
linkis adds shell engine support
- Loading branch information
Showing
38 changed files
with
1,321 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
~ Copyright 2019 WeBank | ||
~ | ||
~ Licensed under the Apache License, Version 2.0 (the "License"); | ||
~ you may not use this file except in compliance with the License. | ||
~ You may obtain a copy of the License at | ||
~ | ||
~ http://www.apache.org/licenses/LICENSE-2.0 | ||
~ | ||
~ Unless required by applicable law or agreed to in writing, software | ||
~ distributed under the License is distributed on an "AS IS" BASIS, | ||
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
~ See the License for the specific language governing permissions and | ||
~ limitations under the License. | ||
--> | ||
|
||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<parent> | ||
<artifactId>linkis</artifactId> | ||
<groupId>com.webank.wedatasphere.linkis</groupId> | ||
<version>0.9.3</version> | ||
</parent> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<artifactId>linkis-shell-engine</artifactId> | ||
<version>${linkis.version}</version> | ||
<packaging>jar</packaging> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.apache.commons</groupId> | ||
<artifactId>commons-exec</artifactId> | ||
<version>1.3</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.webank.wedatasphere.linkis</groupId> | ||
<artifactId>linkis-ujes-engine</artifactId> | ||
<version>${linkis.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.webank.wedatasphere.linkis</groupId> | ||
<artifactId>linkis-common</artifactId> | ||
<version>${linkis.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework.cloud</groupId> | ||
<artifactId>spring-cloud-starter-feign</artifactId> | ||
<version>${spring.eureka.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.webank.wedatasphere.linkis</groupId> | ||
<artifactId>linkis-cloudRPC</artifactId> | ||
<version>${linkis.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.webank.wedatasphere.linkis</groupId> | ||
<artifactId>linkis-storage</artifactId> | ||
<version>${linkis.version}</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>com.webank.wedatasphere.linkis</groupId> | ||
<artifactId>linkis-bml-hook</artifactId> | ||
<version>${linkis.version}</version> | ||
</dependency> | ||
|
||
</dependencies> | ||
|
||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-deploy-plugin</artifactId> | ||
</plugin> | ||
<plugin> | ||
<groupId>net.alchim31.maven</groupId> | ||
<artifactId>scala-maven-plugin</artifactId> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-jar-plugin</artifactId> | ||
</plugin> | ||
<plugin> | ||
<artifactId>maven-assembly-plugin</artifactId> | ||
<configuration> | ||
<descriptorRefs> | ||
<descriptorRef>jar-with-dependencies</descriptorRef> | ||
</descriptorRefs> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-gpg-plugin</artifactId> | ||
<configuration> | ||
<skip>true</skip> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
<resources> | ||
<resource> | ||
<directory>${basedir}/src/main/resources</directory> | ||
</resource> | ||
</resources> | ||
<finalName>${project.artifactId}-${project.version}</finalName> | ||
</build> | ||
|
||
|
||
</project> |
17 changes: 17 additions & 0 deletions
17
...c/main/scala/com/webank/wedatasphere/linkis/engine/shell/codeparser/ShellCodeParser.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package com.webank.wedatasphere.linkis.engine.shell.codeparser | ||
|
||
import com.webank.wedatasphere.linkis.engine.execute.CodeType.CodeType | ||
import com.webank.wedatasphere.linkis.engine.execute.{CodeType, EngineExecutorContext, SingleCodeParser} | ||
|
||
/** | ||
* created by cooperyang on 2019/5/16 | ||
* Description: shell的代码解析器,shell代码不能进行切分,因为shell代码需要进入到 | ||
*/ | ||
class ShellCodeParser extends SingleCodeParser{ | ||
override val codeType: CodeType = CodeType.Shell | ||
|
||
override def parse(code: String, engineExecutorContext: EngineExecutorContext): Array[String] = { | ||
Array(code) | ||
} | ||
|
||
} |
12 changes: 12 additions & 0 deletions
12
...ain/scala/com/webank/wedatasphere/linkis/engine/shell/conf/ShellEngineConfiguration.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package com.webank.wedatasphere.linkis.engine.shell.conf | ||
|
||
import com.webank.wedatasphere.linkis.common.conf.CommonVars | ||
|
||
/** | ||
* created by cooperyang on 2019/5/14 | ||
* Description: | ||
*/ | ||
object ShellEngineConfiguration { | ||
val OUTPUT_LIMIT = CommonVars("bdp.dataworkcloud.shell.output.limit", 5000) | ||
val WORKING_DIR = CommonVars("bdp.dataworkcloud.shell.working.dir", "/appcom/") | ||
} |
21 changes: 21 additions & 0 deletions
21
...c/main/scala/com/webank/wedatasphere/linkis/engine/shell/conf/ShellEngineSpringConf.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package com.webank.wedatasphere.linkis.engine.shell.conf | ||
|
||
import com.webank.wedatasphere.linkis.engine.execute.hook._ | ||
import com.webank.wedatasphere.linkis.engine.execute.{CodeParser, EngineHook} | ||
import com.webank.wedatasphere.linkis.engine.shell.codeparser.ShellCodeParser | ||
import org.springframework.context.annotation.{Bean, Configuration} | ||
|
||
/** | ||
* created by cooperyang on 2019/5/17 | ||
* Description: | ||
*/ | ||
@Configuration | ||
class ShellEngineSpringConf { | ||
@Bean(Array("codeParser")) | ||
def createCodeParser(): CodeParser = new ShellCodeParser() | ||
|
||
|
||
@Bean(Array("engineHooks")) | ||
def createEngineHooks(): Array[EngineHook] = | ||
Array(new ReleaseEngineHook, new MaxExecuteNumEngineHook) | ||
} |
12 changes: 12 additions & 0 deletions
12
.../scala/com/webank/wedatasphere/linkis/engine/shell/exception/NoCorrectUserException.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package com.webank.wedatasphere.linkis.engine.shell.exception | ||
|
||
import com.webank.wedatasphere.linkis.common.exception.ErrorException | ||
|
||
/** | ||
* created by cooperyang on 2019/5/17 | ||
* Description: | ||
*/ | ||
case class NoCorrectUserException() extends ErrorException(50036, "No illegal user holds this process") | ||
|
||
|
||
case class ShellCodeErrorException() extends ErrorException(50037, "shell code is wrong") |
Oops, something went wrong.