Skip to content

Commit

Permalink
fix bug: release pod delete scene. And update version from 1.0.1 to 1…
Browse files Browse the repository at this point in the history
….0.2

Signed-off-by: caimingxia <mingshao.cmx@alibaba-inc.com>
  • Loading branch information
MandssS committed Jul 29, 2022
1 parent 1fbf831 commit 114f6e9
Show file tree
Hide file tree
Showing 17 changed files with 31 additions and 23 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ WORKDIR /app
# && rm -rf helm-v3.5.3-linux-amd64.tar.gz


COPY ./chaosblade-box-starter/target/chaosblade-box-1.0.1.jar .
COPY ./chaosblade-box-starter/target/chaosblade-box-1.0.2.jar .

ENTRYPOINT ["java", "-Duser.timezone=Asia/Shanghai", "-jar", "chaosblade-box-1.0.1.jar"]
ENTRYPOINT ["java", "-Duser.timezone=Asia/Shanghai", "-jar", "chaosblade-box-1.0.2.jar"]
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.PHONY: build clean

export CHAOS_PLATFORM_VERSION=1.0.1
export CHAOS_PLATFORM_VERSION=1.0.2
SRC_ROOT=$(shell pwd)

# chaosblade-box-fe
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ ansible --version
# install ansible, eg: Fedora || RedHat
yum install ansible -y
```
2. If don't have expect installed, you need install `expect`, put [sshKey.sh](https://github.com/chaosblade-io/chaosblade-box/blob/main/ssh/sshKey.sh) and chaosblade-box-1.0.1.jar in a directory
2. If don't have expect installed, you need install `expect`, put [sshKey.sh](https://github.com/chaosblade-io/chaosblade-box/blob/main/ssh/sshKey.sh) and chaosblade-box-1.0.2.jar in a directory
```bash
# Check if there is already installed
expect -v
Expand Down
2 changes: 1 addition & 1 deletion chaosblade-box-agent-sdk/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>chaosblade-box</artifactId>
<groupId>io.chaosblade</groupId>
<version>1.0.1</version>
<version>1.0.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion chaosblade-box-cache/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>chaosblade-box</artifactId>
<groupId>io.chaosblade</groupId>
<version>1.0.1</version>
<version>1.0.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion chaosblade-box-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>chaosblade-box</artifactId>
<groupId>io.chaosblade</groupId>
<version>1.0.1</version>
<version>1.0.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

String description() default "";

String version() default "1.0.1";
String version() default "1.0.2";

ChaosAppType type() default ChaosAppType.CHAOS_APP;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ public static Map<String, Integer> getScopeToScopeType() {
scopeToScopeType.put("pod", ChaosFunctionConstant.SUPPORT_SCOPE_TYPE_K8S);
scopeToScopeType.put("docker", ChaosFunctionConstant.SUPPORT_SCOPE_TYPE_HOST);
scopeToScopeType.put("host", ChaosFunctionConstant.SUPPORT_SCOPE_TYPE_HOST);

SubTargetToCategory.put("container", "1217716899703644162");
SubTargetToCategory.put("pod", "1217716899703644162");
SubTargetToCategory.put("network", "1216672245176541185");
SubTargetToCategory.put("cpu", "1216606329818566658");
SubTargetToCategory.put("file", "1216606480226308098");
Expand Down
2 changes: 1 addition & 1 deletion chaosblade-box-dao/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>chaosblade-box</artifactId>
<groupId>io.chaosblade</groupId>
<version>1.0.1</version>
<version>1.0.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion chaosblade-box-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>chaosblade-box</artifactId>
<groupId>io.chaosblade</groupId>
<version>1.0.1</version>
<version>1.0.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion chaosblade-box-starter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>chaosblade-box</artifactId>
<groupId>io.chaosblade</groupId>
<version>1.0.1</version>
<version>1.0.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.alibaba.chaosblade.box.scheduler;

import com.alibaba.chaosblade.box.common.experiment.task.flow.util.concurrent.ThreadPoolExecutors;
import com.alibaba.chaosblade.box.common.infrastructure.constant.DeviceStatus;
import com.alibaba.chaosblade.box.dao.model.DeviceDO;
import com.alibaba.chaosblade.box.dao.model.base.PageableQueryWrapper;
import com.alibaba.chaosblade.box.dao.model.base.PageableResponse;
Expand Down Expand Up @@ -40,15 +41,15 @@ public class AgentPingScheduleJob extends BaseJob implements Job, InitializingBe
private SettingService settingService;


private final ThreadPoolExecutor rejectedThreadPool = new ThreadPoolExecutor(
static private final ThreadPoolExecutor rejectedThreadPool = new ThreadPoolExecutor(
3,
3,
10,
TimeUnit.SECONDS,
new LinkedBlockingQueue<>(),
ThreadPoolExecutors.defaultThreadFactory("AgentPingScheduleJob"));

private final ExecutorService countDeviceExecutor = new ThreadPoolExecutor(
static private final ExecutorService countDeviceExecutor = new ThreadPoolExecutor(
3,
5,
0,
Expand All @@ -75,7 +76,7 @@ public void execute(JobExecutionContext context) throws JobExecutionException {
//查询所有禁用的应用,验证应用下是否有机器,若存在机器,则将disabled置为false
List<Future<Boolean>> futureList = new ArrayList<>();
for(int page = 1;;page ++) {
//改分页,一次查1w条
//改分页,一次查10条
CloudDeviceQuery cloudDeviceQuery = new CloudDeviceQuery();
PageableQueryWrapper<CloudDeviceQuery> pageableQueryWrapper = PageableQueryWrapper.of(cloudDeviceQuery);
pageableQueryWrapper.pageNumber(page);
Expand Down Expand Up @@ -108,7 +109,12 @@ public void execute(JobExecutionContext context) throws JobExecutionException {
}

private Boolean pingAgent (DeviceDO deviceDO) {
return settingService.pingAgent(deviceDO);
if (settingService.pingAgent(deviceDO)) {
return true;
}

deviceDO.setStatus(DeviceStatus.OFFLINE.getStatus());
return deviceRepository.update(deviceDO);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ spring.datasource.password=
spring.thymeleaf.prefix=classpath:/build
spring.thymeleaf.mode=HTML5

chaos.agent.version=1.0.0
chaos.agent.version=1.0.2
chaos.agent.repository=chaosbladeio/chaosblade-agent
chaos.agent.url=https://chaosblade.oss-cn-hangzhou.aliyuncs.com/platform/release/1.0.0/chaosagent.tar.gz
chaos.agent.helm=https://chaosblade.oss-cn-hangzhou.aliyuncs.com/platform/release/1.0.0/chaosblade-box-agent-1.0.0.tgz
chaos.agent.url=https://chaosblade.oss-cn-hangzhou.aliyuncs.com/platform/release/${chaos.agent.version}/chaosagent.tar.gz
chaos.agent.helm=https://chaosblade.oss-cn-hangzhou.aliyuncs.com/platform/release/${chaos.agent.version}/chaosblade-box-agent-${chaos.agent.version}.tgz

#agent.blade.version=1.5.0
#agent.operator.version=1.5.0
Expand Down
2 changes: 1 addition & 1 deletion chaosblade-box-toolsmgr/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>chaosblade-box</artifactId>
<groupId>io.chaosblade</groupId>
<version>1.0.1</version>
<version>1.0.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
4 changes: 2 additions & 2 deletions deploy/chaosblade-box/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v1
appVersion: "1.0.1"
appVersion: "1.0.2"
description: chaosblade-box
name: chaosblade-box
version: 1.0.1
version: 1.0.2
home: https://github.com/chaosblade-io
2 changes: 1 addition & 1 deletion deploy/chaosblade-box/values.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Default values for chaosblade-box.
box:
repository: chaosbladeio/chaosblade-box
version: 1.0.1
version: 1.0.2
pullPolicy: IfNotPresent

spring:
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<groupId>io.chaosblade</groupId>
<artifactId>chaosblade-box</artifactId>
<packaging>pom</packaging>
<version>1.0.1</version>
<version>1.0.2</version>
<modules>
<module>chaosblade-box-agent-sdk</module>
<module>chaosblade-box-cache</module>
Expand Down

0 comments on commit 114f6e9

Please sign in to comment.