Skip to content

Commit

Permalink
添加打包 更换etl-plugins 模块名为connectors
Browse files Browse the repository at this point in the history
  • Loading branch information
ideal committed Aug 20, 2018
1 parent cd6f5d2 commit 6b60afa
Show file tree
Hide file tree
Showing 17 changed files with 64 additions and 29 deletions.
6 changes: 3 additions & 3 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ project(':sylph-runners:spark').name = 'sylph-runner-spark'

//----
include 'sylph-etl-api'
include 'sylph-etl-plugins'
include 'sylph-etl-plugins:flink-node-plugin'
include 'sylph-etl-plugins:spark-node-plugin'
include 'sylph-connectors'
include 'sylph-connectors:flink-node-plugin'
include 'sylph-connectors:spark-node-plugin'

//----
include 'sylph-dist'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

evaluationDependsOn(':sylph-dist')
subprojects {
apply plugin: 'com.github.harbby.gradle.serviceloader'
serviceLoader {
Expand Down
42 changes: 38 additions & 4 deletions sylph-dist/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,42 @@ task copyFiles(type: Copy,dependsOn: copyLibs){

assemble.dependsOn copyFiles

task dist(){
// from(configurations.runtime) {
// into tarpath+"/lib"
// }
task dist(type: Tar) {
baseName = rootProject.getName()
classifier = 'bin'
extension = 'tgz'
compression = Compression.GZIP
def tarpath = baseName+"-${rootProject.version}"

from(configurations.runtime) {
into tarpath+"/lib"
}

from(project.files('src/bin')) {
into(tarpath+"/bin")
fileMode = 0755
}
from(project.files('src/etc')) {
into(tarpath+"/etc")
}

from(project.files('src/jobs')) {
into(tarpath+"/jobs")
}

from(project.files('src/webapps')) {
into(tarpath+"/webapps")
}

from(project.files('build/modules')){
into tarpath+"/modules"
}

from(project.files('build/etl-plugins')) {
into(tarpath+"/etl-plugins")
}
}

artifacts {
'default' dist
}
31 changes: 16 additions & 15 deletions sylph-dist/src/webapps/index.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<html lang="en">
<meta charset="UTF-8">
<title>任务管理</title>
<title>JobManager</title>
<link href="./css/bootstrap.min.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="./libs/jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="./js/list.js"></script>
Expand Down Expand Up @@ -28,32 +28,33 @@
<body>


<h2>任务管理</h2>
<h2>JobManager</h2>

<form method="post" action="/_sys/job_manger" enctype="multipart/form-data">
<div style="width: 500px; margin-bottom: 50px">
<div class="form-group">
<label>上传任务</label>
<input type="file" name="file" class="form-control" />
</div>
<span>
<input type="submit" class="btn btn-primary" value="点击上传" />
</span>
</div>
</form>
<!--<form method="post" action="/_sys/job_manger" enctype="multipart/form-data">-->
<!--<div style="width: 500px; margin-bottom: 50px">-->
<!--<div class="form-group">-->
<!--<label>上传任务</label>-->
<!--<input type="file" name="file" class="form-control" />-->
<!--</div>-->
<!--<span>-->
<!--<input type="submit" class="btn btn-primary" value="点击上传" />-->
<!--</span>-->
<!--</div>-->
<!--</form>-->

<div class="row">
<div class="col-md-8"><label>插件列表</label></div>
<div class="col-md-4">
<button class="btn btn-primary refresh_all">刷新</button>
<button class="btn btn-primary" onclick='window.location.href="etl.html"'>新建任务</button>
<button class="btn btn-primary" onclick='window.location.href="etl.html"'>新建etl任务</button>
<button class="btn btn-primary" onclick='window.location.href="stream_sql.html"'>新建StreamSql任务</button>
</div>
</div>

<div class="row" id="rowHead">
<div class="col-md-2">任务id</div>
<div class="col-md-3">AppId</div>
<div class="col-md-1">类型</div>
<div class="col-md-1">类型</div>
<div class="col-md-2">创建时间</div>
<div class="col-md-1">状态</div>
<div class="col-md-3">操作</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ public void saveJob(@Nonnull Job job)
job.getId();
try {
Flow flow = job.getFlow();
File yaml = new File(jobDir, "job.yaml");
File typeFile = new File(jobDir, "type.job");
File yaml = new File(jobDir, "job.flow");
File typeFile = new File(jobDir, "job.type");

//TODO: save?
String jobType = job.getActuatorName();
Expand Down Expand Up @@ -108,17 +108,17 @@ public void loadJobs()
.parallel()
.forEach(jobDir -> {
try {
final File typeFile = new File(jobDir, "type.job");
final File typeFile = new File(jobDir, "job.type");
checkArgument(typeFile.exists() && typeFile.isFile(), typeFile + " is not exists or isDirectory");
Map<String, String> jobProps = loadProperties(typeFile);
String jobType = requireNonNull(jobProps.get("type"), "jobProps arg type is null");
try {
byte[] flowBytes = Files.readAllBytes(Paths.get(new File(jobDir, "job.yaml").toURI()));
byte[] flowBytes = Files.readAllBytes(Paths.get(new File(jobDir, "job.flow").toURI()));
Job job = runnerManger.formJobWithFlow(jobDir.getName(), flowBytes, jobType);
jobs.put(job.getId(), job);
}
catch (IOException e) {
throw new SylphException(JOB_BUILD_ERROR, "loadding job " + jobDir + " job.yaml fail", e);
throw new SylphException(JOB_BUILD_ERROR, "loadding job " + jobDir + " job.flow fail", e);
}
}
catch (Exception e) {
Expand Down
2 changes: 1 addition & 1 deletion sylph-runners/flink/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ dependencies {
compileOnly(group: 'org.apache.flink', name: 'flink-streaming-java_2.11', version: deps.flink) {
exclude(module: 'slf4j-api')
}
compile group: 'org.apache.flink', name: 'flink-shaded-hadoop2', version: deps.flink
compileOnly group: 'org.apache.flink', name: 'flink-shaded-hadoop2', version: deps.flink

compileOnly(group: 'org.apache.flink', name: 'flink-streaming-scala_2.11', version: deps.flink) {
exclude(module: 'slf4j-api')
Expand Down

0 comments on commit 6b60afa

Please sign in to comment.