Skip to content

Commit

Permalink
Update CI related GraalVM CE version to 23.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
linghengqian committed Nov 20, 2023
1 parent dc9d8be commit 1be6659
Show file tree
Hide file tree
Showing 12 changed files with 35 additions and 39 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/nightly-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ jobs:

build-proxy-native-image:
if: github.repository == 'apache/shardingsphere'
name: Build GraalVM Native Image
name: Build Proxy Native Image
needs: global-environment
timeout-minutes: 90
permissions:
contents: read
Expand All @@ -119,7 +120,7 @@ jobs:
ref: ${{ inputs.commit-id }}
- uses: graalvm/setup-graalvm@v1
with:
java-version: '17.0.9'
java-version: '21.0.1'
distribution: 'graalvm-community'
github-token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/cache@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nightly-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ jobs:
- uses: actions/checkout@v3
- uses: graalvm/setup-graalvm@v1
with:
java-version: '17.0.9'
java-version: '21.0.1'
distribution: 'graalvm-community'
github-token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/cache@v3
Expand Down
16 changes: 1 addition & 15 deletions distribution/proxy-native/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,6 @@
<groupId>org.apache.shardingsphere</groupId>
<artifactId>shardingsphere-proxy-bootstrap</artifactId>
<version>${project.version}</version>
<exclusions>
<exclusion>
<groupId>org.apache.shardingsphere</groupId>
<artifactId>shardingsphere-cluster-mode-repository-etcd</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
Expand Down Expand Up @@ -78,6 +72,7 @@
<profile>
<id>release.native</id>
<properties>
<java.version>21</java.version>
<jacoco.skip>true</jacoco.skip>
<maven.javadoc.skip>true</maven.javadoc.skip>
<checkstyle.skip>true</checkstyle.skip>
Expand All @@ -87,14 +82,6 @@
<build>
<finalName>apache-shardingsphere-${project.version}</finalName>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin.version}</version>
<configuration>
<source>17</source>
<target>17</target>
</configuration>
</plugin>
<plugin>
<groupId>org.graalvm.buildtools</groupId>
<artifactId>native-maven-plugin</artifactId>
Expand All @@ -104,7 +91,6 @@
<mainClass>org.apache.shardingsphere.proxy.Bootstrap</mainClass>
<buildArgs>
<arg>--report-unsupported-elements-at-runtime</arg>
<arg>-J-Xmx7g</arg>
</buildArgs>
<metadataRepository>
<enabled>true</enabled>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ CE 的 `native-image` 工具的长篇大论的 shell 命令。
ShardingSphere JDBC 要求在如下或更高版本的 `GraalVM CE` 完成构建 GraalVM Native Image。使用者可通过 SDKMAN! 快速切换 JDK。这同理
适用于 `Oracle GraalVM``Liberica Native Image Kit``Mandrel``GraalVM CE` 的下游发行版。

- GraalVM CE 23.0.2 For JDK 17.0.9,对应于 SDKMAN! 的 `17.0.9-graalce`
- GraalVM CE 23.0.2 For JDK 21.0.1,对应于 SDKMAN! 的 `21.0.1-graalce`
- GraalVM CE 23.1.1 For JDK 21.0.1,对应于 SDKMAN! 的 `21.0.1-graalce`

### Maven 生态

Expand Down Expand Up @@ -226,8 +225,8 @@ ShardingSphere 定义了 `nativeTestInShardingSphere` 的 Maven Profile 用于
sudo apt install unzip zip curl sed -y
curl -s "https://get.sdkman.io" | bash
source "$HOME/.sdkman/bin/sdkman-init.sh"
sdk install java 17.0.9-graalce
sdk use java 17.0.9-graalce
sdk install java 21.0.1-graalce
sdk use java 21.0.1-graalce
sudo apt-get install build-essential libz-dev zlib1g-dev -y
git clone [email protected]:apache/shardingsphere.git
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ ShardingSphere JDBC requires GraalVM Native Image to be built with GraalVM CE as
JDK through `SDKMAN!`. Same reason applicable to downstream distributions of `GraalVM CE` such as `Oracle GraalVM`, `Liberica Native Image Kit`
and `Mandrel`.

- GraalVM CE 23.0.2 For JDK 17.0.9, corresponding to `17.0.9-graalce` of SDKMAN!
- GraalVM CE 23.0.2 For JDK 21.0.1, corresponding to `21.0.1-graalce` of SDKMAN!
- GraalVM CE 23.1.1 For JDK 21.0.1, corresponding to `21.0.1-graalce` of SDKMAN!

### Maven Ecology

Expand Down Expand Up @@ -237,8 +236,8 @@ Assuming that the contributor is under a new Ubuntu 22.04.3 LTS instance, Contri
sudo apt install unzip zip curl sed -y
curl -s "https://get.sdkman.io" | bash
source "$HOME/.sdkman/bin/sdkman-init.sh"
sdk install java 17.0.9-graalce
sdk use java 17.0.9-graalce
sdk install java 21.0.1-graalce
sdk use java 21.0.1-graalce
sudo apt-get install build-essential libz-dev zlib1g-dev -y
git clone [email protected]:apache/shardingsphere.git
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ services:
或 `GraalVM Community Edition` 的下游发行版。若使用 `SDKMAN!`,

```shell
sdk install java 17.0.9-graalce
sdk install java 21.0.1-graalce
```

2. 根据 https://www.graalvm.org/jdk17/reference-manual/native-image/#prerequisites 的要求安装本地工具链。
Expand Down Expand Up @@ -90,7 +90,7 @@ sdk install java 17.0.9-graalce
- 通过命令行构建 GraalVM Native Image。

```bash
./mvnw -am -pl distribution/proxy-native -B -T1C -Prelease.native -DskipTests clean package
./mvnw -am -pl distribution/proxy-native -T1C -Prelease.native -DskipTests clean package
```

3. 通过命令行启动 Native Image, 需要带上 4 个参数。
Expand All @@ -105,7 +105,7 @@ sdk install java 17.0.9-graalce
4. 如果需要构建 Docker Image, 在添加存在 SPI 实现的依赖或第三方依赖后, 在命令行执行如下命令。

```shell
./mvnw -am -pl distribution/proxy-native -B -T1C -Prelease.native,docker.native -DskipTests clean package
./mvnw -am -pl distribution/proxy-native -T1C -Prelease.native,docker.native -DskipTests clean package
```

- 假设存在包含`server.yaml` 的 `conf` 文件夹为 `./custom/conf`,可通过如下的 `docker-compose.yml` 文件启动 GraalVM Native
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ services:
JDK 17 according to https://www.graalvm.org/downloads/. If `SDKMAN!` is used,

```shell
sdk install java 17.0.9-graalce
sdk install java 21.0.1-graalce
```

2. Install the local toolchain as required by https://www.graalvm.org/jdk17/reference-manual/native-image/#prerequisites.
Expand All @@ -69,7 +69,7 @@ sdk install java 17.0.9-graalce
Image.

```bash
./mvnw -am -pl distribution/proxy-native -B -T1C -Prelease.native -DskipTests clean package
./mvnw -am -pl distribution/proxy-native -T1C -Prelease.native -DskipTests clean package
```

- Scenario 2: It is necessary to use a JAR that has an SPI implementation or a third-party dependent JAR of a LICENSE
Expand Down Expand Up @@ -97,7 +97,7 @@ sdk install java 17.0.9-graalce
- Build GraalVM Native Image via command line.

```bash
./mvnw -am -pl distribution/proxy-native -B -T1C -Prelease.native -DskipTests clean package
./mvnw -am -pl distribution/proxy-native -T1C -Prelease.native -DskipTests clean package
```

3. To start Native Image through the command line, you need to bring 4 parameters. The first parameter is the `Port`
Expand Down
15 changes: 13 additions & 2 deletions infra/expr/type/espresso/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
<artifactId>shardingsphere-infra-expr-espresso</artifactId>
<name>${project.artifactId}</name>

<properties>
<graalvm.version>23.1.1</graalvm.version>
</properties>

<dependencies>
<dependency>
<groupId>org.apache.shardingsphere</groupId>
Expand All @@ -50,9 +54,16 @@
</dependency>

<dependency>
<groupId>org.graalvm.truffle</groupId>
<artifactId>truffle-api</artifactId>
<groupId>org.graalvm.polyglot</groupId>
<artifactId>polyglot</artifactId>
<version>${graalvm.version}</version>
</dependency>
<dependency>
<groupId>org.graalvm.polyglot</groupId>
<artifactId>java-community</artifactId>
<version>${graalvm.version}</version>
<type>pom</type>
<scope>provided</scope>
</dependency>
</dependencies>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

/**
* The background for this class comes from <a href="https://github.com/oracle/graal/issues/7682">oracle/graal#7682</a>
* and <a href="https://github.com/oracle/graal/blob/vm-ce-23.0.2/docs/reference-manual/native-image/Resources.md">Accessing Resources in Native Image</a>.
* and <a href="https://github.com/oracle/graal/blob/vm-ce-23.1.1/docs/reference-manual/native-image/Resources.md">Accessing Resources in Native Image</a>.
* GraalVM Native Image has special features in its handling of file systems.
* This means we are better off reading the file via `java.io.InputStream` instead of `java.net.URL` to avoid extra code
* processing.
Expand Down
2 changes: 1 addition & 1 deletion infra/nativetest/src/test/resources/yaml/sharding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ rules:
shardingColumn: user_id
shardingAlgorithmName: inline
shardingAlgorithms:
# GroovyShell related classes are not available on GraalVM CE 23.0.2 For JDK 17.0.9,
# GroovyShell related classes are not available on GraalVM CE 23.1.1 For JDK 21.0.1,
# This CLASS_BASE algorithm class is designed to emulate INLINE's `ds_${user_id % 2}`.
# See https://github.com/oracle/graal/issues/5522 .
inline:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public static JDBCRepositorySQL load(final String type) {
}

/**
* Under the GraalVM Native Image corresponding to GraalVM CE 23.0.2 For JDK 17.0.9, although there is
* Under the GraalVM Native Image corresponding to GraalVM CE 23.1.1 For JDK 21.0.1, although there is
* `com.oracle.svm.core.jdk.resources.NativeImageResourceFileSystemProvider`, the corresponding
* `com.oracle.svm.core.jdk.resources.NativeImageResourceFileSystem` does not autoload. This is mainly to align the
* behavior of `ZipFileSystemProvider`, so ShardingSphere need to manually open and close the FileSystem
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1004,7 +1004,7 @@
<profile>
<id>generateMetadata</id>
<properties>
<java.version>17</java.version>
<java.version>21</java.version>
<jacoco.skip>true</jacoco.skip>
<maven.javadoc.skip>true</maven.javadoc.skip>
<checkstyle.skip>true</checkstyle.skip>
Expand Down Expand Up @@ -1073,7 +1073,7 @@
<profile>
<id>nativeTestInShardingSphere</id>
<properties>
<java.version>17</java.version>
<java.version>21</java.version>
</properties>
<build>
<pluginManagement>
Expand Down

0 comments on commit 1be6659

Please sign in to comment.