Skip to content

Commit

Permalink
Fix nightly builds of ShardingSphere Proxy Native
Browse files Browse the repository at this point in the history
  • Loading branch information
linghengqian committed Feb 5, 2023
1 parent 88d04ad commit da2735f
Show file tree
Hide file tree
Showing 12 changed files with 131 additions and 130 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/nightly-build-artifact.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,4 +125,4 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push docker image
run: ./mvnw -am -pl distribution/proxy-native -B -DskipTests -Dmaven.javadoc.skip=true -Dcheckstyle.skip=true -Dspotless.apply.skip=true -Pnative,docker.buildx.push.native -Dproxy.image.repository=${{ env.PROXY_NATIVE }} -Dproxy.image.tag=${{ github.sha }} clean package
run: ./mvnw -am -pl distribution/proxy-native -Pnative,docker.buildx.push.native -B -DskipTests -Dmaven.javadoc.skip=true -Dcheckstyle.skip=true -Dspotless.apply.skip=true -Dproxy.image.repository=${{ env.PROXY_NATIVE }} -Dproxy.image.tag=${{ github.sha }} clean package
25 changes: 14 additions & 11 deletions distribution/proxy-native/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,26 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
FROM alpine AS prepare

FROM busybox AS prepare
ARG APP_NAME
ENV LOCAL_PATH /opt/shardingsphere-proxy-native

RUN mkdir -p /conf/
ADD target/${APP_NAME}.tar.gz /opt
RUN mv /opt/${APP_NAME} ${LOCAL_PATH}

FROM oraclelinux:9-slim

MAINTAINER ShardingSphere "dev@shardingsphere.apache.org"

ARG NATIVE_IMAGE_NAME
ENV LOCAL_PATH /opt/shardingsphere-proxy-native
ENV GRAALVM_HOME "/opt/graalvm-ce-java17-22.3.1"
ENV PATH "$GRAALVM_HOME/bin:$PATH"

bash <(curl -sL https://get.graalvm.org/jdk) -c espresso graalvm-ce-java17-22.3.1

COPY --from=prepare /conf/ ${LOCAL_PATH}/conf

ARG APP_NAME

ADD target/${APP_NAME} ${LOCAL_PATH}/
RUN microdnf install gzip -y && \
bash <(curl -sL https://get.graalvm.org/jdk) --to "/opt" -c espresso graalvm-ce-java17-22.3.1 && \
$GRAALVM_HOME/bin/gu remove native-image && \
microdnf clean all

ENTRYPOINT ${LOCAL_PATH}/${APP_NAME} 3307 ${LOCAL_PATH}/conf
COPY --from=prepare ${LOCAL_PATH} ${LOCAL_PATH}
ENTRYPOINT ${LOCAL_PATH}/${NATIVE_IMAGE_NAME} 3307 ${LOCAL_PATH}/conf
71 changes: 35 additions & 36 deletions distribution/proxy-native/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,11 @@
<artifactId>shardingsphere-proxy-native-distribution</artifactId>

<properties>
<native.image.name>apache-shardingsphere-proxy-native</native.image.name>
<native.image.repository>apache/shardingsphere-proxy-native</native.image.repository>
<exec-maven-plugin.version>3.1.0</exec-maven-plugin.version>
<native.maven.plugin.version>0.9.19</native.maven.plugin.version>
<imageName>apache-shardingsphere-proxy-native</imageName>
<mainClass>org.apache.shardingsphere.proxy.Bootstrap</mainClass>
<native.image.repository>apache/shardingsphere-proxy-native</native.image.repository>
</properties>

<dependencies>
Expand Down Expand Up @@ -67,42 +68,15 @@
</dependencies>

<profiles>
<profile>
<id>release</id>
<build>
<finalName>apache-shardingsphere-${project.version}</finalName>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptors>
<descriptor>src/main/assembly/shardingsphere-proxy-native-binary-distribution.xml</descriptor>
</descriptors>
</configuration>
<executions>
<execution>
<id>shardingsphere-proxy-native-bin</id>
<goals>
<goal>single</goal>
</goals>
<phase>package</phase>
</execution>
</executions>
</plugin>
<plugin>
<groupId>net.nicoulaj.maven.plugins</groupId>
<artifactId>checksum-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>native</id>
<properties>
<hikari-cp.version>5.0.1</hikari-cp.version>
<truffle-api.version>22.3.1</truffle-api.version>
<caffeine.version>3.1.2</caffeine.version>
</properties>
<build>
<finalName>apache-shardingsphere-${project.version}</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand All @@ -120,8 +94,6 @@
<version>${native.maven.plugin.version}</version>
<extensions>true</extensions>
<configuration>
<imageName>${native.image.name}</imageName>
<mainClass>org.apache.shardingsphere.proxy.Bootstrap</mainClass>
<fallback>false</fallback>
<verbose>true</verbose>
<buildArgs>
Expand Down Expand Up @@ -153,6 +125,27 @@
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptors>
<descriptor>src/main/assembly/shardingsphere-proxy-native-binary-distribution.xml</descriptor>
</descriptors>
</configuration>
<executions>
<execution>
<id>shardingsphere-proxy-native-bin</id>
<goals>
<goal>single</goal>
</goals>
<phase>package</phase>
</execution>
</executions>
</plugin>
<plugin>
<groupId>net.nicoulaj.maven.plugins</groupId>
<artifactId>checksum-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</profile>
Expand Down Expand Up @@ -181,7 +174,9 @@
<argument>build</argument>
<argument>--pull</argument>
<argument>--build-arg</argument>
<argument>APP_NAME=${native.image.name}</argument>
<argument>APP_NAME=${project.build.finalName}-shardingsphere-proxy-native-bin</argument>
<argument>--build-arg</argument>
<argument>NATIVE_IMAGE_NAME=${imageName}</argument>
<argument>.</argument>
<argument>-t</argument>
<argument>${proxy.image.repository}:${proxy.image.tag}</argument>
Expand Down Expand Up @@ -245,7 +240,9 @@
<argument>--platform</argument>
<argument>${proxy.image.platform}</argument>
<argument>--build-arg</argument>
<argument>APP_NAME=${native.image.name}</argument>
<argument>APP_NAME=${project.build.finalName}-shardingsphere-proxy-native-bin</argument>
<argument>--build-arg</argument>
<argument>NATIVE_IMAGE_NAME=${imageName}</argument>
<argument>.</argument>
</arguments>
</configuration>
Expand All @@ -265,7 +262,9 @@
<argument>--platform</argument>
<argument>${proxy.image.platform}</argument>
<argument>--build-arg</argument>
<argument>APP_NAME=${native.image.name}</argument>
<argument>APP_NAME=${project.build.finalName}-shardingsphere-proxy-native-bin</argument>
<argument>--build-arg</argument>
<argument>NATIVE_IMAGE_NAME=${imageName}</argument>
<argument>.</argument>
<argument>-t</argument>
<argument>${proxy.image.repository}:${proxy.image.tag}</argument>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@

<fileSets>
<fileSet>
<directory>../../proxy/bootstrap/src/main/resources/conf</directory>
<outputDirectory>conf</outputDirectory>
<fileMode>0644</fileMode>
</fileSet>
<fileSet>
<directory>../../proxy/bootstrap/src/main/resources</directory>
<directory>${project.build.directory}</directory>
<includes>
<include>logback.xml</include>
<include>${imageName}</include>
</includes>
<outputDirectory>/</outputDirectory>
<fileMode>0755</fileMode>
</fileSet>
<fileSet>
<directory>../../proxy/bootstrap/src/main/resources/conf</directory>
<outputDirectory>conf</outputDirectory>
<fileMode>0644</fileMode>
</fileSet>
Expand Down
44 changes: 23 additions & 21 deletions distribution/proxy-native/src/main/release-docs/LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ The text of each license is the standard Apache 2.0 license.
avatica-core 1.22.0: https://calcite.apache.org/avatica, Apache 2.0
avatica-metrics 1.22.0: https://calcite.apache.org/avatica, Apache 2.0
auto-service-annotations 1.0: https://github.com/google/auto/tree/master/service, Apache 2.0
caffeine 2.9.3: https://github.com/ben-manes/caffeine, Apache 2.0
caffeine 3.1.2: https://github.com/ben-manes/caffeine, Apache 2.0
calcite-core 1.32.0: https://calcite.apache.org, Apache 2.0
calcite-linq4j 1.32.0: https://calcite.apache.org, Apache 2.0
commons-codec 1.15: https://github.com/apache/commons-codec, Apache 2.0
Expand Down Expand Up @@ -260,28 +260,30 @@ The text of each license is the standard Apache 2.0 license.
jackson-databind 2.13.4: http://github.com/FasterXML/jackson, Apache 2.0
jackson-dataformat-yaml 2.13.4: http://github.com/FasterXML/jackson, Apache 2.0
jcl-over-slf4j 1.7.36: https://github.com/qos-ch/slf4j, Apache 2.0
jetcd-common 0.7.3: https://github.com/etcd-io/jetcd, Apache 2.0
jetcd-core 0.7.3: https://github.com/etcd-io/jetcd, Apache 2.0
jetcd-api 0.7.5: https://github.com/etcd-io/jetcd, Apache 2.0
jetcd-common 0.7.5: https://github.com/etcd-io/jetcd, Apache 2.0
jetcd-core 0.7.5: https://github.com/etcd-io/jetcd, Apache 2.0
jetcd-grpc 0.7.5: https://github.com/etcd-io/jetcd, Apache 2.0
json-path 2.7.0: https://github.com/jayway/JsonPath, Apache 2.0
json-smart 2.4.7: https://www.minidev.net/, Apache 2.0
json-simple 1.1.1: https://code.google.com/archive/p/json-simple/, Apache 2.0
jsr305 3.0.2: http://findbugs.sourceforge.net/, Apache 2.0
log4j 1.2.17: http://logging.apache.org/log4j/1.2/, Apache 2.0
memory 0.9.0, Apache 2.0
netty-buffer 4.1.86.Final: https://github.com/netty, Apache 2.0
netty-codec 4.1.86.Final: https://github.com/netty, Apache 2.0
netty-codec-http 4.1.86.Final: https://github.com/netty, Apache 2.0
netty-codec-http2 4.1.86.Final: https://github.com/netty, Apache 2.0
netty-codec-socks 4.1.86.Final: https://github.com/netty, Apache 2.0
netty-common 4.1.86.Final: https://github.com/netty, Apache 2.0
netty-handler 4.1.86.Final: https://github.com/netty, Apache 2.0
netty-handler-proxy 4.1.86.Final: https://github.com/netty, Apache 2.0
netty-resolver 4.1.86.Final: https://github.com/netty, Apache 2.0
netty-transport 4.1.86.Final: https://github.com/netty, Apache 2.0
netty-transport-classes-epoll 4.1.86.Final: https://github.com/netty, Apache 2.0
netty-transport-native-epoll 4.1.86.Final-linux-aarch_64: https://github.com/netty, Apache 2.0
netty-transport-native-epoll 4.1.86.Final-linux-x86_64: https://github.com/netty, Apache 2.0
netty-transport-native-unix-common 4.1.86.Final: https://github.com/netty, Apache 2.0
netty-buffer 4.1.87.Final: https://github.com/netty, Apache 2.0
netty-codec 4.1.87.Final: https://github.com/netty, Apache 2.0
netty-codec-http 4.1.87.Final: https://github.com/netty, Apache 2.0
netty-codec-http2 4.1.87.Final: https://github.com/netty, Apache 2.0
netty-codec-socks 4.1.87.Final: https://github.com/netty, Apache 2.0
netty-common 4.1.87.Final: https://github.com/netty, Apache 2.0
netty-handler 4.1.87.Final: https://github.com/netty, Apache 2.0
netty-handler-proxy 4.1.87.Final: https://github.com/netty, Apache 2.0
netty-resolver 4.1.87.Final: https://github.com/netty, Apache 2.0
netty-transport 4.1.87.Final: https://github.com/netty, Apache 2.0
netty-transport-classes-epoll 4.1.87.Final: https://github.com/netty, Apache 2.0
netty-transport-native-epoll 4.1.87.Final-linux-aarch_64: https://github.com/netty, Apache 2.0
netty-transport-native-epoll 4.1.87.Final-linux-x86_64: https://github.com/netty, Apache 2.0
netty-transport-native-unix-common 4.1.87.Final: https://github.com/netty, Apache 2.0
perfmark-api 0.23.0: https://github.com/perfmark/perfmark, Apache 2.0
proto-google-common-protos 2.0.1: https://github.com/googleapis/common-protos-java, Apache 2.0
proj4j 1.1.5: https://github.com/locationtech/proj4j, Apache 2.0
Expand All @@ -290,8 +292,8 @@ The text of each license is the standard Apache 2.0 license.
snakeyaml 1.33: https://bitbucket.org/snakeyaml/snakeyaml, Apache 2.0
transmittable-thread-local 2.14.2: https://github.com/alibaba/transmittable-thread-local, Apache 2.0
uzaygezen-core 0.2: https://code.google.com/p/uzaygezen, Apache 2.0
zookeeper 3.8.0: https://github.com/apache/zookeeper, Apache 2.0
zookeeper-jute 3.8.0: https://github.com/apache/zookeeper, Apache 2.0
zookeeper 3.8.1: https://github.com/apache/zookeeper, Apache 2.0
zookeeper-jute 3.8.1: https://github.com/apache/zookeeper, Apache 2.0

========================================================================
Apache 2.0 licenses
Expand Down Expand Up @@ -319,8 +321,8 @@ The text of each license is also included at licenses/LICENSE-[project].txt.
janino 3.1.8: https://github.com/janino-compiler/janino, BSD-3-Clause
opengauss-jdbc 3.1.0-og: https://gitee.com/opengauss/openGauss-connector-jdbc, BSD-2-Clause
postgresql 42.4.1: https://github.com/pgjdbc/pgjdbc, BSD-2-Clause
protobuf-java 3.17.2: https://github.com/protocolbuffers/protobuf/blob/master/java, BSD-3-Clause
protobuf-java-util 3.17.2: https://github.com/protocolbuffers/protobuf/blob/master/java, BSD-3-Clause
protobuf-java 3.21.12: https://github.com/protocolbuffers/protobuf/blob/master/java, BSD-3-Clause
protobuf-java-util 3.21.12: https://github.com/protocolbuffers/protobuf/blob/master/java, BSD-3-Clause
jts-io-common 1.19.0: https://github.com/locationtech/jts, EDL 1.0
jts-core 1.19.0: https://github.com/locationtech/jts, EDL 1.0

Expand Down
Loading

0 comments on commit da2735f

Please sign in to comment.