Skip to content

Commit

Permalink
Update doc for new changes
Browse files Browse the repository at this point in the history
  • Loading branch information
linghengqian committed Oct 5, 2022
1 parent 27011dc commit 1f40c11
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion distribution/proxy-native/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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, 需要带上两个参数,
Expand All @@ -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
Expand All @@ -126,7 +126,7 @@ services:
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` 的内容。

# 可观察性
Expand All @@ -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
Expand All @@ -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
```
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
Expand All @@ -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
Expand All @@ -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/
Expand All @@ -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
Expand All @@ -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
```

0 comments on commit 1f40c11

Please sign in to comment.