[ Cmii ] [ Octopus ] - add Image Function Scheduler - 2

This commit is contained in:
zeaslity
2024-03-28 15:13:11 +08:00
parent 08c526c4a4
commit aa4412f042
8 changed files with 121 additions and 17 deletions

View File

@@ -22,6 +22,9 @@ public class ImageSyncContext {
// function args
ArrayList<String> imageSyncFuncArgs;
// download only
Boolean downloadAndCompressOnly;
// target
ProjectInfoPO projectInfoPO;
ServerInfoPO projectMasterNode;

View File

@@ -121,12 +121,15 @@ public class FuncServiceImpl implements FuncService {
// add in
funcArgs.add(0, imageFunctionEnum.getFuncName());
return syncCallFunction(
List<String> resultLog = syncCallFunction(
agentTopicName,
ExecutionMessageType.IMAGE,
funcArgs,
true
);
funcArgs.remove(0);
return resultLog;
}

View File

@@ -81,10 +81,12 @@ public class ImageFuncScheduler {
}
if (CollectionUtils.isNotEmpty(cmiiAppNameTagList)) {
if (CollectionUtils.isNotEmpty(imageFullNameList)) {
if (CollectionUtils.isEmpty(realFullNameList)) {
//
realFullNameList = imageFullNameList;
} else {
// cmii app tag name not null && imageFullNameList not nuill
realFullNameList.addAll(imageFullNameList);
}
}
@@ -122,6 +124,12 @@ public class ImageFuncScheduler {
return;
}
log.info("Image Sync Half Complete ! Gzip file name => {}", gzipFileName);
if (imageSyncContext.getDownloadAndCompressOnly()) {
log.info("Image Sync download only !");
return;
}
// outside agent
resultLog = funcService.callImageFuncService(outsideAgentTopicName, DOWNLOAD_GZIP_IMAGE_FILE, imageSyncFuncArgs);
if (!JudgeSyncBaseCommandResult(resultLog)) {

View File

@@ -31,8 +31,12 @@ public class CoreProjectServiceImpl implements CoreProjectService {
@Override
public Page<ProjectInfoPO> projectQueryByEntity(ProjectQueryEntity projectQueryEntity) {
if (projectQueryEntity == null || projectQueryEntity.getProjectName() == null || projectQueryEntity.getProjectNamespace() == null) {
if (projectQueryEntity == null) {
return null;
} else {
if (projectQueryEntity.getProjectName() == null && projectQueryEntity.getProjectNamespace() == null) {
return null;
}
}
if (projectQueryEntity.getPageNumber() == null || projectQueryEntity.getPageSize() == null) {
@@ -45,6 +49,7 @@ public class CoreProjectServiceImpl implements CoreProjectService {
projectQueryEntity.getPageSize()
);
// like wdd?
new LambdaQueryChainWrapper<ProjectInfoPO>(projectInfoService.getBaseMapper())
.likeRight(
StringUtils.isNotBlank(projectQueryEntity.getProjectName()),

View File

@@ -6,7 +6,7 @@ spring:
allow-circular-references: true
allow-bean-definition-overriding: true
rabbitmq:
host: 192.168.35.71
host: 10.250.0.100
port: 20672
username: boge
password: boge8tingH
@@ -21,7 +21,7 @@ spring:
max-interval: 65000
initial-interval: 65000
redis:
host: 192.168.35.71
host: 10.250.0.100
port: 21370
database: 0
password: boge8tingH
@@ -50,7 +50,7 @@ spring:
time-between-eviction-runs: 50000
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://192.168.35.71:21306/octopus_server?autoReconnect=true&useSSL=false&useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2B8
url: jdbc:mysql://10.250.0.100:21306/octopus_server?autoReconnect=true&useSSL=false&useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2B8
username: boge
password: boge8tingH
type: com.zaxxer.hikari.HikariDataSource

View File

@@ -2,14 +2,14 @@ server:
port: 9999
# shanghai 42.192.52.227
# local 42.192.52.227
# local 10.250.0.100
# cqga 42.192.52.227
spring:
main:
allow-circular-references: true
allow-bean-definition-overriding: true
rabbitmq:
host: 42.192.52.227
host: 10.250.0.100
port: 20672
username: boge
password: boge8tingH
@@ -24,7 +24,7 @@ spring:
max-interval: 65000
initial-interval: 65000
redis:
host: 42.192.52.227
host: 10.250.0.100
port: 21370
database: 0
password: boge8tingH
@@ -47,7 +47,7 @@ spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://42.192.52.227:21306/octopus_server?autoReconnect=true&useSSL=false&useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2B8
url: jdbc:mysql://10.250.0.100:21306/octopus_server?autoReconnect=true&useSSL=false&useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2B8
username: boge
password: boge8tingH
type: com.zaxxer.hikari.HikariDataSource