david-streamlio commented on code in PR #25883:
URL: https://github.com/apache/pulsar/pull/25883#discussion_r3360613962


##########
pulsar-client/src/main/resources/META-INF/native-image/org.apache.pulsar/pulsar-client-original/resource-config.json:
##########
@@ -0,0 +1,12 @@
+{
+  "resources": {
+    "includes": [
+      {
+        "pattern": "\\Qorg/asynchttpclient/config/ahc-default.properties\\E"
+      },
+      {
+        "pattern": "\\Qorg/asynchttpclient/config/ahc.properties\\E"
+      }

Review Comment:
   Yes — `pulsar-client-admin-original` now ships its own native-image metadata 
(`reflect-config.json`, `resource-config.json`, `native-image.properties`) 
under 
`pulsar-client-admin/src/main/resources/META-INF/native-image/org.apache.pulsar/pulsar-client-admin-original/`.
 The admin `resource-config.json` covers the AsyncHttpClient 
`ahc-default.properties`/`ahc.properties` resources, and 
`native-image.properties` marks `AsyncHttpConnector` for runtime 
initialization. A `NativeImageConfigAdminTest` static validator checks these 
files.



##########
tests/pom.xml:
##########


Review Comment:
   Good catch — the branch was based on the Maven-era master. I've rebased onto 
the current Gradle master and dropped the `tests/pom.xml` change. The module is 
now registered in the top-level `settings.gradle.kts` alongside the other test 
modules.



##########
tests/pulsar-client-native-image/pom.xml:
##########


Review Comment:
   Done. Replaced the Maven `pom.xml` with a `build.gradle.kts` modeled on 
`tests/pulsar-client-all-shade-test/build.gradle.kts`, using the GraalVM 
`native-build-tools` plugin (`org.graalvm.buildtools.native`, declared in 
`gradle/libs.versions.toml`). The plugin's `nativeCompile` builds 
`NativeImageTesterApp` into a binary (consuming the embedded 
`META-INF/native-image` metadata), and the TestNG `NativeImageSmokeTest` runs 
on the JVM and drives that binary via `ProcessBuilder`.



##########
.github/workflows/ci-pulsar-native-image.yaml:
##########
@@ -0,0 +1,78 @@
+#
+# 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 - Native Image
+on:
+  # Native-image builds are slow, so this does not run on every PR. It runs 
nightly,
+  # can be triggered manually, and on PRs that touch the native-image metadata 
or its test.
+  schedule:
+    - cron: '30 1 * * *'
+  workflow_dispatch:
+  pull_request:
+    branches:
+      - master
+    paths:
+      - '.github/workflows/ci-pulsar-native-image.yaml'
+      - '**/META-INF/native-image/**'
+      - 'tests/pulsar-client-native-image/**'
+
+env:
+  MAVEN_OPTS: -Xss1500k -Xmx1500m 
-Daether.connector.http.reuseConnections=false 
-Daether.connector.requestTimeout=60000 -Dhttp.keepAlive=false 
-Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryHandler.class=standard 
-Dmaven.wagon.http.retryHandler.count=3 
-Dmaven.wagon.http.serviceUnavailableRetryStrategy.class=standard 
-Dmaven.wagon.rto=60000
+
+jobs:
+  native-image-smoke-test:

Review Comment:
   Switched to the integration-test matrix as suggested. Deleted the standalone 
`ci-pulsar-native-image.yaml` and added a `NATIVE_IMAGE` entry to the 
`integration-tests` matrix in `pulsar-ci.yaml` (with a conditional 
`graalvm/setup-graalvm` step and a 40-min timeout), backed by a 
`test_group_native_image` function in 
`pulsar-build/run_integration_group_gradle.sh`. Quick build mode (below) should 
keep it well under the 20-min concern; I'll confirm the actual wall-clock on 
the first CI run.



##########
.github/workflows/ci-pulsar-native-image.yaml:
##########
@@ -0,0 +1,78 @@
+#
+# 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 - Native Image
+on:
+  # Native-image builds are slow, so this does not run on every PR. It runs 
nightly,
+  # can be triggered manually, and on PRs that touch the native-image metadata 
or its test.
+  schedule:
+    - cron: '30 1 * * *'
+  workflow_dispatch:
+  pull_request:
+    branches:
+      - master
+    paths:
+      - '.github/workflows/ci-pulsar-native-image.yaml'
+      - '**/META-INF/native-image/**'
+      - 'tests/pulsar-client-native-image/**'
+
+env:
+  MAVEN_OPTS: -Xss1500k -Xmx1500m 
-Daether.connector.http.reuseConnections=false 
-Daether.connector.requestTimeout=60000 -Dhttp.keepAlive=false 
-Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryHandler.class=standard 
-Dmaven.wagon.http.retryHandler.count=3 
-Dmaven.wagon.http.serviceUnavailableRetryStrategy.class=standard 
-Dmaven.wagon.rto=60000
+
+jobs:
+  native-image-smoke-test:

Review Comment:
   Added. The `build.gradle.kts` configures `graalvmNative { binaries.all { 
quickBuild = true } }` exactly as suggested.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to