At the root of this repository you should create an .env
file that contains the login information for Kafka.
The consumer listens to the floorplan-model
topic, generates the corresponding artefacts, and publishes their path in the server in the scenery-artefacts
topic.
This assumes you have a local installation of the FloorPlan DSL and the scenery_builder.
You'll also need to install Confluent Kafka and other requirements:
pip install confluent-kafka requests dotenv
Create an .env
file to store your credentials and the relevant API endpoints, for example:
KAFKA_USER=myuser
KAFKA_PASS=12345pass
KAFKA_URL=kafka-url:9000
REST_UPLOAD_ARTEFACT_URL=http://server-url:8000/api/upload/artefact
After activating your virtual environment, simply run the floorplan consumer:
python floorplan_consumer.py
The floorplan_bim_producer.py
and artefact_consumer.py
are mockup scripts to test subscribing and publishing to the Kafka topics.
After building or pulling the Docker image, just run a container. The default CMD
is already set for the Kafka consumer.
You should use the argument --env-file
to pass the path of the .env
file containing the credentials to login and URLs, for example:
docker run --env-file .env -it mat_kafka:latest
The Dockerfile uses the images of the development branch of the two floorplan components. The images are built as part of the CI and hosted on GitHub.