diff --git a/distribution/proxy-native/Dockerfile b/distribution/proxy-native/Dockerfile index 5e1df1a7dce3bd..4d10a573be0f55 100644 --- a/distribution/proxy-native/Dockerfile +++ b/distribution/proxy-native/Dockerfile @@ -19,7 +19,7 @@ FROM busybox AS prepare RUN mkdir -p /conf/ -FROM debian:bullseye-slim +FROM oraclelinux:9-slim MAINTAINER ShardingSphere "dev@shardingsphere.apache.org" diff --git a/docs/document/content/user-manual/shardingsphere-proxy/startup/graalvm-native-image.cn.md b/docs/document/content/user-manual/shardingsphere-proxy/startup/graalvm-native-image.cn.md index 57d73f7a036f49..a6eaa79d172604 100644 --- a/docs/document/content/user-manual/shardingsphere-proxy/startup/graalvm-native-image.cn.md +++ b/docs/document/content/user-manual/shardingsphere-proxy/startup/graalvm-native-image.cn.md @@ -62,12 +62,12 @@ services: - 在 Git Source 同级目录下执行如下命令, 直接完成 Native Image 的构建。 ```bash -./mvnw -am -pl shardingsphere-distribution/shardingsphere-proxy-native-distribution -B -Pnative -DskipTests -Dmaven.javadoc.skip=true -Dcheckstyle.skip=true -Dspotless.apply.skip=true -Drat.skip=true clean package +./mvnw -am -pl distribution/proxy-native -B -Pnative -DskipTests -Dmaven.javadoc.skip=true -Dcheckstyle.skip=true -Dspotless.apply.skip=true -Drat.skip=true clean package ``` - 情形二:需要使用存在 SPI 实现的 JAR 或 GPL V2 等 LICENSE 的第三方依赖的 JAR。 -- 在 `shardingsphere-distribution/shardingsphere-proxy-native-distribution/pom.xml` 的 `dependencies` 加入存在 SPI 实现的 JAR +- 在 `distribution/proxy-native/pom.xml` 的 `dependencies` 加入存在 SPI 实现的 JAR 或第三方依赖的 JAR。示例如下 ```xml @@ -89,7 +89,7 @@ services: - 通过命令行构建 GraalVM Native Image。 ```bash -./mvnw -am -pl shardingsphere-distribution/shardingsphere-proxy-native-distribution -B -Pnative -DskipTests -Dmaven.javadoc.skip=true -Dcheckstyle.skip=true -Dspotless.apply.skip=true -Drat.skip=true clean package +./mvnw -am -pl distribution/proxy-native -B -Pnative -DskipTests -Dmaven.javadoc.skip=true -Dcheckstyle.skip=true -Dspotless.apply.skip=true -Drat.skip=true clean package ``` 3. 通过命令行启动 Native Image, 需要带上两个参数, @@ -103,7 +103,7 @@ services: 4. 如果需要构建 Docker Image, 在添加后存在 SPI 实现的依赖或第三方依赖后, 在命令行执行如下命令。 ```shell -./mvnw -am -pl shardingsphere-distribution/shardingsphere-proxy-native-distribution -B -Pnative,docker.native -DskipTests -Dmaven.javadoc.skip=true -Dcheckstyle.skip=true -Dspotless.apply.skip=true -Drat.skip=true clean package +./mvnw -am -pl distribution/proxy-native -B -Pnative,docker.native -DskipTests -Dmaven.javadoc.skip=true -Dcheckstyle.skip=true -Dspotless.apply.skip=true -Drat.skip=true clean package ``` - 假设存在包含`server.yaml` 的 `conf` 文件夹为 `./custom/conf`,可通过如下的 `docker-compose.yml` 文件启动 GraalVM Native @@ -121,12 +121,12 @@ services: - "3307:3307" ``` -- 如果你不对 Git Source 做任何更改, 上文提及的命令将使用 `debian:bullseye-slim` 作为 Base Docker Image。 +- 如果你不对 Git Source 做任何更改, 上文提及的命令将使用 `oraclelinux:9-slim` 作为 Base Docker Image。 但如果你希望使用 `busybox:glic`,`gcr.io/distroless/base` 或 `scratch` 等更小体积的 Docker Image 作为 Base Docker Image,你需要根据 https://www.graalvm.org/22.2/reference-manual/native-image/guides/build-static-executables/ 的要求, 做为 `pom.xml`的 `native profile` 添加 `-H:+StaticExecutableWithDynamicLibC` 的 `jvmArgs` 等操作。 另请注意,某些第三方依赖将需要在 `Dockerfile` 安装更多系统库,例如 `libdl`。 - 因此请确保根据你的使用情况调整 `shardingsphere-distribution/shardingsphere-proxy-native-distribution` + 因此请确保根据你的使用情况调整 `distribution/proxy-native` 下的 `pom.xml` 和 `Dockerfile` 的内容。 # 可观察性 @@ -148,9 +148,9 @@ services: - 以下部分采用 `Apache SkyWalking Java Agent` 作为示例,可用于跟踪 GraalVM 社区的对应 issue。 1. 下载 https://dlcdn.apache.org/skywalking/java-agent/8.12.0/apache-skywalking-java-agent-8.12.0.tgz , - 并解压到 ShardingSphere Git Source 的 `shardingsphere-distribution/shardingsphere-proxy-native-distribution`。 + 并解压到 ShardingSphere Git Source 的 `distribution/proxy-native`。 -2. 修改 `shardingsphere-distribution/shardingsphere-proxy-native-distribution/pom.xml` 的 `native profile`, +2. 修改 `distribution/proxy-native/pom.xml` 的 `native profile`, 为 `org.graalvm.buildtools:native-maven-plugin` 的 `configuration` 添加如下的 `jvmArgs`。 ```xml @@ -165,5 +165,5 @@ services: 3. 通过命令行构建 GraalVM Native Image。 ```bash -./mvnw -am -pl shardingsphere-distribution/shardingsphere-proxy-native-distribution -B -Pnative -DskipTests -Dmaven.javadoc.skip=true -Dcheckstyle.skip=true -Dspotless.apply.skip=true -Drat.skip=true clean package +./mvnw -am -pl distribution/proxy-native -B -Pnative -DskipTests -Dmaven.javadoc.skip=true -Dcheckstyle.skip=true -Dspotless.apply.skip=true -Drat.skip=true clean package ``` diff --git a/docs/document/content/user-manual/shardingsphere-proxy/startup/graalvm-native-image.en.md b/docs/document/content/user-manual/shardingsphere-proxy/startup/graalvm-native-image.en.md index 6eaa2c296ea98f..7849c3ca39699e 100644 --- a/docs/document/content/user-manual/shardingsphere-proxy/startup/graalvm-native-image.en.md +++ b/docs/document/content/user-manual/shardingsphere-proxy/startup/graalvm-native-image.en.md @@ -67,14 +67,14 @@ services: Image. ```bash -./mvnw -am -pl shardingsphere-distribution/shardingsphere-proxy-native-distribution -B -Pnative -DskipTests -Dmaven.javadoc.skip=true -Dcheckstyle.skip=true -Dspotless.apply.skip=true -Drat.skip=true clean package +./mvnw -am -pl distribution/proxy-native -B -Pnative -DskipTests -Dmaven.javadoc.skip=true -Dcheckstyle.skip=true -Dspotless.apply.skip=true -Drat.skip=true 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 such as GPL V2. - Add SPI implementation JARs or third-party dependent JARs to `dependencies` - in `shardingsphere-distribution/shardingsphere-proxy-native-distribution/pom.xml`. Examples are as follows + in `distribution/proxy-native/pom.xml`. Examples are as follows ```xml @@ -95,7 +95,7 @@ services: - Build GraalVM Native Image via command line. ```bash -./mvnw -am -pl shardingsphere-distribution/shardingsphere-proxy-native-distribution -B -Pnative -DskipTests -Dmaven.javadoc.skip=true -Dcheckstyle.skip=true -Dspotless.apply.skip=true -Drat.skip=true clean package +./mvnw -am -pl distribution/proxy-native -B -Pnative -DskipTests -Dmaven.javadoc.skip=true -Dcheckstyle.skip=true -Dspotless.apply.skip=true -Drat.skip=true clean package ``` 3. Start Native Image through the command line, you need to bring two parameters, @@ -111,7 +111,7 @@ services: dependencies, execute the following commands on the command line. ```shell -./mvnw -am -pl shardingsphere-distribution/shardingsphere-proxy-native-distribution -B -Pnative,docker.native -DskipTests -Dmaven.javadoc.skip=true -Dcheckstyle.skip=true -Dspotless.apply.skip=true -Drat .skip=true clean package +./mvnw -am -pl distribution/proxy-native -B -Pnative,docker.native -DskipTests -Dmaven.javadoc.skip=true -Dcheckstyle.skip=true -Dspotless.apply.skip=true -Drat .skip=true clean package ``` - Assuming that there is a `conf` folder containing `server.yaml` as `./custom/conf`, you can start the Docker Image @@ -129,7 +129,7 @@ services: - "3307:3307" ``` -- If you don't make any changes to the Git Source, the commands mentioned above will use `debian:bullseye-slim` as the +- If you don't make any changes to the Git Source, the commands mentioned above will use `oraclelinux:9-slim` as the Base Docker Image. But if you want to use a smaller Docker Image like `busybox:glic`, `gcr.io/distroless/base` or `scratch` as the Base Docker Image, you need according @@ -137,10 +137,10 @@ services: Add operations such as `-H:+StaticExecutableWithDynamicLibC` to `jvmArgs` as the `native profile` of `pom.xml`. Also note that some 3rd party dependencies will require more system libraries such as `libdl` to be installed in the `Dockerfile`. - So make sure to tune `shardingsphere-distribution/shardingsphere-proxy-native-distribution` according to your usage + So make sure to tune `distribution/proxy-native` according to your usage `pom.xml` and `Dockerfile` below. -# observability +# Observability - ShardingSphere for GraalVM Native Image form Proxy, which provides observability capabilities with https://shardingsphere.apache.org/document/current/cn/user-manual/shardingsphere-proxy/observability/ @@ -160,9 +160,9 @@ services: - The following sections use the `Apache SkyWalking Java Agent` as an example, which can be used to track corresponding issues from the GraalVM community. -1. Download https://dlcdn.apache.org/skywalking/java-agent/8.12.0/apache-skywalking-java-agent-8.12.0.tgz and `untar` it to `shardingsphere-distribution/shardingsphere-proxy-native-distribution` in ShardingSphere Git Source. +1. Download https://dlcdn.apache.org/skywalking/java-agent/8.12.0/apache-skywalking-java-agent-8.12.0.tgz and `untar` it to `distribution/proxy-native` in ShardingSphere Git Source. -2. Modify the `native profile` of `shardingsphere-distribution/shardingsphere-proxy-native-distribution/pom.xml`, +2. Modify the `native profile` of `distribution/proxy-native/pom.xml`, Add the following `jvmArgs` to the `configuration` of `org.graalvm.buildtools:native-maven-plugin`. ```xml @@ -177,5 +177,5 @@ services: 3. Build the GraalVM Native Image from the command line. ```bash -./mvnw -am -pl shardingsphere-distribution/shardingsphere-proxy-native-distribution -B -Pnative -DskipTests -Dmaven.javadoc.skip=true -Dcheckstyle.skip=true -Dspotless.apply.skip=true -Drat.skip =true clean package +./mvnw -am -pl distribution/proxy-native -B -Pnative -DskipTests -Dmaven.javadoc.skip=true -Dcheckstyle.skip=true -Dspotless.apply.skip=true -Drat.skip =true clean package ```