Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
d18e42d
[improve][build] Improve the gradle build to use similar bestpractice…
lhotari Apr 1, 2026
32d6848
Improve RAT check, also ignore .kotlin directory to fix CI
lhotari Apr 1, 2026
55218e3
Use Jetty 9 for Alluxio
lhotari Apr 1, 2026
8976c58
Log test execution
lhotari Apr 1, 2026
c610ed5
fail fast when tests fail
lhotari Apr 1, 2026
f060868
Test with IPv4
lhotari Apr 1, 2026
0eb559b
Support showing test output with -PtestShowOutput
lhotari Apr 1, 2026
2ad07d6
Add logging to starting
lhotari Apr 1, 2026
8c36313
Improve test
lhotari Apr 1, 2026
e0022f6
Exclude jetty-bom from enforcedPlatform added by java-conventions
lhotari Apr 1, 2026
993033b
Make alluxio dependencies match the versions used in branch-4.2
lhotari Apr 1, 2026
80a5909
Fix overriding versions
lhotari Apr 1, 2026
e19b38f
Fix a bug in the sink implementation
lhotari Apr 1, 2026
720db60
Fix another bug
lhotari Apr 1, 2026
f5e2ef8
Fix issue with test
lhotari Apr 1, 2026
fcbae7b
Simplify
lhotari Apr 1, 2026
cd2a748
Document the extension
lhotari Apr 1, 2026
8df1002
Fix nar project artifacts
lhotari Apr 2, 2026
1501462
Fix ConnectorDocGenerator
lhotari Apr 2, 2026
c803d8e
Fix alluxio dependency in docs projects to avoid conflicts
lhotari Apr 2, 2026
d06f91a
Add pulsar-io-gen.sh adapted to gradle
lhotari Apr 2, 2026
c925780
Rely on BOMs for versions
lhotari Apr 2, 2026
6c36ca8
Further cleanup
lhotari Apr 2, 2026
d92a836
Cleanup
lhotari Apr 2, 2026
1c425bc
Define project group and version in the correct location
lhotari Apr 2, 2026
50a92c2
configure the shaded client netty property
lhotari Apr 2, 2026
e837a15
Cleanup debezium by using bom
lhotari Apr 2, 2026
f875916
Use pulsar-bom to align versions
lhotari Apr 2, 2026
3e1db0a
Assume alias ends with .bom (-bom in .toml file)
lhotari Apr 2, 2026
f89a5d9
Cleanup
lhotari Apr 2, 2026
61701b2
Add solution for including pulsar modules in nar files
lhotari Apr 2, 2026
6235258
Use pulsar 4.2.0 pulsar-io libraries
lhotari Apr 2, 2026
4dab409
Improve pulsarConnectorsDependencies extension
lhotari Apr 2, 2026
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
71 changes: 71 additions & 0 deletions .github/actions/setup-gradle/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
#
# 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: Setup Gradle
description: Sets up Gradle with Develocity or public build scan publishing by default
inputs:
develocity-access-key:
description: 'Develocity access key for authenticated build scans'
required: false
default: ''
build-scan-publish:
description: 'Whether to publish build scans or use Develocity when the access key is set'
required: false
default: 'true'
cache-read-only:
description: 'Whether the Gradle cache is read-only'
required: false
default: ${{ github.event.repository != null && github.ref_name != github.event.repository.default_branch }}
add-job-summary:
description: 'When to add a job summary'
required: false
default: 'always'
runs:
using: composite
steps:
- name: Set Develocity Project ID and configure custom settings
if: ${{ inputs.develocity-access-key != '' && inputs.build-scan-publish == 'true' }}
shell: bash
run: |
mkdir -p ~/.gradle
touch ~/.gradle/gradle.properties
grep -q 'systemProp.develocity.projectId=' ~/.gradle/gradle.properties || echo systemProp.develocity.projectId=pulsar >> ~/.gradle/gradle.properties
grep -q 'systemProp.scan.uploadInBackground=' ~/.gradle/gradle.properties || echo systemProp.scan.uploadInBackground=false >> ~/.gradle/gradle.properties

- name: Setup Gradle with Develocity
if: ${{ inputs.develocity-access-key != '' && inputs.build-scan-publish == 'true' }}
uses: gradle/actions/setup-gradle@39e147cb9de83bb9910b8ef8bd7fff0ee20fcd6f
with:
develocity-injection-enabled: true
develocity-url: https://develocity.apache.org
# expected format is develocity.apache.org:<access-key>
develocity-access-key: ${{ inputs.develocity-access-key }}
build-scan-publish: ${{ inputs.build-scan-publish }}
cache-read-only: ${{ inputs.cache-read-only }}
add-job-summary: ${{ inputs.add-job-summary }}

- name: Setup Gradle
if: ${{ !(inputs.develocity-access-key != '' && inputs.build-scan-publish == 'true') }}
uses: gradle/actions/setup-gradle@39e147cb9de83bb9910b8ef8bd7fff0ee20fcd6f
with:
build-scan-publish: ${{ inputs.build-scan-publish }}
build-scan-terms-of-use-url: 'https://gradle.com/terms-of-service'
build-scan-terms-of-use-agree: 'yes'
cache-read-only: ${{ inputs.cache-read-only }}
add-job-summary: ${{ inputs.add-job-summary }}
80 changes: 80 additions & 0 deletions .github/actions/tune-runner-vm/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
#
# 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: Tune Runner VM performance
description: tunes the GitHub Runner VM operation system
runs:
using: composite
steps:
- shell: bash
run: |
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
echo "::group::Configure and tune OS"
# Ensure that reverse lookups for current hostname are handled properly
# Add the current IP address, long hostname and short hostname record to /etc/hosts file
echo -e "$(ip addr show eth0 | grep "inet\b" | awk '{print $2}' | cut -d/ -f1)\t$(hostname -f) $(hostname -s)" | sudo tee -a /etc/hosts

# The default vm.swappiness setting is 60 which has a tendency to start swapping when memory
# consumption is high.
# Set vm.swappiness=1 to avoid swapping and allow high RAM usage
echo 1 | sudo tee /proc/sys/vm/swappiness

# use "madvise" Linux Transparent HugePages (THP) setting
# https://www.kernel.org/doc/html/latest/admin-guide/mm/transhuge.html
# "madvise" is generally a better option than the default "always" setting
# recommendation from https://netflixtechblog.com/bending-pause-times-to-your-will-with-generational-zgc-256629c9386b
echo madvise | sudo tee /sys/kernel/mm/transparent_hugepage/enabled
echo advise | sudo tee /sys/kernel/mm/transparent_hugepage/shmem_enabled
echo defer | sudo tee /sys/kernel/mm/transparent_hugepage/defrag
echo 1 | sudo tee /sys/kernel/mm/transparent_hugepage/khugepaged/defrag

# tune filesystem mount options, https://www.kernel.org/doc/Documentation/filesystems/ext4.txt
# commit=999999, effectively disables automatic syncing to disk (default is every 5 seconds)
# nobarrier/barrier=0, loosen data consistency on system crash (no negative impact to empheral CI nodes)
sudo mount -o remount,nodiscard,commit=999999,barrier=0 / || true
if mountpoint -q /mnt; then
sudo mount -o remount,nodiscard,commit=999999,barrier=0 /mnt || true
fi
# disable discard/trim at device level since remount with nodiscard doesn't seem to be effective
# https://www.spinics.net/lists/linux-ide/msg52562.html
for i in /sys/block/sd*/queue/discard_max_bytes; do
echo 0 | sudo tee $i
done
# disable unnecessary timers
sudo systemctl stop fstrim.timer fstrim.service \
podman-auto-update.timer sysstat-collect.timer sysstat-summary.timer \
phpsessionclean.timer man-db.timer motd-news.timer \
dpkg-db-backup.timer e2scrub_all.timer \
update-notifier-download.timer update-notifier-motd.timer || true

# stop unnecessary services
sudo systemctl stop php8.3-fpm.service ModemManager.service \
multipathd.socket multipathd.service udisks2.service walinuxagent.service || true

echo '::endgroup::'

# show memory
echo "::group::Available Memory"
free -m
echo '::endgroup::'
# show disk
echo "::group::Available diskspace"
df -BM
echo "::endgroup::"
fi
41 changes: 29 additions & 12 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,26 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
- uses: actions/checkout@v6

- name: Tune Runner VM
uses: ./.github/actions/tune-runner-vm

- uses: actions/setup-java@v5
with:
distribution: ${{ env.JDK_DISTRIBUTION }}
java-version: ${{ env.JDK_VERSION }}
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c

- name: Build all modules
run: ./gradlew build -x test
- name: License check (RAT)
run: ./gradlew rat
- name: Setup Gradle
uses: ./.github/actions/setup-gradle
with:
develocity-access-key: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
cache-read-only: false

- name: Build and check licenses
run: >-
./gradlew -x test -x nar build rat spotlessCheck
--no-configuration-cache

tests:
name: Tests - ${{ matrix.name }}
Expand All @@ -64,18 +73,26 @@ jobs:
- name: Connectors
tasks: test
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
- uses: actions/checkout@v6

- name: Tune Runner VM
uses: ./.github/actions/tune-runner-vm

- uses: actions/setup-java@v5
with:
distribution: ${{ env.JDK_DISTRIBUTION }}
java-version: ${{ env.JDK_VERSION }}
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c

- name: Setup Gradle
uses: ./.github/actions/setup-gradle
with:
develocity-access-key: ${{ secrets.DEVELOCITY_ACCESS_KEY }}

- name: Run tests
run: ./gradlew ${{ matrix.tasks }}
run: ./gradlew ${{ matrix.tasks }} -PtestFailFast=true
- name: Upload test reports
if: failure()
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: ${{ matrix.name }}-test-reports
path: '**/build/reports/tests/'
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Gradle
.gradle/
.kotlin/
build/
**/build/

Expand Down
48 changes: 48 additions & 0 deletions .ratignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Build artifacts
**/build/**
**/target/**
# Gradle files
.gradle/**
gradle/wrapper/**
**/.gradle/**
**/.kotlin/**
**/gradle/wrapper/**
gradlew
gradlew.bat
gradle/libs.versions.toml
# Generated Flatbuffer files (Kinesis)
**/org/apache/pulsar/io/kinesis/fbs/*.java
# Services files
**/META-INF/services/*
# Certificates and keys
**/*.crt
**/*.key
**/*.csr
**/*.pem
**/*.srl
**/certificate-authority/serial
**/certificate-authority/index.txt
**/*.json
**/*.txt
# Project/IDE files
**/*.md
.github/**
**/*.nar
**/.gitignore
**/.gitattributes
**/*.iml
**/.classpath
**/.project
**/.settings
**/.idea/**
**/.vscode/**
# Avro schemas
**/*.avsc
# Patch files
**/*.patch
# Hidden directories
.*/**
# Test output
**/test-output/**
# Log files
**/*.log
37 changes: 31 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,26 +66,48 @@ mounting them into the `apachepulsar/pulsar` Docker image.
|-----------|-------------|
| Kafka Connect Adaptor | Run Kafka Connect connectors on Pulsar |

## Prerequisites

- **JDK 17** or later — e.g. [Eclipse Temurin](https://adoptium.net/en-GB/temurin/releases?version=17&os=any&arch=any)
or [Amazon Corretto](https://docs.aws.amazon.com/corretto/latest/corretto-17-ug/what-is-corretto-17.html)

> **Note**: This project includes a [Gradle Wrapper](https://docs.gradle.org/current/userguide/gradle_wrapper.html)
> so no separate Gradle installation is needed. Use `./gradlew` on Linux/macOS and `gradlew.bat` on Windows.

## Building

Compile and assemble all modules:

```bash
./gradlew build -x test
./gradlew assemble
```

To build all connector NARs:
NAR files are produced under each connector's `build/libs/` directory.

Build a specific connector:

```bash
./gradlew build -x test
./gradlew :elastic-search:assemble
```

NAR files are produced under each connector's `build/libs/` directory.

To build the distribution tarball containing all connector NARs:
Build the distribution package containing all connector NARs:

```bash
./gradlew :distribution:pulsar-io-distribution:assemble
```

Check source code license headers:

```bash
./gradlew rat spotlessCheck
```

Auto-fix license headers:

```bash
./gradlew spotlessApply
```

## Running Tests

```bash
Expand All @@ -94,6 +116,9 @@ To build the distribution tarball containing all connector NARs:

# Specific connector
./gradlew :elastic-search:test

# Specific test class
./gradlew :elastic-search:test --tests "ElasticSearchSinkTests"
```

## Using Connectors
Expand Down
3 changes: 2 additions & 1 deletion aerospike/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
*/

plugins {
alias(libs.plugins.nar)
id("pulsar-connectors.java-conventions")
id("pulsar-connectors.nar-conventions")
}
dependencies {
implementation(libs.pulsar.io.core)
Expand Down
27 changes: 23 additions & 4 deletions alluxio/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,33 @@
*/

plugins {
alias(libs.plugins.nar)
id("pulsar-connectors.java-conventions")
id("pulsar-connectors.nar-conventions")
}

val alluxioVersion = "2.9.4"

// Alluxio requires older versions of netty, grpc, and jetty than the shared platform provides.
// Exclude these BOMs from the enforced platform so the alluxio-specific versions below can apply.
pulsarConnectorsDependencies {
exclude(libs.jetty.bom)
exclude(libs.netty.bom)
exclude(libs.grpc.bom)
}

dependencies {
// Alluxio-compatible BOMs — these override the shared platform versions.
implementation(enforcedPlatform(libs.jetty9.bom))
implementation(enforcedPlatform("io.netty:netty-bom:4.1.100.Final"))
implementation(enforcedPlatform("io.grpc:grpc-bom:1.37.0"))

implementation(libs.pulsar.io.core)
implementation("org.alluxio:alluxio-core-client-fs:2.9.3")
implementation("org.alluxio:alluxio-core-client-fs:$alluxioVersion")
implementation(libs.jackson.dataformat.yaml)
implementation(libs.guava)

testImplementation(libs.pulsar.client)
testImplementation("org.alluxio:alluxio-minicluster:2.9.3")
}
testImplementation("org.alluxio:alluxio-minicluster:$alluxioVersion") {
exclude(group = "org.glassfish", module = "javax.el")
}
}
Loading