From f51d3c92a1964a67f62c696c757c07f175757ee2 Mon Sep 17 00:00:00 2001 From: linghengqian Date: Mon, 30 Sep 2024 11:19:55 +0800 Subject: [PATCH] Fixes incorrect environment variable definition in SASL integration doc --- .github/workflows/graalvm.yml | 3 +- .../external-integration/sasl.cn.md | 4 +- .../external-integration/sasl.en.md | 5 +-- .../configuration/graalvm-native-image.cn.md | 37 ++++++++-------- .../configuration/graalvm-native-image.en.md | 42 +++++++++---------- pom.xml | 2 +- test/native/pom.xml | 6 +-- .../elasticjob/test/natived/TestMain.java | 3 ++ .../test/natived/it/operation/JavaTest.java | 10 ++++- 9 files changed, 57 insertions(+), 55 deletions(-) diff --git a/.github/workflows/graalvm.yml b/.github/workflows/graalvm.yml index f57cd810d..3e3a79859 100644 --- a/.github/workflows/graalvm.yml +++ b/.github/workflows/graalvm.yml @@ -44,6 +44,5 @@ jobs: github-token: ${{ secrets.GITHUB_TOKEN }} cache: 'maven' native-image-job-reports: 'true' - - name: Run nativeTest with GraalVM CE for ${{ matrix.java-version }} - continue-on-error: true + - name: Run nativeTest with GraalVM CE for ${{ matrix.java }} run: ./mvnw -PnativeTestInElasticJob -T1C -B -e clean test diff --git a/docs/content/user-manual/configuration/external-integration/sasl.cn.md b/docs/content/user-manual/configuration/external-integration/sasl.cn.md index 74929efe4..5be5529de 100644 --- a/docs/content/user-manual/configuration/external-integration/sasl.cn.md +++ b/docs/content/user-manual/configuration/external-integration/sasl.cn.md @@ -21,7 +21,7 @@ services: - ./jaas-server-test.conf:/jaas-test.conf environment: JVMFLAGS: "-Djava.security.auth.login.config=/jaas-test.conf" - ZOO_CFG_EXTRA: "org.apache.zookeeper.server.auth.SASLAuthenticationProvider sessionRequireClientSASLAuth=true" + ZOO_CFG_EXTRA: "authProvider.1=org.apache.zookeeper.server.auth.SASLAuthenticationProvider sessionRequireClientSASLAuth=true" ports: - "2181:2181" ``` @@ -100,4 +100,4 @@ public class ExampleUtils { 要使 ElasticJob 的 `org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperRegistryCenter` 连接至开启 Kerberos 鉴权的 Zookeeper Server, 流程类似于 DIGEST-MD5。以 https://cwiki.apache.org/confluence/display/ZOOKEEPER/Client-Server+mutual+authentication 为准。 -部分地区可能不被允许使用 MIT Kerberos 的源代码或二进制产物,可参考 MIT Kerberos 的分发站点 https://web.mit.edu/kerberos/dist/index.html 。 +Kerberos KDC 不存在可用的 Docker Image,用户可能需要手动启动 Kerberos KDC。 diff --git a/docs/content/user-manual/configuration/external-integration/sasl.en.md b/docs/content/user-manual/configuration/external-integration/sasl.en.md index f77ad37b4..288d39d14 100644 --- a/docs/content/user-manual/configuration/external-integration/sasl.en.md +++ b/docs/content/user-manual/configuration/external-integration/sasl.en.md @@ -23,7 +23,7 @@ services: - ./jaas-server-test.conf:/jaas-test.conf environment: JVMFLAGS: "-Djava.security.auth.login.config=/jaas-test.conf" - ZOO_CFG_EXTRA: "org.apache.zookeeper.server.auth.SASLAuthenticationProvider sessionRequireClientSASLAuth=true" + ZOO_CFG_EXTRA: "authProvider.1=org.apache.zookeeper.server.auth.SASLAuthenticationProvider sessionRequireClientSASLAuth=true" ports: - "2181:2181" ``` @@ -109,5 +109,4 @@ To connect ElasticJob's `org.apache.shardingsphere.elasticjob.reg.zookeeper.Zook the process is similar to DIGEST-MD5. Refer to https://cwiki.apache.org/confluence/display/ZOOKEEPER/Client-Server+mutual+authentication . -Some regions may not allow the use of MIT Kerberos source code or binary products. -Please refer to the MIT Kerberos distribution site https://web.mit.edu/kerberos/dist/index.html . +There is no available Docker Image for Kerberos KDC. Users may need to start Kerberos KDC manually. diff --git a/docs/content/user-manual/configuration/graalvm-native-image.cn.md b/docs/content/user-manual/configuration/graalvm-native-image.cn.md index 560c0f212..b008090b5 100644 --- a/docs/content/user-manual/configuration/graalvm-native-image.cn.md +++ b/docs/content/user-manual/configuration/graalvm-native-image.cn.md @@ -34,7 +34,6 @@ ElasticJob 不为已停止维护的 GraalVM CE 版本设置 CI。 org.apache.shardingsphere.elasticjob elasticjob-bootstrap ${elasticjob.version} - test @@ -43,7 +42,7 @@ ElasticJob 不为已停止维护的 GraalVM CE 版本设置 CI。 org.graalvm.buildtools native-maven-plugin - 0.10.2 + 0.10.3 true @@ -76,12 +75,12 @@ ElasticJob 不为已停止维护的 GraalVM CE 版本设置 CI。 ```groovy plugins { - id 'org.graalvm.buildtools.native' version '0.10.2' + id 'org.graalvm.buildtools.native' version '0.10.3' } dependencies { implementation 'org.apache.shardingsphere.elasticjob:elasticjob-bootstrap:${elasticjob.version}' - implementation(group: 'org.graalvm.buildtools', name: 'graalvm-reachability-metadata', version: '0.10.2', classifier: 'repository', ext: 'zip') + implementation(group: 'org.graalvm.buildtools', name: 'graalvm-reachability-metadata', version: '0.10.3', classifier: 'repository', ext: 'zip') } graalvmNative { @@ -105,18 +104,16 @@ graalvmNative { org.apache.shardingsphere.elasticjob elasticjob-spring-boot-starter ${elasticjob.version} - test org.springframework.boot - spring-boot-starter-jdbc - 3.3.2 - test + spring-boot-starter-web + 3.3.4 org.springframework.boot - spring-boot-starter-web - 3.3.2 + spring-boot-starter-test + 3.3.4 test @@ -126,7 +123,7 @@ graalvmNative { org.graalvm.buildtools native-maven-plugin - 0.10.2 + 0.10.3 true @@ -148,7 +145,7 @@ graalvmNative { org.springframework.boot spring-boot-maven-plugin - 3.3.2 + 3.3.4 process-test-aot @@ -172,16 +169,17 @@ graalvmNative { ```groovy plugins { - id 'org.springframework.boot' version '3.3.2' - id 'io.spring.dependency-management' version '1.1.6' - id 'org.graalvm.buildtools.native' version '0.10.2' + id 'org.springframework.boot' version '3.3.4' + id 'io.spring.dependency-management' version '1.1.6' + id 'org.graalvm.buildtools.native' version '0.10.3' } dependencies { - implementation 'org.springframework.boot:spring-boot-starter-jdbc' - implementation 'org.springframework.boot:spring-boot-starter-web' - implementation 'org.apache.shardingsphere.elasticjob:elasticjob-spring-boot-starter:${elasticjob.version}' - implementation(group: 'org.graalvm.buildtools', name: 'graalvm-reachability-metadata', version: '0.10.2', classifier: 'repository', ext: 'zip') + implementation 'org.springframework.boot:spring-boot-starter-web' + testImplementation 'org.springframework.boot:spring-boot-starter-test' + testRuntimeOnly 'org.junit.platform:junit-platform-launcher' + implementation 'org.apache.shardingsphere.elasticjob:elasticjob-spring-boot-starter:${elasticjob.version}' + implementation(group: 'org.graalvm.buildtools', name: 'graalvm-reachability-metadata', version: '0.10.3', classifier: 'repository', ext: 'zip') } graalvmNative { @@ -191,7 +189,6 @@ graalvmNative { } ``` - ## 对于 sbt 等不被 GraalVM Native Build Tools 支持的构建工具 此类需求需要在 https://github.com/graalvm/native-build-tools 打开额外的 issue 并提供对应构建工具的 Plugin 实现。 diff --git a/docs/content/user-manual/configuration/graalvm-native-image.en.md b/docs/content/user-manual/configuration/graalvm-native-image.en.md index 4353929cb..a6bc4e828 100644 --- a/docs/content/user-manual/configuration/graalvm-native-image.en.md +++ b/docs/content/user-manual/configuration/graalvm-native-image.en.md @@ -36,7 +36,6 @@ refer to the documentation of GraalVM Native Build Tools. org.apache.shardingsphere.elasticjob elasticjob-bootstrap ${elasticjob.version} - test @@ -45,7 +44,7 @@ refer to the documentation of GraalVM Native Build Tools. org.graalvm.buildtools native-maven-plugin - 0.10.2 + 0.10.3 true @@ -78,12 +77,12 @@ Refer to https://github.com/graalvm/native-build-tools/issues/572. ```groovy plugins { - id 'org.graalvm.buildtools.native' version '0.10.2' + id 'org.graalvm.buildtools.native' version '0.10.3' } dependencies { implementation 'org.apache.shardingsphere.elasticjob:elasticjob-bootstrap:${elasticjob.version}' - implementation(group: 'org.graalvm.buildtools', name: 'graalvm-reachability-metadata', version: '0.10.2', classifier: 'repository', ext: 'zip') + implementation(group: 'org.graalvm.buildtools', name: 'graalvm-reachability-metadata', version: '0.10.3', classifier: 'repository', ext: 'zip') } graalvmNative { @@ -108,28 +107,26 @@ To configure additional Maven Profiles for the project, refer to the documentati org.apache.shardingsphere.elasticjob elasticjob-spring-boot-starter ${elasticjob.version} - test org.springframework.boot - spring-boot-starter-jdbc - 3.3.2 - test + spring-boot-starter-web + 3.3.4 org.springframework.boot - spring-boot-starter-web - 3.3.2 + spring-boot-starter-test + 3.3.4 test - + org.graalvm.buildtools native-maven-plugin - 0.10.2 + 0.10.3 true @@ -151,7 +148,7 @@ To configure additional Maven Profiles for the project, refer to the documentati org.springframework.boot spring-boot-maven-plugin - 3.3.2 + 3.3.4 process-test-aot @@ -175,22 +172,23 @@ Refer to https://github.com/graalvm/native-build-tools/issues/572 . ```groovy plugins { - id 'org.springframework.boot' version '3.3.2' - id 'io.spring.dependency-management' version '1.1.6' - id 'org.graalvm.buildtools.native' version '0.10.2' + id 'org.springframework.boot' version '3.3.4' + id 'io.spring.dependency-management' version '1.1.6' + id 'org.graalvm.buildtools.native' version '0.10.3' } dependencies { - implementation 'org.springframework.boot:spring-boot-starter-jdbc' - implementation 'org.springframework.boot:spring-boot-starter-web' - implementation 'org.apache.shardingsphere.elasticjob:elasticjob-spring-boot-starter:${elasticjob.version}' - implementation(group: 'org.graalvm.buildtools', name: 'graalvm-reachability-metadata', version: '0.10.2', classifier: 'repository', ext: 'zip') + implementation 'org.springframework.boot:spring-boot-starter-web' + testImplementation 'org.springframework.boot:spring-boot-starter-test' + testRuntimeOnly 'org.junit.platform:junit-platform-launcher' + implementation 'org.apache.shardingsphere.elasticjob:elasticjob-spring-boot-starter:${elasticjob.version}' + implementation(group: 'org.graalvm.buildtools', name: 'graalvm-reachability-metadata', version: '0.10.3', classifier: 'repository', ext: 'zip') } graalvmNative { - metadataRepository { + metadataRepository { enabled.set(false) - } + } } ``` diff --git a/pom.xml b/pom.xml index 9231ff2dc..399162a31 100644 --- a/pom.xml +++ b/pom.xml @@ -130,7 +130,7 @@ 3.4 1.10 - 0.10.2 + 0.10.3 diff --git a/test/native/pom.xml b/test/native/pom.xml index d031f4f76..805c2ea15 100644 --- a/test/native/pom.xml +++ b/test/native/pom.xml @@ -29,9 +29,9 @@ true - 3.3.2 - 2.0.13 - 1.5.6 + 3.3.4 + 2.0.16 + 1.5.8 diff --git a/test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/TestMain.java b/test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/TestMain.java index b70478796..efc11187c 100644 --- a/test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/TestMain.java +++ b/test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/TestMain.java @@ -20,6 +20,9 @@ import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; +/** + * Spring Boot Web Server for testing only. + */ @SpringBootApplication public class TestMain { diff --git a/test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/it/operation/JavaTest.java b/test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/it/operation/JavaTest.java index 72305f2af..1ea2421c7 100644 --- a/test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/it/operation/JavaTest.java +++ b/test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/it/operation/JavaTest.java @@ -91,9 +91,9 @@ static void beforeAll() throws Exception { client.start(); Awaitility.await().atMost(Duration.ofMillis(500 * 60)).ignoreExceptions().until(client::isConnected); } - firstRegCenter = new ZookeeperRegistryCenter(new ZookeeperConfiguration(testingServer.getConnectString(), "elasticjob-test-native-java")); + firstRegCenter = new ZookeeperRegistryCenter(new ZookeeperConfiguration(testingServer.getConnectString(), "elasticjob-test-native-operation-java")); firstRegCenter.init(); - secondRegCenter = new ZookeeperRegistryCenter(new ZookeeperConfiguration(testingServer.getConnectString(), "elasticjob-test-native-java")); + secondRegCenter = new ZookeeperRegistryCenter(new ZookeeperConfiguration(testingServer.getConnectString(), "elasticjob-test-native-operation-java")); secondRegCenter.init(); HikariConfig config = new HikariConfig(); config.setDriverClassName("org.h2.Driver"); @@ -114,6 +114,7 @@ static void afterAll() throws IOException { * TODO Executing {@link JobConfigurationAPI#removeJobConfiguration(String)} will always cause the listener * to throw an exception similar to {@code Caused by: java.lang.IllegalStateException: Expected state [STARTED] was [STOPPED]} . * This is not acceptable behavior. + * The logic inside {@link org.junit.jupiter.api.Assertions#assertDoesNotThrow(Executable)} should be removed. */ @Test void testJobConfigurationAPI() { @@ -141,6 +142,11 @@ void testJobConfigurationAPI() { JobConfigurationPOJO newTestJavaSimpleJob = jobConfigAPI.getJobConfiguration(jobName); assertThat(newTestJavaSimpleJob, notNullValue()); assertThat(newTestJavaSimpleJob.getCron(), is("0/10 * * * * ?")); + assertDoesNotThrow(() -> { + List ipList = secondRegCenter.getChildrenKeys("/" + jobName + "/servers"); + assertThat(ipList.size(), is(1)); + secondRegCenter.remove("/" + jobName + "/servers/" + ipList.get(0)); + }); jobConfigAPI.removeJobConfiguration(jobName); assertThat(jobConfigAPI.getJobConfiguration(jobName), nullValue()); job.shutdown();