Skip to content

Commit

Permalink
Merge pull request #2444 from linghengqian/fix-doc
Browse files Browse the repository at this point in the history
Fixes incorrect environment variable definition in SASL integration doc
  • Loading branch information
strongduanmu authored Sep 30, 2024
2 parents d29c0ae + f51d3c9 commit 5466e43
Show file tree
Hide file tree
Showing 9 changed files with 57 additions and 55 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/graalvm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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"
```
Expand Down Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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"
```
Expand Down Expand Up @@ -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.
37 changes: 17 additions & 20 deletions docs/content/user-manual/configuration/graalvm-native-image.cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ ElasticJob 不为已停止维护的 GraalVM CE 版本设置 CI。
<groupId>org.apache.shardingsphere.elasticjob</groupId>
<artifactId>elasticjob-bootstrap</artifactId>
<version>${elasticjob.version}</version>
<scope>test</scope>
</dependency>
</dependencies>

Expand All @@ -43,7 +42,7 @@ ElasticJob 不为已停止维护的 GraalVM CE 版本设置 CI。
<plugin>
<groupId>org.graalvm.buildtools</groupId>
<artifactId>native-maven-plugin</artifactId>
<version>0.10.2</version>
<version>0.10.3</version>
<extensions>true</extensions>
<executions>
<execution>
Expand Down Expand Up @@ -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 {
Expand All @@ -105,18 +104,16 @@ graalvmNative {
<groupId>org.apache.shardingsphere.elasticjob</groupId>
<artifactId>elasticjob-spring-boot-starter</artifactId>
<version>${elasticjob.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
<version>3.3.2</version>
<scope>test</scope>
<artifactId>spring-boot-starter-web</artifactId>
<version>3.3.4</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>3.3.2</version>
<artifactId>spring-boot-starter-test</artifactId>
<version>3.3.4</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand All @@ -126,7 +123,7 @@ graalvmNative {
<plugin>
<groupId>org.graalvm.buildtools</groupId>
<artifactId>native-maven-plugin</artifactId>
<version>0.10.2</version>
<version>0.10.3</version>
<extensions>true</extensions>
<executions>
<execution>
Expand All @@ -148,7 +145,7 @@ graalvmNative {
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>3.3.2</version>
<version>3.3.4</version>
<executions>
<execution>
<id>process-test-aot</id>
Expand All @@ -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 {
Expand All @@ -191,7 +189,6 @@ graalvmNative {
}
```


## 对于 sbt 等不被 GraalVM Native Build Tools 支持的构建工具

此类需求需要在 https://github.com/graalvm/native-build-tools 打开额外的 issue 并提供对应构建工具的 Plugin 实现。
Expand Down
42 changes: 20 additions & 22 deletions docs/content/user-manual/configuration/graalvm-native-image.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ refer to the documentation of GraalVM Native Build Tools.
<groupId>org.apache.shardingsphere.elasticjob</groupId>
<artifactId>elasticjob-bootstrap</artifactId>
<version>${elasticjob.version}</version>
<scope>test</scope>
</dependency>
</dependencies>

Expand All @@ -45,7 +44,7 @@ refer to the documentation of GraalVM Native Build Tools.
<plugin>
<groupId>org.graalvm.buildtools</groupId>
<artifactId>native-maven-plugin</artifactId>
<version>0.10.2</version>
<version>0.10.3</version>
<extensions>true</extensions>
<executions>
<execution>
Expand Down Expand Up @@ -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 {
Expand All @@ -108,28 +107,26 @@ To configure additional Maven Profiles for the project, refer to the documentati
<groupId>org.apache.shardingsphere.elasticjob</groupId>
<artifactId>elasticjob-spring-boot-starter</artifactId>
<version>${elasticjob.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
<version>3.3.2</version>
<scope>test</scope>
<artifactId>spring-boot-starter-web</artifactId>
<version>3.3.4</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>3.3.2</version>
<artifactId>spring-boot-starter-test</artifactId>
<version>3.3.4</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.graalvm.buildtools</groupId>
<artifactId>native-maven-plugin</artifactId>
<version>0.10.2</version>
<version>0.10.3</version>
<extensions>true</extensions>
<executions>
<execution>
Expand All @@ -151,7 +148,7 @@ To configure additional Maven Profiles for the project, refer to the documentati
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>3.3.2</version>
<version>3.3.4</version>
<executions>
<execution>
<id>process-test-aot</id>
Expand All @@ -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)
}
}
}
```

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
<maven-plugin-plugin.version>3.4</maven-plugin-plugin.version>
<checksum-maven-plugin.version>1.10</checksum-maven-plugin.version>

<native-maven-plugin.version>0.10.2</native-maven-plugin.version>
<native-maven-plugin.version>0.10.3</native-maven-plugin.version>
</properties>

<dependencyManagement>
Expand Down
6 changes: 3 additions & 3 deletions test/native/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
<properties>
<maven.deploy.skip>true</maven.deploy.skip>
<!--TODO Blocked by https://github.com/apache/shardingsphere-elasticjob/issues/2425 -->
<spring-boot-dependencies.version>3.3.2</spring-boot-dependencies.version>
<slf4j.version>2.0.13</slf4j.version>
<logback.version>1.5.6</logback.version>
<spring-boot-dependencies.version>3.3.4</spring-boot-dependencies.version>
<slf4j.version>2.0.16</slf4j.version>
<logback.version>1.5.8</logback.version>
</properties>

<dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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() {
Expand Down Expand Up @@ -141,6 +142,11 @@ void testJobConfigurationAPI() {
JobConfigurationPOJO newTestJavaSimpleJob = jobConfigAPI.getJobConfiguration(jobName);
assertThat(newTestJavaSimpleJob, notNullValue());
assertThat(newTestJavaSimpleJob.getCron(), is("0/10 * * * * ?"));
assertDoesNotThrow(() -> {
List<String> 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();
Expand Down

0 comments on commit 5466e43

Please sign in to comment.