Faust Python example with Docker
363
Faust is a stream processing library, porting the ideas from Kafka Streams to Python.
It is used at Robinhood to build high performance distributed systems and real-time data pipelines that process billions of events every day.
Faust provides both stream processing and event processing, sharing similarity with tools such as Kafka Streams, Apache Spark/Storm/Samza/Flink,
It does not use a DSL, it’s just Python! This means you can use all your favorite Python libraries when stream processing: NumPy, PyTorch, Pandas, NLTK, Django, Flask, SQLAlchemy, ++
Faust requires Python 3.6 or later for the new async/await syntax, and variable type annotations.
This image contains a Faust application with 3 "packages". Two packages are from Faust tutorials Page Views and Leader Election, the other one is an example of how to integrate the schema-registry with Faust. For the full example, you can take a look here
https://github.com/marcosschroh/faust-docker-compose-example
Because is a streaming processing we need to set up zookeeper and kafka and optionally schema-registry. You can find the description of these images in confluentinc
I will recommend using docker-compose at the beginning, for example, https://github.com/marcosschroh/faust-docker-compose-example/blob/master/docker-compose.yaml. You can run with docker run marcosschroh/faust-docker-example
| Variable | description | example |
|---|---|---|
| WORKER | Entrypoint in setup.py | example |
| WORKER_PORT | Worker port | 6066 |
| KAFKA_BOOSTRAP_SERVER | Kafka servers | kafka://kafka:9092 |
| KAFKA_BOOSTRAP_SERVER_NAME | Kafka server name | kafka |
| KAFKA_BOOSTRAP_SERVER_PORT | Kafka server port | 9092 |
| SCHEMA_REGISTRY_SERVER | Schema registry server name | schema-registry |
| SCHEMA_REGISTRY_SERVER_PORT | Schema registry server port | 8081 |
| SCHEMA_REGISTRY_URL | Schema Registry Server url | http://schema-registry:8081 |
Content type
Image
Digest
Size
75.7 MB
Last updated
over 7 years ago
docker pull marcosschroh/faust-docker-example:1.1.1