Closed ginwakeup closed 2 years ago
you need to install gcc
into the container I believe apt install build-essential
should do it.
you need to install
gcc
into the container I believeapt install build-essential
should do it.
Hi @dylanbstorey , thanks for the answer, unfortunately I already have build-essential and gcc.
The error is caused by confluent-kafka not being able to find librdkafka. This is the command I am running to install it in the docker image:
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
librdkafka-dev build-essential libopenmpi-dev libssl-dev python3-dev libkrb5-dev \
&& apt-get autoremove -yqq --purge \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
but still I get the following error:
#7 8.055 Running setup.py clean for confluent-kafka
#7 8.425 Failed to build confluent-kafka
#7 8.960 Installing collected packages: confluent-kafka, asgiref, airflow-provider-kafka
#7 8.962 Running setup.py install for confluent-kafka: started
#7 9.423 Running setup.py install for confluent-kafka: finished with status 'error'
#7 9.427 error: subprocess-exited-with-error
#7 9.427
#7 9.427 × Running setup.py install for confluent-kafka did not run successfully.
#7 9.427 │ exit code: 1
#7 9.427 ╰─> [52 lines of output]
#7 9.427 running install
#7 9.427 running build
#7 9.427 running build_py
#7 9.427 creating build
#7 9.427 creating build/lib.linux-aarch64-3.7
#7 9.427 creating build/lib.linux-aarch64-3.7/confluent_kafka
#7 9.427 copying src/confluent_kafka/__init__.py -> build/lib.linux-aarch64-3.7/confluent_kafka
#7 9.427 copying src/confluent_kafka/error.py -> build/lib.linux-aarch64-3.7/confluent_kafka
#7 9.427 copying src/confluent_kafka/serializing_producer.py -> build/lib.linux-aarch64-3.7/confluent_kafka
#7 9.427 copying src/confluent_kafka/deserializing_consumer.py -> build/lib.linux-aarch64-3.7/confluent_kafka
#7 9.427 creating build/lib.linux-aarch64-3.7/confluent_kafka/serialization
#7 9.427 copying src/confluent_kafka/serialization/__init__.py -> build/lib.linux-aarch64-3.7/confluent_kafka/serialization
#7 9.427 creating build/lib.linux-aarch64-3.7/confluent_kafka/kafkatest
#7 9.427 copying src/confluent_kafka/kafkatest/verifiable_consumer.py -> build/lib.linux-aarch64-3.7/confluent_kafka/kafkatest
#7 9.427 copying src/confluent_kafka/kafkatest/__init__.py -> build/lib.linux-aarch64-3.7/confluent_kafka/kafkatest
#7 9.427 copying src/confluent_kafka/kafkatest/verifiable_client.py -> build/lib.linux-aarch64-3.7/confluent_kafka/kafkatest
#7 9.427 copying src/confluent_kafka/kafkatest/verifiable_producer.py -> build/lib.linux-aarch64-3.7/confluent_kafka/kafkatest
#7 9.427 creating build/lib.linux-aarch64-3.7/confluent_kafka/avro
#7 9.427 copying src/confluent_kafka/avro/load.py -> build/lib.linux-aarch64-3.7/confluent_kafka/avro
#7 9.427 copying src/confluent_kafka/avro/cached_schema_registry_client.py -> build/lib.linux-aarch64-3.7/confluent_kafka/avro
#7 9.427 copying src/confluent_kafka/avro/__init__.py -> build/lib.linux-aarch64-3.7/confluent_kafka/avro
#7 9.427 copying src/confluent_kafka/avro/error.py -> build/lib.linux-aarch64-3.7/confluent_kafka/avro
#7 9.427 creating build/lib.linux-aarch64-3.7/confluent_kafka/schema_registry
#7 9.427 copying src/confluent_kafka/schema_registry/json_schema.py -> build/lib.linux-aarch64-3.7/confluent_kafka/schema_registry
#7 9.427 copying src/confluent_kafka/schema_registry/__init__.py -> build/lib.linux-aarch64-3.7/confluent_kafka/schema_registry
#7 9.427 copying src/confluent_kafka/schema_registry/error.py -> build/lib.linux-aarch64-3.7/confluent_kafka/schema_registry
#7 9.427 copying src/confluent_kafka/schema_registry/schema_registry_client.py -> build/lib.linux-aarch64-3.7/confluent_kafka/schema_registry
#7 9.427 copying src/confluent_kafka/schema_registry/avro.py -> build/lib.linux-aarch64-3.7/confluent_kafka/schema_registry
#7 9.427 copying src/confluent_kafka/schema_registry/protobuf.py -> build/lib.linux-aarch64-3.7/confluent_kafka/schema_registry
#7 9.427 creating build/lib.linux-aarch64-3.7/confluent_kafka/admin
#7 9.427 copying src/confluent_kafka/admin/_resource.py -> build/lib.linux-aarch64-3.7/confluent_kafka/admin
#7 9.427 copying src/confluent_kafka/admin/_config.py -> build/lib.linux-aarch64-3.7/confluent_kafka/admin
#7 9.427 copying src/confluent_kafka/admin/_acl.py -> build/lib.linux-aarch64-3.7/confluent_kafka/admin
#7 9.427 copying src/confluent_kafka/admin/__init__.py -> build/lib.linux-aarch64-3.7/confluent_kafka/admin
#7 9.427 creating build/lib.linux-aarch64-3.7/confluent_kafka/avro/serializer
#7 9.427 copying src/confluent_kafka/avro/serializer/__init__.py -> build/lib.linux-aarch64-3.7/confluent_kafka/avro/serializer
#7 9.427 copying src/confluent_kafka/avro/serializer/message_serializer.py -> build/lib.linux-aarch64-3.7/confluent_kafka/avro/serializer
#7 9.427 running build_ext
#7 9.427 building 'confluent_kafka.cimpl' extension
#7 9.427 creating build/temp.linux-aarch64-3.7
#7 9.427 creating build/temp.linux-aarch64-3.7/tmp
#7 9.427 creating build/temp.linux-aarch64-3.7/tmp/pip-install-ggcgw7lz
#7 9.427 creating build/temp.linux-aarch64-3.7/tmp/pip-install-ggcgw7lz/confluent-kafka_00fcd73d925244dbbeaef64c302d8657
#7 9.427 creating build/temp.linux-aarch64-3.7/tmp/pip-install-ggcgw7lz/confluent-kafka_00fcd73d925244dbbeaef64c302d8657/src
#7 9.427 creating build/temp.linux-aarch64-3.7/tmp/pip-install-ggcgw7lz/confluent-kafka_00fcd73d925244dbbeaef64c302d8657/src/confluent_kafka
#7 9.427 creating build/temp.linux-aarch64-3.7/tmp/pip-install-ggcgw7lz/confluent-kafka_00fcd73d925244dbbeaef64c302d8657/src/confluent_kafka/src
#7 9.427 gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/usr/local/include/python3.7m -c /tmp/pip-install-ggcgw7lz/confluent-kafka_00fcd73d925244dbbeaef64c302d8657/src/confluent_kafka/src/confluent_kafka.c -o build/temp.linux-aarch64-3.7/tmp/pip-install-ggcgw7lz/confluent-kafka_00fcd73d925244dbbeaef64c302d8657/src/confluent_kafka/src/confluent_kafka.o
#7 9.427 In file included from /tmp/pip-install-ggcgw7lz/confluent-kafka_00fcd73d925244dbbeaef64c302d8657/src/confluent_kafka/src/confluent_kafka.c:17:
#7 9.427 /tmp/pip-install-ggcgw7lz/confluent-kafka_00fcd73d925244dbbeaef64c302d8657/src/confluent_kafka/src/confluent_kafka.h:66:2: error: #error "confluent-kafka-python requires librdkafka v1.9.0 or later. Install the latest version of librdkafka from the Confluent repositories, see http://docs.confluent.io/current/installation.html"
#7 9.427 66 | #error "confluent-kafka-python requires librdkafka v1.9.0 or later. Install the latest version of librdkafka from the Confluent repositories, see http://docs.confluent.io/current/installation.html"
#7 9.427 | ^~~~~
#7 9.427 error: command 'gcc' failed with exit status 1
#7 9.427 [end of output]
confluent-kafka-python requires librdkafka v1.9.0 or later. Install the latest version of librdkafka from the Confluent repositories, see http://docs.confluent.io/current/installation.html
From your logs appears to provide some clues on your next steps.
https://github.com/astronomer/airflow-provider-kafka/blob/main/dev/Dockerfile also works.
Thanks for the reply @dylanbstorey . In the end I noticed I was installing it, but it couldn't find the librdkafka for some linking issues that seem to happen in Debian based images (and the docker hub airflow image should Debian based, if I am not wrong).
I've tried the dev image in your repository and it works, but I am not sure why.
I can see it uses a different image, from quay: quay.io/astronomer/ap-airflow:2.2.3
maybe this is the cause.
From what I know the airflow image from docker hub uses FROM python-slim, shouldn't this be the same? Or maybe the image in quay inherits from something else, like ubuntu?
I am not sure.
Thank you.
Id probably start by not doing a staged build to begin with.
Hi!
I am really interested in the project and I was trying to give it ago, but I can't get passed an installation issue.
My Airflow instance is currently executed in Docker, and I have a custom Dockerfile in which I simply pip install the dependencies:
In my dev.txt requirements file:
Unfortunately, due to the fact that Airflow is not executed as root, and therefore python packages are not installed with root user, I am getting the following error:
Any idea on how I could get past this? Have you tried the Kafka provider in a Docker Airflow container?
Thanks!