Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: mark streampipes-wrapper-python as deprecated #1623

Merged
merged 2 commits into from
May 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
91 changes: 5 additions & 86 deletions streampipes-wrapper-python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,91 +16,10 @@
~
-->

[![Github Actions](https://img.shields.io/github/workflow/status/apache/streampipes/build-and-deploy-docker-dev)](https://github.com/apache/streampipes/actions/)
[![Docker pulls](https://img.shields.io/docker/pulls/apachestreampipes/backend.svg)](https://hub.docker.com/r/apachestreampipes/backend/)
[![Maven central](https://img.shields.io/maven-central/v/org.apache.streampipes/streampipes-backend.svg)](https://img.shields.io/maven-central/v/org.apache.streampipes/streampipes-backend.svg)
[![License](https://img.shields.io/github/license/apache/streampipes.svg)](http://www.apache.org/licenses/LICENSE-2.0)
[![Last commit](https://img.shields.io/github/last-commit/apache/streampipes.svg)]()
[![Twitter](https://img.shields.io/twitter/follow/StreamPipes.svg?label=Follow&style=social)](https://twitter.com/StreamPipes)
## Apache StreamPipes Wrapper for Python - DEPRECATED

## Apache StreamPipes Wrapper for Python [WIP]
StreamPipes effort to support Python is continued in [StreamPipes Python](https://github.com/apache/streampipes/tree/dev/streampipes-client-python):
- [Documentation](https://streampipes.apache.org/docs/docs/python/latest/)
- [Download from PyPi](https://pypi.org/project/streampipes/)

**NOTE**:

> The StreamPipes wrapper for python is currently under development. Thus, the processor model description still needs
> to be implemented externally in Java.

## Apache StreamPipes

Apache StreamPipes enables flexible modeling of stream processing pipelines by providing a graphical
modeling editor on top of existing stream processing frameworks.

It leverages non-technical users to quickly define and execute processing pipelines based on an easily extensible
toolbox of data sources, data processors and data sinks. StreamPipes has an exchangeable runtime execution layer and
executes pipelines using one of the provided wrappers, e.g., for Apache Flink or Apache Kafka Streams.

Pipeline elements in StreamPipes can be installed at runtime - the built-in SDK allows to easily implement new
pipeline elements according to your needs. Pipeline elements are standalone microservices that can run anywhere -
centrally on your server, in a large-scale cluster or close at the edge.

## A Speudocode Example

**NOTE**:
Only works in combination with Java!

````
from streampipes.core import StandaloneModelSubmitter
from streampipes.manager import Declarer
from streampipes.model.pipeline_element_config import Config
from streampipes.core import EventProcessor


class HelloWorldProcessor(EventProcessor):

def on_invocation(self):
pass

def on_event(self, event):
event['greeting'] = 'hello world'
return event

def on_detach(self):
pass


def main():
# Configurations to be stored in key-value store (consul)
config = Config(app_id='pe/org.apache.streampipes.processor.python')

config.register(type='host',
env_key='SP_HOST',
default='processor-python',
description='processor hostname')

config.register(type='port',
env_key='SP_PORT',
default=8090,
description='processor port')

config.register(type='service',
env_key='SP_SERVICE_NAME',
default='Python Processor',
description='processor service name')

processors = {
'org.apache.streampipes.processors.python.helloworld': HelloWorldProcessor,
}

# Declarer
# add the dict of processors to the Declarer
# This is an abstract class that holds the specified processors
Declarer.add(processors=processors)

# StandaloneModelSubmitter
# Initializes the REST api
StandaloneModelSubmitter.init(config=config)


if __name__ == '__main__':
main()
````
Therefore this module is deprecated from version 0.92.0 on and will probably be remove in 0.93.0.
1 change: 1 addition & 0 deletions streampipes-wrapper-python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
long_description_content_type='text/markdown',
install_requires=[
'confluent-kafka==1.4.2',
'Deprecated==1.2.13',
'Flask==2.3.2',
'flask-classful==0.14.2',
'Flask-Negotiate==0.1.0',
Expand Down
2 changes: 2 additions & 0 deletions streampipes-wrapper-python/streampipes/api/rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@

from waitress import serve
from flask import Flask
from deprecated import deprecated

from streampipes.api.resources.dummy import DummyInterimsResource
from streampipes.api.resources.processor import SepaElementResource
from streampipes.api.resources.welcome import WelcomeResource


@deprecated(version='0.92.0', reason="Please switch to StreamPipes Python (see README)")
class PipelineElementApi(object):
_FLASK_CONFIG = {
'DEBUG': False,
Expand Down
3 changes: 3 additions & 0 deletions streampipes-wrapper-python/streampipes/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@
from confluent_kafka.admin import AdminClient
from confluent_kafka import Producer, Consumer

from deprecated import deprecated


@deprecated(version='0.92.0', reason="Please switch to StreamPipes Python (see README)")
class EventProcessor(object):
__metaclass__ = abc.ABC

Expand Down
4 changes: 3 additions & 1 deletion streampipes-wrapper-python/streampipes/declarer.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
# limitations under the License.
#

from depreacted import deprecated

@deprecated(version='0.92.0', reason="Please switch to StreamPipes Python (see README)")
class Singleton(type):
_instances = {}

Expand All @@ -24,7 +26,7 @@ def __call__(cls, *args, **kwargs):
cls._instances[cls] = super(Singleton, cls).__call__(*args, **kwargs)
return cls._instances[cls]


@deprecated(version='0.92.0', reason="Please switch to StreamPipes Python (see README)")
class DeclarerSingleton(metaclass=Singleton):

""" EventProcessorManager holds running processor instances """
Expand Down
7 changes: 5 additions & 2 deletions streampipes-wrapper-python/streampipes/instances.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,18 @@
# limitations under the License.
#
import abc
from deprecated import deprecated


@deprecated(version='0.92'
'.0', reason="Please switch to StreamPipes Python (see README)")
class NamedStreamPipesEntity:
__metaclass__ = abc.ABC

def get_description(self):
pass


@deprecated(version='0.92'
'.0', reason="Please switch to StreamPipes Python (see README)")
class RunningInstances:
__metaclass__ = abc.ABC

Expand Down
2 changes: 2 additions & 0 deletions streampipes-wrapper-python/streampipes/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@
"""Manages processor life cycle"""
import logging
import abc
from deprectaed import deprecated
from streampipes.declarer import DeclarerSingleton


@deprecated(version='0.92.0', reason="Please switch to StreamPipes Python (see README)")
class ProcessorDispatcher(object):
__metaclass__ = abc.ABC

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
# limitations under the License.
#

from deprecated import deprecated

@deprecated(version='0.92.0', reason="Please switch to StreamPipes Python (see README)")
class AbstractStreamPipesEntity:
def __init__(self):
pass
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,12 @@
# limitations under the License.
#
import sys, os
from deprecated import deprecated
sys.path.append(os.path.abspath("streampipes-wrapper-python"))

from streampipes.model.base.named_streampipes_Entity import NamedStreamPipesEntity


@deprecated(version='0.92.0', reason="Please switch to StreamPipes Python (see README)")
class ConsumableStreamPipesEntity(NamedStreamPipesEntity):
pass
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,13 @@
# limitations under the License.
#
import sys, os
from deprecated import deprecated
sys.path.append(os.path.abspath("streampipes-wrapper-python"))

from streampipes.model.base.abstract_streampipes_entity import AbstractStreamPipesEntity


@deprecated(version='0.92.0', reason="Please switch to StreamPipes Python (see README)")
class NamedStreamPipesEntity(AbstractStreamPipesEntity):
def __init__(self):
self.applicationLinks = []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,13 @@
# limitations under the License.
#
import sys, os
from deprecated import deprecated
sys.path.append(os.path.abspath("streampipes-wrapper-python"))

from streampipes.model.base.abstract_streampipes_entity import AbstractStreamPipesEntity


@deprecated(version='0.92.0', reason="Please switch to StreamPipes Python (see README)")
class UnnamedStreamPipesEntity(AbstractStreamPipesEntity):

__serialVersionUID = 8051137255998890188
Expand Down
2 changes: 2 additions & 0 deletions streampipes-wrapper-python/streampipes/model/config_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@
# limitations under the License.
#
import json
from deprecated import deprecated


@deprecated(version='0.92.0', reason="Please switch to StreamPipes Python (see README)")
class ConfigItem(object):
def __init__(self):
self.value = None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@
# limitations under the License.
#
import sys, os
from depreacated import deprecated
sys.path.append(os.path.abspath("streampipes-wrapper-python"))

from streampipes.model.base.consumable_streampipes_entity import ConsumableStreamPipesEntity

@deprecated(version='0.92.0', reason="Please switch to StreamPipes Python (see README)")
class DataProcessorDescription (ConsumableStreamPipesEntity):
__serialVersionUID = 3995767921861518597
def __init__(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@
# limitations under the License.
#
import os
from deprecated import deprecated
from streampipes.model.config_item import ConfigItem


@deprecated(version='0.92.0', reason="Please switch to StreamPipes Python (see README)")
class Config(object):
def __init__(self, app_id: str) -> None:
if not app_id:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,13 @@
# limitations under the License.
#
import sys, os
from deprecated import deprecated
sys.path.append(os.path.abspath("streampipes-wrapper-python"))

import streampipes.model.staticproperty.static_property
import streampipes.model.staticproperty.static_property


@deprecated(version='0.92.0', reason="Please switch to StreamPipes Python (see README)")
class FreeTextStaticProperty(StaticProperty):
__serialVersionUID = 1
def __init__(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,13 @@
# limitations under the License.
#
import sys, os
from deprecated import deprecated
sys.path.append(os.path.abspath("streampipes-wrapper-python"))

from streampipes.model.base.unnamed_streampipes_entity import UnnamedStreamPipesEntity


@deprecated(version='0.92.0', reason="Please switch to StreamPipes Python (see README)")
class StaticProperty(UnnamedStreamPipesEntity):
__serialVersionUID = 2509153122084646025

Expand Down
3 changes: 2 additions & 1 deletion streampipes-wrapper-python/streampipes/submitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@
# limitations under the License.
#
import abc
from deprecated import deprecated

from streampipes.api.rest import PipelineElementApi
from streampipes.base.banner import banner
from streampipes.declarer import DeclarerSingleton
from streampipes.model.pipeline_element_config import Config
from streampipes.utils.register import ConsulUtils


@deprecated(version='0.92.0', reason="Please switch to StreamPipes Python (see README)")
class StandaloneModelSubmitter(object):
__metaclass__ = abc.ABC

Expand Down
2 changes: 2 additions & 0 deletions streampipes-wrapper-python/streampipes/utils/register.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@
import os
import consul
from consul import Check
from deprecated import deprecated
from streampipes.model.pipeline_element_config import Config


@deprecated(version='0.92.0', reason="Please switch to StreamPipes Python (see README)")
class ConsulUtils(object):
_DEFAULT_CONSUL_CONFIG = {
'CONSUL_HOST': 'consul',
Expand Down