Compare commits
4 Commits
5d49c82190
...
6e7cef6170
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6e7cef6170 | ||
|
|
0156a12b3b | ||
|
|
fe58cee730 | ||
|
|
778a6df984 |
@@ -6,6 +6,6 @@ deploy service-common service-dependencies service-configuration service-forest
|
||||
configs=(b2a4 b2b1 b2b12)
|
||||
for config in ${configs[*]};
|
||||
do
|
||||
mvn -pl service-launcher clean package -D skipTests -P $config
|
||||
mvn -pl service-launcher clean package -D skipTests -P $config -s $maven_setting
|
||||
upload $root_path/service-launcher/target/service-launcher-$config-1.0.0-SNAPSHOT.jar
|
||||
done
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
maven_setting=/Users/lanyuanxiaoyao/.m2/settings-nas.xml
|
||||
|
||||
build_profile=b2b12
|
||||
|
||||
upload_username=AxhEbscwsJDbYMH2
|
||||
@@ -27,10 +29,14 @@ function joining {
|
||||
fi
|
||||
}
|
||||
|
||||
function deploy_root() {
|
||||
mvn deploy -N -D skipTests -s $maven_setting
|
||||
}
|
||||
|
||||
function deploy() {
|
||||
mvn -pl $(joining , $@) clean install -D skipTests
|
||||
mvn -pl $(joining , $@) clean deploy -D skipTests -s $maven_setting
|
||||
}
|
||||
|
||||
function package() {
|
||||
mvn -pl $(joining , $@) clean package -D skipTests -P $build_profile
|
||||
mvn -pl $(joining , $@) clean package -D skipTests -P $build_profile -s $maven_setting
|
||||
}
|
||||
|
||||
84
service-ai/.gitignore
vendored
84
service-ai/.gitignore
vendored
@@ -1,84 +0,0 @@
|
||||
.idea/**/workspace.xml
|
||||
.idea/**/tasks.xml
|
||||
.idea/**/usage.statistics.xml
|
||||
.idea/**/dictionaries
|
||||
.idea/**/shelf
|
||||
.idea/**/aws.xml
|
||||
.idea/**/contentModel.xml
|
||||
.idea/**/dataSources/
|
||||
.idea/**/dataSources.ids
|
||||
.idea/**/dataSources.local.xml
|
||||
.idea/**/sqlDataSources.xml
|
||||
.idea/**/dynamic.xml
|
||||
.idea/**/uiDesigner.xml
|
||||
.idea/**/dbnavigator.xml
|
||||
.idea/**/gradle.xml
|
||||
.idea/**/libraries
|
||||
cmake-build-*/
|
||||
.idea/**/mongoSettings.xml
|
||||
*.iws
|
||||
out/
|
||||
.idea_modules/
|
||||
atlassian-ide-plugin.xml
|
||||
.idea/replstate.xml
|
||||
.idea/sonarlint/
|
||||
com_crashlytics_export_strings.xml
|
||||
crashlytics.properties
|
||||
crashlytics-build.properties
|
||||
fabric.properties
|
||||
.idea/httpRequests
|
||||
.idea/caches/build_file_checksums.ser
|
||||
target/
|
||||
pom.xml.tag
|
||||
pom.xml.releaseBackup
|
||||
pom.xml.versionsBackup
|
||||
pom.xml.next
|
||||
release.properties
|
||||
dependency-reduced-pom.xml
|
||||
buildNumber.properties
|
||||
.mvn/timing.properties
|
||||
.mvn/wrapper/maven-wrapper.jar
|
||||
.project
|
||||
.classpath
|
||||
*~
|
||||
.fuse_hidden*
|
||||
.directory
|
||||
.Trash-*
|
||||
.nfs*
|
||||
.gradle
|
||||
**/build/
|
||||
!src/**/build/
|
||||
gradle-app.setting
|
||||
!gradle-wrapper.jar
|
||||
!gradle-wrapper.properties
|
||||
.gradletasknamecache
|
||||
Thumbs.db
|
||||
Thumbs.db:encryptable
|
||||
ehthumbs.db
|
||||
ehthumbs_vista.db
|
||||
*.stackdump
|
||||
[Dd]esktop.ini
|
||||
$RECYCLE.BIN/
|
||||
*.cab
|
||||
*.msi
|
||||
*.msix
|
||||
*.msm
|
||||
*.msp
|
||||
*.lnk
|
||||
.DS_Store
|
||||
.AppleDouble
|
||||
.LSOverride
|
||||
Icon
|
||||
._*
|
||||
.DocumentRevisions-V100
|
||||
.fseventsd
|
||||
.Spotlight-V100
|
||||
.TemporaryItems
|
||||
.Trashes
|
||||
.VolumeIcon.icns
|
||||
.com.apple.timemachine.donotpresent
|
||||
.AppleDB
|
||||
.AppleDesktop
|
||||
Network Trash Folder
|
||||
Temporary Items
|
||||
.apdisk
|
||||
10
service-ai/.idea/.gitignore
generated
vendored
10
service-ai/.idea/.gitignore
generated
vendored
@@ -1,10 +0,0 @@
|
||||
# 默认忽略的文件
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# 基于编辑器的 HTTP 客户端请求
|
||||
/httpRequests/
|
||||
# 依赖于环境的 Maven 主目录路径
|
||||
/mavenHomeManager.xml
|
||||
# Datasource local storage ignored files
|
||||
/dataSources/
|
||||
/dataSources.local.xml
|
||||
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ApifoxUploaderProjectSetting">
|
||||
<option name="apiAccessToken" value="APS-0ZZaS4q0gUiFOlbBJMN8hAmS7viQNi4D" />
|
||||
</component>
|
||||
</project>
|
||||
8
service-ai/.idea/GitCommitMessageStorage.xml
generated
8
service-ai/.idea/GitCommitMessageStorage.xml
generated
@@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="GitCommitMessageStorage">
|
||||
<option name="messageStorage">
|
||||
<MessageStorage />
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
29
service-ai/.idea/codeStyles/Project.xml
generated
29
service-ai/.idea/codeStyles/Project.xml
generated
@@ -1,29 +0,0 @@
|
||||
<component name="ProjectCodeStyleConfiguration">
|
||||
<code_scheme name="Project" version="173">
|
||||
<JavaCodeStyleSettings>
|
||||
<option name="PACKAGES_TO_USE_IMPORT_ON_DEMAND">
|
||||
<value />
|
||||
</option>
|
||||
<option name="IMPORT_LAYOUT_TABLE">
|
||||
<value>
|
||||
<package name="" withSubpackages="true" static="false" module="true" />
|
||||
<package name="" withSubpackages="true" static="false" />
|
||||
<emptyLine />
|
||||
<package name="" withSubpackages="true" static="true" />
|
||||
</value>
|
||||
</option>
|
||||
</JavaCodeStyleSettings>
|
||||
<JetCodeStyleSettings>
|
||||
<option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
|
||||
</JetCodeStyleSettings>
|
||||
<ScalaCodeStyleSettings>
|
||||
<option name="MULTILINE_STRING_CLOSING_QUOTES_ON_NEW_LINE" value="true" />
|
||||
</ScalaCodeStyleSettings>
|
||||
<codeStyleSettings language="JAVA">
|
||||
<option name="KEEP_FIRST_COLUMN_COMMENT" value="false" />
|
||||
</codeStyleSettings>
|
||||
<codeStyleSettings language="kotlin">
|
||||
<option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
|
||||
</codeStyleSettings>
|
||||
</code_scheme>
|
||||
</component>
|
||||
5
service-ai/.idea/codeStyles/codeStyleConfig.xml
generated
5
service-ai/.idea/codeStyles/codeStyleConfig.xml
generated
@@ -1,5 +0,0 @@
|
||||
<component name="ProjectCodeStyleConfiguration">
|
||||
<state>
|
||||
<option name="PREFERRED_PROJECT_CODE_STYLE" value="Default" />
|
||||
</state>
|
||||
</component>
|
||||
15
service-ai/.idea/compiler.xml
generated
15
service-ai/.idea/compiler.xml
generated
@@ -1,15 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CompilerConfiguration">
|
||||
<annotationProcessing>
|
||||
<profile name="Maven default annotation processors profile" enabled="true">
|
||||
<sourceOutputDir name="target/generated-sources/annotations" />
|
||||
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
|
||||
<outputRelativeToContentRoot value="true" />
|
||||
<module name="service-ai-knowledge" />
|
||||
<module name="service-ai-chat" />
|
||||
<module name="service-ai-core" />
|
||||
</profile>
|
||||
</annotationProcessing>
|
||||
</component>
|
||||
</project>
|
||||
13
service-ai/.idea/encodings.xml
generated
13
service-ai/.idea/encodings.xml
generated
@@ -1,13 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Encoding">
|
||||
<file url="file://$PROJECT_DIR$/service-ai-chat/src/main/java" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/service-ai-chat/src/main/resources" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/service-ai-core/src/main/java" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/service-ai-core/src/main/resources" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/service-ai-knowledge/src/main/java" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/service-ai-knowledge/src/main/resources" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/src/main/resources" charset="UTF-8" />
|
||||
</component>
|
||||
</project>
|
||||
30
service-ai/.idea/jarRepositories.xml
generated
30
service-ai/.idea/jarRepositories.xml
generated
@@ -1,30 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="RemoteRepositoriesConfiguration">
|
||||
<remote-repository>
|
||||
<option name="id" value="central" />
|
||||
<option name="name" value="Central Repository" />
|
||||
<option name="url" value="https://repo.maven.apache.org/maven2" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="lanyuanxiaoyao-maven-central" />
|
||||
<option name="name" value="lanyuanxiaoyao-maven-central" />
|
||||
<option name="url" value="https://maven.lanyuanxiaoyao.com/central" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="central" />
|
||||
<option name="name" value="Maven Central repository" />
|
||||
<option name="url" value="https://repo1.maven.org/maven2" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="jboss.community" />
|
||||
<option name="name" value="JBoss Community repository" />
|
||||
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="central" />
|
||||
<option name="name" value="Central Repository" />
|
||||
<option name="url" value="https://maven.lanyuanxiaoyao.com/central" />
|
||||
</remote-repository>
|
||||
</component>
|
||||
</project>
|
||||
12
service-ai/.idea/misc.xml
generated
12
service-ai/.idea/misc.xml
generated
@@ -1,12 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||
<component name="MavenProjectsManager">
|
||||
<option name="originalFiles">
|
||||
<list>
|
||||
<option value="$PROJECT_DIR$/pom.xml" />
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="temurin-17" project-jdk-type="JavaSDK" />
|
||||
</project>
|
||||
6
service-ai/.idea/vcs.xml
generated
6
service-ai/.idea/vcs.xml
generated
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.lanyuanxiaoyao.service.cli.core;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 运行配置
|
||||
*
|
||||
@@ -10,7 +12,8 @@ public class RuntimeInfo {
|
||||
private String signature;
|
||||
private String user;
|
||||
private String jarPath;
|
||||
private String jdkPath;
|
||||
private String defaultJdk;
|
||||
private Map<String, String> jdkPath;
|
||||
private String logPath;
|
||||
private String confPath;
|
||||
private String dataPath;
|
||||
@@ -47,11 +50,19 @@ public class RuntimeInfo {
|
||||
this.jarPath = jarPath;
|
||||
}
|
||||
|
||||
public String getJdkPath() {
|
||||
public String getDefaultJdk() {
|
||||
return defaultJdk;
|
||||
}
|
||||
|
||||
public void setDefaultJdk(String defaultJdk) {
|
||||
this.defaultJdk = defaultJdk;
|
||||
}
|
||||
|
||||
public Map<String, String> getJdkPath() {
|
||||
return jdkPath;
|
||||
}
|
||||
|
||||
public void setJdkPath(String jdkPath) {
|
||||
public void setJdkPath(Map<String, String> jdkPath) {
|
||||
this.jdkPath = jdkPath;
|
||||
}
|
||||
|
||||
@@ -146,22 +157,23 @@ public class RuntimeInfo {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "RuntimeInfo{" +
|
||||
"signature='" + signature + '\'' +
|
||||
", user='" + user + '\'' +
|
||||
", jarPath='" + jarPath + '\'' +
|
||||
", jdkPath='" + jdkPath + '\'' +
|
||||
", logPath='" + logPath + '\'' +
|
||||
", confPath='" + confPath + '\'' +
|
||||
", dataPath='" + dataPath + '\'' +
|
||||
", downloadUrl='" + downloadUrl + '\'' +
|
||||
", kerberosKeytabPath='" + kerberosKeytabPath + '\'' +
|
||||
", loki=" + loki +
|
||||
", zkUrl='" + zkUrl + '\'' +
|
||||
", connectorZkUrl='" + connectorZkUrl + '\'' +
|
||||
", hudi=" + hudi +
|
||||
", security=" + security +
|
||||
", yarn=" + yarn +
|
||||
'}';
|
||||
"signature='" + signature + '\'' +
|
||||
", user='" + user + '\'' +
|
||||
", jarPath='" + jarPath + '\'' +
|
||||
", defaultJdk='" + defaultJdk + '\'' +
|
||||
", jdkPath=" + jdkPath +
|
||||
", logPath='" + logPath + '\'' +
|
||||
", confPath='" + confPath + '\'' +
|
||||
", dataPath='" + dataPath + '\'' +
|
||||
", downloadUrl='" + downloadUrl + '\'' +
|
||||
", kerberosKeytabPath='" + kerberosKeytabPath + '\'' +
|
||||
", loki=" + loki +
|
||||
", zkUrl='" + zkUrl + '\'' +
|
||||
", connectorZkUrl='" + connectorZkUrl + '\'' +
|
||||
", hudi=" + hudi +
|
||||
", security=" + security +
|
||||
", yarn=" + yarn +
|
||||
'}';
|
||||
}
|
||||
|
||||
public static final class LokiInfo {
|
||||
|
||||
@@ -17,6 +17,7 @@ public class ServiceInfo {
|
||||
private List<String> groups = new ArrayList<>();
|
||||
private Integer replicas = 0;
|
||||
private String sourceJar;
|
||||
private String jdk;
|
||||
private List<String> classpath = new ArrayList<>();
|
||||
private Map<String, Object> environments = new HashMap<>();
|
||||
private Map<String, Object> arguments = new HashMap<>();
|
||||
@@ -61,6 +62,14 @@ public class ServiceInfo {
|
||||
this.sourceJar = sourceJar;
|
||||
}
|
||||
|
||||
public String getJdk() {
|
||||
return jdk;
|
||||
}
|
||||
|
||||
public void setJdk(String jdk) {
|
||||
this.jdk = jdk;
|
||||
}
|
||||
|
||||
public List<String> getClasspath() {
|
||||
return classpath;
|
||||
}
|
||||
@@ -88,14 +97,15 @@ public class ServiceInfo {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ServiceInfo{" +
|
||||
"enabled=" + enabled +
|
||||
", order=" + order +
|
||||
", groups=" + groups +
|
||||
", replicas=" + replicas +
|
||||
", sourceJar='" + sourceJar + '\'' +
|
||||
", classpath=" + classpath +
|
||||
", environments=" + environments +
|
||||
", arguments=" + arguments +
|
||||
'}';
|
||||
"enabled=" + enabled +
|
||||
", order=" + order +
|
||||
", groups=" + groups +
|
||||
", replicas=" + replicas +
|
||||
", sourceJar='" + sourceJar + '\'' +
|
||||
", jdk=" + jdk +
|
||||
", classpath=" + classpath +
|
||||
", environments=" + environments +
|
||||
", arguments=" + arguments +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -138,7 +138,8 @@ public class RunnerApplication implements ApplicationRunner {
|
||||
Path planPath = Paths.get(root.toString(), "deploy.plan");
|
||||
Map<String, List<String>> deployPlans = new HashMap<>();
|
||||
if (Files.exists(planPath) && !deployInformationProperties.getShuffler()) {
|
||||
deployPlans = mapper.readValue(new String(Files.readAllBytes(planPath)), new TypeReference<Map<String, List<String>>>() {});
|
||||
deployPlans = mapper.readValue(new String(Files.readAllBytes(planPath)), new TypeReference<Map<String, List<String>>>() {
|
||||
});
|
||||
}
|
||||
|
||||
for (ServiceInfoWrapper serviceInfo : serviceInfoList) {
|
||||
@@ -168,8 +169,8 @@ public class RunnerApplication implements ApplicationRunner {
|
||||
MapUtil.builder()
|
||||
.put("currentPath", absolutRootPath)
|
||||
.put("hosts", hostInfoList
|
||||
.collect(HostInfoWrapper::getHostnameIp)
|
||||
.toSortedList((o1, o2) -> Comparator.<String>naturalOrder().compare(o1.getIp(), o2.getIp())))
|
||||
.collect(HostInfoWrapper::getHostnameIp)
|
||||
.toSortedList((o1, o2) -> Comparator.<String>naturalOrder().compare(o1.getIp(), o2.getIp())))
|
||||
.put("selectedHosts", selectedHosts)
|
||||
.put("runtime", runtimeInfo)
|
||||
.put("info", serviceInfo)
|
||||
@@ -187,8 +188,8 @@ public class RunnerApplication implements ApplicationRunner {
|
||||
MapUtil.builder()
|
||||
.put("currentPath", absolutRootPath)
|
||||
.put("hosts", hostInfoList
|
||||
.collect(HostInfoWrapper::getHostnameIp)
|
||||
.toSortedList((o1, o2) -> Comparator.<String>naturalOrder().compare(o1.getIp(), o2.getIp())))
|
||||
.collect(HostInfoWrapper::getHostnameIp)
|
||||
.toSortedList((o1, o2) -> Comparator.<String>naturalOrder().compare(o1.getIp(), o2.getIp())))
|
||||
.put("runtime", runtimeInfo)
|
||||
.put("info", serviceInfo)
|
||||
.put("arguments", serviceInfo.getArguments())
|
||||
@@ -199,13 +200,13 @@ public class RunnerApplication implements ApplicationRunner {
|
||||
StrUtil.format("stop-{}.sh", serviceInfo.getName())
|
||||
)
|
||||
);
|
||||
generateTemplate(
|
||||
generateTemplate(
|
||||
"cloud/log.ftl",
|
||||
MapUtil.builder()
|
||||
.put("currentPath", absolutRootPath)
|
||||
.put("hosts", hostInfoList
|
||||
.collect(HostInfoWrapper::getHostnameIp)
|
||||
.toSortedList((o1, o2) -> Comparator.<String>naturalOrder().compare(o1.getIp(), o2.getIp())))
|
||||
.collect(HostInfoWrapper::getHostnameIp)
|
||||
.toSortedList((o1, o2) -> Comparator.<String>naturalOrder().compare(o1.getIp(), o2.getIp())))
|
||||
.put("selectedHosts", selectedHosts)
|
||||
.put("runtime", runtimeInfo)
|
||||
.put("info", serviceInfo)
|
||||
@@ -219,24 +220,15 @@ public class RunnerApplication implements ApplicationRunner {
|
||||
);
|
||||
}
|
||||
|
||||
generateTemplate(
|
||||
"cloud/stop-script.ftl",
|
||||
MapUtil.builder()
|
||||
.put("currentPath", absolutRootPath)
|
||||
.put("runtime", runtimeInfo)
|
||||
.build(),
|
||||
Paths.get(root.toString(), "stop.sh")
|
||||
);
|
||||
|
||||
generateTemplate(
|
||||
"cloud/ssh-script.ftl",
|
||||
MapUtil.builder()
|
||||
.put("currentPath", absolutRootPath)
|
||||
.put("hosts", hostInfoList
|
||||
.collect(HostInfoWrapper::getHostnameIp)
|
||||
.toSortedList((o1, o2) -> Comparator.<String>naturalOrder().compare(o1.getIp(), o2.getIp())))
|
||||
.put("runtime", runtimeInfo)
|
||||
.build(),
|
||||
.put("currentPath", absolutRootPath)
|
||||
.put("hosts", hostInfoList
|
||||
.collect(HostInfoWrapper::getHostnameIp)
|
||||
.toSortedList((o1, o2) -> Comparator.<String>naturalOrder().compare(o1.getIp(), o2.getIp())))
|
||||
.put("runtime", runtimeInfo)
|
||||
.build(),
|
||||
Paths.get(root.toString(), "ssh.sh")
|
||||
);
|
||||
|
||||
@@ -338,14 +330,14 @@ public class RunnerApplication implements ApplicationRunner {
|
||||
Paths.get(root.toString(), "update.sh")
|
||||
);
|
||||
|
||||
Template stopTemplate = engine.getTemplate("cloud/stop-script.ftl");
|
||||
String stopScript = stopTemplate.render(MapUtil.builder()
|
||||
.put("currentPath", absolutRootPath)
|
||||
.put("runtime", runtimeInfo)
|
||||
.build());
|
||||
// 一个魔法操作
|
||||
stopScript = stopScript.replaceAll("application_name=\".*\"", "application_name=\"service-uploader.jar\"");
|
||||
Files.write(Paths.get(root.toString(), "stop.sh"), stopScript.getBytes());
|
||||
generateTemplate(
|
||||
"uploader/stop.ftl",
|
||||
MapUtil.builder()
|
||||
.put("currentPath", absolutRootPath)
|
||||
.put("runtime", runtimeInfo)
|
||||
.build(),
|
||||
Paths.get(root.toString(), "stop.sh")
|
||||
);
|
||||
}
|
||||
|
||||
private void generateUpdateJar(Path root) throws IOException {
|
||||
|
||||
@@ -49,6 +49,10 @@ public class ServiceInfoWrapper {
|
||||
return serviceInfo.getSourceJar();
|
||||
}
|
||||
|
||||
public String getJdk() {
|
||||
return serviceInfo.getJdk();
|
||||
}
|
||||
|
||||
public List<String> getClasspath() {
|
||||
return serviceInfo.getClasspath();
|
||||
}
|
||||
|
||||
@@ -7,7 +7,11 @@ deploy:
|
||||
# 应用jar包
|
||||
jar-path: /data/datalake/jars
|
||||
# 主机jdk根目录
|
||||
jdk-path: /opt/jdk8u252-b09
|
||||
default-jdk: jdk8_arm
|
||||
jdk-path:
|
||||
"jdk8": /opt/jdk1.8.0_162
|
||||
"jdk8_arm": /opt/jdk8u252-b09
|
||||
"jdk17": /opt/jdk-17.0.15
|
||||
# 应用日志
|
||||
log-path: /data/datalake/logs
|
||||
# 应用配置
|
||||
|
||||
@@ -38,8 +38,6 @@ deploy:
|
||||
"[connector.hadoop.kerberos-keytab-path]": ${deploy.runtime.kerberos-keytab-path}
|
||||
"[connector.hudi.app-hdfs-path]": ${deploy.runtime.hudi.app-hdfs-path}
|
||||
"[connector.hudi.app-test-hdfs-path]": ${deploy.runtime.hudi.app-test-hdfs-path}
|
||||
"[connector.hudi.victoria-push-url]": ${deploy.runtime.hudi.victoria-push-url}
|
||||
"[connector.hudi.loki-push-url]": ${deploy.runtime.hudi.loki-push-url}
|
||||
arguments:
|
||||
"[spring.application.name]": service-launcher-b1
|
||||
"[connector.cluster.cluster]": b1
|
||||
@@ -59,8 +57,6 @@ deploy:
|
||||
"[connector.hadoop.kerberos-keytab-path]": ${deploy.runtime.kerberos-keytab-path}
|
||||
"[connector.hudi.app-hdfs-path]": ${deploy.runtime.hudi.app-hdfs-path}
|
||||
"[connector.hudi.app-test-hdfs-path]": ${deploy.runtime.hudi.app-test-hdfs-path}
|
||||
"[connector.hudi.victoria-push-url]": ${deploy.runtime.hudi.victoria-push-url}
|
||||
"[connector.hudi.loki-push-url]": ${deploy.runtime.hudi.loki-push-url}
|
||||
arguments:
|
||||
"[spring.application.name]": service-launcher-a4
|
||||
"[connector.cluster.cluster]": a4
|
||||
@@ -80,8 +76,6 @@ deploy:
|
||||
"[connector.hadoop.kerberos-keytab-path]": ${deploy.runtime.kerberos-keytab-path}
|
||||
"[connector.hudi.app-hdfs-path]": ${deploy.runtime.hudi.app-hdfs-path}
|
||||
"[connector.hudi.app-test-hdfs-path]": ${deploy.runtime.hudi.app-test-hdfs-path}
|
||||
"[connector.hudi.victoria-push-url]": ${deploy.runtime.hudi.victoria-push-url}
|
||||
"[connector.hudi.loki-push-url]": ${deploy.runtime.hudi.loki-push-url}
|
||||
arguments:
|
||||
"[spring.application.name]": service-launcher-b12
|
||||
"[connector.cluster.cluster]": b12
|
||||
@@ -147,7 +141,6 @@ deploy:
|
||||
"[connector.hadoop.kerberos-principal]": ${deploy.runtime.user}/$\{hostname}.hdp.dc@ECLD.COM
|
||||
"[connector.hadoop.kerberos-keytab-path]": ${deploy.runtime.kerberos-keytab-path}
|
||||
arguments:
|
||||
"[executor.loki-push-url]": ${deploy.runtime.loki.hudi-push-url}
|
||||
"[executor.task-jar-path]": ${deploy.runtime.executor.task-jar-path}
|
||||
"[executor.task-result-path]": ${deploy.runtime.executor.task-result-path}
|
||||
service-web:
|
||||
@@ -168,3 +161,10 @@ deploy:
|
||||
- "service"
|
||||
source-jar: service-monitor-1.0.0-SNAPSHOT.jar
|
||||
replicas: 1
|
||||
service-ai-chat:
|
||||
order: 6
|
||||
groups:
|
||||
- "ai"
|
||||
source-jar: service-ai-chat-1.0.0-SNAPSHOT.jar
|
||||
jdk: "jdk17"
|
||||
replicas: 1
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
mkdir -p ${runtime.jarPath}
|
||||
curl ${runtime.downloadUrl}/service-check-1.0.0-SNAPSHOT.jar -o ${runtime.jarPath}/service-check.jar
|
||||
${runtime.jdkPath}/bin/java -jar ${runtime.jarPath}/service-check.jar
|
||||
${runtime.jdkPath['jdk8']}/bin/java -jar ${runtime.jarPath}/service-check.jar
|
||||
|
||||
@@ -13,7 +13,7 @@ hostname_full=`ssh $host 'hostname -f'`
|
||||
<#-- 获取当前时间 -->
|
||||
start_time=`date +%Y%m%d%H%M%S`
|
||||
ssh $host "mkdir -p ${runtime.jarPath};curl ${runtime.downloadUrl}/${info.sourceJar} -o ${runtime.jarPath}/${info.name}.jar"
|
||||
ssh $host "export JASYPT_ENCRYPTOR_PASSWORD='r#(R,P\"Dp^A47>WSn:Wn].gs/+\"v:q_Q*An~zF*g-@j@jtSTv5H/,S-3:R?r9R}.';nohup ${runtime.jdkPath}/bin/java <#list environments?keys as key>-D${key}=${environments[key]?string} </#list>-jar ${runtime.jarPath}/${info.name}.jar <#noparse>--deploy.datetime=${datetime} --deploy.ip=${host} --deploy.hostname=${hostname} --deploy.hostname-full=${hostname_full} --deploy.start-time=${start_time}</#noparse> --hudi-service.signature=${runtime.signature} --logging.parent=${runtime.logPath} --loki.url=${runtime.loki.servicePushUrl} --spring.cloud.zookeeper.connect-string=${runtime.zkUrl} --spring.security.meta.authority='${runtime.security.authority}' --spring.security.meta.username='${runtime.security.username}' --spring.security.meta.darkcode='${runtime.security.darkcode}' --yarn-cluster.sync-clusters=${runtime.yarn.syncClusters} --yarn-cluster.compaction-clusters=${runtime.yarn.compactionClusters} <#list arguments?keys as key>--${key}='${arguments[key]?string}' </#list>> /dev/null 2>&1 &"
|
||||
ssh $host "export JASYPT_ENCRYPTOR_PASSWORD='r#(R,P\"Dp^A47>WSn:Wn].gs/+\"v:q_Q*An~zF*g-@j@jtSTv5H/,S-3:R?r9R}.';nohup ${runtime.jdkPath[info.jdk!(runtime.defaultJdk)]}/bin/java <#list environments?keys as key>-D${key}=${environments[key]?string} </#list>-jar ${runtime.jarPath}/${info.name}.jar <#noparse>--deploy.datetime=${datetime} --deploy.ip=${host} --deploy.hostname=${hostname} --deploy.hostname-full=${hostname_full} --deploy.start-time=${start_time}</#noparse> --hudi-service.signature=${runtime.signature} --logging.parent=${runtime.logPath} --spring.cloud.zookeeper.connect-string=${runtime.zkUrl} --spring.security.meta.authority='${runtime.security.authority}' --spring.security.meta.username='${runtime.security.username}' --spring.security.meta.darkcode='${runtime.security.darkcode}' --yarn-cluster.sync-clusters=${runtime.yarn.syncClusters} --yarn-cluster.compaction-clusters=${runtime.yarn.compactionClusters} <#list arguments?keys as key>--${key}='${arguments[key]?string}' </#list>> /dev/null 2>&1 &"
|
||||
</#if>
|
||||
echo ''
|
||||
</#list>
|
||||
|
||||
@@ -1,7 +1,46 @@
|
||||
#!/bin/bash
|
||||
|
||||
<#list hosts as host>
|
||||
host=${host.ip}
|
||||
echo "${info.name} ${host.ip} ${host.hostname} $datetime"
|
||||
ssh $host 'bash -s' < ${currentPath}/stop.sh ${runtime.jarPath}/${info.name}.jar
|
||||
ssh ${host.ip} bash -s <<'EOF'
|
||||
original_command="$0"
|
||||
application_name="${runtime.jarPath}/${info.name}.jar"
|
||||
|
||||
function get_pid() {
|
||||
ID=$(ps ef | grep "$application_name" | grep -v grep | grep -v $original_command | awk '{ print $2 }')
|
||||
if [[ -z "$ID" ]]; then
|
||||
ID=$(ps aux | grep "$application_name" | grep -v grep | grep -v $original_command | awk '{print $2}')
|
||||
if [[ -z "$ID" ]]; then
|
||||
ID=$(${runtime.jdkPath[info.jdk!(runtime.defaultJdk)]}/bin/jps -lmvV | grep "$application_name" | awk '{print $1}')
|
||||
fi
|
||||
fi
|
||||
echo $ID
|
||||
}
|
||||
|
||||
pid=$(get_pid)
|
||||
|
||||
if [[ -z "$pid" ]]; then
|
||||
echo "Application is already stopped."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "Stopping $pid..."
|
||||
kill $pid
|
||||
|
||||
LOOPS=0
|
||||
while (true); do
|
||||
cpid=$(get_pid)
|
||||
if [[ -z "$cpid" ]]; then
|
||||
echo "Oook! cost:$LOOPS"
|
||||
break
|
||||
fi
|
||||
LOOPS=$(($LOOPS+1))
|
||||
if [[ $(($LOOPS%15)) -eq 0 ]]; then
|
||||
echo "Wait timeout, try to force kill $pid..."
|
||||
kill -9 $pid
|
||||
fi
|
||||
sleep 1s
|
||||
done
|
||||
EOF
|
||||
|
||||
</#list>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
mkdir -p ${runtime.jarPath}
|
||||
export JASYPT_ENCRYPTOR_PASSWORD='r#(R,P\"Dp^A47>WSn:Wn].gs/+\"v:q_Q*An~zF*g-@j@jtSTv5H/,S-3:R?r9R}.'
|
||||
${runtime.jdkPath}/bin/java <#noparse>-Ddeploy.datetime=$(date +%Y%m%d%H%M%S) -Ddeploy.hostname=$(hostname) -Ddeploy.hostname-full=$(hostname -f) -Ddeploy.start-time=$(date +%Y%m%d%H%M%S)</#noparse> -Dlogging.parent=${runtime.logPath} -Dloki.url=${runtime.loki.servicePushUrl} -Dspring.cloud.zookeeper.connect-string=${runtime.zkUrl} -Dyarn-cluster.sync-clusters=${runtime.yarn.syncClusters} -Dyarn-cluster.compaction-clusters=${runtime.yarn.compactionClusters} -jar ${runtime.jarPath}/service-command-pro.jar<#if directly> $@</#if>
|
||||
${runtime.jdkPath['jdk8']}/bin/java <#noparse>-Ddeploy.datetime=$(date +%Y%m%d%H%M%S) -Ddeploy.hostname=$(hostname) -Ddeploy.hostname-full=$(hostname -f) -Ddeploy.start-time=$(date +%Y%m%d%H%M%S)</#noparse> -Dlogging.parent=${runtime.logPath} -Dloki.url=${runtime.loki.servicePushUrl} -Dspring.cloud.zookeeper.connect-string=${runtime.zkUrl} -Dyarn-cluster.sync-clusters=${runtime.yarn.syncClusters} -Dyarn-cluster.compaction-clusters=${runtime.yarn.compactionClusters} -jar ${runtime.jarPath}/service-command-pro.jar<#if directly> $@</#if>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
mkdir -p ${runtime.jarPath}
|
||||
export JASYPT_ENCRYPTOR_PASSWORD='r#(R,P\"Dp^A47>WSn:Wn].gs/+\"v:q_Q*An~zF*g-@j@jtSTv5H/,S-3:R?r9R}.'
|
||||
${runtime.jdkPath}/bin/java <#noparse>-Ddeploy.datetime=$(date +%Y%m%d%H%M%S) -Ddeploy.hostname=$(hostname) -Ddeploy.hostname-full=$(hostname -f) -Ddeploy.start-time=$(date +%Y%m%d%H%M%S)</#noparse> -Dlogging.parent=${runtime.logPath} -Dloki.url=${runtime.loki.servicePushUrl} -Dspring.cloud.zookeeper.connect-string=${runtime.zkUrl} -Dyarn-cluster.sync-clusters=${runtime.yarn.syncClusters} -Dyarn-cluster.compaction-clusters=${runtime.yarn.compactionClusters} -jar ${runtime.jarPath}/service-command.jar<#if directly> $@</#if>
|
||||
${runtime.jdkPath['jdk8']}/bin/java <#noparse>-Ddeploy.datetime=$(date +%Y%m%d%H%M%S) -Ddeploy.hostname=$(hostname) -Ddeploy.hostname-full=$(hostname -f) -Ddeploy.start-time=$(date +%Y%m%d%H%M%S)</#noparse> -Dlogging.parent=${runtime.logPath} -Dloki.url=${runtime.loki.servicePushUrl} -Dspring.cloud.zookeeper.connect-string=${runtime.zkUrl} -Dyarn-cluster.sync-clusters=${runtime.yarn.syncClusters} -Dyarn-cluster.compaction-clusters=${runtime.yarn.compactionClusters} -jar ${runtime.jarPath}/service-command.jar<#if directly> $@</#if>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
mkdir -p ${runtime.jarPath}
|
||||
export JASYPT_ENCRYPTOR_PASSWORD='r#(R,P"Dp^A47>WSn:Wn].gs/+"v:q_Q*An~zF*g-@j@jtSTv5H/,S-3:R?r9R}.'
|
||||
nohup ${runtime.jdkPath}/bin/java -jar ${runtime.jarPath}/service-uploader.jar <#noparse>--deploy.datetime=$(date +%Y%m%d%H%M%S) --deploy.hostname=$(hostname) --deploy.hostname-full=$(hostname -f) --deploy.start-time=$(date +%Y%m%d%H%M%S)</#noparse> --logging.parent=${runtime.logPath} --loki.url=${runtime.loki.servicePushUrl} --spring.cloud.zookeeper.connect-string=${runtime.zkUrl} --uploader.backend=local --uploader.tmp-dir=${runtime.dataPath}/uploader --spring.security.meta.authority='${runtime.security.authority}' --spring.security.meta.username='${runtime.security.username}' --spring.security.meta.darkcode='${runtime.security.darkcode}' > /dev/null 2>&1 &
|
||||
nohup ${runtime.jdkPath['jdk8']}/bin/java -jar ${runtime.jarPath}/service-uploader.jar <#noparse>--deploy.datetime=$(date +%Y%m%d%H%M%S) --deploy.hostname=$(hostname) --deploy.hostname-full=$(hostname -f) --deploy.start-time=$(date +%Y%m%d%H%M%S)</#noparse> --logging.parent=${runtime.logPath} --loki.url=${runtime.loki.servicePushUrl} --spring.cloud.zookeeper.connect-string=${runtime.zkUrl} --uploader.backend=local --uploader.tmp-dir=${runtime.dataPath}/uploader --spring.security.meta.authority='${runtime.security.authority}' --spring.security.meta.username='${runtime.security.username}' --spring.security.meta.darkcode='${runtime.security.darkcode}' > /dev/null 2>&1 &
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
original_command="$0"
|
||||
application_name="$1"
|
||||
application_name="service-uploader.jar"
|
||||
|
||||
function get_pid() {
|
||||
ID=$(ps ef | grep "$application_name" | grep -v grep | grep -v $original_command | awk '{ print $2 }')
|
||||
if [[ -z "$ID" ]]; then
|
||||
ID=$(ps aux | grep "$application_name" | grep -v grep | grep -v $original_command | awk '{print $2}')
|
||||
if [[ -z "$ID" ]]; then
|
||||
ID=$(${runtime.jdkPath}/bin/jps -lmvV | grep "$application_name" | awk '{print $1}')
|
||||
ID=$(${runtime.jdkPath['jdk8']}/bin/jps -lmvV | grep "$application_name" | awk '{print $1}')
|
||||
fi
|
||||
fi
|
||||
echo $ID
|
||||
@@ -50,7 +50,9 @@ public class GatewayApplication {
|
||||
.route("scheduler", createRoute("/hudi_services/service_scheduler", "lb://service-scheduler"))
|
||||
.route("web", createRoute("/hudi_services/service_web", "lb://service-web"))
|
||||
.route("services", createRoute("/hudi_services/service_cloud_query", "lb://service-cloud-query"))
|
||||
.route("exporter", createRoute("/hudi_services/service-exporter", "lb://service-exporter"))
|
||||
.route("exporter", createRoute("/hudi_services/service_exporter", "lb://service-exporter"))
|
||||
.route("ai-chat", createRoute("/hudi_services/ai_chat", "lb://service-ai-chat"))
|
||||
.route("ai-knowledge", createRoute("/hudi_services/ai_knowledge", "lb://service-ai-knowledge"))
|
||||
.build();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user