Skip to content

Commit 8448e08

Browse files
committed
Split the components into individual package
A follow-up PR will be made to build dedicated Docker images for each component, so that every component Docker image has minimal jars, which is easy to maintain and good for security fixes.
1 parent af9ed35 commit 8448e08

178 files changed

Lines changed: 1170 additions & 1084 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

dolphinscheduler-alert/dolphinscheduler-alert-server/pom.xml

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,6 @@
8585
<dependency>
8686
<groupId>com.google.guava</groupId>
8787
<artifactId>guava</artifactId>
88-
<exclusions>
89-
<exclusion>
90-
<artifactId>jsr305</artifactId>
91-
<groupId>com.google.code.findbugs</groupId>
92-
</exclusion>
93-
</exclusions>
9488
</dependency>
9589
<dependency>
9690
<groupId>ch.qos.logback</groupId>
@@ -124,11 +118,29 @@
124118
<configuration>
125119
<excludes>
126120
<exclude>*.yaml</exclude>
127-
<exclude>*.yml</exclude>
128121
<exclude>*.xml</exclude>
129122
</excludes>
130123
</configuration>
131124
</plugin>
125+
<plugin>
126+
<artifactId>maven-assembly-plugin</artifactId>
127+
<executions>
128+
<execution>
129+
<id>dolphinscheduler-alert-server</id>
130+
<phase>package</phase>
131+
<goals>
132+
<goal>single</goal>
133+
</goals>
134+
<configuration>
135+
<finalName>alert-server</finalName>
136+
<descriptors>
137+
<descriptor>src/main/assembly/dolphinscheduler-alert-server.xml</descriptor>
138+
</descriptors>
139+
<appendAssemblyId>false</appendAssemblyId>
140+
</configuration>
141+
</execution>
142+
</executions>
143+
</plugin>
132144
</plugins>
133145
</build>
134146
</project>
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
<!--
2+
~ Licensed to the Apache Software Foundation (ASF) under one or more
3+
~ contributor license agreements. See the NOTICE file distributed with
4+
~ this work for additional information regarding copyright ownership.
5+
~ The ASF licenses this file to You under the Apache License, Version 2.0
6+
~ (the "License"); you may not use this file except in compliance with
7+
~ the License. You may obtain a copy of the License at
8+
~
9+
~ http://www.apache.org/licenses/LICENSE-2.0
10+
~
11+
~ Unless required by applicable law or agreed to in writing, software
12+
~ distributed under the License is distributed on an "AS IS" BASIS,
13+
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
~ See the License for the specific language governing permissions and
15+
~ limitations under the License.
16+
-->
17+
18+
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.1.0"
19+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
20+
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.1.0 http://maven.apache.org/xsd/assembly-2.1.0.xsd">
21+
<id>dolphinscheduler-alert-server</id>
22+
<formats>
23+
<format>dir</format>
24+
</formats>
25+
<includeBaseDirectory>false</includeBaseDirectory>
26+
<baseDirectory>alert-server</baseDirectory>
27+
<fileSets>
28+
<fileSet>
29+
<directory>${basedir}/src/main/resources</directory>
30+
<includes>
31+
<include>application-alert.yaml</include>
32+
<include>logback-alert.xml</include>
33+
</includes>
34+
<outputDirectory>conf</outputDirectory>
35+
</fileSet>
36+
<fileSet>
37+
<directory>${basedir}/../../dolphinscheduler-dao/src/main/resources</directory>
38+
<includes>
39+
<include>**/*.yaml</include>
40+
</includes>
41+
<outputDirectory>conf</outputDirectory>
42+
</fileSet>
43+
<fileSet>
44+
<directory>${basedir}/../../dolphinscheduler-common/src/main/resources</directory>
45+
<includes>
46+
<include>**/*.properties</include>
47+
</includes>
48+
<outputDirectory>conf</outputDirectory>
49+
</fileSet>
50+
</fileSets>
51+
<dependencySets>
52+
<dependencySet>
53+
<outputDirectory>libs</outputDirectory>
54+
</dependencySet>
55+
</dependencySets>
56+
</assembly>

dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/monitor/Monitor.java renamed to dolphinscheduler-alert/dolphinscheduler-alert-server/src/main/java/org/apache/dolphinscheduler/alert/AlertConfig.java

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,22 @@
1414
* See the License for the specific language governing permissions and
1515
* limitations under the License.
1616
*/
17-
package org.apache.dolphinscheduler.server.monitor;
1817

19-
/**
20-
* server monitor and auto restart server
21-
*/
22-
public interface Monitor {
18+
package org.apache.dolphinscheduler.alert;
19+
20+
import org.springframework.boot.context.properties.ConfigurationProperties;
21+
import org.springframework.stereotype.Component;
22+
23+
@Component
24+
@ConfigurationProperties("alert")
25+
public final class AlertConfig {
26+
private int port;
27+
28+
public int getPort() {
29+
return port;
30+
}
2331

24-
/**
25-
* monitor server and restart
26-
*
27-
* @param masterPath masterPath
28-
* @param workerPath workerPath
29-
* @param port port
30-
* @param installPath installPath
31-
*/
32-
void monitor(String masterPath, String workerPath, Integer port, String installPath);
32+
public void setPort(final int port) {
33+
this.port = port;
34+
}
3335
}

dolphinscheduler-alert/dolphinscheduler-alert-server/src/main/java/org/apache/dolphinscheduler/alert/AlertServer.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,7 @@
1717

1818
package org.apache.dolphinscheduler.alert;
1919

20-
import static org.apache.dolphinscheduler.common.Constants.ALERT_RPC_PORT;
21-
2220
import org.apache.dolphinscheduler.common.thread.Stopper;
23-
import org.apache.dolphinscheduler.common.utils.PropertyUtils;
2421
import org.apache.dolphinscheduler.dao.AlertDao;
2522
import org.apache.dolphinscheduler.dao.PluginDao;
2623
import org.apache.dolphinscheduler.dao.entity.Alert;
@@ -38,6 +35,7 @@
3835

3936
import org.slf4j.Logger;
4037
import org.slf4j.LoggerFactory;
38+
import org.springframework.beans.factory.annotation.Autowired;
4139
import org.springframework.boot.SpringApplication;
4240
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
4341
import org.springframework.context.annotation.ComponentScan;
@@ -58,6 +56,9 @@ public class AlertServer implements Closeable {
5856

5957
private NettyRemotingServer server;
6058

59+
@Autowired
60+
private AlertConfig config;
61+
6162
public AlertServer(PluginDao pluginDao, AlertDao alertDao, AlertPluginManager alertPluginManager, AlertSender alertSender, AlertRequestProcessor alertRequestProcessor) {
6263
this.pluginDao = pluginDao;
6364
this.alertDao = alertDao;
@@ -101,7 +102,7 @@ private void checkTable() {
101102

102103
private void startServer() {
103104
NettyServerConfig serverConfig = new NettyServerConfig();
104-
serverConfig.setListenPort(PropertyUtils.getInt(ALERT_RPC_PORT, 50052));
105+
serverConfig.setListenPort(config.getPort());
105106

106107
server = new NettyRemotingServer(serverConfig);
107108
server.registerProcessor(CommandType.ALERT_SEND_REQUEST, alertRequestProcessor);

dolphinscheduler-alert/dolphinscheduler-alert-server/src/main/resources/application-alert.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,6 @@ management:
3030
metrics:
3131
tags:
3232
application: ${spring.application.name}
33+
34+
alert:
35+
port: 50052

dolphinscheduler-alert/pom.xml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,5 @@
4141
<groupId>org.slf4j</groupId>
4242
<artifactId>slf4j-api</artifactId>
4343
</dependency>
44-
<dependency>
45-
<groupId>org.springframework.boot</groupId>
46-
<artifactId>spring-boot-starter-test</artifactId>
47-
<scope>test</scope>
48-
</dependency>
4944
</dependencies>
5045
</project>

dolphinscheduler-api/pom.xml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,11 +253,29 @@
253253
<configuration>
254254
<excludes>
255255
<exclude>*.yaml</exclude>
256-
<exclude>*.yml</exclude>
257256
<exclude>*.xml</exclude>
258257
</excludes>
259258
</configuration>
260259
</plugin>
260+
<plugin>
261+
<artifactId>maven-assembly-plugin</artifactId>
262+
<executions>
263+
<execution>
264+
<id>dolphinscheduler-api-server</id>
265+
<phase>package</phase>
266+
<goals>
267+
<goal>single</goal>
268+
</goals>
269+
<configuration>
270+
<finalName>api-server</finalName>
271+
<descriptors>
272+
<descriptor>src/main/assembly/dolphinscheduler-api-server.xml</descriptor>
273+
</descriptors>
274+
<appendAssemblyId>false</appendAssemblyId>
275+
</configuration>
276+
</execution>
277+
</executions>
278+
</plugin>
261279
</plugins>
262280
</build>
263281
</project>
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
<!--
2+
~ Licensed to the Apache Software Foundation (ASF) under one or more
3+
~ contributor license agreements. See the NOTICE file distributed with
4+
~ this work for additional information regarding copyright ownership.
5+
~ The ASF licenses this file to You under the Apache License, Version 2.0
6+
~ (the "License"); you may not use this file except in compliance with
7+
~ the License. You may obtain a copy of the License at
8+
~
9+
~ http://www.apache.org/licenses/LICENSE-2.0
10+
~
11+
~ Unless required by applicable law or agreed to in writing, software
12+
~ distributed under the License is distributed on an "AS IS" BASIS,
13+
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
~ See the License for the specific language governing permissions and
15+
~ limitations under the License.
16+
-->
17+
18+
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.1.0"
19+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
20+
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.1.0 http://maven.apache.org/xsd/assembly-2.1.0.xsd">
21+
<id>dolphinscheduler-api-server</id>
22+
<formats>
23+
<format>dir</format>
24+
</formats>
25+
<includeBaseDirectory>false</includeBaseDirectory>
26+
<baseDirectory>api-server</baseDirectory>
27+
<fileSets>
28+
<fileSet>
29+
<directory>${basedir}/src/main/resources</directory>
30+
<includes>
31+
<include>application-api.yaml</include>
32+
<include>logback-api.xml</include>
33+
</includes>
34+
<outputDirectory>conf</outputDirectory>
35+
</fileSet>
36+
<fileSet>
37+
<directory>${basedir}/../dolphinscheduler-dao/src/main/resources</directory>
38+
<includes>
39+
<include>**/*.yaml</include>
40+
</includes>
41+
<outputDirectory>conf</outputDirectory>
42+
</fileSet>
43+
<fileSet>
44+
<directory>${basedir}/../dolphinscheduler-common/src/main/resources</directory>
45+
<includes>
46+
<include>**/*.properties</include>
47+
</includes>
48+
<outputDirectory>conf</outputDirectory>
49+
</fileSet>
50+
<fileSet>
51+
<directory>${basedir}/../dolphinscheduler-service/src/main/resources</directory>
52+
<includes>
53+
<include>**/*.properties</include>
54+
</includes>
55+
<outputDirectory>conf</outputDirectory>
56+
</fileSet>
57+
</fileSets>
58+
<dependencySets>
59+
<dependencySet>
60+
<outputDirectory>libs</outputDirectory>
61+
</dependencySet>
62+
</dependencySets>
63+
</assembly>

dolphinscheduler-common/pom.xml

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,6 @@
4646
<dependency>
4747
<groupId>com.google.guava</groupId>
4848
<artifactId>guava</artifactId>
49-
<scope>provided</scope>
50-
<exclusions>
51-
<exclusion>
52-
<artifactId>jsr305</artifactId>
53-
<groupId>com.google.code.findbugs</groupId>
54-
</exclusion>
55-
</exclusions>
5649
</dependency>
5750
<dependency>
5851
<groupId>org.mockito</groupId>
@@ -139,10 +132,6 @@
139132
<groupId>com.google.code.gson</groupId>
140133
<artifactId>gson</artifactId>
141134
</exclusion>
142-
<exclusion>
143-
<groupId>org.apache.commons</groupId>
144-
<artifactId>commons-math3</artifactId>
145-
</exclusion>
146135
<exclusion>
147136
<groupId>xmlenc</groupId>
148137
<artifactId>xmlenc</artifactId>
@@ -159,10 +148,6 @@
159148
<groupId>org.apache.zookeeper</groupId>
160149
<artifactId>zookeeper</artifactId>
161150
</exclusion>
162-
<exclusion>
163-
<artifactId>jsr305</artifactId>
164-
<groupId>com.google.code.findbugs</groupId>
165-
</exclusion>
166151
<exclusion>
167152
<groupId>javax.servlet.jsp</groupId>
168153
<artifactId>jsp-api</artifactId>
@@ -179,10 +164,6 @@
179164
<artifactId>jersey-core</artifactId>
180165
<groupId>com.sun.jersey</groupId>
181166
</exclusion>
182-
<exclusion>
183-
<artifactId>xz</artifactId>
184-
<groupId>org.tukaani</groupId>
185-
</exclusion>
186167
</exclusions>
187168
</dependency>
188169
<dependency>
@@ -346,10 +327,6 @@
346327
<groupId>com.google.code.gson</groupId>
347328
<artifactId>gson</artifactId>
348329
</exclusion>
349-
<exclusion>
350-
<groupId>com.google.code.findbugs</groupId>
351-
<artifactId>jsr305</artifactId>
352-
</exclusion>
353330
<exclusion>
354331
<groupId>io.dropwizard.metrics</groupId>
355332
<artifactId>metrics-core</artifactId>
@@ -362,10 +339,6 @@
362339
<groupId>org.apache.avro</groupId>
363340
<artifactId>avro</artifactId>
364341
</exclusion>
365-
<exclusion>
366-
<groupId>org.apache.commons</groupId>
367-
<artifactId>commons-compress</artifactId>
368-
</exclusion>
369342
<exclusion>
370343
<groupId>org.apache.curator</groupId>
371344
<artifactId>curator-client</artifactId>
@@ -579,22 +552,11 @@
579552
<groupId>com.baomidou</groupId>
580553
<artifactId>mybatis-plus-annotation</artifactId>
581554
<version>${mybatis-plus.version}</version>
582-
<scope>compile</scope>
583555
</dependency>
584556

585557
<dependency>
586558
<groupId>com.github.rholder</groupId>
587559
<artifactId>guava-retrying</artifactId>
588-
<exclusions>
589-
<exclusion>
590-
<groupId>com.google.guava</groupId>
591-
<artifactId>guava</artifactId>
592-
</exclusion>
593-
<exclusion>
594-
<groupId>com.google.code.findbugs</groupId>
595-
<artifactId>jsr305</artifactId>
596-
</exclusion>
597-
</exclusions>
598560
</dependency>
599561
<dependency>
600562
<groupId>io.netty</groupId>

dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,6 @@ private Constants() {
3838
*/
3939
public static final String COMMON_PROPERTIES_PATH = "/common.properties";
4040

41-
/**
42-
* alert properties
43-
*/
44-
public static final String ALERT_RPC_PORT = "alert.rpc.port";
45-
4641
/**
4742
* registry properties
4843
*/

0 commit comments

Comments
 (0)