Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 17 additions & 16 deletions src/backend/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import com.dorongold.gradle.tasktree.TaskTreePlugin
buildscript {
ext {
set('springDependencyManagePluginVersion', "1.1.7")
set("springBootVersion", "3.4.4")
set("springBootVersion", "3.5.14")
set("gradleJooqVersion", "3.0.0")
}

Expand Down Expand Up @@ -59,7 +59,6 @@ buildscript {
dependencies {
classpath "io.spring.gradle:dependency-management-plugin:$springDependencyManagePluginVersion"
classpath "nu.studer:gradle-jooq-plugin:$gradleJooqVersion"
classpath 'org.junit.platform:junit-platform-gradle-plugin:1.1.0'
classpath "gradle.plugin.com.dorongold.plugins:task-tree:1.5"
classpath "com.vanniktech:gradle-dependency-graph-generator-plugin:0.8.0"
}
Expand All @@ -68,7 +67,7 @@ buildscript {
plugins {
id "java-library"
id "io.spring.dependency-management" version '1.1.7' apply false
id 'org.springframework.boot' version '3.4.4' apply false
id 'org.springframework.boot' version '3.5.14' apply false
id "idea"
id 'nu.studer.jooq' version '9.0'
}
Expand All @@ -87,25 +86,25 @@ ext {
println("assembly mode: $assemblyMode")

// https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-dependencies
set("springBootVersion", "3.4.4")
set("springBootVersion", "3.5.14")
// https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-dependencies
set('springCloudVersion', "2024.0.1")
set('springCloudVersion', "2025.0.2")
// SpringFox 已移除,使用 SpringDoc OpenAPI (springdoc-openapi-starter-webmvc-ui)
set('springDocVersion', "2.8.4")
set('junitVersion', "5.5.2")
set('springDocVersion', "2.8.17")
set('junitVersion', "5.12.2")
// https://mvnrepository.com/artifact/org.projectlombok/lombok
set('lombokVersion', "1.18.36")
// https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-core
set('jacksonVersion', "2.15.4")
set('jaxrsVersion', "3.1.0")
// https://mvnrepository.com/artifact/ch.qos.logback/logback-core
set('logbackVersion', "1.5.16")
set('logbackVersion', "1.5.34")
// https://mvnrepository.com/artifact/org.slf4j/slf4j-api
set('slf4jVersion', "2.0.16")
// servletVersion 已移除,统一使用 jakarta.servlet (jakartaServletVersion)
// apache commons
// https://mvnrepository.com/artifact/org.apache.commons/commons-lang3
set('apacheCommonsLang3Version', "3.12.0")
set('apacheCommonsLang3Version', "3.20.0")
// https://mvnrepository.com/artifact/org.apache.commons/commons-collections4
set('apacheCommonsCollectionVersion', "4.4")
// https://mvnrepository.com/artifact/org.apache.commons/commons-pool2
Expand Down Expand Up @@ -142,11 +141,11 @@ ext {
set('commonsValidatorVersion', "1.6")
set('okHttpVersion', "4.12.0")
set('jcommanderVersion', "1.72")
set('kubernetesJavaClientVersion', "19.0.0")
set('springCloudKubernetesVersion', "3.2.1")
set('kubernetesJavaClientVersion', "19.0.3")
set('springCloudKubernetesVersion', "3.3.2")
set('cryptoJavaSDKVersion', "1.1.3")
// Fix CVE-2019-10086,CVE-2014-0114
set('commonsBeanutilsVersion', "1.9.4")
// Fix CVE-2025-48734
set('commonsBeanutilsVersion', "1.11.0")
if (System.getProperty("bkjobVersion")) {
set('bkjobVersion', System.getProperty("bkjobVersion"))
println "bkjobVersion:" + bkjobVersion
Expand All @@ -173,7 +172,7 @@ ext {
// 使用Spring Boot内置的版本号变量,不采用驼峰命名,保持与官方BOM文件一致
// mysql.version 和 tomcat.version 由 Spring Boot BOM 管理
// snakeyaml 版本由 Spring Boot BOM 管理
set('mysqlConnectorVersion', "8.0.33")
// mysqlConnectorVersion 版本由 Spring Boot BOM 管理
}

group "com.tencent.bk.job"
Expand Down Expand Up @@ -377,9 +376,8 @@ subprojects {
dependency "com.tencent.devops.leaf:leaf-boot-starter:$bkDevOpsLeafVersion"
dependency "org.apache.zookeeper:zookeeper:$zookeeperVersion"
dependency "com.squareup.okio:okio:$okioVersion"
// reactor-netty, netty, spring-web, amqp-client 版本由 Spring Boot BOM 管理
// reactor-netty, netty, spring-web, amqp-client, mysql-connector-j 版本由 Spring Boot BOM 管理
dependency "org.eclipse.jgit:org.eclipse.jgit:$jgitVersion"
dependency "com.mysql:mysql-connector-j:$mysqlConnectorVersion"
}
}
dependencies {
Expand All @@ -388,11 +386,14 @@ subprojects {
because 'version 1.4 pulled from spring-cloud-starter-openfeign has vulnerabilities(CVE-2023-24998)'
}
}
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
}

configurations {
all*.exclude group: 'junit', module: 'junit'
all*.exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
// 排除commons-logging,会与Spring Boot spring-jcl冲突
all*.exclude group: 'commons-logging', module: 'commons-logging'
// spring-cloud-sleuth-brave 排除已移除(Sleuth 已弃用,使用 Micrometer Tracing)
all*.exclude group: 'org.springframework.data', module: 'spring-data-redis'
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
import org.springframework.cloud.client.discovery.simple.SimpleDiscoveryClientAutoConfiguration;
import org.springframework.cloud.kubernetes.client.KubernetesClientAutoConfiguration;
import org.springframework.cloud.kubernetes.client.discovery.KubernetesInformerDiscoveryClient;
import org.springframework.cloud.kubernetes.commons.KubernetesNamespaceProvider;
import org.springframework.cloud.kubernetes.commons.discovery.KubernetesDiscoveryProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
Expand All @@ -60,7 +59,6 @@ public class JobK8sDiscoveryClientAutoConfiguration {

@Bean
public KubernetesInformerDiscoveryClient kubernetesInformerDiscoveryClient(
KubernetesNamespaceProvider kubernetesNamespaceProvider,
SharedInformerFactory sharedInformerFactory,
@Qualifier("servicesLister") Lister<V1Service> serviceLister,
@Qualifier("endpointsLister") Lister<V1Endpoints> endpointsLister,
Expand All @@ -69,7 +67,6 @@ public KubernetesInformerDiscoveryClient kubernetesInformerDiscoveryClient(
KubernetesDiscoveryProperties properties
) {
return new JobKubernetesInformerDiscoveryClient(
kubernetesNamespaceProvider.getNamespace(),
sharedInformerFactory,
serviceLister,
endpointsLister,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,13 @@
*/
@Slf4j
public class JobKubernetesInformerDiscoveryClient extends KubernetesInformerDiscoveryClient {
public JobKubernetesInformerDiscoveryClient(String namespace,
SharedInformerFactory sharedInformerFactory,
public JobKubernetesInformerDiscoveryClient(SharedInformerFactory sharedInformerFactory,
Lister<V1Service> serviceLister,
Lister<V1Endpoints> endpointsLister,
SharedInformer<V1Service> serviceInformer,
SharedInformer<V1Endpoints> endpointsInformer,
KubernetesDiscoveryProperties properties) {
super(namespace, sharedInformerFactory, serviceLister,
endpointsLister, serviceInformer, endpointsInformer, properties);
super(sharedInformerFactory, serviceLister, endpointsLister, serviceInformer, endpointsInformer, properties);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
Default job logback configuration provided for import
-->
<included>
<conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter" />
<conversionRule conversionWord="wex" converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter" />
<conversionRule conversionWord="wEx" converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter" />
<conversionRule conversionWord="clr" class="org.springframework.boot.logging.logback.ColorConverter" />
<conversionRule conversionWord="wex" class="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter" />
<conversionRule conversionWord="wEx" class="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter" />

<property name="CONSOLE_LOG_PATTERN" value="${CONSOLE_LOG_PATTERN:-%clr([%d{${LOG_DATEFORMAT_PATTERN:-yyyy-MM-dd HH:mm:ss.SSS}}]){faint} %clr(%5p [${APP_NAME:-anon-service},%X{traceId:-},%X{spanId:-}]) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/>
<property name="FILE_LOG_PATTERN" value="${FILE_LOG_PATTERN:-[%d{${LOG_DATEFORMAT_PATTERN:-yyyy-MM-dd HH:mm:ss.SSS}}] %5p [${APP_NAME:-anon-service},%X{traceId:-},%X{spanId:-}] ${PID:- } --- [%t] %-40.40logger{39} : %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ jooq {

println("mysqlURL=" + mysqlURL)
println("mysqlUser=" + mysqlUser)
url = "jdbc:mysql://${mysqlURL}/${databaseName}?useSSL=false&serverTimezone=UTC"
url = "jdbc:mysql://${mysqlURL}/${databaseName}?useSSL=false&serverTimezone=UTC" +
"&allowPublicKeyRetrieval=true"
user = mysqlUser
password = mysqlPasswd
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,12 @@
import org.springframework.cloud.loadbalancer.config.BlockingLoadBalancerClientAutoConfiguration;
import org.springframework.cloud.loadbalancer.support.LoadBalancerClientFactory;
import org.springframework.cloud.openfeign.loadbalancer.FeignLoadBalancerAutoConfiguration;
import org.springframework.cloud.openfeign.loadbalancer.LoadBalancerFeignRequestTransformer;
import org.springframework.cloud.openfeign.loadbalancer.RetryableFeignBlockingLoadBalancerClient;
import org.springframework.context.annotation.Bean;

import java.util.List;

/**
* FeignBlockingLoadBalancerClient相关的自定义Bean配置
*/
Expand All @@ -57,13 +60,15 @@ public class JobFeignLoadBalancerAutoConfiguration {
matchIfMissing = true)
public Client feignRetryClient(LoadBalancerClient loadBalancerClient,
LoadBalancedRetryFactory loadBalancedRetryFactory,
LoadBalancerClientFactory loadBalancerClientFactory) {
LoadBalancerClientFactory loadBalancerClientFactory,
List<LoadBalancerFeignRequestTransformer> transformers) {
log.info("feignRetryClient init");
return new RetryableFeignBlockingLoadBalancerClient(
new WatchableFeignClient(null, null),
loadBalancerClient,
loadBalancedRetryFactory,
loadBalancerClientFactory
loadBalancerClientFactory,
transformers
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,35 +20,36 @@ management:
exposure:
include: health,configprops,env,beans,conditions,loggers,metrics,mappings,prometheus,scheduledtasks,refresh,busrefresh,bindings
base-path: /actuator
enabled-by-default: false
access:
default: none
endpoint:
health:
enabled: true
access: unrestricted
show-details: when_authorized
probes:
enabled: true
configprops:
enabled: true
access: unrestricted
env:
enabled: true
access: unrestricted
beans:
enabled: true
access: unrestricted
conditions:
enabled: true
access: unrestricted
loggers:
enabled: true
access: unrestricted
metrics:
enabled: true
access: unrestricted
mappings:
enabled: true
access: unrestricted
prometheus:
enabled: true
access: unrestricted
scheduledtasks:
enabled: true
access: unrestricted
refresh:
enabled: true
access: unrestricted
busrefresh:
enabled: true
access: unrestricted
server:
port: 19807
shutdown: graceful
Expand Down
31 changes: 16 additions & 15 deletions src/backend/job-assemble/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,39 +19,40 @@ management:
exposure:
include: health,configprops,env,beans,conditions,loggers,metrics,mappings,prometheus,scheduledtasks,info,refresh,busrefresh,bindings
base-path: /actuator
enabled-by-default: false
access:
default: none
endpoint:
health:
enabled: true
access: unrestricted
show-details: when_authorized
probes:
enabled: true
configprops:
enabled: true
access: unrestricted
env:
enabled: true
access: unrestricted
beans:
enabled: true
access: unrestricted
conditions:
enabled: true
access: unrestricted
loggers:
enabled: true
access: unrestricted
metrics:
enabled: true
access: unrestricted
mappings:
enabled: true
access: unrestricted
prometheus:
enabled: true
access: unrestricted
scheduledtasks:
enabled: true
access: unrestricted
info:
enabled: true
access: unrestricted
refresh:
enabled: true
access: unrestricted
busrefresh:
enabled: true
access: unrestricted
bindings:
enabled: true
access: unrestricted

server:
port: 19800
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<configuration scan="true" scanPeriod="30 seconds">
<contextName>logback</contextName>

<conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter" />
<conversionRule conversionWord="wex" converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter" />
<conversionRule conversionWord="wEx" converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter" />
<conversionRule conversionWord="clr" class="org.springframework.boot.logging.logback.ColorConverter" />
<conversionRule conversionWord="wex" class="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter" />
<conversionRule conversionWord="wEx" class="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter" />

<property name="APP_NAME" value="${APP_NAME:-job-assemble}"/>
<property name="CONSOLE_LOG_PATTERN" value="${CONSOLE_LOG_PATTERN:-%clr(%d{${LOG_DATEFORMAT_PATTERN:-yyyy-MM-dd HH:mm:ss.SSS}}){faint} %clr(%5p [${APP_NAME:-anon-service},%X{traceId:-},%X{spanId:-}]) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.30t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,37 +20,38 @@ management:
exposure:
include: health,configprops,env,beans,conditions,loggers,metrics,mappings,prometheus,scheduledtasks,info,refresh,busrefresh,bindings
base-path: /actuator
enabled-by-default: false
access:
default: none
endpoint:
health:
enabled: true
access: unrestricted
show-details: when_authorized
probes:
enabled: true
configprops:
enabled: true
access: unrestricted
env:
enabled: true
access: unrestricted
beans:
enabled: true
access: unrestricted
conditions:
enabled: true
access: unrestricted
loggers:
enabled: true
access: unrestricted
metrics:
enabled: true
access: unrestricted
mappings:
enabled: true
access: unrestricted
prometheus:
enabled: true
access: unrestricted
scheduledtasks:
enabled: true
access: unrestricted
info:
enabled: true
access: unrestricted
refresh:
enabled: true
access: unrestricted
busrefresh:
enabled: true
access: unrestricted
server:
port: 19808
shutdown: graceful
Expand Down
Loading
Loading