Skip to content

Error, when installing requirements in docker-compose. Macbook M2 #1482

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
timurchikk opened this issue Dec 15, 2022 · 3 comments
Open

Error, when installing requirements in docker-compose. Macbook M2 #1482

timurchikk opened this issue Dec 15, 2022 · 3 comments

Comments

@timurchikk
Copy link

Description

@OneCricketeer
Copy link

OneCricketeer commented Feb 9, 2023

Related #1190 #1182 #1466 #1439

@LiamClarkeNZ
Copy link

LiamClarkeNZ commented Apr 3, 2023

Yep, you'll need to download the librdkafka library, so that CKP can link against it when building from source. So apt-get/dnf/pacman whatever install librdkafka. If there are no existing packages for it that support ARM on your Docker image's OS, you can built it from source. This is what we do:

# Install librdkafka from source for confluent-kafka-python
RUN LIBRDKAFKA_VERSION=$( curl -sL https://api.github.com/repos/edenhill/librdkafka/releases/latest \
    | jq -r ".tag_name") \ 
    && mkdir /tmp/librdkafka \
    && curl -L https://github.com/edenhill/librdkafka/archive/refs/tags/$LIBRDKAFKA_VERSION.tar.gz \
          | tar -xz -C /tmp/librdkafka --strip-components=1 \
    && cd /tmp/librdkafka \
    && ./configure --install-deps \
    && make \
    && make install

You'll also need to ensure that the compiler can find them at library install time, if they're installed to a non-traditional location. E.g., when I was trying to install CKP locally for an older Python that there were no binary wheels for ARM on:

brew install librdkafka
# Set these env vars for GCC to find librdkafka headers
env C_INCLUDE_PATH=/opt/homebrew/Cellar/librdkafka/1.9.2/include \ 
      LIBRARY_PATH=/opt/homebrew/Cellar/librdkafka/1.9.2/lib \
      pip install confluent-kafka[avro,json,protobuf]==1.9.2

@sivankumar86
Copy link

have you tried this ?

FROM python:3.9.11-alpine3.15 

# upgrade pip to the latest version
RUN apk --no-cache upgrade \
    && pip install --upgrade pip \
    && apk --no-cache add tzdata build-base gcc libc-dev g++ make git bash

RUN git clone https://github.com/edenhill/librdkafka.git && cd librdkafka \
    && git checkout tags/v2.2.0 && ./configure --clean \
    && ./configure --prefix /usr/local \
    && make && make install
RUN pip install confluent-kafka==2.2.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants