Skip to content
Open
Show file tree
Hide file tree
Changes from 28 commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
35e78e3
MINIFICPP-2740 Rust bindings based on stable C API
martinzink May 13, 2026
512b5ec
rebase changes
martinzink Jun 22, 2026
187e07c
cargo fmt
martinzink Jun 25, 2026
ffc3b4a
cargo behave fix
martinzink Jun 26, 2026
67fdae7
small improvements
martinzink Jun 29, 2026
8da953e
cargo fmt
martinzink Jun 29, 2026
4024b26
update docs
Jul 1, 2026
9e306aa
fix clippy
Jul 1, 2026
123aaee
claude code review
martinzink Jul 1, 2026
3f63290
arm clippy fixes
martinzink Jul 1, 2026
f58cc91
add Send for CffiInputStream/CffiOutputStream
martinzink Jul 1, 2026
840db45
clippy fixes
martinzink Jul 1, 2026
ba6ad68
ci clippy changes
martinzink Jul 1, 2026
6b3e659
rebase fixes
martinzink Jul 6, 2026
f33babc
update manifest
martinzink Jul 6, 2026
b0f7d6b
c23 update
martinzink Jul 7, 2026
ad0bec5
cargo fmt
martinzink Jul 7, 2026
ebcbd63
update manifest
martinzink Jul 7, 2026
0dddb32
support c2x
martinzink Jul 7, 2026
e8a2505
tag docker image without explicit version
martinzink Jul 7, 2026
7b2807b
cargo_check -> cargo_fmt_check
martinzink Jul 7, 2026
d99eaa6
Renames:
martinzink Jul 20, 2026
ad70c8c
added tech preview disclaimer
martinzink Jul 20, 2026
671732e
apache short licenses in every source file
martinzink Jul 20, 2026
4074b0d
update README.md
martinzink Jul 20, 2026
ea4ef88
fix clippy
martinzink Jul 20, 2026
b09fd16
lordgamez review changes
martinzink Jul 21, 2026
2355d70
szaszm review changes
martinzink Jul 21, 2026
0e76e46
indent minifi_rs_playground/src/lib.rs macro
martinzink Jul 23, 2026
52fa5be
doc changes
martinzink Jul 23, 2026
1b00ee4
update errors.rs
martinzink Jul 23, 2026
d6ce9e5
ConvertMinifiStringView changes, README.md changes
martinzink Jul 23, 2026
c355d0a
Apply suggestions from code review
martinzink Jul 24, 2026
d6b140a
log errors in DispatchOnTrigger<SingleThreadedTrigger>::dispatch_on_t…
martinzink Jul 24, 2026
df4fd04
remove read_in_batches alltogether
martinzink Jul 24, 2026
12e0d80
review changes
martinzink Jul 24, 2026
39fffc4
manifest and docs update
martinzink Jul 24, 2026
adf68c1
read_stream fix
martinzink Jul 24, 2026
bf529a2
SAFETY docs
martinzink Jul 24, 2026
fc85700
manifest update
martinzink Jul 24, 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
665 changes: 654 additions & 11 deletions .github/references/ubuntu_22_04_clang_arm_manifest.json

Large diffs are not rendered by default.

68 changes: 65 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ concurrency:
env:
DOCKER_CMAKE_FLAGS: -DDOCKER_VERIFY_THREAD=3 -DUSE_SHARED_LIBS= -DSTRICT_GSL_CHECKS=AUDIT -DCI_BUILD=ON -DENABLE_AWS=ON -DENABLE_KAFKA=ON -DENABLE_MQTT=ON -DENABLE_AZURE=ON -DENABLE_SQL=ON \
-DENABLE_SPLUNK=ON -DENABLE_GCP=ON -DENABLE_OPC=ON -DENABLE_PYTHON_SCRIPTING=ON -DENABLE_LUA_SCRIPTING=ON -DENABLE_KUBERNETES=ON -DENABLE_TEST_PROCESSORS=ON -DENABLE_PROMETHEUS=ON \
-DENABLE_ELASTICSEARCH=ON -DENABLE_GRAFANA_LOKI=ON -DENABLE_COUCHBASE=ON -DENABLE_LLAMACPP=ON -DDOCKER_BUILD_ONLY=ON -DMINIFI_PERFORMANCE_TESTS=ON
-DENABLE_ELASTICSEARCH=ON -DENABLE_GRAFANA_LOKI=ON -DENABLE_COUCHBASE=ON -DENABLE_LLAMACPP=ON -DDOCKER_BUILD_ONLY=ON -DMINIFI_PERFORMANCE_TESTS=ON -DMINIFI_RUST=OFF
CCACHE_DIR: ${{ GITHUB.WORKSPACE }}/.ccache
jobs:
macos_xcode:
Expand Down Expand Up @@ -52,6 +52,7 @@ jobs:
-DENABLE_SFTP=ON
-DENABLE_SPLUNK=ON
-DENABLE_SQL=ON
-DMINIFI_RUST=ON
-DENABLE_TEST_PROCESSORS=ON
-DFORCE_COLORED_OUTPUT=OFF
-DLIBC_STATIC=OFF
Expand Down Expand Up @@ -161,6 +162,7 @@ jobs:
-DENABLE_SQL=ON
-DENABLE_TEST_PROCESSORS=ON
-DENABLE_WEL=ON
-DMINIFI_RUST=ON
-DFORCE_COLORED_OUTPUT=ON
-DINSTALLER_MERGE_MODULES=OFF
-DMINIFI_FAIL_ON_WARNINGS=ON
Expand Down Expand Up @@ -261,6 +263,7 @@ jobs:
-DENABLE_SPLUNK=ON
-DENABLE_SQL=ON
-DENABLE_SYSTEMD=ON
-DMINIFI_RUST=ON
-DENABLE_TEST_PROCESSORS=ON
-DFORCE_COLORED_OUTPUT=ON
-DMINIFI_FAIL_ON_WARNINGS=ON
Expand Down Expand Up @@ -552,8 +555,55 @@ jobs:
with:
name: behavex_output_modular
path: build/behavex_output_modular
rusty_docker_tests:
name: "Rusty Docker integration tests (x86_64)"
needs: docker_build
runs-on: ubuntu-24.04
timeout-minutes: 20
steps:
- id: checkout
uses: actions/checkout@v6
- id: run_cmake
name: Run CMake
run: |
mkdir build
cd build
cmake ${DOCKER_CMAKE_FLAGS} ..
- name: Download artifact
uses: actions/download-artifact@v8
with:
name: minifi_docker
path: build
- name: Load Docker image
run: |
docker load --input ./build/minifi_docker.tar | awk '{print $NF}' | xargs -I {} docker tag {} apacheminificpp:behave
- id: install_deps
name: Install dependencies for Docker Verify
run: |
sudo apt update
sudo apt install -y python3-virtualenv
- id: test
name: Docker Verify
working-directory: ./minifi_rust
run: cargo behave-alpine
- name: Test Reporter
if: always()
uses: dorny/test-reporter@a43b3a5f7366b97d083190328d2c652e1a8b6aa2 # v3
with:
name: Docker integration tests
path: minifi_rust/minifi_rs_behave/output/behave/*.xml
reporter: java-junit
only-summary: 'true'
list-tests: 'failed'
list-suites: 'failed'
- name: Upload artifact
if: failure()
uses: actions/upload-artifact@v7
with:
name: minifi_rs_behave
path: minifi_rust/minifi_rs_behave/output
linters:
name: "C++ lint + Shellcheck + Flake8"
name: "C++ lint + Shellcheck + Flake8 + Cargo fmt check + Clippy check"
runs-on: ubuntu-22.04-arm
timeout-minutes: 15
steps:
Expand All @@ -578,8 +628,20 @@ jobs:
continue-on-error: true
run: ./run_flake8.sh .

- id: cargo_fmt_check
name: Cargo fmt check
continue-on-error: true
run: cargo fmt --all --check
working-directory: minifi_rust

Comment on lines 605 to +636
- id: clippy_check
name: Clippy check
continue-on-error: true
run: cargo clippy --workspace --all-targets -- -D warnings
working-directory: minifi_rust

- name: Check Linter Statuses
if: steps.cpp_lint.outcome == 'failure' || steps.shellcheck.outcome == 'failure' || steps.flake8_check.outcome == 'failure'
if: steps.cpp_lint.outcome == 'failure' || steps.shellcheck.outcome == 'failure' || steps.flake8_check.outcome == 'failure' || steps.cargo_fmt_check.outcome == 'failure' || steps.clippy_check.outcome == 'failure'
run: |
echo "One or more linters failed. Failing the workflow."
exit 1
10 changes: 10 additions & 0 deletions .github/workflows/create-release-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,16 @@ jobs:
with:
name: ${{ matrix.platform.rpm-artifact }}
path: build/nifi-minifi-cpp-*.rpm

- id: cargo
working-directory: minifi_rust
run: |
cargo build --release

- uses: actions/upload-artifact@v7
with:
name: minifi_rust_extensions
path: minifi_rust/target/release/*.so
windows_VS2022:
name: "Windows Server 2025 x86_64"
runs-on: windows-2025
Expand Down
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -849,3 +849,5 @@ if (MINIFI_ADVANCED_CODE_COVERAGE)
endif()

add_subdirectory(packaging)

add_subdirectory(minifi_rust)
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,13 @@ def setup_controller_service(context: MinifiTestContext, service_name: str):
context.get_or_create_default_minifi_container().flow_definition.controller_services.append(controller_service)


@given('a {class_name} controller service named "{service_name}" is set up and the "{property_name}" property set to "{property_value}"')
def setup_controller_service_with_property(context: MinifiTestContext, class_name: str, service_name: str, property_name: str, property_value: str):
controller_service = ControllerService(class_name=class_name, service_name=service_name)
controller_service.add_property(property_name, property_value)
context.get_or_create_default_minifi_container().flow_definition.controller_services.append(controller_service)


@given('a {service_name} controller service is set up and the "{property_name}" property set to "{property_value}"')
def setup_controller_service_with_property(context: MinifiTestContext, service_name: str, property_name: str, property_value: str):
controller_service = ControllerService(class_name=service_name, service_name=service_name)
Expand Down
1 change: 1 addition & 0 deletions cmake/MiNiFiOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ add_minifi_option(ENABLE_EXECUTE_PROCESS "Enable ExecuteProcess processor" OFF)
add_minifi_option(ENABLE_CONTROLLER "Enables the build of MiNiFi controller binary." ON)
add_minifi_option(ENABLE_LLAMACPP "Enables llama.cpp support." ON)
add_minifi_option(ENABLE_OPC "Instructs the build system to enable the OPC extension" ON)
add_minifi_option(MINIFI_RUST "Enables the build of rust based extensions." OFF)

Comment thread
martinzink marked this conversation as resolved.
set_minifi_cache_variable(CUSTOM_MALLOC OFF "Overwrite malloc implementation.")
set_property(CACHE CUSTOM_MALLOC PROPERTY STRINGS "jemalloc" "mimalloc" "rpmalloc" OFF)
Expand Down
3 changes: 2 additions & 1 deletion docker/rockylinux/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,12 @@ COPY . ${MINIFI_BASE_DIR}
# Install the system dependencies needed for a build
# ccache is in EPEL
RUN dnf -y install epel-release && dnf -y install gcc-toolset-14 gcc-toolset-14-libatomic-devel sudo git which make libarchive ccache ca-certificates perl patch bison flex libtool cmake rpmdevtools && \
if echo "$MINIFI_OPTIONS" | grep -q "MINIFI_RUST=ON"; then dnf -y install rust cargo clang; fi && \
if echo "$MINIFI_OPTIONS" | grep -q "ENABLE_ALL=ON\|ENABLE_PYTHON_SCRIPTING=ON\|ENABLE_OPC=ON"; then dnf -y --enablerepo=devel install python3-devel; fi && \
if echo "$MINIFI_OPTIONS" | grep -q "ENABLE_SFTP=ON" && [ "${DOCKER_SKIP_TESTS}" == "OFF" ]; then dnf -y install java-1.8.0-openjdk maven; fi

RUN cd $MINIFI_BASE_DIR && \
ln -s /usr/bin/ccache /usr/lib64/ccache/c++
ln -sfn /usr/bin/ccache /usr/lib64/ccache/c++

# Setup minificpp user
RUN groupadd -g ${GID} ${USER} && useradd -g ${GID} ${USER} && \
Expand Down
19 changes: 19 additions & 0 deletions minifi_rust/.cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[target.aarch64-unknown-linux-musl]
rustflags = ["-C", "target-feature=-crt-static"]

[target.x86_64-unknown-linux-musl]
rustflags = ["-C", "target-feature=-crt-static"]

[target.aarch64-apple-darwin]
rustflags = ["-C", "link-arg=-undefined", "-C", "link-arg=dynamic_lookup"]

[target.x86_64-apple-darwin]
rustflags = ["-C", "link-arg=-undefined", "-C", "link-arg=dynamic_lookup"]

[alias]
behave = ["run", "--release", "--bin", "minifi_rs_behave"]
behave-alpine = ["run", "--release", "--bin", "minifi_rs_behave", "--", "--alpine"]
behave-debian = ["run", "--release", "--bin", "minifi_rs_behave", "--", "--debian"]

[env]
MINIFI_SDK_PATH="../"
12 changes: 12 additions & 0 deletions minifi_rust/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.git
.vscode
.gitmodules
.idea
output
features
target/debug
target/release/build
target/release/deps
target/release/.fingerprint
target/release/examples
target/release/incremental
7 changes: 7 additions & 0 deletions minifi_rust/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.idea
output
venv
.venv
target
.DS_Store
Cargo.lock
48 changes: 48 additions & 0 deletions minifi_rust/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# 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.
#

if (NOT MINIFI_RUST)
return()
endif()

include(FetchContent)

# Corrosion is a tool for integrating Rust into an existing CMake project
FetchContent_Declare(Corrosion
URL https://github.com/corrosion-rs/corrosion/archive/refs/tags/v0.6.1.tar.gz
URL_HASH SHA256=e9e95b1ee2bad52681f347993fb1a5af5cce458c5ce8a2636c9e476e4babf8e3
SYSTEM)

FetchContent_MakeAvailable(Corrosion)

set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")

corrosion_import_crate(MANIFEST_PATH ${CMAKE_CURRENT_SOURCE_DIR}/Cargo.toml)

if (NOT ENABLE_TEST_PROCESSORS)
set_target_properties(cargo-build_minifi_rs_playground PROPERTIES EXCLUDE_FROM_ALL TRUE)
endif()

include(CTest)

add_test(
NAME cargo_tests
COMMAND cargo test
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
9 changes: 9 additions & 0 deletions minifi_rust/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[workspace]
resolver = "3"
members = ["minifi_native_sys", "minifi_native", "minifi_native_macros", "minifi_rs_behave", "extensions/*"]

[profile.release]
panic = "abort"

[profile.dev]
panic = "abort"
Loading
Loading