chaos monkey tests

This commit is contained in:
2021-11-28 18:20:36 +01:00
parent 8bfc231a7e
commit 453cd37217
48 changed files with 2567 additions and 188 deletions

View File

@@ -2,17 +2,30 @@ FROM openjdk:11 AS development
WORKDIR /opt/app
# ENV SPRING_DATASOURCE_URL=jdbc:mysql://backend-db:3306/db
ENV EXECUTOR_POOL_URI=http://executor-pool:8083
ENV ROSTER_URI=http://roster:8082
COPY .mvn/ .mvn
COPY mvnw pom.xml mvnw.cmd ./
COPY executor-computation/.mvn ./.mvn
COPY executor-computation/mvnw executor-computation/pom.xml executor-computation/mvnw.cmd ./
RUN apt-get clean && apt-get update && apt-get install dos2unix
RUN dos2unix mvnw
RUN ./mvnw dependency:go-offline
COPY common/pom.xml /opt/app/common/
COPY common/src /opt/app/common/src
COPY common/*target /opt/app/common/target
COPY src /opt/app/src
COPY *target /opt/app/target
COPY executor-base/pom.xml /opt/app/executor-base/
COPY executor-base/src /opt/app/executor-base/src
COPY executor-base/*target /opt/app/executor-base/target
COPY executor-computation/src /opt/app/src
COPY executor-computation/*target /opt/app/target
RUN ./mvnw -f /opt/app/common/pom.xml clean install
RUN ./mvnw -f /opt/app/executor-base/pom.xml clean install
RUN ./mvnw clean install
CMD ["./mvnw", "spring-boot:run", "-Dspring-boot.run.jvmArguments=\"-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005\"", "-Dspring.devtools.restart.enabled=true"]

View File

@@ -52,6 +52,21 @@
<artifactId>json</artifactId>
<version>20210307</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>de.codecentric</groupId>
<artifactId>chaos-monkey-spring-boot</artifactId>
<version>2.5.4</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-test</artifactId>
</dependency>
</dependencies>
<build>

View File

@@ -1,5 +1,7 @@
package ch.unisg.executorcomputation;
import java.util.concurrent.TimeUnit;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@@ -9,6 +11,14 @@ import ch.unisg.executorcomputation.executor.domain.Executor;
public class ExecutorcomputationApplication {
public static void main(String[] args) {
try {
TimeUnit.SECONDS.sleep(40);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
SpringApplication.run(ExecutorcomputationApplication.class, args);
Executor.getExecutor();
}

View File

@@ -1 +1,14 @@
server.port=8085
spring.profiles.active=chaos-monkey
chaos.monkey.enabled=false
management.endpoint.chaosmonkey.enabled=true
management.endpoint.chaosmonkeyjmx.enabled=true
# include specific endpoints
management.endpoints.web.exposure.include=health,info,chaosmonkey
chaos.monkey.watcher.controller=true
chaos.monkey.watcher.restController=true
chaos.monkey.watcher.service=true
chaos.monkey.watcher.repository=true
chaos.monkey.watcher.component=true