lorrystream 0.0.2__tar.gz → 0.0.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- lorrystream-0.0.2/CHANGES.rst → lorrystream-0.0.3/CHANGES.md +7 -9
- lorrystream-0.0.3/MANIFEST.in +3 -0
- lorrystream-0.0.3/PKG-INFO +122 -0
- lorrystream-0.0.3/README.md +247 -0
- {lorrystream-0.0.2 → lorrystream-0.0.3}/doc/backlog.rst +5 -3
- lorrystream-0.0.3/doc/carabas/backlog.md +21 -0
- lorrystream-0.0.3/doc/carabas/dms/handbook.md +79 -0
- lorrystream-0.0.3/doc/carabas/dms/index.md +135 -0
- lorrystream-0.0.3/doc/carabas/dms/mysql.md +4 -0
- lorrystream-0.0.3/doc/carabas/dms/postgresql.md +57 -0
- lorrystream-0.0.3/doc/carabas/index.md +53 -0
- lorrystream-0.0.3/doc/carabas/kcl/dynamodb-standalone.md +71 -0
- lorrystream-0.0.3/doc/carabas/kcl/dynamodb.md +244 -0
- lorrystream-0.0.3/doc/carabas/kcl/kinesis.md +107 -0
- lorrystream-0.0.3/doc/carabas/lambda/index.md +222 -0
- lorrystream-0.0.3/doc/carabas/research.md +48 -0
- lorrystream-0.0.3/doc/changes.md +15 -0
- lorrystream-0.0.3/doc/index.md +80 -0
- lorrystream-0.0.3/doc/readme.md +247 -0
- {lorrystream-0.0.2 → lorrystream-0.0.3}/doc/research.rst +43 -3
- lorrystream-0.0.3/doc/singer/cratedb.md +30 -0
- lorrystream-0.0.3/doc/singer/index.md +8 -0
- lorrystream-0.0.3/doc/singer/intro.md +269 -0
- lorrystream-0.0.3/doc/source/kinesis.md +80 -0
- lorrystream-0.0.3/lorrystream/__init__.py +10 -0
- lorrystream-0.0.3/lorrystream/carabas/aws/__init__.py +11 -0
- lorrystream-0.0.3/lorrystream/carabas/aws/cf/dms_next.py +268 -0
- lorrystream-0.0.3/lorrystream/carabas/aws/function/__init__.py +0 -0
- lorrystream-0.0.3/lorrystream/carabas/aws/function/model.py +157 -0
- lorrystream-0.0.3/lorrystream/carabas/aws/function/oci.py +263 -0
- lorrystream-0.0.3/lorrystream/carabas/aws/function/zip.py +198 -0
- lorrystream-0.0.3/lorrystream/carabas/aws/model.py +163 -0
- lorrystream-0.0.3/lorrystream/carabas/aws/stack/__init__.py +0 -0
- lorrystream-0.0.3/lorrystream/carabas/aws/stack/dms.py +685 -0
- lorrystream-0.0.3/lorrystream/carabas/aws/stack/dynamodb.py +141 -0
- lorrystream-0.0.3/lorrystream/process/__init__.py +0 -0
- lorrystream-0.0.3/lorrystream/process/kinesis_cratedb_lambda.py +151 -0
- lorrystream-0.0.3/lorrystream/spike/__init__.py +0 -0
- lorrystream-0.0.3/lorrystream/spike/kcl_dynamodb/__init__.py +0 -0
- lorrystream-0.0.3/lorrystream/spike/kcl_dynamodb/dynamodb_cdc_processor.py +221 -0
- lorrystream-0.0.3/lorrystream/spike/kcl_kinesis/__init__.py +0 -0
- lorrystream-0.0.3/lorrystream/spike/kcl_kinesis/amazon_kclpy_helper.py +203 -0
- lorrystream-0.0.3/lorrystream/spike/kcl_kinesis/record_processor.py +171 -0
- lorrystream-0.0.3/lorrystream/spike/kinesis/__init__.py +0 -0
- lorrystream-0.0.3/lorrystream/streamz/__init__.py +0 -0
- lorrystream-0.0.3/lorrystream/util/__init__.py +0 -0
- {lorrystream-0.0.2 → lorrystream-0.0.3}/lorrystream/util/common.py +1 -1
- lorrystream-0.0.3/lorrystream/util/python/__init__.py +0 -0
- lorrystream-0.0.3/lorrystream/util/python/bundle.py +20 -0
- lorrystream-0.0.3/lorrystream/util/python/pep723.py +27 -0
- lorrystream-0.0.3/lorrystream.egg-info/PKG-INFO +122 -0
- lorrystream-0.0.3/lorrystream.egg-info/SOURCES.txt +77 -0
- lorrystream-0.0.3/lorrystream.egg-info/requires.txt +63 -0
- {lorrystream-0.0.2 → lorrystream-0.0.3}/pyproject.toml +146 -86
- lorrystream-0.0.2/MANIFEST.in +0 -3
- lorrystream-0.0.2/PKG-INFO +0 -382
- lorrystream-0.0.2/README.rst +0 -283
- lorrystream-0.0.2/doc/operations.rst +0 -3
- lorrystream-0.0.2/doc/research-new.rst +0 -26
- lorrystream-0.0.2/lorrystream/__init__.py +0 -1
- lorrystream-0.0.2/lorrystream.egg-info/PKG-INFO +0 -382
- lorrystream-0.0.2/lorrystream.egg-info/SOURCES.txt +0 -37
- lorrystream-0.0.2/lorrystream.egg-info/requires.txt +0 -36
- {lorrystream-0.0.2 → lorrystream-0.0.3}/LICENSE +0 -0
- {lorrystream-0.0.2 → lorrystream-0.0.3}/doc/development.rst +0 -0
- {lorrystream-0.0.2 → lorrystream-0.0.3}/doc/prior-art.rst +0 -0
- {lorrystream-0.0.2 → lorrystream-0.0.3}/doc/sink/database.rst +0 -0
- {lorrystream-0.0.2 → lorrystream-0.0.3}/doc/source/amqp.rst +0 -0
- {lorrystream-0.0.2 → lorrystream-0.0.3}/doc/source/mqtt.rst +0 -0
- {lorrystream-0.0.2/lorrystream/streamz → lorrystream-0.0.3/lorrystream/carabas}/__init__.py +0 -0
- {lorrystream-0.0.2/lorrystream/util → lorrystream-0.0.3/lorrystream/carabas/aws/cf}/__init__.py +0 -0
- {lorrystream-0.0.2 → lorrystream-0.0.3}/lorrystream/cli.py +0 -0
- {lorrystream-0.0.2 → lorrystream-0.0.3}/lorrystream/cmd.py +0 -0
- {lorrystream-0.0.2 → lorrystream-0.0.3}/lorrystream/core.py +0 -0
- {lorrystream-0.0.2 → lorrystream-0.0.3}/lorrystream/exceptions.py +0 -0
- {lorrystream-0.0.2 → lorrystream-0.0.3}/lorrystream/model.py +0 -0
- {lorrystream-0.0.2 → lorrystream-0.0.3}/lorrystream/streamz/amqp.py +0 -0
- {lorrystream-0.0.2 → lorrystream-0.0.3}/lorrystream/streamz/model.py +0 -0
- {lorrystream-0.0.2 → lorrystream-0.0.3}/lorrystream/streamz/sinks.py +0 -0
- {lorrystream-0.0.2 → lorrystream-0.0.3}/lorrystream/streamz/sources.py +0 -0
- {lorrystream-0.0.2 → lorrystream-0.0.3}/lorrystream/util/about.py +0 -0
- {lorrystream-0.0.2 → lorrystream-0.0.3}/lorrystream/util/aio.py +0 -0
- {lorrystream-0.0.2 → lorrystream-0.0.3}/lorrystream/util/cli.py +0 -0
- {lorrystream-0.0.2 → lorrystream-0.0.3}/lorrystream/util/data.py +0 -0
- {lorrystream-0.0.2 → lorrystream-0.0.3}/lorrystream.egg-info/dependency_links.txt +0 -0
- {lorrystream-0.0.2 → lorrystream-0.0.3}/lorrystream.egg-info/entry_points.txt +0 -0
- {lorrystream-0.0.2 → lorrystream-0.0.3}/lorrystream.egg-info/top_level.txt +0 -0
- {lorrystream-0.0.2 → lorrystream-0.0.3}/setup.cfg +0 -0
|
@@ -1,17 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
LorryStream changelog
|
|
3
|
-
#####################
|
|
1
|
+
# Changelog
|
|
4
2
|
|
|
5
|
-
in progress
|
|
6
|
-
===========
|
|
3
|
+
## in progress
|
|
7
4
|
|
|
8
|
-
2024-
|
|
9
|
-
|
|
5
|
+
## 2024-08-16 v0.0.3
|
|
6
|
+
- Carabas: A subsystem to divert workloads to other people’s computers
|
|
7
|
+
|
|
8
|
+
## 2024-07-10 v0.0.2
|
|
10
9
|
- Initial working version, supporting MQTT, AMQP, and SQLAlchemy/CrateDB
|
|
11
10
|
- Add CLI interface
|
|
12
11
|
- Add logging
|
|
13
12
|
- Add software tests
|
|
14
13
|
|
|
15
|
-
2023-04-06 v0.0.1
|
|
16
|
-
=================
|
|
14
|
+
## 2023-04-06 v0.0.1
|
|
17
15
|
- Framework and code layout explorations
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: lorrystream
|
|
3
|
+
Version: 0.0.3
|
|
4
|
+
Summary: A lightweight and polyglot stream-processing library, to be used as a data backplane-, message relay-, or pipeline-subsystem.
|
|
5
|
+
Author-email: Andreas Motl <andreas.motl@panodata.org>, Richard Pobering <richard.pobering@panodata.org>
|
|
6
|
+
License: LGPL 3, EUPL 1.2
|
|
7
|
+
Project-URL: Changelog, https://lorrystream.readthedocs.io/changes.html
|
|
8
|
+
Project-URL: Documentation, https://lorrystream.readthedocs.io/
|
|
9
|
+
Project-URL: Homepage, https://lorrystream.readthedocs.io/
|
|
10
|
+
Project-URL: Issues, https://github.com/daq-tools/lorrystream/issues
|
|
11
|
+
Project-URL: Repository, https://github.com/daq-tools/lorrystream
|
|
12
|
+
Keywords: amqp,data,export,import,kinesis,mqtt,pandas,rdbms,sql,stream
|
|
13
|
+
Classifier: Development Status :: 3 - Alpha
|
|
14
|
+
Classifier: Environment :: Console
|
|
15
|
+
Classifier: Intended Audience :: Customer Service
|
|
16
|
+
Classifier: Intended Audience :: Developers
|
|
17
|
+
Classifier: Intended Audience :: Education
|
|
18
|
+
Classifier: Intended Audience :: End Users/Desktop
|
|
19
|
+
Classifier: Intended Audience :: Information Technology
|
|
20
|
+
Classifier: Intended Audience :: Manufacturing
|
|
21
|
+
Classifier: Intended Audience :: Science/Research
|
|
22
|
+
Classifier: Intended Audience :: System Administrators
|
|
23
|
+
Classifier: Intended Audience :: Telecommunications Industry
|
|
24
|
+
Classifier: License :: OSI Approved :: European Union Public Licence 1.2 (EUPL 1.2)
|
|
25
|
+
Classifier: License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)
|
|
26
|
+
Classifier: Operating System :: MacOS :: MacOS X
|
|
27
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
28
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
29
|
+
Classifier: Operating System :: Unix
|
|
30
|
+
Classifier: Programming Language :: Python
|
|
31
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
32
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
33
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
34
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
35
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
36
|
+
Classifier: Topic :: Adaptive Technologies
|
|
37
|
+
Classifier: Topic :: Communications
|
|
38
|
+
Classifier: Topic :: Database
|
|
39
|
+
Classifier: Topic :: Documentation
|
|
40
|
+
Classifier: Topic :: Education
|
|
41
|
+
Classifier: Topic :: Internet
|
|
42
|
+
Classifier: Topic :: Internet :: WWW/HTTP
|
|
43
|
+
Classifier: Topic :: Office/Business
|
|
44
|
+
Classifier: Topic :: Scientific/Engineering
|
|
45
|
+
Classifier: Topic :: Software Development :: Embedded Systems
|
|
46
|
+
Classifier: Topic :: Software Development :: Libraries
|
|
47
|
+
Classifier: Topic :: Software Development :: Object Brokering
|
|
48
|
+
Classifier: Topic :: Software Development :: Pre-processors
|
|
49
|
+
Classifier: Topic :: Software Development :: Quality Assurance
|
|
50
|
+
Classifier: Topic :: Software Development :: Testing
|
|
51
|
+
Classifier: Topic :: Software Development :: Version Control
|
|
52
|
+
Classifier: Topic :: System :: Archiving
|
|
53
|
+
Classifier: Topic :: System :: Benchmark
|
|
54
|
+
Classifier: Topic :: System :: Clustering
|
|
55
|
+
Classifier: Topic :: System :: Distributed Computing
|
|
56
|
+
Classifier: Topic :: System :: Hardware
|
|
57
|
+
Classifier: Topic :: System :: Logging
|
|
58
|
+
Classifier: Topic :: System :: Monitoring
|
|
59
|
+
Classifier: Topic :: System :: Networking
|
|
60
|
+
Classifier: Topic :: System :: Systems Administration
|
|
61
|
+
Classifier: Topic :: Text Processing
|
|
62
|
+
Classifier: Topic :: Utilities
|
|
63
|
+
Requires-Python: >=3.9
|
|
64
|
+
Description-Content-Type: text/x-rst
|
|
65
|
+
License-File: LICENSE
|
|
66
|
+
Requires-Dist: boltons
|
|
67
|
+
Requires-Dist: click<9
|
|
68
|
+
Requires-Dist: colorama<1
|
|
69
|
+
Requires-Dist: colorlog
|
|
70
|
+
Requires-Dist: commons-codec==0.0.3
|
|
71
|
+
Requires-Dist: dask
|
|
72
|
+
Requires-Dist: funcy
|
|
73
|
+
Requires-Dist: influxdb
|
|
74
|
+
Requires-Dist: influxdb-client[ciso]
|
|
75
|
+
Requires-Dist: paho-mqtt
|
|
76
|
+
Requires-Dist: pandas<2.3
|
|
77
|
+
Requires-Dist: pika<1.4
|
|
78
|
+
Requires-Dist: simplejson<4
|
|
79
|
+
Requires-Dist: sqlalchemy==2.0.*
|
|
80
|
+
Requires-Dist: sqlalchemy-cratedb==0.38.0
|
|
81
|
+
Requires-Dist: streamz
|
|
82
|
+
Requires-Dist: tomli
|
|
83
|
+
Requires-Dist: toolz
|
|
84
|
+
Provides-Extra: all
|
|
85
|
+
Requires-Dist: lorrystream[carabas]; extra == "all"
|
|
86
|
+
Provides-Extra: carabas
|
|
87
|
+
Requires-Dist: aiobotocore==2.13.*; extra == "carabas"
|
|
88
|
+
Requires-Dist: async-kinesis<1.2; extra == "carabas"
|
|
89
|
+
Requires-Dist: aws-lambda-layer<0.6; extra == "carabas"
|
|
90
|
+
Requires-Dist: boto3==1.34.*; extra == "carabas"
|
|
91
|
+
Requires-Dist: cottonformation<1.2; extra == "carabas"
|
|
92
|
+
Requires-Dist: localstack[base-runtime]<3.7; extra == "carabas"
|
|
93
|
+
Provides-Extra: develop
|
|
94
|
+
Requires-Dist: black<25; extra == "develop"
|
|
95
|
+
Requires-Dist: mypy<1.12; extra == "develop"
|
|
96
|
+
Requires-Dist: pika-stubs<0.2; extra == "develop"
|
|
97
|
+
Requires-Dist: poethepoet<0.28; extra == "develop"
|
|
98
|
+
Requires-Dist: pyproject-fmt<2.3; extra == "develop"
|
|
99
|
+
Requires-Dist: ruff<0.6; extra == "develop"
|
|
100
|
+
Requires-Dist: validate-pyproject<0.19; extra == "develop"
|
|
101
|
+
Provides-Extra: docs
|
|
102
|
+
Requires-Dist: furo==2024.1.29; extra == "docs"
|
|
103
|
+
Requires-Dist: myst-parser[linkify]<5,>=0.18; extra == "docs"
|
|
104
|
+
Requires-Dist: sphinx-autobuild==2021.3.14; extra == "docs"
|
|
105
|
+
Requires-Dist: sphinx-copybutton; extra == "docs"
|
|
106
|
+
Requires-Dist: sphinx-design-elements<1; extra == "docs"
|
|
107
|
+
Requires-Dist: sphinxcontrib-mermaid<1; extra == "docs"
|
|
108
|
+
Requires-Dist: sphinxext-opengraph<1; extra == "docs"
|
|
109
|
+
Provides-Extra: release
|
|
110
|
+
Requires-Dist: build<2; extra == "release"
|
|
111
|
+
Requires-Dist: twine<6; extra == "release"
|
|
112
|
+
Provides-Extra: test
|
|
113
|
+
Requires-Dist: cratedb-toolkit[testing]==0.0.15; extra == "test"
|
|
114
|
+
Requires-Dist: docker<7; extra == "test"
|
|
115
|
+
Requires-Dist: localstack-utils<1.1; extra == "test"
|
|
116
|
+
Requires-Dist: pytest<9; extra == "test"
|
|
117
|
+
Requires-Dist: pytest-asyncio-cooperative<0.30; extra == "test"
|
|
118
|
+
Requires-Dist: pytest-cov<6; extra == "test"
|
|
119
|
+
Requires-Dist: pytest-mock<4; extra == "test"
|
|
120
|
+
Requires-Dist: pytest-mqtt<0.5,>=0.4.2; extra == "test"
|
|
121
|
+
Requires-Dist: requests==2.28.1; extra == "test"
|
|
122
|
+
Requires-Dist: testcontainer-python-rabbitmq==0.4.*; extra == "test"
|
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
# LorryStream
|
|
2
|
+
|
|
3
|
+
## About
|
|
4
|
+
|
|
5
|
+
**LorryStream** is a lightweight and polyglot stream-processing library,
|
|
6
|
+
to be used as a data backplane-, message relay-, or pipeline-subsystem,
|
|
7
|
+
in the spirit of [socat] and [GStreamer]. It is based on [Streamz],
|
|
8
|
+
[Dask], and other Python libraries.
|
|
9
|
+
|
|
10
|
+
You can use **LorryStream** to store data received from the network into
|
|
11
|
+
databases, or to relay it back to the network, for example into
|
|
12
|
+
different bus systems. It can be used both as a standalone program, and
|
|
13
|
+
as a library.
|
|
14
|
+
|
|
15
|
+
It is conceived to generalize and improve the corresponding subsystems
|
|
16
|
+
of programs and frameworks like [Kotori], [Wetterdienst], [Luftdatenpumpe],
|
|
17
|
+
[amqp-forward], [ttnlogger], [Kahn], or [mqttwarn].
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
## Synopsis
|
|
21
|
+
|
|
22
|
+
The canonical command is `lorry relay <source> <sink>`. Please note
|
|
23
|
+
`%23` is `#`.
|
|
24
|
+
|
|
25
|
+
``` sh
|
|
26
|
+
lorry relay \
|
|
27
|
+
"mqtt://localhost/testdrive/%23" \
|
|
28
|
+
"crate://localhost/?table=testdrive"
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
If you prefer a GStreamer-like pipeline definition syntax.
|
|
32
|
+
|
|
33
|
+
``` sh
|
|
34
|
+
lorry launch "mqttsrc location=mqtt://localhost/testdrive/%23 ! sqlsink location=crate://localhost/?table=testdrive"
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Quickstart
|
|
38
|
+
|
|
39
|
+
If you are in a hurry, and want to run LorryStream without any
|
|
40
|
+
installation, just use the OCI image on Podman or Docker.
|
|
41
|
+
|
|
42
|
+
``` sh
|
|
43
|
+
docker run --rm --network=host ghcr.io/daq-tools/lorrystream \
|
|
44
|
+
lorry relay \
|
|
45
|
+
"mqtt://localhost/testdrive/%23" \
|
|
46
|
+
"crate://localhost/?table=testdrive"
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Setup
|
|
50
|
+
|
|
51
|
+
Install `lorrystream` from PyPI.
|
|
52
|
+
|
|
53
|
+
``` sh
|
|
54
|
+
pip install lorrystream
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Usage
|
|
58
|
+
|
|
59
|
+
This section outlines some example invocations of LorryStream, both on
|
|
60
|
+
the command line, and per library use. Other than the resources
|
|
61
|
+
available from the web, testing data can be acquired from the
|
|
62
|
+
repository's [testdata] folder.
|
|
63
|
+
|
|
64
|
+
### Prerequisites
|
|
65
|
+
|
|
66
|
+
For properly running some of the example invocations outlined below, you
|
|
67
|
+
will need a few servers. The easiest way to spin up those instances is
|
|
68
|
+
to use Podman or Docker.
|
|
69
|
+
|
|
70
|
+
``` sh
|
|
71
|
+
docker run --name=mosquitto --rm -it --publish=1883:1883 \
|
|
72
|
+
eclipse-mosquitto:2.0.15 mosquitto -c /mosquitto-no-auth.conf
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
-- <https://github.com/docker-library/docs/blob/master/eclipse-mosquitto/README.md>
|
|
76
|
+
|
|
77
|
+
``` sh
|
|
78
|
+
docker run --name=cratedb --rm -it --publish=4200:4200 --publish=5432:5432 \
|
|
79
|
+
crate:5.2 -Cdiscovery.type=single-node
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
-- <https://github.com/docker-library/docs/blob/master/crate/README.md>
|
|
83
|
+
|
|
84
|
+
### Command line use
|
|
85
|
+
|
|
86
|
+
#### Help
|
|
87
|
+
|
|
88
|
+
``` sh
|
|
89
|
+
lorry --help
|
|
90
|
+
lorry info
|
|
91
|
+
lorry relay --help
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
#### Bus to storage
|
|
95
|
+
|
|
96
|
+
``` sh
|
|
97
|
+
# Relay messages from MQTT to CrateDB.
|
|
98
|
+
lorry relay \
|
|
99
|
+
"mqtt://localhost/testdrive/%23" \
|
|
100
|
+
"crate://localhost/?table=testdrive"
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
#### Bus to bus
|
|
104
|
+
|
|
105
|
+
``` sh
|
|
106
|
+
# Relay messages from AMQP to MQTT.
|
|
107
|
+
lorry relay \
|
|
108
|
+
"amqp://localhost/testdrive/demo" \
|
|
109
|
+
"mqtt://localhost/testdrive/demo"
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### Library use
|
|
113
|
+
|
|
114
|
+
``` python
|
|
115
|
+
>>> from lorrystream import parse_launch
|
|
116
|
+
>>> parse_launch("mqttsrc location=mqtt://localhost/testdrive/%23 ! sqlsink location=crate://localhost/?table=testdrive")
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
#### OCI
|
|
120
|
+
|
|
121
|
+
OCI images are available on the GitHub Container Registry (GHCR). We are
|
|
122
|
+
publishing image variants for general availability- and
|
|
123
|
+
nightly-releases, and pull requests.
|
|
124
|
+
|
|
125
|
+
In order to always run the latest `nightly` development version, and to
|
|
126
|
+
use a shortcut for that, this section outlines how to use an alias for
|
|
127
|
+
`lorry`, and a variable for storing the data source and sink URIs. It
|
|
128
|
+
may be useful to save a few keystrokes on subsequent invocations.
|
|
129
|
+
|
|
130
|
+
``` sh
|
|
131
|
+
docker pull ghcr.io/daq-tools/lorrystream:nightly
|
|
132
|
+
alias lorry="docker run --rm --interactive ghcr.io/daq-tools/lorrystream:nightly lorry"
|
|
133
|
+
SOURCE=mqtt://localhost/testdrive/%23
|
|
134
|
+
SINK=crate://crate@localhost:4200/?table=testdrive
|
|
135
|
+
|
|
136
|
+
lorry relay "${SOURCE}" "${SINK}"
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
## Story
|
|
141
|
+
|
|
142
|
+
### Details
|
|
143
|
+
|
|
144
|
+
- Data sources are message bus systems like AMQP, Kafka, MQTT, ZeroMQ,
|
|
145
|
+
and network listener endpoints for TCP, UDP, HTTP, and WebSocket.
|
|
146
|
+
- Data sinks are RDBMS databases supported by SQLAlchemy, or other
|
|
147
|
+
message brokers.
|
|
148
|
+
|
|
149
|
+
### Motivation
|
|
150
|
+
|
|
151
|
+
- Implement a reusable solution, simple to install and operate, that
|
|
152
|
+
doesn't depend on vendor-provided infrastructure, and can easily be
|
|
153
|
+
embedded into existing frameworks and software stacks, or integrated
|
|
154
|
+
otherwise by running it as a separate service.
|
|
155
|
+
- Help the community and industry to modernize their aging DAQ backend
|
|
156
|
+
systems designed within the previous decades.
|
|
157
|
+
- Use as pipeline elements, protocol translator, bridge elements.
|
|
158
|
+
|
|
159
|
+
### Background
|
|
160
|
+
|
|
161
|
+
> Flow-Based Programming ([FBP]) is a programming paradigm that uses a
|
|
162
|
+
> "data processing factory" metaphor for designing and building applications.
|
|
163
|
+
> It is a special case of [dataflow] programming characterized by asynchronous,
|
|
164
|
+
> concurrent processes "under the covers".
|
|
165
|
+
>
|
|
166
|
+
> FBP has been found to support improved development time and
|
|
167
|
+
> maintainability, reusability, rapid prototyping, simulation, improved
|
|
168
|
+
> performance, and good communication among developers, maintenance
|
|
169
|
+
> staff, users, systems people, and management - not to mention that FBP
|
|
170
|
+
> naturally takes advantage of multiple cores, without the programmer
|
|
171
|
+
> having to struggle with the intricacies of multitasking.
|
|
172
|
+
>
|
|
173
|
+
> -- [Flow-based Programming]
|
|
174
|
+
|
|
175
|
+
### Caveat
|
|
176
|
+
|
|
177
|
+
Please note that LorryStream is alpha-quality software, and a work in
|
|
178
|
+
progress. Contributions of all kinds are very welcome, in order to make
|
|
179
|
+
it more solid.
|
|
180
|
+
|
|
181
|
+
Breaking changes should be expected until a 1.0 release, so version
|
|
182
|
+
pinning is recommended, especially when you use it as a library.
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
## Project information
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
### Contributions
|
|
189
|
+
|
|
190
|
+
The LorryStream library is an open source project, and is [managed on
|
|
191
|
+
GitHub]. Every kind of contribution, feedback, or patch, is much welcome.
|
|
192
|
+
[Create an issue] or submit a patch if you think we should include a new
|
|
193
|
+
feature, or to report or fix a bug.
|
|
194
|
+
|
|
195
|
+
### Development
|
|
196
|
+
|
|
197
|
+
In order to setup a development environment on your workstation, please
|
|
198
|
+
head over to the [development sandbox]
|
|
199
|
+
documentation. When you see the software tests succeed, you should be
|
|
200
|
+
ready to start hacking.
|
|
201
|
+
|
|
202
|
+
### License
|
|
203
|
+
|
|
204
|
+
The project is licensed under the terms of the LGPL license, see
|
|
205
|
+
[LICENSE].
|
|
206
|
+
|
|
207
|
+
### Prior art
|
|
208
|
+
|
|
209
|
+
We are maintaining a [list of other projects] with
|
|
210
|
+
the same or similar goals like LorryStream.
|
|
211
|
+
|
|
212
|
+
### Kudos
|
|
213
|
+
|
|
214
|
+
- [J. Paul Rodker Morrison] for discovering/inventing the Flow-Based
|
|
215
|
+
Programming ([FBP]) paradigm in the late '60s.
|
|
216
|
+
|
|
217
|
+
- [Matthew Rocklin], [Christopher J. 'CJ' Wright], and [Chinmay Chandak]
|
|
218
|
+
for conceiving [Streamz].
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
[amqp-forward]: https://github.com/daq-tools/amqp-forward
|
|
222
|
+
[Chinmay Chandak]: https://github.com/chinmaychandak
|
|
223
|
+
[Christopher J. 'CJ' Wright]: https://github.com/CJ-Wright
|
|
224
|
+
[Create an issue]: https://github.com/daq-tools/lorrystream/issues
|
|
225
|
+
[Dask]: https://github.com/dask/dask
|
|
226
|
+
[Dataflow]: https://en.wikipedia.org/wiki/Dataflow
|
|
227
|
+
[development sandbox]: https://github.com/daq-tools/lorrystream/blob/main/doc/development.rst
|
|
228
|
+
[FBP]: https://en.wikipedia.org/wiki/Flow-based_programming
|
|
229
|
+
[Flow-based Programming]: https://jpaulm.github.io/fbp/
|
|
230
|
+
[fsspec]: https://pypi.org/project/fsspec/
|
|
231
|
+
[GStreamer]: https://en.wikipedia.org/wiki/GStreamer
|
|
232
|
+
[J. Paul Rodker Morrison]: https://jpaulm.github.io/
|
|
233
|
+
[Kahn]: https://github.com/maritime-labs/kahn
|
|
234
|
+
[Kotori]: https://github.com/daq-tools/kotori
|
|
235
|
+
[LICENSE]: https://github.com/daq-tools/lorrystream/blob/main/LICENSE
|
|
236
|
+
[list of other projects]: https://github.com/daq-tools/lorrystream/blob/main/doc/prior-art.rst
|
|
237
|
+
[Luftdatenpumpe]: https://github.com/earthobservations/luftdatenpumpe
|
|
238
|
+
[managed on GitHub]: https://github.com/daq-tools/lorrystream
|
|
239
|
+
[Matthew Rocklin]: https://github.com/mrocklin
|
|
240
|
+
[mqttwarn]: https://github.com/jpmens/mqttwarn
|
|
241
|
+
[pandas]: https://pandas.pydata.org/
|
|
242
|
+
[socat]: http://www.dest-unreach.org/socat/
|
|
243
|
+
[SQLAlchemy]: https://pypi.org/project/SQLAlchemy/
|
|
244
|
+
[Streamz]: https://github.com/python-streamz/streamz
|
|
245
|
+
[testdata]: https://github.com/daq-tools/lorrystream/tree/main/tests/testdata
|
|
246
|
+
[ttnlogger]: https://github.com/daq-tools/ttnlogger
|
|
247
|
+
[Wetterdienst]: https://github.com/earthobservations/wetterdienst/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
#######
|
|
2
|
+
Backlog
|
|
3
|
+
#######
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
***********
|
|
@@ -40,6 +40,8 @@ Iteration 2
|
|
|
40
40
|
- [o] Examples: Add ``appsink`` example
|
|
41
41
|
- [o] Improve inline docs
|
|
42
42
|
- [o] Release 0.1.0
|
|
43
|
+
- [o] CSV: https://github.com/alan-turing-institute/CleverCSV
|
|
44
|
+
- [o] Excel & ODF: https://github.com/dimastbk/python-calamine
|
|
43
45
|
|
|
44
46
|
|
|
45
47
|
***********
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Carabas Backlog
|
|
2
|
+
|
|
3
|
+
## Iteration +1
|
|
4
|
+
- [x] Improve type mapping
|
|
5
|
+
- [x] Generalize CDC event -> SQL translator
|
|
6
|
+
- [ ] Only optionally display debug output of Docker build process,
|
|
7
|
+
[ ] when using `--verbose`.
|
|
8
|
+
- [ ] Bring back "Zip" use, for interactive hacking
|
|
9
|
+
- [ ] Distill into a Lambda variant
|
|
10
|
+
- [ ] Automation!
|
|
11
|
+
- [ ] DDL: CREATE TABLE <tablename> (data OBJECT(DYNAMIC));
|
|
12
|
+
- [ ] Wrap KCL launcher into manager component
|
|
13
|
+
|
|
14
|
+
## Iteration +2
|
|
15
|
+
- [ ] Performance improvements (simdjson?)
|
|
16
|
+
- [ ] Use SQLAlchemy for generating and submitting SQL statement
|
|
17
|
+
- [ ] Improve efficiency by using bulk operations when applicable
|
|
18
|
+
- [ ] is in UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS state and can not be updated
|
|
19
|
+
- [ ] is in ROLLBACK_COMPLETE state and can not be updated.
|
|
20
|
+
- [ ] Cannot create a publicly accessible DBInstance. The specified VPC has no
|
|
21
|
+
internet gateway attached.Update the VPC and then try again
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
(aws-dms-handbook)=
|
|
2
|
+
# AWS DMS Handbook
|
|
3
|
+
|
|
4
|
+
A few useful AWSCLI commands to check the status of the DMS engine and
|
|
5
|
+
relevant pipeline elements. You can also use the AWS Web Console to
|
|
6
|
+
inspect and commandeer the same details.
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
## Status Checks
|
|
10
|
+
Display ARNs of all replication instances.
|
|
11
|
+
```shell
|
|
12
|
+
aws dms describe-replication-instances | jq -r '.ReplicationInstances[].ReplicationInstanceArn'
|
|
13
|
+
```
|
|
14
|
+
Display replication endpoints and relevant connection settings.
|
|
15
|
+
```shell
|
|
16
|
+
aws dms describe-endpoints
|
|
17
|
+
```
|
|
18
|
+
Invoke connection test on given DMS endpoint.
|
|
19
|
+
```shell
|
|
20
|
+
aws dms test-connection \
|
|
21
|
+
--replication-instance-arn arn:aws:dms:eu-central-1:831394476016:rep:JD2LL6OM35BJZNKZIRSOE2FXIY \
|
|
22
|
+
--endpoint-arn arn:aws:dms:eu-central-1:831394476016:endpoint:3IVDGL6E4RDNBF2LFBYF6DYV3Y
|
|
23
|
+
```
|
|
24
|
+
Display connection test results.
|
|
25
|
+
```shell
|
|
26
|
+
aws dms describe-connections
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
## Operations
|
|
31
|
+
Enumerate all configured replication tasks with compact output.
|
|
32
|
+
```shell
|
|
33
|
+
aws dms describe-replication-tasks | \
|
|
34
|
+
jq '.ReplicationTasks[] | {ReplicationTaskIdentifier, ReplicationTaskArn, MigrationType, StartReplicationType, Status, StopReason, FailureMessages, ProvisionData}'
|
|
35
|
+
```
|
|
36
|
+
Start replication task with given ARN.
|
|
37
|
+
```shell
|
|
38
|
+
aws dms start-replication-task \
|
|
39
|
+
--start-replication-task-type start-replication --replication-task-arn \
|
|
40
|
+
arn:aws:dms:eu-central-1:831394476016:task:7QBLNBTPCNDEBG7CHI3WA73YFA
|
|
41
|
+
```
|
|
42
|
+
Stop replication task with given ARN.
|
|
43
|
+
```shell
|
|
44
|
+
aws dms stop-replication-task --replication-task-arn \
|
|
45
|
+
arn:aws:dms:eu-central-1:831394476016:task:7QBLNBTPCNDEBG7CHI3WA73YFA
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
## Logging
|
|
50
|
+
To see detailed progress about the replication process, use CloudWatch to
|
|
51
|
+
inspect corresponding log output.
|
|
52
|
+
|
|
53
|
+
Enumerate all log groups.
|
|
54
|
+
```shell
|
|
55
|
+
aws logs describe-log-groups
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Get log output history.
|
|
59
|
+
```shell
|
|
60
|
+
aws logs get-log-events \
|
|
61
|
+
--log-group-name dms-tasks-testdrive-dms-instance \
|
|
62
|
+
--log-stream-name dms-task-7QBLNBTPCNDEBG7CHI3WA73YFA | jq .events[].message
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Start watching the log output using the `start-live-tail` CloudWatch operation.
|
|
66
|
+
```shell
|
|
67
|
+
aws logs start-live-tail --log-group-identifiers \
|
|
68
|
+
arn:aws:logs:eu-central-1:831394476016:log-group:/aws/rds/instance/testdrive-dms-postgresql-dev-db/postgresql \
|
|
69
|
+
arn:aws:logs:eu-central-1:831394476016:log-group:dms-tasks-testdrive-dms-instance
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
## CloudFormation
|
|
74
|
+
When the CloudFormation deployment is stuck, or if you want to start from scratch,
|
|
75
|
+
those commands are useful.
|
|
76
|
+
```shell
|
|
77
|
+
aws cloudformation continue-update-rollback --stack-name testdrive-dms-postgresql-dev
|
|
78
|
+
aws cloudformation delete-stack --stack-name testdrive-dms-postgresql-dev
|
|
79
|
+
```
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
(aws-dms)=
|
|
2
|
+
# Pipelines with AWS DMS
|
|
3
|
+
|
|
4
|
+
_AWS DMS to Kinesis to CrateDB._
|
|
5
|
+
|
|
6
|
+
## What's Inside
|
|
7
|
+
- [Working with AWS DMS tasks]
|
|
8
|
+
- [Using Amazon Kinesis Data Streams as a target for AWS Database Migration Service]
|
|
9
|
+
- An IaC driver program based on [AWS CloudFormation] technologies using the
|
|
10
|
+
[cottonformation] Python API. It can be used to set up infrastructure on AWS
|
|
11
|
+
without much ado.
|
|
12
|
+
- DMS: Full load and CDC
|
|
13
|
+
- DMS Source: RDS PostgreSQL
|
|
14
|
+
- DMS Target: Amazon Kinesis
|
|
15
|
+
- CDC Target: CrateDB Cloud
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
## AWS Infrastructure Setup
|
|
19
|
+
The following walkthrough describes a full deployment of AWS DMS including
|
|
20
|
+
relevant outbound data processors for demonstration purposes.
|
|
21
|
+
|
|
22
|
+
In order to run it in production, you are welcome to derive from it and tweak
|
|
23
|
+
it for your own purposes. YMMV. If you need support, don't hesitate to ask for
|
|
24
|
+
help.
|
|
25
|
+
|
|
26
|
+
### Install
|
|
27
|
+
Install LorryStream.
|
|
28
|
+
```shell
|
|
29
|
+
pip install --upgrade 'lorrystream[carabas]'
|
|
30
|
+
```
|
|
31
|
+
Acquire IaC driver program.
|
|
32
|
+
```shell
|
|
33
|
+
wget https://github.com/daq-tools/lorrystream/raw/main/examples/aws/rds_postgresql_kinesis_lambda_oci_cratedb.py
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Configure
|
|
37
|
+
Please configure endpoint and replication settings within the source code
|
|
38
|
+
of the IaC program you just acquired, and presented next.
|
|
39
|
+
|
|
40
|
+
### Deploy
|
|
41
|
+
First, prepare an AWS ECR repository for publishing the OCI image including your
|
|
42
|
+
downstream processor element that is consuming the replication data stream from
|
|
43
|
+
Amazon Kinesis, and runs it into CrateDB. To learn about how this works, please
|
|
44
|
+
visit the documentation section about the [](project:#ecr-repository).
|
|
45
|
+
|
|
46
|
+
Configure CrateDB database sink address.
|
|
47
|
+
```shell
|
|
48
|
+
export SINK_SQLALCHEMY_URL='crate://admin:dZ..qB@example.eks1.eu-west-1.aws.cratedb.net:4200/?ssl=true'
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Invoke the IaC driver program in order to deploy relevant resources on AWS.
|
|
52
|
+
```shell
|
|
53
|
+
python examples/aws/rds_postgresql_kinesis_lambda_oci_cratedb.py
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
After deployment succeeded, you will be presented a corresponding response including
|
|
57
|
+
relevant information about entrypoints to the software stack you've just created.
|
|
58
|
+
```text
|
|
59
|
+
Result of CloudFormation deployment:
|
|
60
|
+
psql command: psql "postgresql://dynapipe:secret11@testdrive-dms-postgresql-dev-db.czylftvqn1ed.eu-central-1.rds.amazonaws.com:5432/postgres"
|
|
61
|
+
RDS Instance ARN: arn:aws:rds:eu-central-1:831394476016:db:testdrive-dms-postgresql-dev-db
|
|
62
|
+
Stream ARN: arn:aws:kinesis:eu-central-1:831394476016:stream/testdrive-dms-postgresql-dev-stream
|
|
63
|
+
Replication ARN: arn:aws:dms:eu-central-1:831394476016:replication-config:EAM3JEHXGBGZBPN5PLON7NPDEE
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
:::{note}
|
|
67
|
+
Please note this is a demonstration stack, deviating from typical real-world situations.
|
|
68
|
+
|
|
69
|
+
- Contrary to this stack, which includes an RDS PostgreSQL instance, a database instance
|
|
70
|
+
will already be up and running, so the remaining task is to just configure the Kinesis
|
|
71
|
+
Data Stream and consume it.
|
|
72
|
+
|
|
73
|
+
- Contrary to this stack, which uses AWS Lambda to host the downstream processor element,
|
|
74
|
+
when aiming for better cost-effectiveness, you will run corresponding code on a dedicated
|
|
75
|
+
computing environment.
|
|
76
|
+
:::
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
## Operations
|
|
80
|
+
Please consult the [](project:#aws-dms-handbook) to learn about commands
|
|
81
|
+
suitable for operating the AWS DMS engine.
|
|
82
|
+
|
|
83
|
+
:::{toctree}
|
|
84
|
+
:hidden:
|
|
85
|
+
|
|
86
|
+
handbook
|
|
87
|
+
:::
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
## Usage
|
|
92
|
+
|
|
93
|
+
### DMS
|
|
94
|
+
AWS DMS provides `full-load` and `full-load-and-cdc` migration types.
|
|
95
|
+
For a `full-load-and-cdc` task, AWS DMS migrates table data, and then applies
|
|
96
|
+
data changes that occur on the source, automatically establishing continuous
|
|
97
|
+
replication.
|
|
98
|
+
|
|
99
|
+
When starting a replication task using [StartReplicationTask], you can use those
|
|
100
|
+
possible values for `--start-replication-task-type`, see also [start-replication-task]:
|
|
101
|
+
|
|
102
|
+
:start-replication:
|
|
103
|
+
The only valid value for the first run of the task when the migration type is
|
|
104
|
+
`full-load` or `full-load-and-cdc`
|
|
105
|
+
|
|
106
|
+
:resume-processing:
|
|
107
|
+
Not applicable for any full-load task, because you can't resume partially loaded
|
|
108
|
+
tables during the full load phase. Use it to replicate the changes from the last
|
|
109
|
+
stop position.
|
|
110
|
+
|
|
111
|
+
:reload-target:
|
|
112
|
+
For a `full-load-and-cdc` task, load all the tables again, and start capturing
|
|
113
|
+
source changes.
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
## Migration by DMS Source
|
|
117
|
+
This section enumerates specific information to consider when aiming to use DMS
|
|
118
|
+
for your database as a source element.
|
|
119
|
+
|
|
120
|
+
:::{toctree}
|
|
121
|
+
:maxdepth: 2
|
|
122
|
+
|
|
123
|
+
postgresql
|
|
124
|
+
mysql
|
|
125
|
+
:::
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
[AWS CloudFormation]: https://en.wikipedia.org/wiki/AWS_CloudFormation
|
|
130
|
+
[cottonformation]: https://pypi.org/project/cottonformation/
|
|
131
|
+
[StartReplicationTask]: https://docs.aws.amazon.com/dms/latest/APIReference/API_StartReplicationTask.html
|
|
132
|
+
[start-replication-task]: https://docs.aws.amazon.com/cli/latest/reference/dms/start-replication-task.html
|
|
133
|
+
[Using Amazon Kinesis Data Streams as a target for AWS Database Migration Service]: https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Target.Kinesis.html
|
|
134
|
+
[Using object mapping to migrate data to a Kinesis data stream]: https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Target.Kinesis.html#CHAP_Target.Kinesis.ObjectMapping
|
|
135
|
+
[Working with AWS DMS tasks]: https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Tasks.html
|