-
Notifications
You must be signed in to change notification settings - Fork 2
Getting Kafka esque with Python
Ritesh Agrawal edited this page Sep 17, 2021
·
1 revision
-
Install Docker (Mac, Windows, Linux) on your system.
-
Mac/Windows only: in Docker’s advanced settings, increase the memory dedicated to Docker to at least 4GB.
-
Clone the repository here :
https://github.com/DipenChawla/kafka-python-workshop/tree/main cd kafka-python-workshop- Test your docker memory settings
docker system info | grep MemoryShould return a value greater than 4GB - if not, the Kafka stack will probably not work.
-
Smoke test your Docker environment, by running :
docker run -p 8080:8080 hello-worldYou should see:
$ docker run -p 8080:8080 hello-world Unable to find image 'hello-world:latest' locally latest: Pulling from library/hello-world d1725b59e92d: Pull complete Digest: sha256:0add3ace90ecb4adbf7777e9aacf18357296e799f81cabc9fde470971e499788 Status: Downloaded newer image for hello-world:latest Hello from Docker! This message shows that your installation appears to be working correctly. [...]
-
-
Install docker-compose (Mac, Windows, Linux)
-
If you're using Docker Desktop, you can skip this as Compose is bundled-in with Docker Desktop
-
Smoke test your installation by running:
docker-compose version -
Run docker-compose in detached mode. This will setup a local Kafka broker, a Zookeeper node and a few important peripherals that will be a part of later exercises.
docker-compose up -d
-
-
Create a Python virtualenv
-
for Unix/MacOS
$(which python3) -m venv newenv/ source env/bin/activate -
for Windows
py -m venv newenv/ .\env\Scripts\activate
Installation guide (link) for virtualenv
- Install requirements for the workshop with
pip install -r requirements.txt
- Taking down docker containers after the workshop
docker-compose down