From 13277aff16e18cc9b017e2b77098be9c1fb7ead8 Mon Sep 17 00:00:00 2001 From: Marton Szasz Date: Wed, 2 Oct 2024 17:01:31 +0200 Subject: [PATCH] MINIFICPP-2464 Drop the GPS extension Signed-off-by: Marton Szasz --- .github/workflows/ci.yml | 9 +- Extensions.md | 4 +- PROCESSORS.md | 24 ----- README.md | 9 -- Windows.md | 2 +- aptitude.sh | 2 - arch.sh | 2 - bootstrap.sh | 3 - bootstrap/package_manager.py | 7 +- bootstrap/system_dependency.py | 2 - bstrp_functions.sh | 2 - centos.sh | 2 - cmake/DockerConfig.cmake | 1 - cmake/FindLibGPS.cmake | 55 ------------ cmake/MiNiFiOptions.cmake | 1 - darwin.sh | 2 - debian.sh | 2 - docker/Dockerfile | 2 - docker/centos/Dockerfile | 3 +- docker/rockylinux/Dockerfile | 5 +- extensions/gps/CMakeLists.txt | 39 -------- extensions/gps/GetGPS.cpp | 135 ---------------------------- extensions/gps/GetGPS.h | 90 ------------------- extensions/gps/tests/CMakeLists.txt | 34 ------- extensions/gps/tests/GPSTests.cpp | 84 ----------------- fedora.sh | 2 - rheldistro.sh | 8 +- suse.sh | 8 +- 28 files changed, 12 insertions(+), 527 deletions(-) delete mode 100644 cmake/FindLibGPS.cmake delete mode 100644 extensions/gps/CMakeLists.txt delete mode 100644 extensions/gps/GetGPS.cpp delete mode 100644 extensions/gps/GetGPS.h delete mode 100644 extensions/gps/tests/CMakeLists.txt delete mode 100644 extensions/gps/tests/GPSTests.cpp diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 142b040d4d..7c3770f3cd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,7 +30,6 @@ jobs: -DENABLE_ENCRYPT_CONFIG=ON -DENABLE_EXPRESSION_LANGUAGE=ON -DENABLE_GCP=ON - -DENABLE_GPS=OFF -DENABLE_KUBERNETES=ON -DENABLE_LIBARCHIVE=ON -DENABLE_LIBRDKAFKA=ON @@ -137,7 +136,6 @@ jobs: -DENABLE_ENCRYPT_CONFIG=ON -DENABLE_EXPRESSION_LANGUAGE=ON -DENABLE_GCP=ON - -DENABLE_GPS=OFF -DENABLE_GRAFANA_LOKI=ON -DENABLE_KUBERNETES=ON -DENABLE_LIBARCHIVE=ON @@ -251,7 +249,6 @@ jobs: -DENABLE_ENCRYPT_CONFIG=ON -DENABLE_EXPRESSION_LANGUAGE=ON -DENABLE_GCP=OFF - -DENABLE_GPS=OFF -DENABLE_KUBERNETES=OFF -DENABLE_LIBARCHIVE=ON -DENABLE_LIBRDKAFKA=OFF @@ -350,7 +347,6 @@ jobs: -DENABLE_EXPRESSION_LANGUAGE=ON -DENABLE_EXECUTE_PROCESS=ON -DENABLE_GCP=ON - -DENABLE_GPS=ON -DENABLE_GRAFANA_LOKI=ON -DENABLE_KUBERNETES=ON -DENABLE_LIBARCHIVE=ON @@ -395,7 +391,7 @@ jobs: echo "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-16 main" | sudo tee -a /etc/apt/sources.list echo "deb-src http://apt.llvm.org/jammy/ llvm-toolchain-jammy-16 main" | sudo tee -a /etc/apt/sources.list sudo apt update - sudo apt install -y ccache libfl-dev libgps-dev clang-16 clang-tidy-16 libc++-16-dev libc++abi-16-dev libc++1-16 libc++abi1-16 libunwind-16 libsqliteodbc flake8 parallel + sudo apt install -y ccache libfl-dev clang-16 clang-tidy-16 libc++-16-dev libc++abi-16-dev libc++1-16 libc++abi1-16 libunwind-16 libsqliteodbc flake8 parallel echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV echo -e "127.0.0.1\t$HOSTNAME" | sudo tee -a /etc/hosts > /dev/null - id: free_disk_space @@ -507,8 +503,7 @@ jobs: run: | # rocky build can run out of the github runners' disk space if built with RelWithDebInfo so we keep the Release build here mkdir build && cd build && cmake -DUSE_SHARED_LIBS=ON -DCI_BUILD=ON -DCMAKE_BUILD_TYPE=Release -DSTRICT_GSL_CHECKS=AUDIT -DMINIFI_FAIL_ON_WARNINGS=OFF -DENABLE_AWS=ON -DENABLE_AZURE=ON \ - -DENABLE_ENCRYPT_CONFIG=ON -DENABLE_GPS=ON -DENABLE_LIBRDKAFKA=ON -DENABLE_MQTT=ON -DENABLE_OPC=ON \ - -DENABLE_OPENCV=ON -DENABLE_OPS=ON -DENABLE_SQL=ON -DENABLE_SYSTEMD=ON \ + -DENABLE_ENCRYPT_CONFIG=ON -DENABLE_LIBRDKAFKA=ON -DENABLE_MQTT=ON -DENABLE_OPC=ON -DENABLE_OPENCV=ON -DENABLE_OPS=ON -DENABLE_SQL=ON -DENABLE_SYSTEMD=ON \ -DENABLE_PYTHON_SCRIPTING=ON -DENABLE_LUA_SCRIPTING=ON -DENABLE_KUBERNETES=ON -DENABLE_GCP=ON -DENABLE_PROCFS=ON -DENABLE_PROMETHEUS=ON \ -DENABLE_ELASTICSEARCH=ON -DENABLE_GRAFANA_LOKI=ON -DDOCKER_SKIP_TESTS=OFF -DDOCKER_BUILD_ONLY=ON -DDOCKER_CCACHE_DUMP_LOCATION=${{ env.CCACHE_DIR }} .. && make rocky-test - name: cache save diff --git a/Extensions.md b/Extensions.md index 07fb211408..c156cc8b78 100644 --- a/Extensions.md +++ b/Extensions.md @@ -62,8 +62,8 @@ nifi.extension.path=../extensions/* ### Exlusion If you want to exclude some extensions from being loaded, without having to specify the rest, you can do so by prefixing the pattern with `!`. ``` -// This loads all extensions but the gps extension. (the exact name differs by platform: dylib, dll, so) -nifi.extension.path=../extensions/*,!../extensions/libminifi-gps.so +// This loads all extensions but the azure extension. (the exact name differs by platform: dylib, dll, so) +nifi.extension.path=../extensions/*,!../extensions/libminifi-azure.so ``` You could even exclude some subdirectory and then re-include specific extensions/subdirectories in that. diff --git a/PROCESSORS.md b/PROCESSORS.md index 293c317e41..ff84886732 100644 --- a/PROCESSORS.md +++ b/PROCESSORS.md @@ -49,7 +49,6 @@ limitations under the License. - [FocusArchiveEntry](#FocusArchiveEntry) - [GenerateFlowFile](#GenerateFlowFile) - [GetFile](#GetFile) -- [GetGPS](#GetGPS) - [GetTCP](#GetTCP) - [HashContent](#HashContent) - [InvokeHTTP](#InvokeHTTP) @@ -1124,29 +1123,6 @@ In the list below, the names of required properties appear in bold. Any other pr | success | All files are routed to success | -## GetGPS - -### Description - -Obtains GPS coordinates from the GPSDHost and port. - -### Properties - -In the list below, the names of required properties appear in bold. Any other properties (not in bold) are considered optional. The table also indicates any default values, and whether a property supports the NiFi Expression Language. - -| Name | Default Value | Allowable Values | Description | -|----------------|---------------|------------------|-----------------------------------------------------------| -| GPSD Host | localhost | | The host running the GPSD daemon | -| GPSD Port | 2947 | | The GPSD daemon port | -| GPSD Wait Time | 50000000 | | Timeout value for waiting for data from the GPSD instance | - -### Relationships - -| Name | Description | -|---------|---------------------------------| -| success | All files are routed to success | - - ## GetTCP ### Description diff --git a/README.md b/README.md index f325315e09..13c83f08f4 100644 --- a/README.md +++ b/README.md @@ -77,7 +77,6 @@ The next table outlines CMAKE flags that correspond with MiNiFi extensions. Exte | CivetWeb | [ListenHTTP](PROCESSORS.md#listenhttp) | -DENABLE_CIVET=ON | | Elasticsearch | [ElasticsearchCredentialsControllerService](CONTROLLERS.md#elasticsearchcredentialscontrollerservice)
[PostElasticsearch](PROCESSORS.md#postelasticsearch) | -DENABLE_ELASTICSEARCH=ON | | ExecuteProcess (Linux and macOS) | [ExecuteProcess](PROCESSORS.md#executeprocess) | -DENABLE_EXECUTE_PROCESS=ON | -| GPS (Linux and macOS) | [GetGPS](PROCESSORS.md#getgps) | -DENABLE_GPS=ON | | Google Cloud Platform | [DeleteGCSObject](PROCESSORS.md#deletegcsobject)
[FetchGCSObject](PROCESSORS.md#fetchgcsobject)
[GCPCredentialsControllerService](CONTROLLERS.md#gcpcredentialscontrollerservice)
[ListGCSBucket](PROCESSORS.md#listgcsbucket)
[PutGCSObject](PROCESSORS.md#putgcsobject) | -DENABLE_GCP=ON | | Grafana Loki | [PushGrafanaLokiREST](PROCESSORS.md#pushgrafanalokirest)
[PushGrafanaLokiGrpc](PROCESSORS.md#pushgrafanalokigrpc) | -DENABLE_GRAFANA_LOKI=ON | | Kafka | [PublishKafka](PROCESSORS.md#publishkafka)
[ConsumeKafka](PROCESSORS.md#consumekafka) | -DENABLE_LIBRDKAFKA=ON | @@ -138,7 +137,6 @@ and rebuild. #### System Libraries / Development Headers Required * Python 3 and development headers -- Required if Python support is enabled -* libgps-dev -- Required if building libGPS support * perl -- Required for OpenSSL configuration * NASM -- Required for OpenSSL only on Windows * jom (optional) -- for parallel build of OpenSSL on Windows @@ -206,8 +204,6 @@ dnf install python36-devel dnf install docker # (Optional) for system integration tests dnf install docker python-virtualenv -# If building with GPS support -dnf install gpsd-devel ``` ##### Aptitude based Linux Distributions @@ -235,8 +231,6 @@ apt install libpython3-dev apt install docker.io # (Optional) for system integration tests apt install docker.io python-virtualenv -# (Optional) If building with GPS support -apt install libgps-dev ``` ##### macOS Using Homebrew (with XCode Command Line Tools installed) @@ -260,8 +254,6 @@ brew link curl --force # (Optional) for building docker image/running system integration tests # Install docker using instructions at https://docs.docker.com/docker-for-mac/install/ sudo pip install virtualenv -# If building with GPS support -brew install gpsd # It is recommended that you install bison from source as HomeBrew now uses an incompatible version of Bison ``` @@ -327,7 +319,6 @@ This will set up a virtual environment in the bootstrap folder, and guide you th D. Python Scripting support ....Enabled E. Expression Language support .Enabled F. Kafka support ...............Enabled - I. GPS support .................Disabled K. Bustache Support ............Disabled L. Lua Scripting Support .......Enabled M. MQTT Support ................Enabled diff --git a/Windows.md b/Windows.md index 0317fe8156..a87abd85fd 100644 --- a/Windows.md +++ b/Windows.md @@ -122,7 +122,7 @@ A basic working CMake configuration can be inferred from the `win_build_vs.bat`. ``` mkdir build cd build -cmake -G "Visual Studio 17 2022" -A x64 -DMINIFI_INCLUDE_VC_REDIST_MERGE_MODULES=OFF -DTEST_CUSTOM_WEL_PROVIDER=OFF -DENABLE_SQL=OFF -DMINIFI_USE_REAL_ODBC_TEST_DRIVER=OFF -DCMAKE_BUILD_TYPE_INIT=Release -DCMAKE_BUILD_TYPE=Release -DWIN32=WIN32 -DENABLE_LIBRDKAFKA=OFF -DENABLE_AWS=OFF -DENABLE_PDH= -DENABLE_AZURE=OFF -DENABLE_SFTP=OFF -DENABLE_SPLUNK= -DENABLE_GCP= -DENABLE_OPENCV=OFF -DENABLE_PROMETHEUS=OFF -DENABLE_ELASTICSEARCH= -DUSE_SHARED_LIBS=OFF -DENABLE_CONTROLLER=ON -DENABLE_BUSTACHE=OFF -DENABLE_ENCRYPT_CONFIG=OFF -DENABLE_GPS=OFF -DENABLE_LUA_SCRIPTING=OFF -DENABLE_MQTT=OFF -DENABLE_OPC=OFF -DENABLE_OPS=OFF -DENABLE_PYTHON_SCRIPTING= -DBUILD_ROCKSDB=ON -DUSE_SYSTEM_UUID=OFF -DENABLE_LIBARCHIVE=ON -DENABLE_WEL=ON -DMINIFI_FAIL_ON_WARNINGS=OFF -DSKIP_TESTS=OFF .. +cmake -G "Visual Studio 17 2022" -A x64 -DMINIFI_INCLUDE_VC_REDIST_MERGE_MODULES=OFF -DTEST_CUSTOM_WEL_PROVIDER=OFF -DENABLE_SQL=OFF -DMINIFI_USE_REAL_ODBC_TEST_DRIVER=OFF -DCMAKE_BUILD_TYPE_INIT=Release -DCMAKE_BUILD_TYPE=Release -DWIN32=WIN32 -DENABLE_LIBRDKAFKA=OFF -DENABLE_AWS=OFF -DENABLE_PDH= -DENABLE_AZURE=OFF -DENABLE_SFTP=OFF -DENABLE_SPLUNK= -DENABLE_GCP= -DENABLE_OPENCV=OFF -DENABLE_PROMETHEUS=OFF -DENABLE_ELASTICSEARCH= -DUSE_SHARED_LIBS=OFF -DENABLE_CONTROLLER=ON -DENABLE_BUSTACHE=OFF -DENABLE_ENCRYPT_CONFIG=OFF -DENABLE_LUA_SCRIPTING=OFF -DENABLE_MQTT=OFF -DENABLE_OPC=OFF -DENABLE_OPS=OFF -DENABLE_PYTHON_SCRIPTING= -DBUILD_ROCKSDB=ON -DUSE_SYSTEM_UUID=OFF -DENABLE_LIBARCHIVE=ON -DENABLE_WEL=ON -DMINIFI_FAIL_ON_WARNINGS=OFF -DSKIP_TESTS=OFF .. msbuild /m nifi-minifi-cpp.sln /property:Configuration=Release /property:Platform=x64 copy minifi_main\Release\minifi.exe minifi_main\ cpack diff --git a/aptitude.sh b/aptitude.sh index dbf313e8d5..f1f642eb55 100644 --- a/aptitude.sh +++ b/aptitude.sh @@ -78,8 +78,6 @@ build_deps(){ INSTALLED+=("libtool") elif [ "$FOUND_VALUE" = "python" ]; then INSTALLED+=("libpython3-dev") - elif [ "$FOUND_VALUE" = "gpsd" ]; then - INSTALLED+=("libgps-dev") elif [ "$FOUND_VALUE" = "libarchive" ]; then INSTALLED+=("liblzma-dev") fi diff --git a/arch.sh b/arch.sh index 5114535b8f..47cb533135 100644 --- a/arch.sh +++ b/arch.sh @@ -58,8 +58,6 @@ build_deps(){ INSTALLED+=("libtool") elif [ "$FOUND_VALUE" = "python" ]; then INSTALLED+=("python") - elif [ "$FOUND_VALUE" = "gpsd" ]; then - INSTALLED+=("gpsd") elif [ "$FOUND_VALUE" = "libarchive" ]; then INSTALLED+=("libarchive") fi diff --git a/bootstrap.sh b/bootstrap.sh index 3a4af2e925..45e630ade2 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -277,9 +277,6 @@ add_option EXPRESSION_LANGUAGE_ENABLED ${TRUE} "ENABLE_EXPRESSION_LANGUAGE" add_dependency EXPRESSION_LANGUAGE_ENABLED "bison" add_dependency EXPRESSION_LANGUAGE_ENABLED "flex" -add_option GPS_ENABLED ${FALSE} "ENABLE_GPS" -add_dependency GPS_ENABLED "gpsd" - add_option AWS_ENABLED ${TRUE} "ENABLE_AWS" add_option KAFKA_ENABLED ${TRUE} "ENABLE_LIBRDKAFKA" diff --git a/bootstrap/package_manager.py b/bootstrap/package_manager.py index 38ffe36373..99a51b4d34 100644 --- a/bootstrap/package_manager.py +++ b/bootstrap/package_manager.py @@ -118,8 +118,7 @@ def install(self, dependencies: Dict[str, Set[str]]) -> bool: return self._install(dependencies=dependencies, install_cmd="sudo apt install -y", replace_dict={"libarchive": {"liblzma-dev"}, - "python": {"libpython3-dev"}, - "gpsd": {"libgps-dev"}}) + "python": {"libpython3-dev"}}) def _get_installed_packages(self) -> Set[str]: result = subprocess.run(['dpkg', '--get-selections'], text=True, capture_output=True, check=True) @@ -150,8 +149,7 @@ def install(self, dependencies: Dict[str, Set[str]]) -> bool: install_cmd = "sudo dnf install -y" return self._install(dependencies=dependencies, install_cmd=install_cmd, - replace_dict={"gpsd": {"gpsd-devel"}, - "python": {"python3-devel"}}) + replace_dict={"python": {"python3-devel"}}) def _get_installed_packages(self) -> Set[str]: result = subprocess.run(['dnf', 'list', 'installed'], text=True, capture_output=True, check=True) @@ -275,7 +273,6 @@ def install(self, dependencies: Dict[str, Set[str]]) -> bool: "bison": set(), "flex": set(), "libarchive": set(), - "gpsd": set(), "automake": set(), "autoconf": set(), "libtool": set(), diff --git a/bootstrap/system_dependency.py b/bootstrap/system_dependency.py index add420db0c..02050b579d 100644 --- a/bootstrap/system_dependency.py +++ b/bootstrap/system_dependency.py @@ -30,8 +30,6 @@ def _create_system_dependencies(minifi_options: MinifiOptions) -> Dict[str, Set[ system_dependencies['m4'] = {'m4'} if minifi_options.is_enabled("ENABLE_LIBARCHIVE"): system_dependencies['libarchive'] = {'libarchive'} - if minifi_options.is_enabled("ENABLE_GPS"): - system_dependencies['gpsd'] = {'gpsd'} if minifi_options.is_enabled("ENABLE_SQL"): system_dependencies['automake'] = {'automake'} system_dependencies['autoconf'] = {'autoconf'} diff --git a/bstrp_functions.sh b/bstrp_functions.sh index 3f037cd860..471938d05f 100755 --- a/bstrp_functions.sh +++ b/bstrp_functions.sh @@ -382,7 +382,6 @@ show_supported_features() { echo "D. Python Scripting support ....$(print_feature_status PYTHON_SCRIPTING_ENABLED)" echo "E. Expression Language support .$(print_feature_status EXPRESSION_LANGUAGE_ENABLED)" echo "F. Kafka support ...............$(print_feature_status KAFKA_ENABLED)" - echo "I. GPS support .................$(print_feature_status GPS_ENABLED)" echo "K. Bustache Support ............$(print_feature_status BUSTACHE_ENABLED)" echo "L. Lua Scripting Support .......$(print_feature_status LUA_SCRIPTING_ENABLED)" echo "M. MQTT Support ................$(print_feature_status MQTT_ENABLED)" @@ -432,7 +431,6 @@ read_feature_options(){ d) ToggleFeature PYTHON_SCRIPTING_ENABLED ;; e) ToggleFeature EXPRESSION_LANGUAGE_ENABLED ;; f) ToggleFeature KAFKA_ENABLED ;; - i) ToggleFeature GPS_ENABLED ;; k) ToggleFeature BUSTACHE_ENABLED ;; l) ToggleFeature LUA_SCRIPTING_ENABLED ;; m) ToggleFeature MQTT_ENABLED ;; diff --git a/centos.sh b/centos.sh index 35c94b7678..fb77f661fd 100644 --- a/centos.sh +++ b/centos.sh @@ -81,8 +81,6 @@ build_deps() { INSTALLED+=("automake") elif [ "$FOUND_VALUE" = "python" ]; then INSTALLED+=("python36-devel") - elif [ "$FOUND_VALUE" = "gpsd" ]; then - INSTALLED+=("gpsd-devel") elif [ "$FOUND_VALUE" = "libarchive" ]; then INSTALLED+=("xz-devel") INSTALLED+=("bzip2-devel") diff --git a/cmake/DockerConfig.cmake b/cmake/DockerConfig.cmake index 4870af5421..7346de263b 100644 --- a/cmake/DockerConfig.cmake +++ b/cmake/DockerConfig.cmake @@ -64,7 +64,6 @@ add_custom_target( -DENABLE_PROMETHEUS=OFF -DENABLE_GRPC_FOR_LOKI=OFF -DENABLE_PROCFS=OFF - -DENABLE_GPS=OFF -DENABLE_OPENCV=OFF -DENABLE_BUSTACHE=OFF -DENABLE_SFTP=OFF diff --git a/cmake/FindLibGPS.cmake b/cmake/FindLibGPS.cmake deleted file mode 100644 index 857df86efa..0000000000 --- a/cmake/FindLibGPS.cmake +++ /dev/null @@ -1,55 +0,0 @@ -# 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. - -# Find module for LIBGPS library and includes -# LIBGPS_FOUND - if system found LIBGPS library -# LIBGPS_INCLUDE_DIRS - The LIBGPS include directories -# LIBGPS_LIBRARIES - The libraries needed to use LIBGPS -# LIBGPS_DEFINITIONS - Compiler switches required for using LIBGPS - -# For OS X do not attempt to use the OS X application frameworks or bundles. -set (CMAKE_FIND_FRAMEWORK NEVER) -set (CMAKE_FIND_APPBUNDLE NEVER) - -find_path(LIBGPS_INCLUDE_DIR - NAMES gps.h - PATHS /usr/local/include /usr/include - DOC "LIBGPS include header" -) - -find_library(LIBGPS_LIBRARY - NAMES libgps.so libgps.dylib - PATHS /usr/local/lib /usr/lib/x86_64-linux-gnu /usr/lib/arm-linux-gnueabihf - DOC "LIBGPS library" -) - -find_library(LIBGPS_STATIC_LIBRARY - NAMES libgps.a - PATHS /usr/local/lib /usr/lib/x86_64-linux-gnu /usr/lib/arm-linux-gnueabihf - DOC "LIBGPS Static library" -) - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(LibGPS DEFAULT_MSG LIBGPS_INCLUDE_DIR LIBGPS_LIBRARY) - -if (LIBGPS_FOUND) - set(LIBGPS_LIBRARIES ${LIBGPS_LIBRARY} ) - set(LIBGPS_INCLUDE_DIRS ${LIBGPS_INCLUDE_DIR} ) - set(LIBGPS_DEFINITIONS ) -endif() - -mark_as_advanced(LIBGPS_ROOT_DIR LIBGPS_INCLUDE_DIR LIBGPS_LIBRARY LIBGPS_STATIC_LIBRARY) diff --git a/cmake/MiNiFiOptions.cmake b/cmake/MiNiFiOptions.cmake index e1f1032ca5..536e93557a 100644 --- a/cmake/MiNiFiOptions.cmake +++ b/cmake/MiNiFiOptions.cmake @@ -94,7 +94,6 @@ add_minifi_option(ENABLE_ROCKSDB "Enables the RocksDB extension." ON) add_minifi_option(ENABLE_LIBARCHIVE "Enables the lib archive extensions." ON) add_minifi_option(ENABLE_LZMA "Enables the liblzma build" ON) add_minifi_option(ENABLE_BZIP2 "Enables the bzip2 build" ON) -add_minifi_option(ENABLE_GPS "Enables the GPS extension." OFF) add_minifi_option(ENABLE_SQL "Enables the SQL Suite of Tools." ON) add_minifi_option(ENABLE_MQTT "Enables the mqtt extension." ON) add_minifi_option(ENABLE_LIBRDKAFKA "Enables the librdkafka extension." ON) diff --git a/darwin.sh b/darwin.sh index 3d5bdc296c..946a2e260a 100644 --- a/darwin.sh +++ b/darwin.sh @@ -89,8 +89,6 @@ build_deps(){ elif [ "$FOUND_VALUE" = "automake" ]; then INSTALLED+=("automake") INSTALLED+=("autoconf") - elif [ "$FOUND_VALUE" = "gpsd" ]; then - INSTALLED+=("gpsd") elif [ "$FOUND_VALUE" = "libarchive" ]; then INSTALLED+=("bzip2") elif [ "$FOUND_VALUE" = "libssh2" ]; then diff --git a/debian.sh b/debian.sh index 8ca34a7692..612106eafe 100644 --- a/debian.sh +++ b/debian.sh @@ -67,8 +67,6 @@ build_deps(){ INSTALLED+=("libpython3-dev") elif [ "$FOUND_VALUE" = "automake" ]; then INSTALLED+=("automake") - elif [ "$FOUND_VALUE" = "gpsd" ]; then - INSTALLED+=("libgps-dev") elif [ "$FOUND_VALUE" = "libarchive" ]; then INSTALLED+=("liblzma-dev") elif [ "$FOUND_VALUE" = "libssh2" ]; then diff --git a/docker/Dockerfile b/docker/Dockerfile index acacf3ce26..68e4645a15 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -48,7 +48,6 @@ RUN apk --no-cache add gcc \ cmake \ git \ patch \ - gpsd-dev \ python3-dev \ doxygen \ ccache @@ -94,7 +93,6 @@ ENV MINIFI_VERSIONED_HOME ${MINIFI_BASE_DIR}/nifi-minifi-cpp-${MINIFI_VERSION} RUN addgroup -g ${GID} ${USER} && adduser -u ${UID} -D -G ${USER} -g "" ${USER} && \ install -d -o ${USER} -g ${USER} ${MINIFI_BASE_DIR} && ln -s ${MINIFI_VERSIONED_HOME} ${MINIFI_HOME} && \ apk add --no-cache libstdc++ tzdata alpine-conf && \ - if echo "$MINIFI_OPTIONS" | grep -q "ENABLE_GPS=ON"; then apk add --no-cache gpsd; fi && \ if echo "$MINIFI_OPTIONS" | grep -q "ENABLE_PYTHON_SCRIPTING=ON"; then apk add --no-cache python3; fi # Copy built minifi distribution from builder diff --git a/docker/centos/Dockerfile b/docker/centos/Dockerfile index 141e8f1e9c..e2eec731dd 100644 --- a/docker/centos/Dockerfile +++ b/docker/centos/Dockerfile @@ -42,9 +42,8 @@ ENV USER minificpp RUN mkdir -p $MINIFI_BASE_DIR COPY . ${MINIFI_BASE_DIR} -# gpsd-devel and ccache are in EPEL +# ccache is in EPEL RUN ulimit -n 1024000 && yum -y install epel-release && yum -y install sudo git which make libarchive ccache ca-certificates perl-IPC-Cmd && \ - if echo "$MINIFI_OPTIONS" | grep -q "ENABLE_GPS=ON"; then yum -y install gpsd-devel; fi && \ if echo "$MINIFI_OPTIONS" | grep -q "ENABLE_PYTHON_SCRIPTING=ON"; then yum -y install python36-devel; fi && \ if echo "$MINIFI_OPTIONS" | grep -q "ENABLE_SFTP=ON" && [ "${DOCKER_SKIP_TESTS}" == "OFF" ]; then yum -y install java-1.8.0-openjdk maven; fi diff --git a/docker/rockylinux/Dockerfile b/docker/rockylinux/Dockerfile index 10df6954bb..a46953d9bd 100644 --- a/docker/rockylinux/Dockerfile +++ b/docker/rockylinux/Dockerfile @@ -39,10 +39,9 @@ RUN mkdir -p $MINIFI_BASE_DIR COPY . ${MINIFI_BASE_DIR} # Install the system dependencies needed for a build -# gpsd-devel and ccache are in EPEL +# ccache is in EPEL RUN dnf -y install epel-release && dnf -y install gcc-toolset-12 sudo git which make libarchive ccache ca-certificates perl patch bison flex libtool cmake && \ - if echo "$MINIFI_OPTIONS" | grep -q "ENABLE_ALL=ON"; then dnf -y --enablerepo=devel install gpsd-devel python3-devel; fi && \ - if echo "$MINIFI_OPTIONS" | grep -q "ENABLE_GPS=ON"; then dnf -y install gpsd-devel; fi && \ + if echo "$MINIFI_OPTIONS" | grep -q "ENABLE_ALL=ON"; then dnf -y --enablerepo=devel install python3-devel; fi && \ if echo "$MINIFI_OPTIONS" | grep -q "ENABLE_PYTHON_SCRIPTING=ON"; then dnf -y 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 diff --git a/extensions/gps/CMakeLists.txt b/extensions/gps/CMakeLists.txt deleted file mode 100644 index 545fa5bcd7..0000000000 --- a/extensions/gps/CMakeLists.txt +++ /dev/null @@ -1,39 +0,0 @@ -# -# 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 (WIN32 OR NOT (ENABLE_ALL OR ENABLE_GPS)) - return() -endif() - -include(${CMAKE_SOURCE_DIR}/extensions/ExtensionHeader.txt) - -find_package(LibGPS REQUIRED) - -include_directories(${LIBGPS_INCLUDE_DIRS}) - -file(GLOB SOURCES "*.cpp") - -add_minifi_library(minifi-gps SHARED ${SOURCES}) - -# Include UUID -target_link_libraries(minifi-gps ${LIBMINIFI} ) -target_link_libraries(minifi-gps ${LIBGPS_LIBRARIES}) - -register_extension(minifi-gps "GPS EXTENSIONS" GPS-EXTENSION "Enables LibGPS Functionality and the GetGPS processor." "extensions/gps/tests") -register_extension_linter(minifi-gps-linter) diff --git a/extensions/gps/GetGPS.cpp b/extensions/gps/GetGPS.cpp deleted file mode 100644 index a49d685926..0000000000 --- a/extensions/gps/GetGPS.cpp +++ /dev/null @@ -1,135 +0,0 @@ -/** - * @file GetGPS.cpp - * GetGPS class implementation - * - * 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. - */ -#include "GetGPS.h" -#include -#include - -#define policy_t gps_policy_t -#include -#undef policy_t -#define policy_t ambiguous use gps_policy_t - -#include -#include -#include -#include - -#include "core/ProcessContext.h" -#include "core/ProcessSession.h" -#include "core/Resource.h" - -namespace org::apache::nifi::minifi::processors { - -void GetGPS::initialize() { - setSupportedProperties(Properties); - setSupportedRelationships(Relationships); -} - -void GetGPS::onSchedule(core::ProcessContext& context, core::ProcessSessionFactory&) { - std::string value; - - if (context.getProperty(GPSDHost, value)) { - gpsdHost_ = value; - } - if (context.getProperty(GPSDPort, value)) { - gpsdPort_ = value; - } - if (context.getProperty(GPSDWaitTime, value)) { - core::Property::StringToInt(value, gpsdWaitTime_); - } - logger_->log_trace("GPSD client scheduled"); -} - -int get_gps_status(struct gps_data_t* gps_data) { -#if defined(GPSD_API_MAJOR_VERSION) && GPSD_API_MAJOR_VERSION >= 10 - return gps_data->fix.status; -#else - return gps_data->status; -#endif -} - -void GetGPS::onTrigger(core::ProcessContext&, core::ProcessSession& session) { - try { - gpsmm gps_rec(gpsdHost_.c_str(), gpsdPort_.c_str()); - - if (gps_rec.stream(WATCH_ENABLE | WATCH_JSON) == nullptr) { - logger_->log_error("No GPSD running."); - return; - } - - while (isRunning()) { - struct gps_data_t* gpsdata; - - if (!gps_rec.waiting(gpsdWaitTime_)) - continue; - - if ((gpsdata = gps_rec.read()) == nullptr) { - logger_->log_error("Read error"); - return; - } else { - if (get_gps_status(gpsdata) > 0) { - if (gpsdata->fix.longitude != gpsdata->fix.longitude || gpsdata->fix.altitude != gpsdata->fix.altitude) { - logger_->log_info("No GPS fix."); - continue; - } - - logger_->log_debug("Longitude: {}\nLatitude: {}\nAltitude: {}\nAccuracy: {}\n\n", gpsdata->fix.latitude, gpsdata->fix.longitude, gpsdata->fix.altitude, - (gpsdata->fix.epx > gpsdata->fix.epy) ? gpsdata->fix.epx : gpsdata->fix.epy); - - auto flowFile = session.create(); - if (flowFile == nullptr) - return; - - flowFile->addAttribute("gps_mode", std::to_string(gpsdata->fix.mode)); - flowFile->addAttribute("gps_ept", std::to_string(gpsdata->fix.ept)); - flowFile->addAttribute("gps_latitude", std::to_string(gpsdata->fix.latitude)); - flowFile->addAttribute("gps_epy", std::to_string(gpsdata->fix.epy)); - flowFile->addAttribute("gps_longitude", std::to_string(gpsdata->fix.longitude)); - flowFile->addAttribute("gps_epx", std::to_string(gpsdata->fix.epx)); - flowFile->addAttribute("gps_altitude", std::to_string(gpsdata->fix.altitude)); - flowFile->addAttribute("gps_epv", std::to_string(gpsdata->fix.epv)); - flowFile->addAttribute("gps_track", std::to_string(gpsdata->fix.track)); - flowFile->addAttribute("gps_epd", std::to_string(gpsdata->fix.epd)); - flowFile->addAttribute("gps_speed", std::to_string(gpsdata->fix.speed)); - flowFile->addAttribute("gps_eps", std::to_string(gpsdata->fix.eps)); - flowFile->addAttribute("gps_climb", std::to_string(gpsdata->fix.climb)); - flowFile->addAttribute("gps_epc", std::to_string(gpsdata->fix.epc)); - - // Calculated Accuracy value - flowFile->addAttribute("gps_accuracy", std::to_string((gpsdata->fix.epx > gpsdata->fix.epy) ? gpsdata->fix.epx : gpsdata->fix.epy)); - - session.transfer(flowFile, Success); - - // Break the for(;;) waiting loop - break; - } else { - logger_->log_info("Satellite lock has not yet been acquired"); - } - } - } - } catch (std::exception &exception) { - logger_->log_error("GetGPS Caught Exception {}", exception.what()); - throw; - } -} - -REGISTER_RESOURCE(GetGPS, Processor); - -} // namespace org::apache::nifi::minifi::processors diff --git a/extensions/gps/GetGPS.h b/extensions/gps/GetGPS.h deleted file mode 100644 index 12ddb30e4c..0000000000 --- a/extensions/gps/GetGPS.h +++ /dev/null @@ -1,90 +0,0 @@ -/** - * @file GetGPS.h - * GetGPS class declaration - * - * 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. - */ -#pragma once - -#include -#include -#include -#include - -#include "../FlowFileRecord.h" -#include "../core/Processor.h" -#include "core/PropertyDefinition.h" -#include "core/PropertyDefinitionBuilder.h" -#include "core/PropertyType.h" -#include "core/RelationshipDefinition.h" - -namespace org::apache::nifi::minifi::processors { - -class GetGPS : public core::Processor { - public: - explicit GetGPS(std::string name, const utils::Identifier& uuid = {}) - : core::Processor(std::move(name), uuid) { - gpsdHost_ = "localhost"; - gpsdPort_ = "2947"; - gpsdWaitTime_ = 50000000; - } - ~GetGPS() override = default; - - EXTENSIONAPI static constexpr const char* Description = "Obtains GPS coordinates from the GPSDHost and port."; - - EXTENSIONAPI static constexpr auto GPSDHost = core::PropertyDefinitionBuilder<>::createProperty("GPSD Host") - .withDescription("The host running the GPSD daemon") - .withDefaultValue("localhost") - .build(); - EXTENSIONAPI static constexpr auto GPSDPort = core::PropertyDefinitionBuilder<>::createProperty("GPSD Port") - .withDescription("The GPSD daemon port") - .withPropertyType(core::StandardPropertyTypes::PORT_TYPE) - .withDefaultValue("2947") - .build(); - EXTENSIONAPI static constexpr auto GPSDWaitTime = core::PropertyDefinitionBuilder<>::createProperty("GPSD Wait Time") - .withDescription("Timeout value for waiting for data from the GPSD instance") - .withPropertyType(core::StandardPropertyTypes::UNSIGNED_LONG_TYPE) - .withDefaultValue("50000000") - .build(); - EXTENSIONAPI static constexpr auto Properties = std::to_array({ - GPSDHost, - GPSDPort, - GPSDWaitTime - }); - - - EXTENSIONAPI static constexpr auto Success = core::RelationshipDefinition{"success", "All files are routed to success"}; - EXTENSIONAPI static constexpr auto Relationships = std::array{Success}; - - EXTENSIONAPI static constexpr bool SupportsDynamicProperties = false; - EXTENSIONAPI static constexpr bool SupportsDynamicRelationships = false; - EXTENSIONAPI static constexpr core::annotation::Input InputRequirement = core::annotation::Input::INPUT_ALLOWED; - EXTENSIONAPI static constexpr bool IsSingleThreaded = false; - - ADD_COMMON_VIRTUAL_FUNCTIONS_FOR_PROCESSORS - - void onSchedule(core::ProcessContext& context, core::ProcessSessionFactory& session_factory) override; - void onTrigger(core::ProcessContext& context, core::ProcessSession& session) override; - void initialize() override; - - private: - std::string gpsdHost_; - std::string gpsdPort_; - int64_t gpsdWaitTime_; - std::shared_ptr logger_ = core::logging::LoggerFactory::getLogger(uuid_); -}; - -} // namespace org::apache::nifi::minifi::processors diff --git a/extensions/gps/tests/CMakeLists.txt b/extensions/gps/tests/CMakeLists.txt deleted file mode 100644 index 60151a5483..0000000000 --- a/extensions/gps/tests/CMakeLists.txt +++ /dev/null @@ -1,34 +0,0 @@ -# -# 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. -# - -file(GLOB GPS_INTEGRATION_TESTS "*.cpp") -SET(GPS_TEST_COUNT 0) -FOREACH(testfile ${GPS_INTEGRATION_TESTS}) - get_filename_component(testfilename "${testfile}" NAME_WE) - add_minifi_executable("${testfilename}" "${testfile}") - target_include_directories(${testfilename} PRIVATE BEFORE "${CMAKE_SOURCE_DIR}/extensions/standard-processors") - target_include_directories(${testfilename} PRIVATE BEFORE "${CMAKE_SOURCE_DIR}/extensions/gps/") - createTests("${testfilename}") - target_link_libraries(${testfilename} minifi-gps) - target_link_libraries(${testfilename} minifi-standard-processors) - target_link_libraries(${testfilename} Catch2WithMain) - MATH(EXPR GPS_TEST_COUNT "${GPS_TEST_COUNT}+1") - add_test(NAME "${testfilename}" COMMAND "${testfilename}" WORKING_DIRECTORY ${TEST_DIR}) -ENDFOREACH() -message("-- Finished building ${GPS_TEST_COUNT} GPS related test file(s)...") diff --git a/extensions/gps/tests/GPSTests.cpp b/extensions/gps/tests/GPSTests.cpp deleted file mode 100644 index 9b6f55df4e..0000000000 --- a/extensions/gps/tests/GPSTests.cpp +++ /dev/null @@ -1,84 +0,0 @@ -/** - * - * 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. - */ - -#include -#include -#include -#include -#include -#include -#include - -#include "core/Core.h" -#include "core/FlowFile.h" -#include "core/Processor.h" -#include "core/ProcessContext.h" -#include "core/ProcessorNode.h" -#include "core/ProcessSession.h" -#include "FlowController.h" -#include "GetGPS.h" -#include "processors/GetFile.h" -#include "unit/TestBase.h" -#include "unit/Catch.h" -#include "unit/ProvenanceTestHelper.h" - -TEST_CASE("GPSD Create", "[gpsdtest1]") { - TestController testController; - - LogTestController::getInstance().setTrace(); - - std::shared_ptr plan = testController.createPlan(); - - std::shared_ptr getfile = plan->addProcessor("GetGPS", "GetGPS"); - - plan->addProcessor("LogAttribute", "logattribute", core::Relationship("success", "description"), true); - - auto dir = testController.createTempDirectory(); - - plan->setProperty(getfile, org::apache::nifi::minifi::processors::GetFile::Directory, dir.string()); - testController.runSession(plan, false); - auto records = plan->getProvenanceRecords(); - std::shared_ptr record = plan->getCurrentFlowFile(); - REQUIRE(record == nullptr); - REQUIRE(records.empty()); - - std::fstream file; - std::stringstream ss; - ss << dir << "/" << "tstFile.ext"; - file.open(ss.str(), std::ios::out); - file << "tempFile"; - file.close(); - plan->reset(); - testController.runSession(plan, false); -#if WIN32 - _unlink(ss.str().c_str()); -#else - unlink(ss.str().c_str()); -#endif - - records = plan->getProvenanceRecords(); - record = plan->getCurrentFlowFile(); - testController.runSession(plan, false); - - records = plan->getProvenanceRecords(); - record = plan->getCurrentFlowFile(); - - REQUIRE(true == LogTestController::getInstance().contains("GPSD client scheduled")); - LogTestController::getInstance().reset(); -} - diff --git a/fedora.sh b/fedora.sh index e9e6f40bbc..455aabf420 100644 --- a/fedora.sh +++ b/fedora.sh @@ -63,8 +63,6 @@ build_deps(){ INSTALLED+=("autoconf") elif [ "$FOUND_VALUE" = "automake" ]; then INSTALLED+=("automake") - elif [ "$FOUND_VALUE" = "gpsd" ]; then - INSTALLED+=("gpsd-devel") elif [ "$FOUND_VALUE" = "libarchive" ]; then INSTALLED+=("xz-devel") elif [ "$FOUND_VALUE" = "libssh2" ]; then diff --git a/rheldistro.sh b/rheldistro.sh index 3980b9bcbf..c6b6d4ccab 100644 --- a/rheldistro.sh +++ b/rheldistro.sh @@ -19,11 +19,7 @@ verify_enable_platform() { feature="$1" if [ "$OS_MAJOR" = "6" ]; then - if [ "$feature" = "GPS_ENABLED" ]; then - echo "false" - else - verify_gcc_enable "$feature" - fi + verify_gcc_enable "$feature" else verify_gcc_enable "$feature" fi @@ -102,8 +98,6 @@ build_deps(){ INSTALLED+=("libtool") elif [ "$FOUND_VALUE" = "python" ]; then INSTALLED+=("python3-devel") - elif [ "$FOUND_VALUE" = "gpsd" ]; then - INSTALLED+=("gpsd-devel") elif [ "$FOUND_VALUE" = "libarchive" ]; then INSTALLED+=("xz-devel") elif [ "$FOUND_VALUE" = "libssh2" ]; then diff --git a/suse.sh b/suse.sh index e90557e6e7..174c8e8896 100644 --- a/suse.sh +++ b/suse.sh @@ -19,11 +19,7 @@ verify_enable_platform() { feature="$1" if [ "$OS_MAJOR" = "6" ]; then - if [ "${feature}" = "GPS_ENABLED" ]; then - echo "false" - else - verify_gcc_enable "${feature}" - fi + verify_gcc_enable "${feature}" else verify_gcc_enable "${feature}" fi @@ -84,8 +80,6 @@ build_deps(){ INSTALLED+=("libtool") elif [ "$FOUND_VALUE" = "python" ]; then INSTALLED+=("python3-devel") - elif [ "$FOUND_VALUE" = "gpsd" ]; then - INSTALLED+=("gpsd-devel") elif [ "$FOUND_VALUE" = "libarchive" ]; then INSTALLED+=("xz-devel") elif [ "$FOUND_VALUE" = "libssh2" ]; then