You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by fg...@apache.org on 2022/04/07 14:32:20 UTC

[nifi-minifi-cpp] branch main updated (47000876a -> 692cf0002)

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

fgerlits pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/nifi-minifi-cpp.git


    from 47000876a MINIFICPP-1788 flush old bins on expiration
     new e683bd7f9 MINIFICPP-1782 Upgrade and verify interworking with latest NiFi version
     new 692cf0002 MINIFICPP-1793 Fix GCP toggling in bootstrap.sh

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 CMakeLists.txt                                           |  1 +
 bstrp_functions.sh                                       |  2 +-
 docker/test/integration/features/http.feature            | 16 ++++++++++++++++
 docker/test/integration/minifi/core/ImageStore.py        | 16 ----------------
 docker/test/integration/minifi/core/NifiContainer.py     |  6 ++++--
 .../flow_serialization/Nifi_flow_xml_serializer.py       |  2 +-
 docker/test/integration/steps/steps.py                   |  5 +++++
 7 files changed, 28 insertions(+), 20 deletions(-)


[nifi-minifi-cpp] 02/02: MINIFICPP-1793 Fix GCP toggling in bootstrap.sh

Posted by fg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

fgerlits pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/nifi-minifi-cpp.git

commit 692cf000223378979455832bc293a716405e4cba
Author: Gabor Gyimesi <ga...@gmail.com>
AuthorDate: Mon Apr 4 11:30:27 2022 +0200

    MINIFICPP-1793 Fix GCP toggling in bootstrap.sh
    
    Signed-off-by: Ferenc Gerlits <fg...@gmail.com>
    
    This closes #1295
---
 CMakeLists.txt     | 1 +
 bstrp_functions.sh | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 99ebfd10e..cb4339e92 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -116,6 +116,7 @@ option(ENABLE_OPENWSMAN "Enables the Openwsman extensions." OFF)
 option(ENABLE_AZURE "Enables Azure support." OFF)
 option(ENABLE_ENCRYPT_CONFIG "Enables build of encrypt-config binary." ON)
 option(ENABLE_SPLUNK "Enable Splunk support" OFF)
+option(ENABLE_GCP "Enable Google Cloud support" OFF)
 option(DOCKER_BUILD_ONLY "Disables all targets except docker build scripts. Ideal for systems without an up-to-date compiler." OFF)
 option(ENABLE_KUBERNETES "Enables the Kubernetes extensions." OFF)
 option(ENABLE_TEST_PROCESSORS "Enables test processors" OFF)
diff --git a/bstrp_functions.sh b/bstrp_functions.sh
index 501ddc39c..dca46d7d7 100755
--- a/bstrp_functions.sh
+++ b/bstrp_functions.sh
@@ -450,7 +450,7 @@ read_feature_options(){
     z) ToggleFeature NANOFI_ENABLED ;;
     aa) ToggleFeature SPLUNK_ENABLED ;;
     ab) ToggleFeature KUBERNETES_ENABLED ;;
-    ac) ToogleFeature GCP_ENABLED ;;
+    ac) ToggleFeature GCP_ENABLED ;;
     1) ToggleFeature TESTS_ENABLED ;;
     2) EnableAllFeatures ;;
     3) ToggleFeature JNI_ENABLED;;


[nifi-minifi-cpp] 01/02: MINIFICPP-1782 Upgrade and verify interworking with latest NiFi version

Posted by fg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

fgerlits pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/nifi-minifi-cpp.git

commit e683bd7f9431a69bfe5ef651ca066c9aa9d53c0c
Author: Gabor Gyimesi <ga...@gmail.com>
AuthorDate: Thu Mar 24 13:29:12 2022 +0100

    MINIFICPP-1782 Upgrade and verify interworking with latest NiFi version
    
    Signed-off-by: Ferenc Gerlits <fg...@gmail.com>
    
    This closes #1286
---
 docker/test/integration/features/http.feature            | 16 ++++++++++++++++
 docker/test/integration/minifi/core/ImageStore.py        | 16 ----------------
 docker/test/integration/minifi/core/NifiContainer.py     |  6 ++++--
 .../flow_serialization/Nifi_flow_xml_serializer.py       |  2 +-
 docker/test/integration/steps/steps.py                   |  5 +++++
 5 files changed, 26 insertions(+), 19 deletions(-)

diff --git a/docker/test/integration/features/http.feature b/docker/test/integration/features/http.feature
index 044818b1b..62844dcaa 100644
--- a/docker/test/integration/features/http.feature
+++ b/docker/test/integration/features/http.feature
@@ -77,3 +77,19 @@ Feature: Sending data using InvokeHTTP to a receiver using ListenHTTP
 
     When both instances start up
     Then at least one empty flowfile is placed in the monitored directory in less than 120 seconds
+
+  Scenario: A MiNiFi instance transfers data to a NiFi instance with message body
+    Given a GetFile processor with the "Input Directory" property set to "/tmp/input"
+    And the "Keep Source File" property of the GetFile processor is set to "true"
+    And a file with the content "test" is present in "/tmp/input"
+    And a InvokeHTTP processor with the "Remote URL" property set to "http://nifi:8081/contentListener"
+    And the "HTTP Method" property of the InvokeHTTP processor is set to "POST"
+    And the "success" relationship of the GetFile processor is connected to the InvokeHTTP
+
+    And a NiFi flow with the name "nifi" is set up
+    And a ListenHTTP processor with the "Listening Port" property set to "8081" in the "nifi" flow
+    And a PutFile processor with the "Directory" property set to "/tmp/output" in the "nifi" flow
+    And the "success" relationship of the ListenHTTP processor is connected to the PutFile
+
+    When both instances start up
+    Then at least one flowfile with the content "test" is placed in the monitored directory in less than 120 seconds
diff --git a/docker/test/integration/minifi/core/ImageStore.py b/docker/test/integration/minifi/core/ImageStore.py
index f6cf1dfef..d9f850e61 100644
--- a/docker/test/integration/minifi/core/ImageStore.py
+++ b/docker/test/integration/minifi/core/ImageStore.py
@@ -14,7 +14,6 @@
 # limitations under the License.
 
 
-from .NifiContainer import NifiContainer
 from .MinifiContainer import MinifiContainer
 import logging
 import tarfile
@@ -49,8 +48,6 @@ class ImageStore:
             image = self.__build_minifi_cpp_image_with_provenance_repo()
         elif container_engine == "http-proxy":
             image = self.__build_http_proxy_image()
-        elif container_engine == "nifi":
-            image = self.__build_nifi_image()
         elif container_engine == "postgresql-server":
             image = self.__build_postgresql_server_image()
         elif container_engine == "kafka-broker":
@@ -135,19 +132,6 @@ class ImageStore:
 
         return self.__build_image(dockerfile)
 
-    def __build_nifi_image(self):
-        dockerfile = dedent(r"""\
-                FROM {base_image}
-                USER root
-                RUN sed -i -e 's/^\(nifi.remote.input.host\)=.*/\1={name}/' {nifi_root}/conf/nifi.properties
-                RUN sed -i -e 's/^\(nifi.remote.input.socket.port\)=.*/\1=5000/' {nifi_root}/conf/nifi.properties
-                USER nifi
-                """.format(name='nifi',
-                           base_image='apache/nifi:' + NifiContainer.NIFI_VERSION,
-                           nifi_root=NifiContainer.NIFI_ROOT))
-
-        return self.__build_image(dockerfile)
-
     def __build_postgresql_server_image(self):
         dockerfile = dedent("""\
                 FROM {base_image}
diff --git a/docker/test/integration/minifi/core/NifiContainer.py b/docker/test/integration/minifi/core/NifiContainer.py
index df72227af..a9ea539b0 100644
--- a/docker/test/integration/minifi/core/NifiContainer.py
+++ b/docker/test/integration/minifi/core/NifiContainer.py
@@ -23,12 +23,13 @@ import os
 
 
 class NifiContainer(FlowContainer):
-    NIFI_VERSION = '1.7.0'
+    NIFI_VERSION = '1.16.0'
     NIFI_ROOT = '/opt/nifi/nifi-' + NIFI_VERSION
 
     def __init__(self, config_dir, name, vols, network, image_store, command=None):
         if not command:
             entry_command = (r"sed -i -e 's/^\(nifi.remote.input.host\)=.*/\1={name}/' {nifi_root}/conf/nifi.properties && "
+                             r"sed -i -e 's/^\(nifi.sensitive.props.key\)=.*/\1=secret_key_12345/' {nifi_root}/conf/nifi.properties && "
                              r"cp /tmp/nifi_config/flow.xml.gz {nifi_root}/conf && /opt/nifi/scripts/start.sh").format(name=name, nifi_root=NifiContainer.NIFI_ROOT)
             command = ["/bin/sh", "-c", entry_command]
         super().__init__(config_dir, name, 'nifi', vols, network, image_store, command)
@@ -54,11 +55,12 @@ class NifiContainer(FlowContainer):
         logging.info('Creating and running nifi docker container...')
         self.__create_config()
         self.client.containers.run(
-            self.image_store.get_image(self.get_engine()),
+            "apache/nifi:" + NifiContainer.NIFI_VERSION,
             detach=True,
             name=self.name,
             hostname=self.name,
             network=self.network.name,
             entrypoint=self.command,
+            environment=["NIFI_WEB_HTTP_PORT=8080"],
             volumes=self.vols)
         logging.info('Added container \'%s\'', self.name)
diff --git a/docker/test/integration/minifi/flow_serialization/Nifi_flow_xml_serializer.py b/docker/test/integration/minifi/flow_serialization/Nifi_flow_xml_serializer.py
index 22af97610..727d68d43 100644
--- a/docker/test/integration/minifi/flow_serialization/Nifi_flow_xml_serializer.py
+++ b/docker/test/integration/minifi/flow_serialization/Nifi_flow_xml_serializer.py
@@ -183,7 +183,7 @@ class Nifi_flow_xml_serializer:
                     continue
                 proc_property.append(proc_property_name)
                 proc_property_value = Element('value')
-                proc_property_value.text = property_value
+                proc_property_value.text = str(property_value)
                 proc_property.append(proc_property_value)
                 conn_destination.append(proc_property)
 
diff --git a/docker/test/integration/steps/steps.py b/docker/test/integration/steps/steps.py
index 8f1b6143b..389241dc8 100644
--- a/docker/test/integration/steps/steps.py
+++ b/docker/test/integration/steps/steps.py
@@ -312,6 +312,11 @@ def step_impl(context, source_name):
         container.add_start_node(source)
 
 
+@given("a NiFi flow with the name \"{flow_name}\" is set up")
+def step_impl(context, flow_name):
+    context.test.acquire_container(flow_name, 'nifi')
+
+
 # HTTP proxy setup
 @given("the http proxy server is set up")
 @given("a http proxy server is set up accordingly")