[Octopus] modify project to SpringBoot version
This commit is contained in:
2
.github/workflows/build-push-docker.yml
vendored
2
.github/workflows/build-push-docker.yml
vendored
@@ -28,7 +28,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
java-version: '11'
|
java-version: '11'
|
||||||
distribution: 'temurin'
|
distribution: 'temurin'
|
||||||
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
|
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml-back
|
||||||
settings-path: ${{ github.workspace }} # location for the settings.xml file
|
settings-path: ${{ github.workspace }} # location for the settings.xml file
|
||||||
cache: maven
|
cache: maven
|
||||||
|
|
||||||
|
|||||||
136
agent-go/executor/function/BaseFunction.go
Normal file
136
agent-go/executor/function/BaseFunction.go
Normal file
@@ -0,0 +1,136 @@
|
|||||||
|
package function
|
||||||
|
|
||||||
|
import "strings"
|
||||||
|
|
||||||
|
type BaseFunc interface {
|
||||||
|
Exec(baseFuncName string, funcArgs ...string) string
|
||||||
|
}
|
||||||
|
|
||||||
|
type AgentOsOperator struct {
|
||||||
|
execCommandPrefix string `json:"exec_command_prefix",comment:"apt-get or yum or zapper"`
|
||||||
|
|
||||||
|
canAccessInternet bool `json:"can_access_internet",comment:"是否可以访问公网"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Exec 执行基础功能函数
|
||||||
|
func (op *AgentOsOperator) Exec(baseFuncName string, funcArgs ...string) string {
|
||||||
|
|
||||||
|
result := ""
|
||||||
|
|
||||||
|
switch baseFuncName {
|
||||||
|
|
||||||
|
case "shutdownFirewall":
|
||||||
|
result = op.shutdownFirewall()
|
||||||
|
break
|
||||||
|
case "modifyHostname":
|
||||||
|
result = op.modifyHostname(funcArgs)
|
||||||
|
break
|
||||||
|
case "disableSwap":
|
||||||
|
result = op.disableSwap()
|
||||||
|
break
|
||||||
|
case "installDocker":
|
||||||
|
result = op.installDocker(funcArgs)
|
||||||
|
break
|
||||||
|
case "installDockerCompose":
|
||||||
|
result = op.installDockerCompose()
|
||||||
|
break
|
||||||
|
case "modifyDockerConfig":
|
||||||
|
result = op.modifyDockerConfig()
|
||||||
|
break
|
||||||
|
case "installHelm":
|
||||||
|
result = op.installHelm()
|
||||||
|
break
|
||||||
|
case "installHarbor":
|
||||||
|
result = op.installHarbor(funcArgs)
|
||||||
|
break
|
||||||
|
case "chronyToPublicNTP":
|
||||||
|
result = op.chronyToPublicNTP()
|
||||||
|
break
|
||||||
|
case "chronyToMaster":
|
||||||
|
result = op.chronyToMaster(funcArgs)
|
||||||
|
break
|
||||||
|
case "installZSH":
|
||||||
|
result = op.installZSH()
|
||||||
|
break
|
||||||
|
case "modifySshPort":
|
||||||
|
result = op.modifySshPort(funcArgs)
|
||||||
|
break
|
||||||
|
case "openBBR":
|
||||||
|
result = op.openBBR()
|
||||||
|
break
|
||||||
|
default:
|
||||||
|
result = op.ok(funcArgs)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return result
|
||||||
|
}
|
||||||
|
|
||||||
|
func (op *AgentOsOperator) shutdownFirewall() string {
|
||||||
|
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (op *AgentOsOperator) modifyHostname(args []string) string {
|
||||||
|
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (op *AgentOsOperator) disableSwap() string {
|
||||||
|
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (op *AgentOsOperator) installDocker(args []string) string {
|
||||||
|
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (op *AgentOsOperator) installDockerCompose() string {
|
||||||
|
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (op *AgentOsOperator) installHelm() string {
|
||||||
|
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (op *AgentOsOperator) modifyDockerConfig() string {
|
||||||
|
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (op *AgentOsOperator) installHarbor(args []string) string {
|
||||||
|
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (op *AgentOsOperator) chronyToPublicNTP() string {
|
||||||
|
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (op *AgentOsOperator) chronyToMaster(args []string) string {
|
||||||
|
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (op *AgentOsOperator) installZSH() string {
|
||||||
|
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (op *AgentOsOperator) modifySshPort(args []string) string {
|
||||||
|
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (op *AgentOsOperator) openBBR() string {
|
||||||
|
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (op *AgentOsOperator) ok(args []string) string {
|
||||||
|
return "base function is ok , args are => " + strings.Join(args, " ")
|
||||||
|
}
|
||||||
@@ -18,6 +18,7 @@ const (
|
|||||||
ExecOmType = "EXECUTOR"
|
ExecOmType = "EXECUTOR"
|
||||||
StatusOmType = "STATUS"
|
StatusOmType = "STATUS"
|
||||||
InitOmType = "INIT"
|
InitOmType = "INIT"
|
||||||
|
AgentOmType = "AGENT"
|
||||||
)
|
)
|
||||||
|
|
||||||
var pool, _ = ants.NewPool(100, ants.WithNonblocking(false), ants.WithLogger(logger2.Log), ants.WithMaxBlockingTasks(30), ants.WithDisablePurge(true))
|
var pool, _ = ants.NewPool(100, ants.WithNonblocking(false), ants.WithLogger(logger2.Log), ants.WithMaxBlockingTasks(30), ants.WithDisablePurge(true))
|
||||||
|
|||||||
@@ -83,6 +83,11 @@ func doHandleOctopusMessage(octopusMessage *OctopusMessage) {
|
|||||||
P.Submit(func() {
|
P.Submit(func() {
|
||||||
statusOMHandler(octopusMessage)
|
statusOMHandler(octopusMessage)
|
||||||
})
|
})
|
||||||
|
case g.AgentOmType:
|
||||||
|
P.Submit(func() {
|
||||||
|
agentOMHandler(octopusMessage)
|
||||||
|
},
|
||||||
|
)
|
||||||
default:
|
default:
|
||||||
P.Submit(func() {
|
P.Submit(func() {
|
||||||
blackHoleOMHandler(octopusMessage)
|
blackHoleOMHandler(octopusMessage)
|
||||||
@@ -91,6 +96,11 @@ func doHandleOctopusMessage(octopusMessage *OctopusMessage) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// agentOMHandler 处理Agent的核心操作指令
|
||||||
|
func agentOMHandler(octopusMessage *OctopusMessage) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
func executorOMHandler(octopusMessage *OctopusMessage) {
|
func executorOMHandler(octopusMessage *OctopusMessage) {
|
||||||
|
|
||||||
executionMsgString := octopusMessage.Content.(string)
|
executionMsgString := octopusMessage.Content.(string)
|
||||||
|
|||||||
@@ -27,6 +27,10 @@
|
|||||||
<artifactId>oshi-core-java11</artifactId>
|
<artifactId>oshi-core-java11</artifactId>
|
||||||
<version>6.4.0</version>
|
<version>6.4.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.fasterxml.jackson.core</groupId>
|
||||||
|
<artifactId>jackson-annotations</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
package io.wdd.common;
|
package io.wdd.common;
|
||||||
|
|
||||||
import org.springframework.boot.SpringApplication;
|
//import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
//import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
|
||||||
@SpringBootApplication
|
//@SpringBootApplication
|
||||||
public class CommonApplication {
|
//public class CommonApplication {
|
||||||
|
//
|
||||||
public static void main(String[] args) {
|
// public static void main(String[] args) {
|
||||||
SpringApplication.run(CommonApplication.class, args);
|
// SpringApplication.run(CommonApplication.class, args);
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
}
|
//}
|
||||||
|
|||||||
138
pom.xml
138
pom.xml
@@ -20,10 +20,10 @@
|
|||||||
<description>ProjectOctopus</description>
|
<description>ProjectOctopus</description>
|
||||||
|
|
||||||
<modules>
|
<modules>
|
||||||
<module>agent</module>
|
|
||||||
<module>server</module>
|
<module>server</module>
|
||||||
|
<!--<module>agent</module>
|
||||||
<module>common</module>
|
<module>common</module>
|
||||||
<module>source</module>
|
<module>source</module>-->
|
||||||
</modules>
|
</modules>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
@@ -36,101 +36,6 @@
|
|||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|
||||||
<!--<dependency>
|
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
|
||||||
</dependency>-->
|
|
||||||
|
|
||||||
<!-- spring cloud -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.cloud</groupId>
|
|
||||||
<artifactId>spring-cloud-dependencies</artifactId>
|
|
||||||
<version>${spring-cloud.version}</version>
|
|
||||||
<type>pom</type>
|
|
||||||
<scope>import</scope>
|
|
||||||
</dependency>
|
|
||||||
<!-- spring cloud alibaba dependency -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.alibaba.cloud</groupId>
|
|
||||||
<artifactId>spring-cloud-alibaba-dependencies</artifactId>
|
|
||||||
<version>${alibaba-cloud.version}</version>
|
|
||||||
<type>pom</type>
|
|
||||||
<scope>import</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.cloud</groupId>
|
|
||||||
<artifactId>spring-cloud-starter-bootstrap</artifactId>
|
|
||||||
<version>3.1.5</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.alibaba.cloud</groupId>
|
|
||||||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
|
||||||
<version>${alibaba-cloud.version}</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!--<dependency>
|
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot-starter-quartz</artifactId>
|
|
||||||
</dependency>-->
|
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot-starter-web</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!--<dependency>
|
|
||||||
<groupId>org.springframework.shell</groupId>
|
|
||||||
<artifactId>spring-shell-starter</artifactId>
|
|
||||||
</dependency>-->
|
|
||||||
|
|
||||||
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.apache.commons</groupId>
|
|
||||||
<artifactId>commons-lang3</artifactId>
|
|
||||||
<version>3.12.0</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- https://mvnrepository.com/artifact/com.google.guava/guava -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.google.guava</groupId>
|
|
||||||
<artifactId>guava</artifactId>
|
|
||||||
<version>31.1-jre</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- rabbitmq dependency -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot-starter-amqp</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- redis dependency -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot-starter-data-redis</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<!--<dependency>
|
|
||||||
<groupId>org.redisson</groupId>
|
|
||||||
<artifactId>redisson-spring-boot-starter</artifactId>
|
|
||||||
<version>3.13.6</version>
|
|
||||||
</dependency>-->
|
|
||||||
<!-- lettuce pool 缓存连接池-->
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.apache.commons</groupId>
|
|
||||||
<artifactId>commons-pool2</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>commons-beanutils</groupId>
|
|
||||||
<artifactId>commons-beanutils</artifactId>
|
|
||||||
<version>1.9.4</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.projectlombok</groupId>
|
|
||||||
<artifactId>lombok</artifactId>
|
|
||||||
<optional>true</optional>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!--<dependency>
|
<!--<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
@@ -139,11 +44,42 @@
|
|||||||
<optional>true</optional>
|
<optional>true</optional>
|
||||||
</dependency>-->
|
</dependency>-->
|
||||||
|
|
||||||
<dependency>
|
<!--<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-test</artifactId>
|
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||||
<scope>test</scope>
|
</dependency>-->
|
||||||
</dependency>
|
|
||||||
|
<!-- spring cloud -->
|
||||||
|
<!--<dependency>
|
||||||
|
<groupId>org.springframework.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-dependencies</artifactId>
|
||||||
|
<version>${spring-cloud.version}</version>
|
||||||
|
<type>pom</type>
|
||||||
|
<scope>import</scope>
|
||||||
|
</dependency>-->
|
||||||
|
<!-- spring cloud alibaba dependency -->
|
||||||
|
<!--<dependency>
|
||||||
|
<groupId>com.alibaba.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-alibaba-dependencies</artifactId>
|
||||||
|
<version>${alibaba-cloud.version}</version>
|
||||||
|
<type>pom</type>
|
||||||
|
<scope>import</scope>
|
||||||
|
</dependency>-->
|
||||||
|
<!--<dependency>
|
||||||
|
<groupId>org.springframework.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-bootstrap</artifactId>
|
||||||
|
<version>3.1.5</version>
|
||||||
|
</dependency>-->
|
||||||
|
<!--<dependency>
|
||||||
|
<groupId>com.alibaba.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||||
|
<version>${alibaba-cloud.version}</version>
|
||||||
|
</dependency>-->
|
||||||
|
|
||||||
|
<!--<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-quartz</artifactId>
|
||||||
|
</dependency>-->
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
|
|||||||
@@ -21,9 +21,37 @@
|
|||||||
<dependencies>
|
<dependencies>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.wdd</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>common</artifactId>
|
<artifactId>spring-boot-starter-web</artifactId>
|
||||||
<version>${project.parent.version}</version>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- rabbitmq dependency -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-amqp</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- redis dependency -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-data-redis</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<!--<dependency>
|
||||||
|
<groupId>org.redisson</groupId>
|
||||||
|
<artifactId>redisson-spring-boot-starter</artifactId>
|
||||||
|
<version>3.13.6</version>
|
||||||
|
</dependency>-->
|
||||||
|
<!-- lettuce pool 缓存连接池-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.commons</groupId>
|
||||||
|
<artifactId>commons-pool2</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>commons-beanutils</groupId>
|
||||||
|
<artifactId>commons-beanutils</artifactId>
|
||||||
|
<version>1.9.4</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- add in 2023-02-08 needed for some operation -->
|
<!-- add in 2023-02-08 needed for some operation -->
|
||||||
@@ -67,12 +95,32 @@
|
|||||||
<version>3.5.2</version>
|
<version>3.5.2</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- https://mvnrepository.com/artifact/com.alibaba/druid -->
|
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 -->
|
||||||
<!--<dependency>
|
<dependency>
|
||||||
<groupId>com.alibaba</groupId>
|
<groupId>org.apache.commons</groupId>
|
||||||
<artifactId>druid</artifactId>
|
<artifactId>commons-lang3</artifactId>
|
||||||
<version>1.1.19</version>
|
<version>3.12.0</version>
|
||||||
</dependency>-->
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.github.oshi</groupId>
|
||||||
|
<artifactId>oshi-core-java11</artifactId>
|
||||||
|
<version>6.4.0</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- https://mvnrepository.com/artifact/com.google.guava/guava -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.google.guava</groupId>
|
||||||
|
<artifactId>guava</artifactId>
|
||||||
|
<version>31.1-jre</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.projectlombok</groupId>
|
||||||
|
<artifactId>lombok</artifactId>
|
||||||
|
<optional>true</optional>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- https://mvnrepository.com/artifact/mysql/mysql-connector-java -->
|
<!-- https://mvnrepository.com/artifact/mysql/mysql-connector-java -->
|
||||||
<dependency>
|
<dependency>
|
||||||
@@ -87,6 +135,12 @@
|
|||||||
<scope>runtime</scope>
|
<scope>runtime</scope>
|
||||||
</dependency>-->
|
</dependency>-->
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-test</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<dependencyManagement>
|
<dependencyManagement>
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
package io.wdd.common.handler;
|
package io.wdd.common.handler;
|
||||||
|
|
||||||
import com.google.common.collect.Maps;
|
import com.google.common.collect.Maps;
|
||||||
import io.wdd.common.beans.response.R;
|
import io.wdd.common.response.R;
|
||||||
import io.wdd.common.beans.response.ResultStat;
|
import io.wdd.common.response.ResultStat;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.amqp.rabbit.support.ListenerExecutionFailedException;
|
import org.springframework.amqp.rabbit.support.ListenerExecutionFailedException;
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
package io.wdd.common.handler;
|
package io.wdd.common.handler;
|
||||||
|
|
||||||
import io.wdd.common.beans.response.ResultStat;
|
import io.wdd.common.response.ResultStat;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package io.wdd.common.beans.response;
|
package io.wdd.common.response;
|
||||||
|
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package io.wdd.common.beans.response;
|
package io.wdd.common.response;
|
||||||
|
|
||||||
public enum ResultStat {
|
public enum ResultStat {
|
||||||
|
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
package io.wdd.common.utils;
|
package io.wdd.common.utils;
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
import io.wdd.common.beans.rabbitmq.OctopusMessage;
|
|
||||||
import io.wdd.common.handler.MyRuntimeException;
|
import io.wdd.common.handler.MyRuntimeException;
|
||||||
|
import io.wdd.rpc.message.OctopusMessage;
|
||||||
import org.springframework.amqp.core.Message;
|
import org.springframework.amqp.core.Message;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
@@ -8,7 +8,6 @@ import org.springframework.amqp.rabbit.core.RabbitTemplate;
|
|||||||
import org.springframework.amqp.support.converter.Jackson2JsonMessageConverter;
|
import org.springframework.amqp.support.converter.Jackson2JsonMessageConverter;
|
||||||
import org.springframework.amqp.support.converter.MessageConverter;
|
import org.springframework.amqp.support.converter.MessageConverter;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
@@ -7,7 +7,7 @@ import com.amazonaws.services.s3.model.S3Object;
|
|||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import io.swagger.annotations.ApiParam;
|
import io.swagger.annotations.ApiParam;
|
||||||
import io.wdd.common.beans.response.R;
|
import io.wdd.common.response.R;
|
||||||
import io.wdd.func.oss.config.OctopusObjectSummary;
|
import io.wdd.func.oss.config.OctopusObjectSummary;
|
||||||
import io.wdd.func.oss.config.OssConfig;
|
import io.wdd.func.oss.config.OssConfig;
|
||||||
import io.wdd.func.oss.service.OSSCoreService;
|
import io.wdd.func.oss.service.OSSCoreService;
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ package io.wdd.func.controller;
|
|||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import io.swagger.annotations.ApiParam;
|
import io.swagger.annotations.ApiParam;
|
||||||
import io.wdd.common.beans.response.R;
|
import io.wdd.common.response.R;
|
||||||
import io.wdd.func.xray.beans.node.ProxyNode;
|
import io.wdd.func.xray.beans.node.ProxyNode;
|
||||||
import io.wdd.func.xray.beans.node.XrayConfigInfo;
|
import io.wdd.func.xray.beans.node.XrayConfigInfo;
|
||||||
import io.wdd.func.xray.service.XrayCallAgent;
|
import io.wdd.func.xray.service.XrayCallAgent;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
package io.wdd.common.beans.agent;
|
package io.wdd.rpc.agent;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package io.wdd.common.beans.agent;
|
package io.wdd.rpc.agent;
|
||||||
|
|
||||||
public enum AgentOperationType {
|
public enum AgentOperationType {
|
||||||
|
|
||||||
@@ -3,11 +3,9 @@ package io.wdd.rpc.agent;
|
|||||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||||
import com.fasterxml.jackson.core.type.TypeReference;
|
import com.fasterxml.jackson.core.type.TypeReference;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
import io.wdd.common.beans.agent.AgentOperationMessage;
|
|
||||||
import io.wdd.common.beans.agent.AgentOperationType;
|
|
||||||
import io.wdd.common.beans.rabbitmq.OctopusMessage;
|
|
||||||
import io.wdd.common.beans.rabbitmq.OctopusMessageType;
|
|
||||||
import io.wdd.common.utils.TimeUtils;
|
import io.wdd.common.utils.TimeUtils;
|
||||||
|
import io.wdd.rpc.message.OctopusMessage;
|
||||||
|
import io.wdd.rpc.message.OctopusMessageType;
|
||||||
import io.wdd.rpc.message.handler.AsyncWaitOMResult;
|
import io.wdd.rpc.message.handler.AsyncWaitOMResult;
|
||||||
import io.wdd.rpc.message.handler.OMReplayContend;
|
import io.wdd.rpc.message.handler.OMReplayContend;
|
||||||
import io.wdd.rpc.message.sender.OMessageToAgentSender;
|
import io.wdd.rpc.message.sender.OMessageToAgentSender;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ package io.wdd.rpc.controller;
|
|||||||
|
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import io.wdd.common.beans.response.R;
|
import io.wdd.common.response.R;
|
||||||
import io.wdd.rpc.agent.OctopusAgentService;
|
import io.wdd.rpc.agent.OctopusAgentService;
|
||||||
import io.wdd.server.beans.vo.ServerInfoVO;
|
import io.wdd.server.beans.vo.ServerInfoVO;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ package io.wdd.rpc.controller;
|
|||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import io.swagger.annotations.ApiParam;
|
import io.swagger.annotations.ApiParam;
|
||||||
import io.wdd.common.beans.response.R;
|
import io.wdd.common.response.R;
|
||||||
import io.wdd.rpc.execute.result.BuildStreamReader;
|
import io.wdd.rpc.execute.result.BuildStreamReader;
|
||||||
import io.wdd.rpc.execute.service.AsyncExecutionService;
|
import io.wdd.rpc.execute.service.AsyncExecutionService;
|
||||||
import io.wdd.rpc.execute.service.SyncExecutionService;
|
import io.wdd.rpc.execute.service.SyncExecutionService;
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ package io.wdd.rpc.controller;
|
|||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import io.swagger.annotations.ApiParam;
|
import io.swagger.annotations.ApiParam;
|
||||||
import io.wdd.common.beans.response.R;
|
import io.wdd.common.response.R;
|
||||||
import io.wdd.rpc.scheduler.beans.ScriptSchedulerVO;
|
import io.wdd.rpc.scheduler.beans.ScriptSchedulerVO;
|
||||||
import io.wdd.rpc.scheduler.service.QuartzSchedulerService;
|
import io.wdd.rpc.scheduler.service.QuartzSchedulerService;
|
||||||
import org.quartz.JobDetail;
|
import org.quartz.JobDetail;
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ package io.wdd.rpc.controller;
|
|||||||
|
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import io.wdd.common.beans.response.R;
|
import io.wdd.common.response.R;
|
||||||
import io.wdd.rpc.init.ServerCacheAgentStatus;
|
import io.wdd.rpc.init.ServerCacheAgentStatus;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
package io.wdd.common.beans.executor;
|
package io.wdd.rpc.execute;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
import io.wdd.common.utils.TimeUtils;
|
import io.wdd.common.utils.TimeUtils;
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
package io.wdd.rpc.execute.service;
|
package io.wdd.rpc.execute.service;
|
||||||
|
|
||||||
import io.wdd.common.beans.rabbitmq.OctopusMessage;
|
import io.wdd.rpc.message.OctopusMessage;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|||||||
@@ -2,11 +2,11 @@ package io.wdd.rpc.execute.service;
|
|||||||
|
|
||||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
import io.wdd.common.beans.executor.ExecutionMessage;
|
|
||||||
import io.wdd.common.beans.rabbitmq.OctopusMessage;
|
|
||||||
import io.wdd.common.beans.rabbitmq.OctopusMessageType;
|
|
||||||
import io.wdd.common.utils.TimeUtils;
|
import io.wdd.common.utils.TimeUtils;
|
||||||
|
import io.wdd.rpc.execute.ExecutionMessage;
|
||||||
import io.wdd.rpc.execute.config.ExecutionLog;
|
import io.wdd.rpc.execute.config.ExecutionLog;
|
||||||
|
import io.wdd.rpc.message.OctopusMessage;
|
||||||
|
import io.wdd.rpc.message.OctopusMessageType;
|
||||||
import io.wdd.rpc.message.sender.OMessageToAgentSender;
|
import io.wdd.rpc.message.sender.OMessageToAgentSender;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ import io.wdd.server.service.ExecutionLogService;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.collections.CollectionUtils;
|
import org.apache.commons.collections.CollectionUtils;
|
||||||
import org.springframework.context.annotation.Lazy;
|
import org.springframework.context.annotation.Lazy;
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
import javax.annotation.PostConstruct;
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package io.wdd.rpc.execute.service;
|
package io.wdd.rpc.execute.service;
|
||||||
|
|
||||||
import io.wdd.common.beans.rabbitmq.OctopusMessage;
|
import io.wdd.rpc.message.OctopusMessage;
|
||||||
import io.wdd.common.beans.rabbitmq.OctopusMessageType;
|
import io.wdd.rpc.message.OctopusMessageType;
|
||||||
import io.wdd.rpc.message.handler.AsyncWaitOMResult;
|
import io.wdd.rpc.message.handler.AsyncWaitOMResult;
|
||||||
import io.wdd.rpc.message.handler.OMReplayContend;
|
import io.wdd.rpc.message.handler.OMReplayContend;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|||||||
@@ -3,11 +3,11 @@ package io.wdd.rpc.init;
|
|||||||
|
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
import com.rabbitmq.client.Channel;
|
import com.rabbitmq.client.Channel;
|
||||||
import io.wdd.common.beans.rabbitmq.OctopusMessage;
|
|
||||||
import io.wdd.common.beans.rabbitmq.OctopusMessageType;
|
|
||||||
import io.wdd.common.beans.status.AgentStatus;
|
|
||||||
import io.wdd.common.handler.MyRuntimeException;
|
import io.wdd.common.handler.MyRuntimeException;
|
||||||
|
import io.wdd.rpc.message.OctopusMessage;
|
||||||
|
import io.wdd.rpc.message.OctopusMessageType;
|
||||||
import io.wdd.rpc.message.sender.OMessageToAgentSender;
|
import io.wdd.rpc.message.sender.OMessageToAgentSender;
|
||||||
|
import io.wdd.rpc.status.AgentStatus;
|
||||||
import io.wdd.server.beans.vo.ServerInfoVO;
|
import io.wdd.server.beans.vo.ServerInfoVO;
|
||||||
import io.wdd.server.utils.DaemonDatabaseOperator;
|
import io.wdd.server.utils.DaemonDatabaseOperator;
|
||||||
import lombok.SneakyThrows;
|
import lombok.SneakyThrows;
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
package io.wdd.rpc.init;
|
package io.wdd.rpc.init;
|
||||||
|
|
||||||
|
|
||||||
import io.wdd.common.beans.status.AgentHealthyStatusEnum;
|
|
||||||
import io.wdd.common.utils.TimeUtils;
|
import io.wdd.common.utils.TimeUtils;
|
||||||
|
import io.wdd.rpc.status.AgentHealthyStatusEnum;
|
||||||
import io.wdd.server.beans.vo.ServerInfoVO;
|
import io.wdd.server.beans.vo.ServerInfoVO;
|
||||||
import io.wdd.server.coreService.CoreServerService;
|
import io.wdd.server.coreService.CoreServerService;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@@ -15,7 +15,8 @@ import javax.annotation.Resource;
|
|||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import static io.wdd.common.beans.status.OctopusStatusMessage.ALL_AGENT_STATUS_REDIS_KEY;
|
import static io.wdd.rpc.status.OctopusStatusMessage.ALL_AGENT_STATUS_REDIS_KEY;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Server启动或者运行的时候,需要初 缓存一系列的信息
|
* Server启动或者运行的时候,需要初 缓存一系列的信息
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
package io.wdd.common.beans.rabbitmq;
|
package io.wdd.rpc.message;
|
||||||
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package io.wdd.common.beans.rabbitmq;
|
package io.wdd.rpc.message;
|
||||||
|
|
||||||
public enum OctopusMessageType {
|
public enum OctopusMessageType {
|
||||||
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
package io.wdd.rpc.message.handler;
|
package io.wdd.rpc.message.handler;
|
||||||
|
|
||||||
import io.wdd.common.beans.rabbitmq.OctopusMessage;
|
import io.wdd.rpc.message.OctopusMessage;
|
||||||
import io.wdd.server.config.ServerCommonPool;
|
import io.wdd.server.config.ServerCommonPool;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ package io.wdd.rpc.message.handler;
|
|||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import io.wdd.common.beans.rabbitmq.OctopusMessage;
|
import io.wdd.rpc.message.OctopusMessage;
|
||||||
import io.wdd.common.beans.rabbitmq.OctopusMessageType;
|
import io.wdd.rpc.message.OctopusMessageType;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|||||||
@@ -2,8 +2,8 @@ package io.wdd.rpc.message.handler;
|
|||||||
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
import io.wdd.common.beans.rabbitmq.OctopusMessage;
|
|
||||||
import io.wdd.common.handler.MyRuntimeException;
|
import io.wdd.common.handler.MyRuntimeException;
|
||||||
|
import io.wdd.rpc.message.OctopusMessage;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.amqp.core.Message;
|
import org.springframework.amqp.core.Message;
|
||||||
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
|
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
|
||||||
|
|||||||
@@ -2,10 +2,10 @@ package io.wdd.rpc.message.sender;
|
|||||||
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
import io.wdd.common.beans.rabbitmq.OctopusMessage;
|
|
||||||
import io.wdd.common.beans.rabbitmq.OctopusMessageType;
|
|
||||||
import io.wdd.common.handler.MyRuntimeException;
|
import io.wdd.common.handler.MyRuntimeException;
|
||||||
import io.wdd.rpc.init.InitRabbitMQConfig;
|
import io.wdd.rpc.init.InitRabbitMQConfig;
|
||||||
|
import io.wdd.rpc.message.OctopusMessage;
|
||||||
|
import io.wdd.rpc.message.OctopusMessageType;
|
||||||
import lombok.SneakyThrows;
|
import lombok.SneakyThrows;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.amqp.rabbit.core.RabbitTemplate;
|
import org.springframework.amqp.rabbit.core.RabbitTemplate;
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import io.wdd.server.utils.SpringUtils;
|
|||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.quartz.JobExecutionContext;
|
import org.quartz.JobExecutionContext;
|
||||||
import org.quartz.JobExecutionException;
|
import org.quartz.JobExecutionException;
|
||||||
import org.springframework.scheduling.annotation.Async;
|
|
||||||
import org.springframework.scheduling.quartz.QuartzJobBean;
|
import org.springframework.scheduling.quartz.QuartzJobBean;
|
||||||
import org.springframework.util.ReflectionUtils;
|
import org.springframework.util.ReflectionUtils;
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package io.wdd.rpc.scheduler.config;
|
package io.wdd.rpc.scheduler.config;
|
||||||
|
|
||||||
import io.wdd.common.beans.executor.ExecutionMessage;
|
|
||||||
import io.wdd.common.utils.TimeUtils;
|
import io.wdd.common.utils.TimeUtils;
|
||||||
|
import io.wdd.rpc.execute.ExecutionMessage;
|
||||||
import io.wdd.rpc.scheduler.beans.ScriptSchedulerDTO;
|
import io.wdd.rpc.scheduler.beans.ScriptSchedulerDTO;
|
||||||
import org.quartz.Scheduler;
|
import org.quartz.Scheduler;
|
||||||
import org.quartz.SchedulerException;
|
import org.quartz.SchedulerException;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package io.wdd.rpc.scheduler.service.status;
|
package io.wdd.rpc.scheduler.service.status;
|
||||||
|
|
||||||
|
|
||||||
import io.wdd.common.beans.status.OctopusStatusMessage;
|
import io.wdd.rpc.status.OctopusStatusMessage;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.util.CollectionUtils;
|
import org.springframework.util.CollectionUtils;
|
||||||
@@ -10,8 +10,8 @@ import javax.annotation.Resource;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import static io.wdd.common.beans.status.OctopusStatusMessage.METRIC_STATUS_MESSAGE_TYPE;
|
|
||||||
import static io.wdd.rpc.init.ServerCacheAgentStatus.ALL_HEALTHY_AGENT_TOPIC_NAME_LIST;
|
import static io.wdd.rpc.init.ServerCacheAgentStatus.ALL_HEALTHY_AGENT_TOPIC_NAME_LIST;
|
||||||
|
import static io.wdd.rpc.status.OctopusStatusMessage.METRIC_STATUS_MESSAGE_TYPE;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 收集OctopusAgent的运行Metric信息
|
* 收集OctopusAgent的运行Metric信息
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import com.fasterxml.jackson.core.JsonProcessingException;
|
|||||||
import com.fasterxml.jackson.core.type.TypeReference;
|
import com.fasterxml.jackson.core.type.TypeReference;
|
||||||
import com.fasterxml.jackson.databind.DeserializationFeature;
|
import com.fasterxml.jackson.databind.DeserializationFeature;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
import io.wdd.common.beans.status.AgentStatus;
|
import io.wdd.rpc.status.AgentStatus;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|||||||
@@ -2,11 +2,11 @@ package io.wdd.rpc.scheduler.service.status;
|
|||||||
|
|
||||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
import io.wdd.common.beans.rabbitmq.OctopusMessage;
|
|
||||||
import io.wdd.common.beans.rabbitmq.OctopusMessageType;
|
|
||||||
import io.wdd.common.beans.status.OctopusStatusMessage;
|
|
||||||
import io.wdd.common.utils.TimeUtils;
|
import io.wdd.common.utils.TimeUtils;
|
||||||
|
import io.wdd.rpc.message.OctopusMessage;
|
||||||
|
import io.wdd.rpc.message.OctopusMessageType;
|
||||||
import io.wdd.rpc.message.sender.OMessageToAgentSender;
|
import io.wdd.rpc.message.sender.OMessageToAgentSender;
|
||||||
|
import io.wdd.rpc.status.OctopusStatusMessage;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
package io.wdd.rpc.scheduler.service.status;
|
package io.wdd.rpc.scheduler.service.status;
|
||||||
|
|
||||||
import io.wdd.common.beans.status.OctopusStatusMessage;
|
|
||||||
import io.wdd.common.utils.TimeUtils;
|
import io.wdd.common.utils.TimeUtils;
|
||||||
import io.wdd.rpc.init.ServerCacheAgentStatus;
|
import io.wdd.rpc.init.ServerCacheAgentStatus;
|
||||||
import io.wdd.rpc.scheduler.service.BuildStatusScheduleTask;
|
import io.wdd.rpc.scheduler.service.BuildStatusScheduleTask;
|
||||||
|
import io.wdd.rpc.status.OctopusStatusMessage;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.collections.CollectionUtils;
|
import org.apache.commons.collections.CollectionUtils;
|
||||||
import org.springframework.context.annotation.Lazy;
|
import org.springframework.context.annotation.Lazy;
|
||||||
@@ -16,9 +16,9 @@ import java.util.List;
|
|||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import static io.wdd.common.beans.status.OctopusStatusMessage.ALL_AGENT_STATUS_REDIS_KEY;
|
|
||||||
import static io.wdd.common.beans.status.OctopusStatusMessage.HEALTHY_STATUS_MESSAGE_TYPE;
|
|
||||||
import static io.wdd.rpc.init.ServerCacheAgentStatus.ALL_AGENT_TOPIC_NAME_LIST;
|
import static io.wdd.rpc.init.ServerCacheAgentStatus.ALL_AGENT_TOPIC_NAME_LIST;
|
||||||
|
import static io.wdd.rpc.status.OctopusStatusMessage.ALL_AGENT_STATUS_REDIS_KEY;
|
||||||
|
import static io.wdd.rpc.status.OctopusStatusMessage.HEALTHY_STATUS_MESSAGE_TYPE;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新频率被类 BuildStatusScheduleTask.class控制
|
* 更新频率被类 BuildStatusScheduleTask.class控制
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package io.wdd.common.beans.status;
|
package io.wdd.rpc.status;
|
||||||
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* AgentHealthy状态描述实体类
|
* AgentHealthy状态描述实体类
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package io.wdd.common.beans.status;
|
package io.wdd.rpc.status;
|
||||||
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package io.wdd.common.beans.status;
|
package io.wdd.rpc.status;
|
||||||
|
|
||||||
import io.wdd.common.utils.TimeUtils;
|
import io.wdd.common.utils.TimeUtils;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package io.wdd.common.beans.status;
|
package io.wdd.rpc.status;
|
||||||
|
|
||||||
public enum AppStatusEnum {
|
public enum AppStatusEnum {
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package io.wdd.common.beans.status;
|
package io.wdd.rpc.status;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package io.wdd.common.beans.status;
|
package io.wdd.rpc.status;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@@ -1,8 +1,7 @@
|
|||||||
package io.wdd.common.beans.status;
|
package io.wdd.rpc.status;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.Getter;
|
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
import oshi.hardware.CentralProcessor;
|
import oshi.hardware.CentralProcessor;
|
||||||
import oshi.util.Util;
|
import oshi.util.Util;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package io.wdd.common.beans.status;
|
package io.wdd.rpc.status;
|
||||||
|
|
||||||
import io.wdd.common.utils.FormatUtils;
|
import io.wdd.common.utils.FormatUtils;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package io.wdd.common.beans.status;
|
package io.wdd.rpc.status;
|
||||||
|
|
||||||
import io.wdd.common.utils.FormatUtils;
|
import io.wdd.common.utils.FormatUtils;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package io.wdd.common.beans.status;
|
package io.wdd.rpc.status;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package io.wdd.common.beans.status;
|
package io.wdd.rpc.status;
|
||||||
|
|
||||||
|
|
||||||
import io.wdd.common.utils.FormatUtils;
|
import io.wdd.common.utils.FormatUtils;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package io.wdd.common.beans.status;
|
package io.wdd.rpc.status;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
package io.wdd.server.controller;
|
package io.wdd.server.controller;
|
||||||
|
|
||||||
|
|
||||||
|
import io.wdd.common.response.R;
|
||||||
import io.wdd.server.beans.vo.AppInfoVO;
|
import io.wdd.server.beans.vo.AppInfoVO;
|
||||||
import io.wdd.server.coreService.CoreAppService;
|
import io.wdd.server.coreService.CoreAppService;
|
||||||
import io.wdd.common.beans.response.R;
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
package io.wdd.server.controller;
|
package io.wdd.server.controller;
|
||||||
|
|
||||||
|
import io.wdd.common.response.R;
|
||||||
import io.wdd.server.beans.po.DomainInfoPO;
|
import io.wdd.server.beans.po.DomainInfoPO;
|
||||||
import io.wdd.server.beans.vo.DomainInfoVO;
|
import io.wdd.server.beans.vo.DomainInfoVO;
|
||||||
import io.wdd.server.coreService.CoreDomainService;
|
import io.wdd.server.coreService.CoreDomainService;
|
||||||
import io.wdd.common.beans.response.R;
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ package io.wdd.server.controller;
|
|||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import io.swagger.annotations.ApiParam;
|
import io.swagger.annotations.ApiParam;
|
||||||
import io.wdd.common.beans.response.R;
|
import io.wdd.common.response.R;
|
||||||
import io.wdd.server.beans.po.DomainInfoPO;
|
import io.wdd.server.beans.po.DomainInfoPO;
|
||||||
import io.wdd.server.beans.po.ServerInfoPO;
|
import io.wdd.server.beans.po.ServerInfoPO;
|
||||||
import io.wdd.server.beans.vo.AppInfoVO;
|
import io.wdd.server.beans.vo.AppInfoVO;
|
||||||
|
|||||||
161
server/src/main/resources/application.yml
Normal file
161
server/src/main/resources/application.yml
Normal file
@@ -0,0 +1,161 @@
|
|||||||
|
server:
|
||||||
|
port: 9999
|
||||||
|
|
||||||
|
spring:
|
||||||
|
main:
|
||||||
|
allow-circular-references: true
|
||||||
|
allow-bean-definition-overriding: true
|
||||||
|
rabbitmq:
|
||||||
|
host: 150.230.198.103
|
||||||
|
port: 20672
|
||||||
|
username: boge
|
||||||
|
password: boge14@Level5
|
||||||
|
virtual-host: /
|
||||||
|
listener:
|
||||||
|
simple:
|
||||||
|
retry:
|
||||||
|
# ack failed will reentrant the Rabbit Listener
|
||||||
|
max-attempts: 2
|
||||||
|
enabled: true
|
||||||
|
# retry interval unit ms
|
||||||
|
max-interval: 65000
|
||||||
|
initial-interval: 65000
|
||||||
|
redis:
|
||||||
|
host: 146.56.147.12
|
||||||
|
port: 21370
|
||||||
|
database: 0
|
||||||
|
password: boge14@Level5
|
||||||
|
# cluster:
|
||||||
|
# nodes:
|
||||||
|
# - 43.154.83.213:21370
|
||||||
|
# - 43.154.83.213:21371
|
||||||
|
# - 43.154.83.213:21372
|
||||||
|
# - 43.154.83.213:21373
|
||||||
|
# - 43.154.83.213:21374
|
||||||
|
# - 43.154.83.213:21375
|
||||||
|
# # 获取失败 最大重定向次数
|
||||||
|
# max-redirects: 3
|
||||||
|
# timeout: 50000
|
||||||
|
#如果用以前的jedis,可以把下面的lettuce换成jedis即可
|
||||||
|
lettuce:
|
||||||
|
pool:
|
||||||
|
# 连接池最大连接数默认值为8
|
||||||
|
max-active: 16
|
||||||
|
# 连接池最大阻塞时间(使用负值表示没有限制)默认值为-1
|
||||||
|
max-wait: -1
|
||||||
|
# 连接池中最大空闲连接数默认值为8
|
||||||
|
max-idle: 10
|
||||||
|
# 连接池中的最小空闲连接数,默认值为0
|
||||||
|
min-idle: 10
|
||||||
|
time-between-eviction-runs: 50000
|
||||||
|
datasource:
|
||||||
|
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||||
|
url: jdbc:mysql://140.238.63.37:21306/wdd_server?autoReconnect=true&useSSL=false&useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2B8
|
||||||
|
username: root
|
||||||
|
password: boge14@Level5
|
||||||
|
type: com.zaxxer.hikari.HikariDataSource
|
||||||
|
hikari:
|
||||||
|
minimum-idle: 3
|
||||||
|
# 空闲连接存活最大时间,默认600000(10分钟)
|
||||||
|
idle-timeout: 180000
|
||||||
|
# 连接池最大连接数,默认是10
|
||||||
|
maximum-pool-size: 5
|
||||||
|
# 此属性控制从池返回的连接的默认自动提交行为,默认值:true
|
||||||
|
auto-commit: true
|
||||||
|
connection-test-query: SELECT 1
|
||||||
|
# 最大文件上传
|
||||||
|
servlet:
|
||||||
|
multipart:
|
||||||
|
max-file-size: 500MB
|
||||||
|
max-request-size: 500MB
|
||||||
|
|
||||||
|
mybatis-plus:
|
||||||
|
type-aliases-package: io.wdd.server.beans.po
|
||||||
|
global-config:
|
||||||
|
db-column-underline: true
|
||||||
|
db-config:
|
||||||
|
# modify ethe id strategy
|
||||||
|
id-type: assign_id
|
||||||
|
# logic delete field globally
|
||||||
|
logicDeleteField: isDelete
|
||||||
|
logic-not-delete-value: 0
|
||||||
|
logic-delete-value: 1
|
||||||
|
banner: false
|
||||||
|
configuration:
|
||||||
|
# 希望知道所有的sql是怎么执行的, 配置输出日志
|
||||||
|
#log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
|
||||||
|
log-impl: org.apache.ibatis.logging.nologging.NoLoggingImpl
|
||||||
|
# 数据库下划线--实体类也是下划线 需要为false
|
||||||
|
map-underscore-to-camel-case: true
|
||||||
|
# 一级缓存的 缓存级别默认为 session,如果要关闭一级缓存可以设置为 statement
|
||||||
|
local-cache-scope: session
|
||||||
|
# 是否开启二级缓存
|
||||||
|
cache-enabled: false
|
||||||
|
# 默认地址为 classpath*:/mapper/**/*.xml
|
||||||
|
# mapper-locations: classpath*:/real-mappers/**/*.xml
|
||||||
|
|
||||||
|
octopus:
|
||||||
|
message:
|
||||||
|
# agent boot up default common exchange
|
||||||
|
init_exchange: InitExchange
|
||||||
|
# server will send message to agent using this common queue
|
||||||
|
init_to_server: InitToServer
|
||||||
|
# agent boot up default common exchange routing key
|
||||||
|
init_to_server_key: InitToServerKey
|
||||||
|
# server will receive message from agent using this common queue
|
||||||
|
init_from_server: InitFromServer
|
||||||
|
# agent boot up default common exchange routing key
|
||||||
|
init_from_server_key: InitFromServerKey
|
||||||
|
# initialization register time out (unit ms) default is 5 min
|
||||||
|
init_ttl: "3000000"
|
||||||
|
# Octopus Exchange Name == server comunicate with agent
|
||||||
|
octopus_exchange: OctopusExchange
|
||||||
|
# Octopus Message To Server == all agent send info to server queue and topic
|
||||||
|
octopus_to_server: OctopusToServer
|
||||||
|
executor:
|
||||||
|
name: executor-functions
|
||||||
|
status:
|
||||||
|
name: octopus-agent
|
||||||
|
healthy:
|
||||||
|
type: cron
|
||||||
|
cron: 10 */1 * * * ? *
|
||||||
|
start-delay: 30
|
||||||
|
metric:
|
||||||
|
pinch: 20
|
||||||
|
|
||||||
|
oss:
|
||||||
|
# 这里只是因为需要一个层级,不一定下面的都是oracle
|
||||||
|
oracle:
|
||||||
|
seoul1:
|
||||||
|
namespace: cnk8d6fazu16
|
||||||
|
region: ap-seoul-1
|
||||||
|
key: aed62d24d85e2da809ce02bf272420ba4ed74820
|
||||||
|
secret: rQdEcn69K049+JkA1IGoQmC1k8zma8zfWvZvVS0h144=
|
||||||
|
capacity: 10737418240
|
||||||
|
seoul2:
|
||||||
|
namespace: cncvl8ro2rbf
|
||||||
|
region: ap-seoul-1
|
||||||
|
key: 9e413c6e66269bc65d7ec951d93ba9c6a9781f6e
|
||||||
|
secret: dkXD7PysjrhsTKfNIbKupUmtxdfOvYCyLXf0MXa4hnU=
|
||||||
|
capacity: 10737418240
|
||||||
|
tokyo1:
|
||||||
|
namespace: nrjcs6lwr9vy
|
||||||
|
region: ap-tokyo-1
|
||||||
|
key: 0584c323d6c8d24cc2fc8c2d716a4ea35bb99ae6
|
||||||
|
secret: +xicO9obeqzC5a/WY1rXvl5pMWSWbVIpMt3Qv691NtU=
|
||||||
|
capacity: 10737418240
|
||||||
|
phoenix1:
|
||||||
|
namespace: axqr6x6t48wm
|
||||||
|
region: us-phoenix-1
|
||||||
|
key: e87a121f1548b244c7bd649a1f0ca35195d46cf2
|
||||||
|
secret: uT+NIgJiKPjSaPT8EVUw3xbLSCv/CFMFuebVauznafk=
|
||||||
|
capacity: 10737418240
|
||||||
|
london1:
|
||||||
|
namespace: lrmzslyt8jzs
|
||||||
|
region: uk-london-1
|
||||||
|
key: 57671886f9f1bcc5ac7235b5a0e6123f5ca271b3
|
||||||
|
secret: ukWae6TXjID2Wqxh+7mAPAf4busZPGzwAh/WDKZ5MOQ=
|
||||||
|
capacity: 10737418240
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user