From 0899aa269303b050b2bfe7e6f7f98f3f59057963 Mon Sep 17 00:00:00 2001 From: jiangpengcheng Date: Thu, 24 Jul 2025 11:28:29 +0800 Subject: [PATCH 1/3] Use latest protobuf in python image --- images/pulsar-functions-python-runner/Dockerfile | 3 +-- images/pulsar-functions-python-runner/pulsarctl.Dockerfile | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/images/pulsar-functions-python-runner/Dockerfile b/images/pulsar-functions-python-runner/Dockerfile index 79780a0d4..7852a030f 100644 --- a/images/pulsar-functions-python-runner/Dockerfile +++ b/images/pulsar-functions-python-runner/Dockerfile @@ -42,7 +42,6 @@ RUN rm -rf /pulsar/instances/python-instance/pulsar/ \ USER $USER -# a temp solution from https://github.com/apache/pulsar/pull/15846 to fix python protobuf version error -RUN pip3 install protobuf==3.20.2 --user +RUN pip3 install protobuf --upgrade --user # to make the python runner could print json logs RUN pip3 install python-json-logger --user diff --git a/images/pulsar-functions-python-runner/pulsarctl.Dockerfile b/images/pulsar-functions-python-runner/pulsarctl.Dockerfile index 182b2a299..d00529ace 100644 --- a/images/pulsar-functions-python-runner/pulsarctl.Dockerfile +++ b/images/pulsar-functions-python-runner/pulsarctl.Dockerfile @@ -64,7 +64,6 @@ RUN rm -rf /pulsar/instances/python-instance/pulsar/ \ WORKDIR /pulsar USER $USER -# a temp solution from https://github.com/apache/pulsar/pull/15846 to fix python protobuf version error -RUN pip3 install protobuf==3.20.2 --user +RUN pip3 install protobuf --upgrade --user # to make the python runner could print json logs RUN pip3 install python-json-logger --user From e64d201ee16081681e4a527fb3e57e6ed273e105 Mon Sep 17 00:00:00 2001 From: jiangpengcheng Date: Thu, 24 Jul 2025 11:46:13 +0800 Subject: [PATCH 2/3] Use protobuf==6.31.1 in python image --- images/pulsar-functions-python-runner/Dockerfile | 2 +- images/pulsar-functions-python-runner/pulsarctl.Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/images/pulsar-functions-python-runner/Dockerfile b/images/pulsar-functions-python-runner/Dockerfile index 7852a030f..fd6de14de 100644 --- a/images/pulsar-functions-python-runner/Dockerfile +++ b/images/pulsar-functions-python-runner/Dockerfile @@ -42,6 +42,6 @@ RUN rm -rf /pulsar/instances/python-instance/pulsar/ \ USER $USER -RUN pip3 install protobuf --upgrade --user +RUN pip3 install protobuf==6.31.1 --user # to make the python runner could print json logs RUN pip3 install python-json-logger --user diff --git a/images/pulsar-functions-python-runner/pulsarctl.Dockerfile b/images/pulsar-functions-python-runner/pulsarctl.Dockerfile index d00529ace..eba75ea7b 100644 --- a/images/pulsar-functions-python-runner/pulsarctl.Dockerfile +++ b/images/pulsar-functions-python-runner/pulsarctl.Dockerfile @@ -64,6 +64,6 @@ RUN rm -rf /pulsar/instances/python-instance/pulsar/ \ WORKDIR /pulsar USER $USER -RUN pip3 install protobuf --upgrade --user +RUN pip3 install protobuf==6.31.1 --user # to make the python runner could print json logs RUN pip3 install python-json-logger --user From 47602095fce7f695f2267b145bbd87b44820bc03 Mon Sep 17 00:00:00 2001 From: jiangpengcheng Date: Thu, 24 Jul 2025 15:48:05 +0800 Subject: [PATCH 3/3] Check proto file --- images/pulsar-functions-python-runner/Dockerfile | 6 +++++- images/pulsar-functions-python-runner/pulsarctl.Dockerfile | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/images/pulsar-functions-python-runner/Dockerfile b/images/pulsar-functions-python-runner/Dockerfile index fd6de14de..9f9c8367a 100644 --- a/images/pulsar-functions-python-runner/Dockerfile +++ b/images/pulsar-functions-python-runner/Dockerfile @@ -42,6 +42,10 @@ RUN rm -rf /pulsar/instances/python-instance/pulsar/ \ USER $USER -RUN pip3 install protobuf==6.31.1 --user +# a temp solution from https://github.com/apache/pulsar/pull/15846 to fix python protobuf version error +RUN pip3 install protobuf==3.20.2 --user +# a temporary fix for https://github.com/apache/pulsar/pull/24544, it requires the protobuf version to be 6.31.1 +RUN grep -q 'from google.protobuf import runtime_version as _runtime_version' /pulsar/instances/python-instance/Function_pb2.py && \ + pip install protobuf==6.31.1 || true # to make the python runner could print json logs RUN pip3 install python-json-logger --user diff --git a/images/pulsar-functions-python-runner/pulsarctl.Dockerfile b/images/pulsar-functions-python-runner/pulsarctl.Dockerfile index eba75ea7b..f63170e6c 100644 --- a/images/pulsar-functions-python-runner/pulsarctl.Dockerfile +++ b/images/pulsar-functions-python-runner/pulsarctl.Dockerfile @@ -64,6 +64,10 @@ RUN rm -rf /pulsar/instances/python-instance/pulsar/ \ WORKDIR /pulsar USER $USER -RUN pip3 install protobuf==6.31.1 --user +# a temp solution from https://github.com/apache/pulsar/pull/15846 to fix python protobuf version error +RUN pip3 install protobuf==3.20.2 --user +# a temporary fix for https://github.com/apache/pulsar/pull/24544, it requires the protobuf version to be 6.31.1 +RUN grep -q 'from google.protobuf import runtime_version as _runtime_version' /pulsar/instances/python-instance/Function_pb2.py && \ + pip install protobuf==6.31.1 || true # to make the python runner could print json logs RUN pip3 install python-json-logger --user