Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions dataflow/snippets/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@
# on the host machine. This Dockerfile is derived from the
# dataflow/custom-containers/ubuntu sample.

FROM python:3.14-slim
FROM python:3.13-slim

# Install JRE
COPY --from=openjdk:8-jre-slim /usr/local/openjdk-8 /usr/local/openjdk-8
ENV JAVA_HOME /usr/local/openjdk-8
RUN update-alternatives --install /usr/bin/java java /usr/local/openjdk-8/bin/java 10
COPY --from=eclipse-temurin:17-jre /opt/java/openjdk /opt/java/openjdk
ENV JAVA_HOME /opt/java/openjdk
RUN update-alternatives --install /usr/bin/java java /opt/java/openjdk/bin/java 10

WORKDIR /pipeline

# Copy files from official SDK image.
COPY --from=apache/beam_python3.14_sdk:2.73.0 /opt/apache/beam /opt/apache/beam
COPY --from=apache/beam_python3.13_sdk:2.76.0 /opt/apache/beam /opt/apache/beam
# Set the entrypoint to Apache Beam SDK launcher.
ENTRYPOINT [ "/opt/apache/beam/boot" ]

Expand All @@ -37,8 +37,8 @@ RUN apt-get update
RUN apt-get install -y --no-install-recommends docker.io

# Install dependencies.
RUN pip3 install --no-cache-dir apache-beam[gcp]==2.73.0
RUN pip install --no-cache-dir kafka-python==2.0.6
RUN pip3 install --no-cache-dir apache-beam[gcp]==2.76.0
RUN pip install --no-cache-dir kafka-python==3.0.11

# Verify that the image does not have conflicting dependencies.
RUN pip check
Expand Down
2 changes: 1 addition & 1 deletion dataflow/snippets/requirements-test.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
pytest==9.0.3; python_version >= "3.10"
pytest==9.1.1
docker==7.1.0

4 changes: 2 additions & 2 deletions dataflow/snippets/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
apache-beam[gcp]==2.63.0
kafka-python==2.0.6
apache-beam[gcp]==2.76.0
kafka-python==3.0.11
4 changes: 2 additions & 2 deletions dataflow/snippets/tests/test_read_kafka.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
from docker import DockerClient
from kafka import KafkaProducer
from kafka.admin import KafkaAdminClient, NewTopic
from kafka.errors import NoBrokersAvailable
from kafka.errors import KafkaTimeoutError
Comment thread
XrossFox marked this conversation as resolved.

import pytest

Expand Down Expand Up @@ -67,7 +67,7 @@ def create_topics() -> None:
topics.append(NewTopic(name=TOPIC_NAMES[1], num_partitions=1, replication_factor=1))
client.create_topics(topics)
break
except NoBrokersAvailable:
except KafkaTimeoutError:
Comment thread
XrossFox marked this conversation as resolved.
time.sleep(5)


Expand Down
Loading