You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by wu...@apache.org on 2023/08/11 02:38:18 UTC

[skywalking] branch master updated: Make builds reproducible for automatic releases CI (#11204)

This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking.git


The following commit(s) were added to refs/heads/master by this push:
     new 49bf7a171a Make builds reproducible for automatic releases CI (#11204)
49bf7a171a is described below

commit 49bf7a171ae372accc4c5ed0d0b39b8c92cb70ec
Author: kezhenxu94 <ke...@apache.org>
AuthorDate: Fri Aug 11 10:38:12 2023 +0800

    Make builds reproducible for automatic releases CI (#11204)
---
 .github/workflows/skywalking.yaml |  4 +++-
 docs/en/changes/changes.md        |  1 +
 docs/en/guides/benchmark.md       |  2 ++
 oap-server/microbench/pom.xml     |  4 ++--
 oap-server/pom.xml                | 10 +++++++++-
 pom.xml                           |  4 +++-
 6 files changed, 20 insertions(+), 5 deletions(-)

diff --git a/.github/workflows/skywalking.yaml b/.github/workflows/skywalking.yaml
index 650d0408e8..fc679c0151 100644
--- a/.github/workflows/skywalking.yaml
+++ b/.github/workflows/skywalking.yaml
@@ -175,9 +175,11 @@ jobs:
           cache: "maven"
       - name: Build distribution tar
         run: |
-          ./mvnw clean install javadoc:javadoc -B -q \
+          ./mvnw clean install javadoc:javadoc -B -q -Pall \
             -Dmaven.test.skip \
             -Dcheckstyle.skip
+      - name: Verify builds are reproducible
+        run: ./mvnw -Dmaven.test.skip clean verify artifact:compare -Pall
       - uses: actions/upload-artifact@v3
         name: Upload distribution tar
         with:
diff --git a/docs/en/changes/changes.md b/docs/en/changes/changes.md
index 0adf037526..0f0e649a3b 100644
--- a/docs/en/changes/changes.md
+++ b/docs/en/changes/changes.md
@@ -6,6 +6,7 @@
 * Maven artifact `skywalking-log-recevier-plugin` is renamed to `skywalking-log-receiver-plugin`.
 * Bump up cli version 0.11 to 0.12.
 * Bump up the version of ASF parent pom to v30.
+* Make builds reproducible for automatic releases CI.
 
 #### OAP Server
 
diff --git a/docs/en/guides/benchmark.md b/docs/en/guides/benchmark.md
index b303dfeac7..5f11314bbc 100644
--- a/docs/en/guides/benchmark.md
+++ b/docs/en/guides/benchmark.md
@@ -5,6 +5,8 @@ We have a module called `microbench` which performs a series of micro-benchmark
 Make new JMH tests extend the `org.apache.skywalking.oap.server.microbench.base.AbstractMicrobenchmark`
 to customize runtime conditions (Measurement, Fork, Warmup, etc.).
 
+You can build the jar with command `./mvnw -Dmaven.test.skip -DskipTests -pl :microbench package -am -Pbenchmark`.
+
 JMH tests could run as a normal unit test. And they could run as an independent uber jar via `java -jar benchmark.jar` for all benchmarks,
 or via `java -jar /benchmarks.jar exampleClassName` for a specific test.
 
diff --git a/oap-server/microbench/pom.xml b/oap-server/microbench/pom.xml
index a6a06f014f..e0fd871dc7 100644
--- a/oap-server/microbench/pom.xml
+++ b/oap-server/microbench/pom.xml
@@ -27,10 +27,10 @@
     <artifactId>microbench</artifactId>
 
     <properties>
-        <jmh.version>1.25</jmh.version>
+        <jmh.version>1.36</jmh.version>
         <slf4j.version>1.7.30</slf4j.version>
         <uberjar.name>benchmarks</uberjar.name>
-        <maven-shade-plugin.version>3.1.1</maven-shade-plugin.version>
+        <maven-shade-plugin.version>3.2.3</maven-shade-plugin.version>
     </properties>
 
     <dependencies>
diff --git a/oap-server/pom.xml b/oap-server/pom.xml
index 942a44816c..c38981a9d5 100755
--- a/oap-server/pom.xml
+++ b/oap-server/pom.xml
@@ -46,12 +46,20 @@
         <module>server-tools</module>
         <module>server-fetcher-plugin</module>
         <module>server-health-checker</module>
-        <module>microbench</module>
         <module>ai-pipeline</module>
         <module>mqe-grammar</module>
         <module>mqe-rt</module>
     </modules>
 
+    <profiles>
+        <profile>
+            <id>benchmark</id>
+            <modules>
+                <module>microbench</module>
+            </modules>
+        </profile>
+    </profiles>
+
     <properties>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
     </properties>
diff --git a/pom.xml b/pom.xml
index cbaeac8da1..052a6c22b6 100755
--- a/pom.xml
+++ b/pom.xml
@@ -150,6 +150,8 @@
         <maven.compiler.source>11</maven.compiler.source>
         <maven.compiler.target>11</maven.compiler.target>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+        <!-- `project.build.outputTimestamp` is required for reproducible builds: https://maven.apache.org/guides/mini/guide-reproducible-builds.html -->
+        <project.build.outputTimestamp>0</project.build.outputTimestamp>
 
         <powermock.version>2.0.9</powermock.version>
         <checkstyle.version>6.18</checkstyle.version>
@@ -372,7 +374,7 @@
                     <artifactId>antlr4-maven-plugin</artifactId>
                     <version>${antlr.version}</version>
                 </plugin>
-                
+
                 <plugin>
                     <groupId>org.apache.maven.plugins</groupId>
                     <artifactId>maven-release-plugin</artifactId>