Skip to content

Commit

Permalink
improvement 16096
Browse files Browse the repository at this point in the history
  • Loading branch information
SbloodyS committed Sep 18, 2024
1 parent 84619e9 commit f88ef6c
Show file tree
Hide file tree
Showing 25 changed files with 450 additions and 324 deletions.
1 change: 1 addition & 0 deletions .asf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ github:
- Docs
- Frontend Build
- "E2E-K8S-Result"
- "API-Test-Result"
- "Mergeable: milestone-label-check"
- "Title Validator"
required_pull_request_reviews:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ spring:
date-format: "yyyy-MM-dd HH:mm:ss"
banner:
charset: UTF-8
location: classpath:alert-banner.txt
datasource:
driver-class-name: org.postgresql.Driver
url: jdbc:postgresql://127.0.0.1:5432/dolphinscheduler
Expand Down
1 change: 1 addition & 0 deletions dolphinscheduler-api/src/main/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ spring:
active: postgresql
banner:
charset: UTF-8
location: classpath:api-banner.txt
jackson:
time-zone: UTC
date-format: "yyyy-MM-dd HH:mm:ss"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,6 @@
<fileSet>
<directory>${basedir}/../dolphinscheduler-tools/target/tools</directory>
<outputDirectory>tools</outputDirectory>
<excludes>
<exclude>libs/</exclude>
</excludes>
</fileSet>

<fileSet>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ spring:
active: postgresql
banner:
charset: UTF-8
location: classpath:master-banner.txt
jackson:
time-zone: UTC
date-format: "yyyy-MM-dd HH:mm:ss"
Expand Down
4 changes: 4 additions & 0 deletions dolphinscheduler-standalone-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,22 @@
<dependency>
<groupId>org.apache.dolphinscheduler</groupId>
<artifactId>dolphinscheduler-master</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.dolphinscheduler</groupId>
<artifactId>dolphinscheduler-worker</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.dolphinscheduler</groupId>
<artifactId>dolphinscheduler-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.dolphinscheduler</groupId>
<artifactId>dolphinscheduler-alert-server</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ spring:
date-format: "yyyy-MM-dd HH:mm:ss"
banner:
charset: UTF-8
location: classpath:standalone-banner.txt
sql:
init:
schema-locations: classpath:sql/dolphinscheduler_h2.sql
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,12 @@ private PropertyUtils() {
public static List<Property> startParamsTransformPropertyList(String startParams) {
List<Property> startParamList = null;
if (startParams != null) {
boolean isJson = JSONUtils.checkJsonValid(startParams);
if (isJson) {
try {
Map<String, String> startParamMap = JSONUtils.toMap(startParams);
startParamList = startParamMap.entrySet().stream()
.map(entry -> new Property(entry.getKey(), Direct.IN, DataType.VARCHAR, entry.getValue()))
.collect(Collectors.toList());
} else {
} catch (Exception ignore) {
startParamList = JSONUtils.toList(startParams, Property.class);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
</fileSets>
<dependencySets>
<dependencySet>
<useTransitiveDependencies>false</useTransitiveDependencies>
<outputDirectory>libs</outputDirectory>
</dependencySet>
</dependencySets>
Expand Down
6 changes: 5 additions & 1 deletion dolphinscheduler-tools/src/main/bin/create-demo-processes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ fi

JAVA_OPTS=${JAVA_OPTS:-"-server -Duser.timezone=${SPRING_JACKSON_TIME_ZONE} -Xms1g -Xmx1g -Xmn512m -XX:+PrintGCDetails -Xloggc:gc.log -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=dump.hprof"}

for jar in $(find "$DOLPHINSCHEDULER_HOME/libs" -name "*.jar" | grep -v "dolphinscheduler*.jar"); do
CP=$CP:"$jar"
done

$JAVA_HOME/bin/java $JAVA_OPTS \
-cp "$TOOLS_HOME/conf":"$DOLPHINSCHEDULER_HOME/libs/*":"$DOLPHINSCHEDULER_HOME/tools/sql" \
-cp "$TOOLS_HOME/conf":"$CP":"$TOOLS_HOME/sql" \
-Dspring.profiles.active=demo,${DATABASE} \
org.apache.dolphinscheduler.tools.demo.CreateProcessDemo
6 changes: 5 additions & 1 deletion dolphinscheduler-tools/src/main/bin/migrate-lineage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ fi

JAVA_OPTS=${JAVA_OPTS:-"-server -Duser.timezone=${SPRING_JACKSON_TIME_ZONE} -Xms4g -Xmx4g -Xmn512m -XX:+PrintGCDetails -Xloggc:gc.log -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=dump.hprof"}

for jar in $(find "$DOLPHINSCHEDULER_HOME/libs" -name "*.jar" | grep -v "dolphinscheduler*.jar"); do
CP=$CP:"$jar"
done

$JAVA_HOME/bin/java $JAVA_OPTS \
-cp "$TOOLS_HOME/conf":"$DOLPHINSCHEDULER_HOME/libs/*":"$DOLPHINSCHEDULER_HOME/tools/sql" \
-cp "$TOOLS_HOME/conf":"$CP":"$TOOLS_HOME/sql" \
-Dspring.profiles.active=lineage,${DATABASE} \
org.apache.dolphinscheduler.tools.lineage.MigrateLineage
6 changes: 5 additions & 1 deletion dolphinscheduler-tools/src/main/bin/migrate-resource.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ fi

JAVA_OPTS=${JAVA_OPTS:-"-server -Duser.timezone=${SPRING_JACKSON_TIME_ZONE} -Xms1g -Xmx1g -Xmn512m -XX:+PrintGCDetails -Xloggc:gc.log -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=dump.hprof"}

for jar in $(find "$DOLPHINSCHEDULER_HOME/libs" -name "*.jar" | grep -v "dolphinscheduler*.jar"); do
CP=$CP:"$jar"
done

$JAVA_HOME/bin/java $JAVA_OPTS \
-cp "$TOOLS_HOME/conf":"$DOLPHINSCHEDULER_HOME/libs/*":"$DOLPHINSCHEDULER_HOME/tools/sql" \
-cp "$TOOLS_HOME/conf":"$CP":"$TOOLS_HOME/sql" \
-Dspring.profiles.active=resource,${DATABASE} \
org.apache.dolphinscheduler.tools.resource.MigrateResource $1
6 changes: 5 additions & 1 deletion dolphinscheduler-tools/src/main/bin/upgrade-schema.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ fi

JAVA_OPTS=${JAVA_OPTS:-"-server -Duser.timezone=${SPRING_JACKSON_TIME_ZONE} -Xms1g -Xmx1g -Xmn512m -XX:+PrintGCDetails -Xloggc:gc.log -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=dump.hprof"}

for jar in $(find "$DOLPHINSCHEDULER_HOME/libs" -name "*.jar" | grep -v "dolphinscheduler*.jar"); do
CP=$CP:"$jar"
done

$JAVA_HOME/bin/java $JAVA_OPTS \
-cp "$TOOLS_HOME/conf":"$DOLPHINSCHEDULER_HOME/libs/*":"$DOLPHINSCHEDULER_HOME/tools/sql" \
-cp "$TOOLS_HOME/conf":"$CP":"$TOOLS_HOME/sql":"$TOOLS_HOME/libs/*" \
-Dspring.profiles.active=upgrade,${DATABASE} \
org.apache.dolphinscheduler.tools.datasource.UpgradeDolphinScheduler
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.Import;
import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Component;
Expand All @@ -33,7 +34,9 @@
public class UpgradeDolphinScheduler {

public static void main(String[] args) {
SpringApplication.run(UpgradeDolphinScheduler.class, args);
ConfigurableApplicationContext context = SpringApplication.run(UpgradeDolphinScheduler.class, args);

SpringApplication.exit(context, () -> 0);
}

@Component
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.FilterType;
import org.springframework.context.annotation.Profile;
Expand All @@ -36,7 +37,9 @@
public class CreateProcessDemo {

public static void main(String[] args) {
SpringApplication.run(CreateProcessDemo.class, args);
ConfigurableApplicationContext context = SpringApplication.run(CreateProcessDemo.class, args);

SpringApplication.exit(context, () -> 0);
}

@Component
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Component;
Expand All @@ -37,7 +38,9 @@
public class MigrateLineage {

public static void main(String[] args) {
SpringApplication.run(MigrateResource.class, args);
ConfigurableApplicationContext context = SpringApplication.run(MigrateLineage.class, args);

SpringApplication.exit(context, () -> 0);
}

@Component
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Component;
Expand All @@ -34,7 +35,9 @@
public class MigrateResource {

public static void main(String[] args) {
SpringApplication.run(MigrateResource.class, args);
ConfigurableApplicationContext context = SpringApplication.run(MigrateResource.class, args);

SpringApplication.exit(context, () -> 0);
}

@Component
Expand Down
Loading

0 comments on commit f88ef6c

Please sign in to comment.