Browse Source

Merge pull request #593 from analysys/dev-1.1.0

merge from dev-1.1.0
pull/2/head
bao liang 5 years ago committed by GitHub
parent
commit
ad17f789a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      escheduler-api/pom.xml
  2. 54
      escheduler-api/src/main/java/cn/escheduler/api/CombinedApplicationServer.java
  3. 1
      escheduler-api/src/main/java/cn/escheduler/api/configuration/AppConfiguration.java
  4. 54
      escheduler-api/src/main/resources/combined_logback.xml
  5. 2
      escheduler-server/src/main/java/cn/escheduler/server/rpc/LoggerServer.java
  6. 26
      escheduler-ui/build/webpack.config.combined.js
  7. 3
      escheduler-ui/package.json
  8. 2
      escheduler-ui/src/view/common/meta.inc
  9. 8
      package.xml

8
escheduler-api/pom.xml

@ -9,9 +9,11 @@
<packaging>jar</packaging>
<dependencies>
<dependency>
<dependency>
<groupId>cn.analysys</groupId>
<artifactId>escheduler-alert</artifactId>
</dependency>
<dependency>
<groupId>cn.analysys</groupId>
<artifactId>escheduler-server</artifactId>
<exclusions>

54
escheduler-api/src/main/java/cn/escheduler/api/CombinedApplicationServer.java

@ -0,0 +1,54 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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.
*/
package cn.escheduler.api;
import cn.escheduler.alert.AlertServer;
import cn.escheduler.dao.ProcessDao;
import cn.escheduler.server.master.MasterServer;
import cn.escheduler.server.rpc.LoggerServer;
import cn.escheduler.server.worker.WorkerServer;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
@SpringBootApplication
@ServletComponentScan
@ComponentScan("cn.escheduler")
@EnableSwagger2
public class CombinedApplicationServer extends SpringBootServletInitializer {
public static void main(String[] args) throws Exception {
ConfigurableApplicationContext context = SpringApplication.run(ApiApplicationServer.class, args);
ProcessDao processDao = context.getBean(ProcessDao.class);
MasterServer master = new MasterServer(processDao);
master.run(processDao);
WorkerServer workerServer = new WorkerServer();
workerServer.run();
LoggerServer server = new LoggerServer();
server.start();
AlertServer alertServer = AlertServer.getInstance();
alertServer.start();
}
}

1
escheduler-api/src/main/java/cn/escheduler/api/configuration/AppConfiguration.java

@ -84,6 +84,7 @@ public class AppConfiguration implements WebMvcConfigurer {
registry.addResourceHandler("/static/**").addResourceLocations("classpath:/static/");
registry.addResourceHandler("doc.html").addResourceLocations("classpath:/META-INF/resources/");
registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/");
registry.addResourceHandler("/ui/**").addResourceLocations("file:ui/");
}
@Override

54
escheduler-api/src/main/resources/combined_logback.xml

@ -0,0 +1,54 @@
<!-- Logback configuration. See http://logback.qos.ch/manual/index.html -->
<configuration scan="true" scanPeriod="120 seconds">
<property name="log.base" value="logs"/>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>
%highlight([%level]) %date{yyyy-MM-dd HH:mm:ss.SSS} %logger{10}:[%line] - %msg%n
</pattern>
<charset>UTF-8</charset>
</encoder>
</appender>
<appender name="TASKLOGFILE" class="cn.escheduler.server.worker.log.TaskLogAppender">
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>INFO</level>
</filter>
<filter class="cn.escheduler.server.worker.log.TaskLogFilter"></filter>
<file>${log.base}/{processDefinitionId}/{processInstanceId}/{taskInstanceId}.log</file>
<encoder>
<pattern>
[%level] %date{yyyy-MM-dd HH:mm:ss.SSS} %logger{96}:[%line] - %msg%n
</pattern>
<charset>UTF-8</charset>
</encoder>
<append>true</append>
</appender>
<appender name="COMBINEDLOGFILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.base}/escheduler-combined.log</file>
<filter class="cn.escheduler.server.worker.log.WorkerLogFilter">
<level>INFO</level>
</filter>
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<fileNamePattern>${log.base}/escheduler-combined.%d{yyyy-MM-dd_HH}.%i.log</fileNamePattern>
<maxHistory>168</maxHistory>
<maxFileSize>200MB</maxFileSize>
</rollingPolicy>
     
<encoder>
<pattern>
[%level] %date{yyyy-MM-dd HH:mm:ss.SSS} %logger{96}:[%line] - %msg%n
</pattern>
<charset>UTF-8</charset>
</encoder>
  
</appender>
<root level="INFO">
<appender-ref ref="STDOUT"/>
<appender-ref ref="TASKLOGFILE"/>
<appender-ref ref="COMBINEDLOGFILE"/>
</root>
</configuration>

2
escheduler-server/src/main/java/cn/escheduler/server/rpc/LoggerServer.java

@ -44,7 +44,7 @@ public class LoggerServer {
*/
private Server server;
private void start() throws IOException {
public void start() throws IOException {
/* The port on which the server should run */
int port = Constants.RPC_PORT;
server = ServerBuilder.forPort(port)

26
escheduler-ui/build/webpack.config.combined.js

@ -0,0 +1,26 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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.
*/
const merge = require('webpack-merge')
const prodConfig = require('./webpack.config.prod')
const config = merge.smart(prodConfig, {
output: {
publicPath: '/escheduler/ui/'
}
})
module.exports = config

3
escheduler-ui/package.json

@ -10,7 +10,8 @@
"lint": "standard \"**/*.{js,vue}\"",
"lint:fix": "standard \"**/*.{js,vue}\" --fix",
"start": "npm run dev",
"combo": "node ./build/combo.js"
"combo": "node ./build/combo.js",
"build:combined": "npm run clean && cross-env NODE_ENV=production webpack --config ./build/webpack.config.combined.js"
},
"dependencies": {
"autoprefixer": "^9.1.0",

2
escheduler-ui/src/view/common/meta.inc

@ -21,4 +21,4 @@
<script>
let NODE_ENV = '${locals.NODE_ENV}'
</script>
</script>

8
package.xml

@ -34,6 +34,14 @@
<outputDirectory>.</outputDirectory>
</fileSet>
<fileSet>
<directory>escheduler-ui/dist</directory>
<includes>
<include>**/*.*</include>
</includes>
<outputDirectory>./ui</outputDirectory>
</fileSet>
<fileSet>
<directory>sql</directory>
<includes>

Loading…
Cancel
Save