diff --git a/.ci/clusters/values_runner_images.yaml b/.ci/clusters/values_runner_images.yaml index 4e9621faf..c224bb782 100644 --- a/.ci/clusters/values_runner_images.yaml +++ b/.ci/clusters/values_runner_images.yaml @@ -172,9 +172,9 @@ functions: disk: 1048576000 functionRuntimeFactoryConfigs: functionDockerImages: - JAVA: "streamnative/pulsar-functions-java-runner:2.9.2.23" - PYTHON: "streamnative/pulsar-functions-python-runner:2.9.2.23" - GO: "streamnative/pulsar-functions-go-runner:2.9.2.23" + JAVA: "localhost:5000/pulsar-functions-java-runner:2.9.2.23" + PYTHON: "localhost:5000/pulsar-functions-python-runner:2.9.2.23" + GO: "localhost:5000/pulsar-functions-go-runner:2.9.2.23" functionInstanceMinResources: cpu: 0.1 ram: 10485760 diff --git a/.github/workflows/test-function-runner.yml b/.github/workflows/test-function-runner.yml index f9027fa99..cc850ffe9 100644 --- a/.github/workflows/test-function-runner.yml +++ b/.github/workflows/test-function-runner.yml @@ -41,8 +41,10 @@ jobs: .ci/cleanup.sh - name: Build runner images + env: + DOCKER_REPO: localhost:5000 run: | - PULSAR_IMAGE_TAG=2.9.2.23 PULSAR_IMAGE=streamnative/pulsar-all KIND_PUSH=true images/build.sh + PULSAR_IMAGE_TAG=2.9.2.23 PULSAR_IMAGE=streamnative/pulsar-all KIND_PUSH=false images/build.sh - name: Verify function runner run: | diff --git a/images/build.sh b/images/build.sh index 407edbd1b..8f1600131 100755 --- a/images/build.sh +++ b/images/build.sh @@ -72,6 +72,15 @@ if [ "$KIND_PUSH" = true ] ; then kind load docker-image "${DOCKER_REPO}"/${PULSARCTL_GO_RUNNER}:"${RUNNER_TAG}" --name $cluster done fi + +if [ "$DOCKER_REPO" = "localhost:5000" ]; then + docker push "${DOCKER_REPO}"/${JAVA_RUNNER}:"${RUNNER_TAG}" + docker push "${DOCKER_REPO}"/${PULSARCTL_JAVA_RUNNER}:"${RUNNER_TAG}" + docker push "${DOCKER_REPO}"/${PYTHON_RUNNER}:"${RUNNER_TAG}" + docker push "${DOCKER_REPO}"/${PULSARCTL_PYTHON_RUNNER}:"${RUNNER_TAG}" + docker push "${DOCKER_REPO}"/${GO_RUNNER}:"${RUNNER_TAG}" + docker push "${DOCKER_REPO}"/${PULSARCTL_GO_RUNNER}:"${RUNNER_TAG}" +fi # #if [ "$CI_TEST" = true ] ; then # echo "apply images to function mesh ci yaml" diff --git a/images/pulsar-functions-python-runner/Dockerfile b/images/pulsar-functions-python-runner/Dockerfile index c59123c0d..673b37a43 100644 --- a/images/pulsar-functions-python-runner/Dockerfile +++ b/images/pulsar-functions-python-runner/Dockerfile @@ -41,6 +41,11 @@ WORKDIR /pulsar RUN if [ -f "/pulsar/bin/install-pulsar-client-37.sh" ]; then /pulsar/bin/install-pulsar-client-37.sh || true ; fi RUN if [ -f "/pulsar/bin/install-pulsar-client.sh" ]; then /pulsar/bin/install-pulsar-client.sh || pip3 install 'pulsar-client[all]==3.1.0' ; fi +# this dir is duplicate with the installed pulsar-client pip package, and maybe not compatible with the `_pulsar`(the .so library package) +RUN rm -rf /pulsar/instances/python-instance/pulsar/ \ + && sed -i "s/serde.IdentitySerDe/pulsar.functions.serde.IdentitySerDe/g" /pulsar/instances/python-instance/python_instance.py \ + && sed -i "s/serde.IdentitySerDe/pulsar.functions.serde.IdentitySerDe/g" /pulsar/instances/python-instance/contextimpl.py + USER $USER # a temp solution from https://github.com/apache/pulsar/pull/15846 to fix python protobuf version error diff --git a/images/pulsar-functions-python-runner/pulsarctl.Dockerfile b/images/pulsar-functions-python-runner/pulsarctl.Dockerfile index 298686118..b0a58d543 100644 --- a/images/pulsar-functions-python-runner/pulsarctl.Dockerfile +++ b/images/pulsar-functions-python-runner/pulsarctl.Dockerfile @@ -34,6 +34,11 @@ RUN if [ -d "/pulsar/cpp-client" ]; then apt-get update \ RUN if [ -f "/pulsar/bin/install-pulsar-client-37.sh" ]; then /pulsar/bin/install-pulsar-client-37.sh || pip3 install 'pulsar-client[all]==3.1.0' ; fi RUN if [ -f "/pulsar/bin/install-pulsar-client.sh" ]; then /pulsar/bin/install-pulsar-client.sh || pip3 install 'pulsar-client[all]==3.1.0' ; fi +# this dir is duplicate with the installed pulsar-client pip package, and maybe not compatible with the `_pulsar`(the .so library package) +RUN rm -rf /pulsar/instances/python-instance/pulsar/ \ + && sed -i "s/serde.IdentitySerDe/pulsar.functions.serde.IdentitySerDe/g" /pulsar/instances/python-instance/python_instance.py \ + && sed -i "s/serde.IdentitySerDe/pulsar.functions.serde.IdentitySerDe/g" /pulsar/instances/python-instance/contextimpl.py + WORKDIR /pulsar USER $USER