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

wusheng pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/skywalking-graalvm-distro.git


The following commit(s) were added to refs/heads/main by this push:
     new 8923e73  Add CI workflow, distribution packaging, and license header 
check
8923e73 is described below

commit 8923e737e31215321f897ba197a6dcb33780d098
Author: Wu Sheng <[email protected]>
AuthorDate: Thu Feb 19 21:29:51 2026 +0800

    Add CI workflow, distribution packaging, and license header check
    
    - GHA CI with two jobs: license-header (skywalking-eyes) and
      build-graal-jvm-distro (style check, compile, test, dist build)
    - Distribution assembly: bin/ (start/stop scripts), config/, libs/, VERSION
    - Startup script ensures classpath ordering for same-FQCN overrides
    - Makefile targets: compile, test, javadoc, dist, build-distro
    - .licenserc.yaml for Apache-2.0 header enforcement
    
    Co-Authored-By: Claude Opus 4.6 <[email protected]>
---
 .github/workflows/ci.yml                           | 69 ++++++++++++++++
 .licenserc.yaml                                    | 46 +++++++++++
 Makefile                                           | 24 +++++-
 oap-graalvm-server/pom.xml                         | 58 ++++++++++++++
 .../src/main/assembly/bin/oapService.sh            | 64 +++++++++++++++
 .../src/main/assembly/bin/oapServiceStop.sh        | 45 +++++++++++
 .../src/main/assembly/distribution.xml             | 93 ++++++++++++++++++++++
 7 files changed, 396 insertions(+), 3 deletions(-)

diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
new file mode 100644
index 0000000..5c558d1
--- /dev/null
+++ b/.github/workflows/ci.yml
@@ -0,0 +1,69 @@
+# 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.
+
+name: CI
+
+on:
+  push:
+    branches: [ main ]
+  pull_request:
+    branches: [ main ]
+
+concurrency:
+  group: ci-${{ github.ref }}
+  cancel-in-progress: true
+
+jobs:
+  license-header:
+    name: License Header Check
+    runs-on: ubuntu-latest
+    steps:
+      - name: Checkout
+        uses: actions/checkout@v4
+
+      - name: Check license headers
+        uses: apache/skywalking-eyes/header@main
+
+  build-graal-jvm-distro:
+    name: Build GraalVM JVM Distro
+    runs-on: ubuntu-latest
+
+    steps:
+      - name: Checkout with submodules
+        uses: actions/checkout@v4
+        with:
+          submodules: recursive
+
+      - name: Set up GraalVM JDK 25
+        uses: graalvm/setup-graalvm@v1
+        with:
+          java-version: '25'
+          distribution: 'graalvm'
+          cache: 'maven'
+
+      - name: Build SkyWalking submodule
+        run: make build-skywalking
+
+      - name: Style check + Compile
+        run: make compile
+
+      - name: Javadoc
+        run: make javadoc
+
+      - name: Test
+        run: make test
+
+      - name: Build distribution
+        run: make build-distro
diff --git a/.licenserc.yaml b/.licenserc.yaml
new file mode 100644
index 0000000..54e964a
--- /dev/null
+++ b/.licenserc.yaml
@@ -0,0 +1,46 @@
+#
+# 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.
+#
+header:
+  license:
+    spdx-id: Apache-2.0
+    copyright-owner: Apache Software Foundation
+
+  paths:
+    - '**/*.java'
+    - '**/*.xml'
+    - '**/*.yml'
+    - '**/*.yaml'
+    - '**/*.sh'
+    - '**/*.properties'
+    - 'Makefile'
+
+  paths-ignore:
+    - 'skywalking/**'
+    - '.mvn/**'
+    - '**/target/**'
+    - '**/*.md'
+    - '**/*.json'
+    - '**/*.txt'
+    - '**/*.iml'
+    - 'LICENSE'
+    - 'NOTICE'
+    - '.gitmodules'
+    - '.gitignore'
+
+  comment: on-failure
diff --git a/Makefile b/Makefile
index cdeb4bd..44ecbc0 100644
--- a/Makefile
+++ b/Makefile
@@ -19,7 +19,7 @@ SW_VERSION := $(shell grep '<revision>' skywalking/pom.xml | 
head -1 | sed 's/.*
 MVN := ./mvnw
 MVN_ARGS := -Dskywalking.version=$(SW_VERSION)
 
-.PHONY: all clean build init-submodules build-skywalking build-distro info
+.PHONY: all clean build init-submodules build-skywalking build-distro compile 
test javadoc dist info
 
 all: build
 
@@ -35,13 +35,31 @@ init-submodules:
 build-skywalking: init-submodules
        cd skywalking && ../mvnw flatten:flatten install -DskipTests 
-Dmaven.javadoc.skip=true -Dcheckstyle.skip=true
 
-# Build the distro modules
+# Compile only (no tests)
+compile:
+       $(MVN) clean compile -DskipTests $(MVN_ARGS)
+
+# Run tests (includes compile)
+test:
+       $(MVN) clean test $(MVN_ARGS)
+
+# Generate javadoc (validates javadoc correctness)
+javadoc:
+       $(MVN) javadoc:javadoc -DskipTests $(MVN_ARGS)
+
+# Build the distro modules (compile + test + package + assembly)
 build-distro:
        $(MVN) clean package $(MVN_ARGS)
 
+# Show the distribution directory
+dist: build-distro
+       @echo "Distribution created at:"
+       @echo "  
oap-graalvm-server/target/oap-graalvm-jvm-distro/oap-graalvm-jvm-distro/"
+       @echo "  oap-graalvm-server/target/oap-graalvm-jvm-distro.tar.gz"
+
 # Full build: skywalking first, then distro
 build: build-skywalking build-distro
 
 clean:
        $(MVN) clean $(MVN_ARGS)
-       cd skywalking && ../mvnw clean
\ No newline at end of file
+       cd skywalking && ../mvnw clean
diff --git a/oap-graalvm-server/pom.xml b/oap-graalvm-server/pom.xml
index b0c7c83..da64740 100644
--- a/oap-graalvm-server/pom.xml
+++ b/oap-graalvm-server/pom.xml
@@ -323,6 +323,64 @@
                     </argLine>
                 </configuration>
             </plugin>
+            <!-- Generate VERSION file with pom version + git commit ID -->
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-antrun-plugin</artifactId>
+                <version>3.1.0</version>
+                <executions>
+                    <execution>
+                        <id>generate-version-file</id>
+                        <phase>prepare-package</phase>
+                        <goals>
+                            <goal>run</goal>
+                        </goals>
+                        <configuration>
+                            <target>
+                                <exec executable="git" 
outputproperty="git.commit.id" failonerror="false">
+                                    <arg value="rev-parse"/>
+                                    <arg value="--short"/>
+                                    <arg value="HEAD"/>
+                                </exec>
+                                <exec executable="git" 
outputproperty="git.commit.id.full" failonerror="false">
+                                    <arg value="rev-parse"/>
+                                    <arg value="HEAD"/>
+                                </exec>
+                                <tstamp>
+                                    <format property="build.timestamp" 
pattern="yyyy-MM-dd'T'HH:mm:ssZ"/>
+                                </tstamp>
+                                <echo 
file="${project.build.directory}/VERSION">version=${project.version}
+git.commit.id=${git.commit.id.full}
+git.commit.id.short=${git.commit.id}
+build.time=${build.timestamp}
+</echo>
+                            </target>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            <!-- Assemble distribution folder: bin/ + config/ + libs/ + 
VERSION -->
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-assembly-plugin</artifactId>
+                <version>3.7.1</version>
+                <configuration>
+                    <finalName>oap-graalvm-jvm-distro</finalName>
+                    <appendAssemblyId>false</appendAssemblyId>
+                    <descriptors>
+                        
<descriptor>src/main/assembly/distribution.xml</descriptor>
+                    </descriptors>
+                </configuration>
+                <executions>
+                    <execution>
+                        <id>create-dist</id>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>single</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
         </plugins>
     </build>
 </project>
\ No newline at end of file
diff --git a/oap-graalvm-server/src/main/assembly/bin/oapService.sh 
b/oap-graalvm-server/src/main/assembly/bin/oapService.sh
new file mode 100644
index 0000000..026b080
--- /dev/null
+++ b/oap-graalvm-server/src/main/assembly/bin/oapService.sh
@@ -0,0 +1,64 @@
+#!/usr/bin/env sh
+# 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.
+
+PRG="$0"
+PRGDIR=$(dirname "$PRG")
+[ -z "$OAP_HOME" ] && OAP_HOME=$(cd "$PRGDIR/.." > /dev/null || exit 1; pwd)
+
+OAP_LOG_DIR="${OAP_LOG_DIR:-${OAP_HOME}/logs}"
+JAVA_OPTS="${JAVA_OPTS:- -Xms256M -Xmx4096M}"
+
+if [ ! -d "${OAP_LOG_DIR}" ]; then
+    mkdir -p "${OAP_LOG_DIR}"
+fi
+
+_RUNJAVA=${JAVA_HOME}/bin/java
+[ -z "$JAVA_HOME" ] && _RUNJAVA=java
+
+# Build classpath: config directory first, then libs.
+# IMPORTANT: oap-graalvm-server-*.jar MUST appear on the classpath BEFORE
+# upstream JARs (server-core, meter-analyzer, log-analyzer) to ensure
+# same-FQCN replacement classes shadow the upstream originals.
+# See DISTRO-POLICY.md Challenge 5 for details.
+CLASSPATH="$OAP_HOME/config"
+
+# Add oap-graalvm-server JAR first (contains same-FQCN override classes)
+for i in "$OAP_HOME"/libs/oap-graalvm-server-*.jar
+do
+    CLASSPATH="$CLASSPATH:$i"
+done
+
+# Add precompiler-generated JAR second (contains pre-compiled OAL/MAL/LAL 
classes + manifests)
+for i in "$OAP_HOME"/libs/precompiler-*-generated.jar
+do
+    CLASSPATH="$CLASSPATH:$i"
+done
+
+# Add all remaining JARs
+for i in "$OAP_HOME"/libs/*.jar
+do
+    case "$i" in
+        */oap-graalvm-server-*) continue ;;
+        *precompiler-*-generated*) continue ;;
+    esac
+    CLASSPATH="$CLASSPATH:$i"
+done
+
+OAP_OPTIONS=" -Doap.logDir=${OAP_LOG_DIR}"
+
+eval exec "\"$_RUNJAVA\" ${JAVA_OPTS} ${OAP_OPTIONS} -classpath $CLASSPATH 
org.apache.skywalking.oap.server.graalvm.GraalVMOAPServerStartUp \
+        2>${OAP_LOG_DIR}/oap.log"
diff --git a/oap-graalvm-server/src/main/assembly/bin/oapServiceStop.sh 
b/oap-graalvm-server/src/main/assembly/bin/oapServiceStop.sh
new file mode 100644
index 0000000..00ac548
--- /dev/null
+++ b/oap-graalvm-server/src/main/assembly/bin/oapServiceStop.sh
@@ -0,0 +1,45 @@
+#!/usr/bin/env sh
+# 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.
+
+PRG="$0"
+PRGDIR=$(dirname "$PRG")
+[ -z "$OAP_HOME" ] && OAP_HOME=$(cd "$PRGDIR/.." > /dev/null || exit 1; pwd)
+
+PID=$(ps -ef | grep GraalVMOAPServerStartUp | grep -v grep | awk '{print $2}')
+
+if [ -z "$PID" ]; then
+    echo "No SkyWalking GraalVM OAP server is running."
+    exit 0
+fi
+
+echo "Stopping SkyWalking GraalVM OAP server (PID: $PID)..."
+kill "$PID"
+
+# Wait for process to stop
+TIMEOUT=30
+while [ $TIMEOUT -gt 0 ]; do
+    if ! kill -0 "$PID" 2>/dev/null; then
+        echo "SkyWalking GraalVM OAP server stopped."
+        exit 0
+    fi
+    sleep 1
+    TIMEOUT=$((TIMEOUT - 1))
+done
+
+echo "Force killing SkyWalking GraalVM OAP server (PID: $PID)..."
+kill -9 "$PID" 2>/dev/null
+echo "SkyWalking GraalVM OAP server stopped."
diff --git a/oap-graalvm-server/src/main/assembly/distribution.xml 
b/oap-graalvm-server/src/main/assembly/distribution.xml
new file mode 100644
index 0000000..4005bb0
--- /dev/null
+++ b/oap-graalvm-server/src/main/assembly/distribution.xml
@@ -0,0 +1,93 @@
+<!--
+  ~ 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.2.0";
+          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+          xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.2.0
+                              http://maven.apache.org/xsd/assembly-2.2.0.xsd";>
+    <id>dist</id>
+    <formats>
+        <format>dir</format>
+        <format>tar.gz</format>
+    </formats>
+    <includeBaseDirectory>true</includeBaseDirectory>
+    <baseDirectory>oap-graalvm-jvm-distro</baseDirectory>
+
+    <fileSets>
+        <!-- bin/ — startup and shutdown scripts -->
+        <fileSet>
+            <directory>src/main/assembly/bin</directory>
+            <outputDirectory>bin</outputDirectory>
+            <fileMode>0755</fileMode>
+        </fileSet>
+        <!-- VERSION file generated by maven-antrun-plugin -->
+        <fileSet>
+            <directory>${project.build.directory}</directory>
+            <outputDirectory>.</outputDirectory>
+            <includes>
+                <include>VERSION</include>
+            </includes>
+        </fileSet>
+        <!-- config/ — application.yml -->
+        <fileSet>
+            <directory>src/main/resources</directory>
+            <outputDirectory>config</outputDirectory>
+            <includes>
+                <include>application.yml</include>
+            </includes>
+        </fileSet>
+        <!-- config/ — upstream OAL/MAL/LAL scripts and other resource files 
-->
+        <fileSet>
+            
<directory>${project.basedir}/../skywalking/oap-server/server-starter/src/main/resources</directory>
+            <outputDirectory>config</outputDirectory>
+            <includes>
+                <include>oal/**</include>
+                <include>ui-initialized-templates/**</include>
+                <include>alarm-settings.yml</include>
+                <include>component-libraries.yml</include>
+                <include>endpoint-name-grouping.yml</include>
+                <include>gateways.yml</include>
+                <include>hierarchy-definition.yml</include>
+                <include>metadata-service-mapping.yaml</include>
+                <include>network-address-alias.yml</include>
+                <include>service-apdex-threshold.yml</include>
+                <include>trace-sampling-policy-settings.yml</include>
+            </includes>
+        </fileSet>
+        <!-- logs/ — empty directory for runtime logs -->
+        <fileSet>
+            <directory>.</directory>
+            <outputDirectory>logs</outputDirectory>
+            <excludes>
+                <exclude>**/*</exclude>
+            </excludes>
+        </fileSet>
+    </fileSets>
+
+    <dependencySets>
+        <!--
+          libs/ — all dependency JARs.
+          The startup script controls classpath ordering:
+          oap-graalvm-server-*.jar is added FIRST to ensure same-FQCN
+          replacement classes shadow upstream originals.
+        -->
+        <dependencySet>
+            <outputDirectory>libs</outputDirectory>
+            <useProjectArtifact>true</useProjectArtifact>
+        </dependencySet>
+    </dependencySets>
+</assembly>

Reply via email to