4 Commits

Author SHA1 Message Date
v-zhangjc9
6e7cef6170 fix(ai): 移除多余的git跟踪 2025-05-20 17:06:31 +08:00
v-zhangjc9
0156a12b3b feat(gateway): 增加AI相关端口 2025-05-20 16:36:36 +08:00
v-zhangjc9
fe58cee730 feat(bin): 修改仓库到私有仓库中 2025-05-20 14:43:56 +08:00
v-zhangjc9
778a6df984 feat(cli): 增加多jdk的支持 2025-05-20 14:42:51 +08:00
27 changed files with 149 additions and 298 deletions

View File

@@ -6,6 +6,6 @@ deploy service-common service-dependencies service-configuration service-forest
configs=(b2a4 b2b1 b2b12) configs=(b2a4 b2b1 b2b12)
for config in ${configs[*]}; for config in ${configs[*]};
do 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 upload $root_path/service-launcher/target/service-launcher-$config-1.0.0-SNAPSHOT.jar
done done

View File

@@ -1,5 +1,7 @@
#!/bin/bash #!/bin/bash
maven_setting=/Users/lanyuanxiaoyao/.m2/settings-nas.xml
build_profile=b2b12 build_profile=b2b12
upload_username=AxhEbscwsJDbYMH2 upload_username=AxhEbscwsJDbYMH2
@@ -27,10 +29,14 @@ function joining {
fi fi
} }
function deploy_root() {
mvn deploy -N -D skipTests -s $maven_setting
}
function deploy() { function deploy() {
mvn -pl $(joining , $@) clean install -D skipTests mvn -pl $(joining , $@) clean deploy -D skipTests -s $maven_setting
} }
function package() { 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
View File

@@ -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
View File

@@ -1,10 +0,0 @@
# 默认忽略的文件
/shelf/
/workspace.xml
# 基于编辑器的 HTTP 客户端请求
/httpRequests/
# 依赖于环境的 Maven 主目录路径
/mavenHomeManager.xml
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

View File

@@ -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>

View File

@@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GitCommitMessageStorage">
<option name="messageStorage">
<MessageStorage />
</option>
</component>
</project>

View File

@@ -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>

View File

@@ -1,5 +0,0 @@
<component name="ProjectCodeStyleConfiguration">
<state>
<option name="PREFERRED_PROJECT_CODE_STYLE" value="Default" />
</state>
</component>

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>

View File

@@ -1,5 +1,7 @@
package com.lanyuanxiaoyao.service.cli.core; package com.lanyuanxiaoyao.service.cli.core;
import java.util.Map;
/** /**
* 运行配置 * 运行配置
* *
@@ -10,7 +12,8 @@ public class RuntimeInfo {
private String signature; private String signature;
private String user; private String user;
private String jarPath; private String jarPath;
private String jdkPath; private String defaultJdk;
private Map<String, String> jdkPath;
private String logPath; private String logPath;
private String confPath; private String confPath;
private String dataPath; private String dataPath;
@@ -47,11 +50,19 @@ public class RuntimeInfo {
this.jarPath = jarPath; 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; return jdkPath;
} }
public void setJdkPath(String jdkPath) { public void setJdkPath(Map<String, String> jdkPath) {
this.jdkPath = jdkPath; this.jdkPath = jdkPath;
} }
@@ -146,22 +157,23 @@ public class RuntimeInfo {
@Override @Override
public String toString() { public String toString() {
return "RuntimeInfo{" + return "RuntimeInfo{" +
"signature='" + signature + '\'' + "signature='" + signature + '\'' +
", user='" + user + '\'' + ", user='" + user + '\'' +
", jarPath='" + jarPath + '\'' + ", jarPath='" + jarPath + '\'' +
", jdkPath='" + jdkPath + '\'' + ", defaultJdk='" + defaultJdk + '\'' +
", logPath='" + logPath + '\'' + ", jdkPath=" + jdkPath +
", confPath='" + confPath + '\'' + ", logPath='" + logPath + '\'' +
", dataPath='" + dataPath + '\'' + ", confPath='" + confPath + '\'' +
", downloadUrl='" + downloadUrl + '\'' + ", dataPath='" + dataPath + '\'' +
", kerberosKeytabPath='" + kerberosKeytabPath + '\'' + ", downloadUrl='" + downloadUrl + '\'' +
", loki=" + loki + ", kerberosKeytabPath='" + kerberosKeytabPath + '\'' +
", zkUrl='" + zkUrl + '\'' + ", loki=" + loki +
", connectorZkUrl='" + connectorZkUrl + '\'' + ", zkUrl='" + zkUrl + '\'' +
", hudi=" + hudi + ", connectorZkUrl='" + connectorZkUrl + '\'' +
", security=" + security + ", hudi=" + hudi +
", yarn=" + yarn + ", security=" + security +
'}'; ", yarn=" + yarn +
'}';
} }
public static final class LokiInfo { public static final class LokiInfo {

View File

@@ -17,6 +17,7 @@ public class ServiceInfo {
private List<String> groups = new ArrayList<>(); private List<String> groups = new ArrayList<>();
private Integer replicas = 0; private Integer replicas = 0;
private String sourceJar; private String sourceJar;
private String jdk;
private List<String> classpath = new ArrayList<>(); private List<String> classpath = new ArrayList<>();
private Map<String, Object> environments = new HashMap<>(); private Map<String, Object> environments = new HashMap<>();
private Map<String, Object> arguments = new HashMap<>(); private Map<String, Object> arguments = new HashMap<>();
@@ -61,6 +62,14 @@ public class ServiceInfo {
this.sourceJar = sourceJar; this.sourceJar = sourceJar;
} }
public String getJdk() {
return jdk;
}
public void setJdk(String jdk) {
this.jdk = jdk;
}
public List<String> getClasspath() { public List<String> getClasspath() {
return classpath; return classpath;
} }
@@ -88,14 +97,15 @@ public class ServiceInfo {
@Override @Override
public String toString() { public String toString() {
return "ServiceInfo{" + return "ServiceInfo{" +
"enabled=" + enabled + "enabled=" + enabled +
", order=" + order + ", order=" + order +
", groups=" + groups + ", groups=" + groups +
", replicas=" + replicas + ", replicas=" + replicas +
", sourceJar='" + sourceJar + '\'' + ", sourceJar='" + sourceJar + '\'' +
", classpath=" + classpath + ", jdk=" + jdk +
", environments=" + environments + ", classpath=" + classpath +
", arguments=" + arguments + ", environments=" + environments +
'}'; ", arguments=" + arguments +
'}';
} }
} }

View File

@@ -138,7 +138,8 @@ public class RunnerApplication implements ApplicationRunner {
Path planPath = Paths.get(root.toString(), "deploy.plan"); Path planPath = Paths.get(root.toString(), "deploy.plan");
Map<String, List<String>> deployPlans = new HashMap<>(); Map<String, List<String>> deployPlans = new HashMap<>();
if (Files.exists(planPath) && !deployInformationProperties.getShuffler()) { 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) { for (ServiceInfoWrapper serviceInfo : serviceInfoList) {
@@ -168,8 +169,8 @@ public class RunnerApplication implements ApplicationRunner {
MapUtil.builder() MapUtil.builder()
.put("currentPath", absolutRootPath) .put("currentPath", absolutRootPath)
.put("hosts", hostInfoList .put("hosts", hostInfoList
.collect(HostInfoWrapper::getHostnameIp) .collect(HostInfoWrapper::getHostnameIp)
.toSortedList((o1, o2) -> Comparator.<String>naturalOrder().compare(o1.getIp(), o2.getIp()))) .toSortedList((o1, o2) -> Comparator.<String>naturalOrder().compare(o1.getIp(), o2.getIp())))
.put("selectedHosts", selectedHosts) .put("selectedHosts", selectedHosts)
.put("runtime", runtimeInfo) .put("runtime", runtimeInfo)
.put("info", serviceInfo) .put("info", serviceInfo)
@@ -187,8 +188,8 @@ public class RunnerApplication implements ApplicationRunner {
MapUtil.builder() MapUtil.builder()
.put("currentPath", absolutRootPath) .put("currentPath", absolutRootPath)
.put("hosts", hostInfoList .put("hosts", hostInfoList
.collect(HostInfoWrapper::getHostnameIp) .collect(HostInfoWrapper::getHostnameIp)
.toSortedList((o1, o2) -> Comparator.<String>naturalOrder().compare(o1.getIp(), o2.getIp()))) .toSortedList((o1, o2) -> Comparator.<String>naturalOrder().compare(o1.getIp(), o2.getIp())))
.put("runtime", runtimeInfo) .put("runtime", runtimeInfo)
.put("info", serviceInfo) .put("info", serviceInfo)
.put("arguments", serviceInfo.getArguments()) .put("arguments", serviceInfo.getArguments())
@@ -199,13 +200,13 @@ public class RunnerApplication implements ApplicationRunner {
StrUtil.format("stop-{}.sh", serviceInfo.getName()) StrUtil.format("stop-{}.sh", serviceInfo.getName())
) )
); );
generateTemplate( generateTemplate(
"cloud/log.ftl", "cloud/log.ftl",
MapUtil.builder() MapUtil.builder()
.put("currentPath", absolutRootPath) .put("currentPath", absolutRootPath)
.put("hosts", hostInfoList .put("hosts", hostInfoList
.collect(HostInfoWrapper::getHostnameIp) .collect(HostInfoWrapper::getHostnameIp)
.toSortedList((o1, o2) -> Comparator.<String>naturalOrder().compare(o1.getIp(), o2.getIp()))) .toSortedList((o1, o2) -> Comparator.<String>naturalOrder().compare(o1.getIp(), o2.getIp())))
.put("selectedHosts", selectedHosts) .put("selectedHosts", selectedHosts)
.put("runtime", runtimeInfo) .put("runtime", runtimeInfo)
.put("info", serviceInfo) .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( generateTemplate(
"cloud/ssh-script.ftl", "cloud/ssh-script.ftl",
MapUtil.builder() MapUtil.builder()
.put("currentPath", absolutRootPath) .put("currentPath", absolutRootPath)
.put("hosts", hostInfoList .put("hosts", hostInfoList
.collect(HostInfoWrapper::getHostnameIp) .collect(HostInfoWrapper::getHostnameIp)
.toSortedList((o1, o2) -> Comparator.<String>naturalOrder().compare(o1.getIp(), o2.getIp()))) .toSortedList((o1, o2) -> Comparator.<String>naturalOrder().compare(o1.getIp(), o2.getIp())))
.put("runtime", runtimeInfo) .put("runtime", runtimeInfo)
.build(), .build(),
Paths.get(root.toString(), "ssh.sh") Paths.get(root.toString(), "ssh.sh")
); );
@@ -338,14 +330,14 @@ public class RunnerApplication implements ApplicationRunner {
Paths.get(root.toString(), "update.sh") Paths.get(root.toString(), "update.sh")
); );
Template stopTemplate = engine.getTemplate("cloud/stop-script.ftl"); generateTemplate(
String stopScript = stopTemplate.render(MapUtil.builder() "uploader/stop.ftl",
.put("currentPath", absolutRootPath) MapUtil.builder()
.put("runtime", runtimeInfo) .put("currentPath", absolutRootPath)
.build()); .put("runtime", runtimeInfo)
// 一个魔法操作 .build(),
stopScript = stopScript.replaceAll("application_name=\".*\"", "application_name=\"service-uploader.jar\""); Paths.get(root.toString(), "stop.sh")
Files.write(Paths.get(root.toString(), "stop.sh"), stopScript.getBytes()); );
} }
private void generateUpdateJar(Path root) throws IOException { private void generateUpdateJar(Path root) throws IOException {

View File

@@ -49,6 +49,10 @@ public class ServiceInfoWrapper {
return serviceInfo.getSourceJar(); return serviceInfo.getSourceJar();
} }
public String getJdk() {
return serviceInfo.getJdk();
}
public List<String> getClasspath() { public List<String> getClasspath() {
return serviceInfo.getClasspath(); return serviceInfo.getClasspath();
} }

View File

@@ -7,7 +7,11 @@ deploy:
# 应用jar包 # 应用jar包
jar-path: /data/datalake/jars jar-path: /data/datalake/jars
# 主机jdk根目录 # 主机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 log-path: /data/datalake/logs
# 应用配置 # 应用配置

View File

@@ -38,8 +38,6 @@ deploy:
"[connector.hadoop.kerberos-keytab-path]": ${deploy.runtime.kerberos-keytab-path} "[connector.hadoop.kerberos-keytab-path]": ${deploy.runtime.kerberos-keytab-path}
"[connector.hudi.app-hdfs-path]": ${deploy.runtime.hudi.app-hdfs-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.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: arguments:
"[spring.application.name]": service-launcher-b1 "[spring.application.name]": service-launcher-b1
"[connector.cluster.cluster]": b1 "[connector.cluster.cluster]": b1
@@ -59,8 +57,6 @@ deploy:
"[connector.hadoop.kerberos-keytab-path]": ${deploy.runtime.kerberos-keytab-path} "[connector.hadoop.kerberos-keytab-path]": ${deploy.runtime.kerberos-keytab-path}
"[connector.hudi.app-hdfs-path]": ${deploy.runtime.hudi.app-hdfs-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.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: arguments:
"[spring.application.name]": service-launcher-a4 "[spring.application.name]": service-launcher-a4
"[connector.cluster.cluster]": a4 "[connector.cluster.cluster]": a4
@@ -80,8 +76,6 @@ deploy:
"[connector.hadoop.kerberos-keytab-path]": ${deploy.runtime.kerberos-keytab-path} "[connector.hadoop.kerberos-keytab-path]": ${deploy.runtime.kerberos-keytab-path}
"[connector.hudi.app-hdfs-path]": ${deploy.runtime.hudi.app-hdfs-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.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: arguments:
"[spring.application.name]": service-launcher-b12 "[spring.application.name]": service-launcher-b12
"[connector.cluster.cluster]": 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-principal]": ${deploy.runtime.user}/$\{hostname}.hdp.dc@ECLD.COM
"[connector.hadoop.kerberos-keytab-path]": ${deploy.runtime.kerberos-keytab-path} "[connector.hadoop.kerberos-keytab-path]": ${deploy.runtime.kerberos-keytab-path}
arguments: arguments:
"[executor.loki-push-url]": ${deploy.runtime.loki.hudi-push-url}
"[executor.task-jar-path]": ${deploy.runtime.executor.task-jar-path} "[executor.task-jar-path]": ${deploy.runtime.executor.task-jar-path}
"[executor.task-result-path]": ${deploy.runtime.executor.task-result-path} "[executor.task-result-path]": ${deploy.runtime.executor.task-result-path}
service-web: service-web:
@@ -168,3 +161,10 @@ deploy:
- "service" - "service"
source-jar: service-monitor-1.0.0-SNAPSHOT.jar source-jar: service-monitor-1.0.0-SNAPSHOT.jar
replicas: 1 replicas: 1
service-ai-chat:
order: 6
groups:
- "ai"
source-jar: service-ai-chat-1.0.0-SNAPSHOT.jar
jdk: "jdk17"
replicas: 1

View File

@@ -1,4 +1,4 @@
#!/bin/bash #!/bin/bash
mkdir -p ${runtime.jarPath} mkdir -p ${runtime.jarPath}
curl ${runtime.downloadUrl}/service-check-1.0.0-SNAPSHOT.jar -o ${runtime.jarPath}/service-check.jar 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

View File

@@ -13,7 +13,7 @@ hostname_full=`ssh $host 'hostname -f'`
<#-- 获取当前时间 --> <#-- 获取当前时间 -->
start_time=`date +%Y%m%d%H%M%S` 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 "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> </#if>
echo '' echo ''
</#list> </#list>

View File

@@ -1,7 +1,46 @@
#!/bin/bash #!/bin/bash
<#list hosts as host> <#list hosts as host>
host=${host.ip}
echo "${info.name} ${host.ip} ${host.hostname} $datetime" 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> </#list>

View File

@@ -1,4 +1,4 @@
#!/bin/bash #!/bin/bash
mkdir -p ${runtime.jarPath} 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}.' 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>

View File

@@ -1,4 +1,4 @@
#!/bin/bash #!/bin/bash
mkdir -p ${runtime.jarPath} 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}.' 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>

View File

@@ -1,4 +1,4 @@
#!/bin/bash #!/bin/bash
mkdir -p ${runtime.jarPath} 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}.' 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 &

View File

@@ -1,14 +1,14 @@
#!/bin/bash #!/bin/bash
original_command="$0" original_command="$0"
application_name="$1" application_name="service-uploader.jar"
function get_pid() { function get_pid() {
ID=$(ps ef | grep "$application_name" | grep -v grep | grep -v $original_command | awk '{ print $2 }') ID=$(ps ef | grep "$application_name" | grep -v grep | grep -v $original_command | awk '{ print $2 }')
if [[ -z "$ID" ]]; then if [[ -z "$ID" ]]; then
ID=$(ps aux | grep "$application_name" | grep -v grep | grep -v $original_command | awk '{print $2}') ID=$(ps aux | grep "$application_name" | grep -v grep | grep -v $original_command | awk '{print $2}')
if [[ -z "$ID" ]]; then 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
fi fi
echo $ID echo $ID

View File

@@ -50,7 +50,9 @@ public class GatewayApplication {
.route("scheduler", createRoute("/hudi_services/service_scheduler", "lb://service-scheduler")) .route("scheduler", createRoute("/hudi_services/service_scheduler", "lb://service-scheduler"))
.route("web", createRoute("/hudi_services/service_web", "lb://service-web")) .route("web", createRoute("/hudi_services/service_web", "lb://service-web"))
.route("services", createRoute("/hudi_services/service_cloud_query", "lb://service-cloud-query")) .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(); .build();
} }
} }