diff --git a/.github/workflows/ozhera-monitor-package.yml b/.github/workflows/ozhera-monitor-package.yml index 59ea8d1ed..63b40f93b 100644 --- a/.github/workflows/ozhera-monitor-package.yml +++ b/.github/workflows/ozhera-monitor-package.yml @@ -12,16 +12,16 @@ on: # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - check-build-8: + check-build-21: name: ozhera-monitor test runs-on: ubuntu-latest steps: - name: Setup Maven Action uses: s4u/setup-maven-action@v1.7.0 with: - java-version: 8 + java-version: 21 #settings-properties: '[{"propertyName1": "propertyValue1"}, {"propertyName2": "propertyValue2"}]' - run: echo ' false ossrh ossrh-snapshot https://s01.oss.sonatype.org/content/repositories/snapshots ossrh ossrh-snapshot https://s01.oss.sonatype.org/content/repositories/snapshots artifactory artifactory github ${env.GITHUB_ACTOR} ${env.GITHUB_TOKEN} ' > ~/.m2/settings.xml - - run: cd ozhera-monitor; mvn -U clean package --fail-at-end -Dmaven.test.skip=true \ No newline at end of file + - run: cd ozhera-monitor; mvn -U clean package --fail-at-end -Dmaven.test.skip=true diff --git a/ozhera-monitor/dockerfile b/ozhera-monitor/dockerfile index 84a8200e5..903e9e3f7 100644 --- a/ozhera-monitor/dockerfile +++ b/ozhera-monitor/dockerfile @@ -1,5 +1,5 @@ -FROM openjdk:8-jre +FROM openjdk:21-jdk-bookworm -COPY ./hera-monitor-server/target/hera-monitor-server-1.1-SNAPSHOT.jar /home/work/hera-monitor-server-1.1-SNAPSHOT.jar +COPY ./ozhera-monitor-server/target/ozhera-monitor-server-1.2-jdk21-SNAPSHOT.jar /home/work/ozhera-monitor-server-1.2-jdk21-SNAPSHOT.jar -ENTRYPOINT ["java","-XX:+PrintReferenceGC","-XX:+PrintGCDetails","-XX:+PrintGCDateStamps","-XX:+PrintHeapAtGC","-Xloggc:/home/work/log/gc.log","-Duser.timezone=Asia/Shanghai","-XX:+HeapDumpOnOutOfMemoryError","-XX:HeapDumpPath=/home/rocksdb/dum/oom.dump","-jar","/home/work/hera-monitor-server-1.1-SNAPSHOT.jar","&&","tail","-f","/dev/null"] +ENTRYPOINT ["sh","-c","java -XX:+UseZGC --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.math=ALL-UNNAMED --add-opens java.base/sun.reflect=ALL-UNNAMED --add-opens java.base/java.xml=ALL-UNNAMED --add-exports java.base/sun.reflect.annotation=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED --add-exports java.xml/com.sun.org.apache.xerces.internal.impl.dv.util=ALL-UNNAMED -Duser.timezone=Asia/Shanghai -jar /home/work/ozhera-monitor-server-1.2-jdk21-SNAPSHOT.jar"] \ No newline at end of file diff --git a/ozhera-monitor/ozhera-monitor-api/pom.xml b/ozhera-monitor/ozhera-monitor-api/pom.xml index baeab9a55..0515382bb 100644 --- a/ozhera-monitor/ozhera-monitor-api/pom.xml +++ b/ozhera-monitor/ozhera-monitor-api/pom.xml @@ -5,22 +5,16 @@ run.mone ozhera-monitor - 1.2-SNAPSHOT + 1.2-jdk21-SNAPSHOT 4.0.0 ozhera-monitor-api - - 8 - 8 - - org.projectlombok lombok - 1.18.20 diff --git a/ozhera-monitor/ozhera-monitor-common/pom.xml b/ozhera-monitor/ozhera-monitor-common/pom.xml index 575f95fdc..7b68c5b6b 100644 --- a/ozhera-monitor/ozhera-monitor-common/pom.xml +++ b/ozhera-monitor/ozhera-monitor-common/pom.xml @@ -5,17 +5,12 @@ run.mone ozhera-monitor - 1.2-SNAPSHOT + 1.2-jdk21-SNAPSHOT 4.0.0 ozhera-monitor-common - - 8 - 8 - - org.apache.commons @@ -45,7 +40,6 @@ org.projectlombok lombok - 1.18.20 diff --git a/ozhera-monitor/ozhera-monitor-server/pom.xml b/ozhera-monitor/ozhera-monitor-server/pom.xml index 789d41800..66df3d3f1 100644 --- a/ozhera-monitor/ozhera-monitor-server/pom.xml +++ b/ozhera-monitor/ozhera-monitor-server/pom.xml @@ -5,21 +5,22 @@ run.mone ozhera-monitor - 1.2-SNAPSHOT + 1.2-jdk21-SNAPSHOT 4.0.0 ozhera-monitor-server - - 8 - 8 - - run.mone ozhera-monitor-service + + + spring-context-support + org.springframework + + diff --git a/ozhera-monitor/ozhera-monitor-server/src/main/java/com/xiaomi/mone/monitor/aop/HeraRequestMappingAspect.java b/ozhera-monitor/ozhera-monitor-server/src/main/java/com/xiaomi/mone/monitor/aop/HeraRequestMappingAspect.java index 6c5a50d39..a7b36ac2c 100644 --- a/ozhera-monitor/ozhera-monitor-server/src/main/java/com/xiaomi/mone/monitor/aop/HeraRequestMappingAspect.java +++ b/ozhera-monitor/ozhera-monitor-server/src/main/java/com/xiaomi/mone/monitor/aop/HeraRequestMappingAspect.java @@ -43,12 +43,6 @@ public void operationLog(){} @Resource(name = "heraRequestMappingExecutor") private ThreadPoolExecutor heraRequestMappingExecutor; - @Bean("heraRequestMappingExecutor") - public ThreadPoolExecutor heraRequestMappingExecutor() { - return new ThreadPoolExecutor(1, 20, 5, TimeUnit.MINUTES, new LinkedBlockingQueue(20), - (Runnable r) -> new Thread(r, "compute-execute-thread-v2"), new ThreadPoolExecutor.CallerRunsPolicy()); - } - @Around("operationLog()") public Object doAround(ProceedingJoinPoint joinPoint) throws Throwable { try { diff --git a/ozhera-monitor/ozhera-monitor-server/src/main/java/com/xiaomi/mone/monitor/config/BeanConfiguration.java b/ozhera-monitor/ozhera-monitor-server/src/main/java/com/xiaomi/mone/monitor/config/BeanConfiguration.java new file mode 100644 index 000000000..138bf38de --- /dev/null +++ b/ozhera-monitor/ozhera-monitor-server/src/main/java/com/xiaomi/mone/monitor/config/BeanConfiguration.java @@ -0,0 +1,18 @@ +package com.xiaomi.mone.monitor.config; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +import java.util.concurrent.LinkedBlockingQueue; +import java.util.concurrent.ThreadPoolExecutor; +import java.util.concurrent.TimeUnit; + +@Configuration +public class BeanConfiguration { + + @Bean("heraRequestMappingExecutor") + public ThreadPoolExecutor heraRequestMappingExecutor() { + return new ThreadPoolExecutor(1, 20, 5, TimeUnit.MINUTES, new LinkedBlockingQueue(20), + (Runnable r) -> new Thread(r, "compute-execute-thread-v2"), new ThreadPoolExecutor.CallerRunsPolicy()); + } +} diff --git a/ozhera-monitor/ozhera-monitor-server/src/main/resources/application.properties b/ozhera-monitor/ozhera-monitor-server/src/main/resources/application.properties index 169ce12ba..ccf39fc04 100644 --- a/ozhera-monitor/ozhera-monitor-server/src/main/resources/application.properties +++ b/ozhera-monitor/ozhera-monitor-server/src/main/resources/application.properties @@ -29,4 +29,5 @@ log.path=@log.path@ dev.mode=@dev.mode@ inner.auth=@inner.auth@ -service.selector.property=@service.selector.property@ \ No newline at end of file +service.selector.property=@service.selector.property@ +spring.main.allow-circular-references=true \ No newline at end of file diff --git a/ozhera-monitor/ozhera-monitor-service/pom.xml b/ozhera-monitor/ozhera-monitor-service/pom.xml index 78a73ab2d..f6356b597 100644 --- a/ozhera-monitor/ozhera-monitor-service/pom.xml +++ b/ozhera-monitor/ozhera-monitor-service/pom.xml @@ -5,17 +5,12 @@ run.mone ozhera-monitor - 1.2-SNAPSHOT + 1.2-jdk21-SNAPSHOT 4.0.0 ozhera-monitor-service - - 8 - 8 - - @@ -33,7 +28,7 @@ run.mone app-api - 1.4-SNAPSHOT + 1.4-jdk21-SNAPSHOT @@ -60,9 +55,9 @@ - run.mone + com.alibaba.spring spring-context-support - 1.0.10-mone-SNAPSHOT + 1.0.10 @@ -189,7 +184,7 @@ org.springframework spring-jdbc - 5.0.6.RELEASE + 5.3.29 @@ -261,12 +256,6 @@ 3.14.2 - - com.squareup.okio - okio - 1.17.2 - - run.mone http diff --git a/ozhera-monitor/ozhera-monitor-service/src/main/java/com/xiaomi/mone/monitor/service/es/EsService.java b/ozhera-monitor/ozhera-monitor-service/src/main/java/com/xiaomi/mone/monitor/service/es/EsService.java index d36a15832..115fe81a4 100644 --- a/ozhera-monitor/ozhera-monitor-service/src/main/java/com/xiaomi/mone/monitor/service/es/EsService.java +++ b/ozhera-monitor/ozhera-monitor-service/src/main/java/com/xiaomi/mone/monitor/service/es/EsService.java @@ -16,7 +16,7 @@ import org.elasticsearch.action.search.SearchRequest; import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.client.core.CountRequest; -import org.elasticsearch.common.unit.TimeValue; +import org.elasticsearch.core.TimeValue; import org.elasticsearch.index.query.*; import org.elasticsearch.search.SearchHit; import org.elasticsearch.search.builder.SearchSourceBuilder; diff --git a/ozhera-monitor/pom.xml b/ozhera-monitor/pom.xml index 3a05030ae..3db90486b 100644 --- a/ozhera-monitor/pom.xml +++ b/ozhera-monitor/pom.xml @@ -7,13 +7,13 @@ org.springframework.boot spring-boot-starter-parent - 2.5.2 + 2.7.15 run.mone ozhera-monitor pom - 1.2-SNAPSHOT + 1.2-jdk21-SNAPSHOT ozhera-monitor-server ozhera-monitor-service @@ -22,11 +22,10 @@ - 8 - 8 UTF-8 - 5.1.3.RELEASE - 1.2-SNAPSHOT + 5.3.29 + 1.18.30 + 1.2-jdk21-SNAPSHOT /opt/workspace_all/workspace_mi/mone_opensource/ozhera/ozhera-monitor @@ -86,10 +85,20 @@ ${ozhera-monitor.release.version} + + org.projectlombok + lombok + ${lombok.version} + - + + org.apache.rocketmq + rocketmq-client + 4.9.3 + + @@ -97,17 +106,11 @@ org.apache.maven.plugins maven-compiler-plugin + 3.11.0 - 1.8 - 1.8 - true - true - UTF-8 - - - ${project.basedir}/src/main/java - - + 21 + 21 + 21