Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Release Profile for distribution/proxy-native #21657

Merged
merged 1 commit into from
Oct 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/nightly-graalvm-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
- uses: actions/checkout@v3
- uses: graalvm/setup-graalvm@v1
with:
version: '22.2.0'
version: 'dev'
java-version: '17'
components: 'native-image'
github-token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
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 scratch
FROM oraclelinux:9-slim

MAINTAINER ShardingSphere "[email protected]"

Expand Down
31 changes: 30 additions & 1 deletion distribution/proxy-native/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<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.14</native.maven.plugin.version>
<native.maven.plugin.version>0.9.16</native.maven.plugin.version>
</properties>

<dependencies>
Expand Down Expand Up @@ -67,6 +67,35 @@
</dependencies>

<profiles>
<profile>
<id>release</id>
Copy link
Member Author

@linghengqian linghengqian Oct 20, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For this PR, if you need a binary package of release distribution/proxy-native, you need to execute ./mvnw -am -pl distribution/proxy-native -B -DskipTests -Dmaven.javadoc.skip=true -Dcheckstyle.skip=true - Dspotless.apply.skip=true -Pnative,release clean package. This requires both GraalVM CE for JDK 17 and the native-image component of GraalVM installed on the device on which this command is executed. In which document should I state this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@strongduanmu I just want to make sure, does such a release note exist? 🤣

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@linghengqian I think we can add this requirement in ShardingSphere release document——https://shardingsphere.apache.org/community/cn/involved/release/shardingsphere/#3-%E5%8F%91%E5%B8%83-docker.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • I looked at the Dockerfile and release process of distribution/proxy and found that all the raw materials used to build the Docker Image are extracted from the .tar.gz file generated by the release profile.

  • Is this an unwritten rule, or is it possible to make a Docker Image without making an intermediate .tar.gz? I'm not quite sure if .tar.gz is only needed for distributing binaries.

  • If this provision exists, I will fix the Dockerfile of distribution/proxy-native when opening a new PR.

<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>
<build>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<!--
~ Licensed to the Apache Software Foundation (ASF) under one or more
~ contributor license agreements. See the NOTICE file distributed with
~ this work for additional information regarding copyright ownership.
~ The ASF licenses this file to You under the Apache License, Version 2.0
~ (the "License"); you may not use this file except in compliance with
~ the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->

<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd">
<id>shardingsphere-proxy-native-bin</id>
<formats>
<format>tar.gz</format>
</formats>
<includeBaseDirectory>true</includeBaseDirectory>
<baseDirectory>${project.build.finalName}-shardingsphere-proxy-native-bin</baseDirectory>

<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>
<includes>
<include>logback.xml</include>
</includes>
<outputDirectory>conf</outputDirectory>
<fileMode>0644</fileMode>
</fileSet>
<fileSet>
<directory>src/main/release-docs</directory>
<includes>
<include>**/*</include>
</includes>
<outputDirectory>/</outputDirectory>
</fileSet>
</fileSets>
</assembly>
364 changes: 364 additions & 0 deletions distribution/proxy-native/src/main/release-docs/LICENSE

Large diffs are not rendered by default.

Loading