-
-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Kafka cluster setup to docker-compose files and refactor Dockerfi…
…le for rdkafka dependencies. Implement retrying for consumer.rcv() fn to handle temporary Kafka unavailability.
- Loading branch information
Showing
15 changed files
with
767 additions
and
182 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,15 @@ LABEL maintainer="Parseable Team <[email protected]>" | |
LABEL org.opencontainers.image.vendor="Parseable Inc" | ||
LABEL org.opencontainers.image.licenses="AGPL-3.0" | ||
|
||
RUN apt-get update && \ | ||
apt-get install --no-install-recommends -y \ | ||
cmake \ | ||
librdkafka-dev \ | ||
ca-certificates \ | ||
libsasl2-dev \ | ||
libssl-dev && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
WORKDIR /parseable | ||
COPY . . | ||
RUN cargo build --release | ||
|
@@ -30,7 +39,16 @@ FROM gcr.io/distroless/cc-debian12:latest | |
|
||
WORKDIR /parseable | ||
|
||
# Copy the static shell into base image. | ||
# Copy the Parseable binary from builder | ||
COPY --from=builder /parseable/target/release/parseable /usr/bin/parseable | ||
|
||
# Copy only the libraries that binary needs since kafka is statically linked | ||
COPY --from=builder /usr/lib/x86_64-linux-gnu/libsasl2.so.2 /usr/lib/x86_64-linux-gnu/ | ||
COPY --from=builder /usr/lib/x86_64-linux-gnu/libssl.so.3 /usr/lib/x86_64-linux-gnu/ | ||
COPY --from=builder /usr/lib/x86_64-linux-gnu/libcrypto.so.3 /usr/lib/x86_64-linux-gnu/ | ||
|
||
# Copy CA certificates | ||
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ | ||
|
||
|
||
CMD ["/usr/bin/parseable"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
services: | ||
kafka: | ||
image: docker.io/bitnami/kafka:3.9 | ||
ports: | ||
- "9092:9092" | ||
- "29092:29092" | ||
volumes: | ||
- "kafka_data:/bitnami" | ||
environment: | ||
# KRaft settings | ||
- KAFKA_CFG_NODE_ID=0 | ||
- KAFKA_CFG_PROCESS_ROLES=controller,broker | ||
- KAFKA_CFG_CONTROLLER_QUORUM_VOTERS=0@kafka:9093 | ||
# Listeners for internal and external communication | ||
- KAFKA_CFG_LISTENERS=PLAINTEXT://0.0.0.0:9092,PLAINTEXT_INTERNAL://0.0.0.0:29092,CONTROLLER://:9093 | ||
- KAFKA_CFG_ADVERTISED_LISTENERS=PLAINTEXT://localhost:9092,PLAINTEXT_INTERNAL://kafka:29092 | ||
- KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP=PLAINTEXT:PLAINTEXT,PLAINTEXT_INTERNAL:PLAINTEXT,CONTROLLER:PLAINTEXT | ||
- KAFKA_CFG_CONTROLLER_LISTENER_NAMES=CONTROLLER | ||
- KAFKA_CFG_INTER_BROKER_LISTENER_NAME=PLAINTEXT_INTERNAL | ||
|
||
kafka-ui: | ||
platform: linux/amd64 | ||
image: provectuslabs/kafka-ui:latest | ||
ports: | ||
- "8080:8080" | ||
depends_on: | ||
- kafka | ||
environment: | ||
KAFKA_CLUSTERS_0_NAME: local | ||
KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS: kafka:29092 | ||
KAFKA_CLUSTERS_0_METRICS_PORT: 9101 | ||
DYNAMIC_CONFIG_ENABLED: "true" | ||
deploy: | ||
restart_policy: | ||
condition: on-failure | ||
delay: 20s | ||
max_attempts: 3 | ||
|
||
volumes: | ||
kafka_data: | ||
driver: local |
Oops, something went wrong.