diff --git a/packages/pynumaflow/examples/accumulator/streamsorter/Dockerfile b/packages/pynumaflow/examples/accumulator/streamsorter/Dockerfile index dcec2776..012c814d 100644 --- a/packages/pynumaflow/examples/accumulator/streamsorter/Dockerfile +++ b/packages/pynumaflow/examples/accumulator/streamsorter/Dockerfile @@ -27,7 +27,12 @@ WORKDIR $EXAMPLE_PATH COPY --from=builder $EXAMPLE_PATH/.venv $EXAMPLE_PATH/.venv COPY --from=builder $EXAMPLE_PATH/ $EXAMPLE_PATH/ -ENTRYPOINT [] -CMD ["uv", "run", "python", "example.py"] +# NOTE: We cannot use "uv run python example.py" here because uv run reads the +# example's pyproject.toml, finds the pynumaflow path source (path = "../../../"), +# and tries to resolve it. In the runtime stage, the parent pynumaflow source tree +# is not present (by design, to keep the image small), so uv run fails. +# Instead, we activate the pre-built .venv via PATH and run python directly. +ENV PATH="$EXAMPLE_PATH/.venv/bin:$PATH" +CMD ["python", "example.py"] EXPOSE 5000 diff --git a/packages/pynumaflow/examples/batchmap/flatmap/Dockerfile b/packages/pynumaflow/examples/batchmap/flatmap/Dockerfile index dba98a65..3cbfb7b5 100644 --- a/packages/pynumaflow/examples/batchmap/flatmap/Dockerfile +++ b/packages/pynumaflow/examples/batchmap/flatmap/Dockerfile @@ -27,7 +27,12 @@ WORKDIR $EXAMPLE_PATH COPY --from=builder $EXAMPLE_PATH/.venv $EXAMPLE_PATH/.venv COPY --from=builder $EXAMPLE_PATH/ $EXAMPLE_PATH/ -ENTRYPOINT [] -CMD ["uv", "run", "python", "example.py"] +# NOTE: We cannot use "uv run python example.py" here because uv run reads the +# example's pyproject.toml, finds the pynumaflow path source (path = "../../../"), +# and tries to resolve it. In the runtime stage, the parent pynumaflow source tree +# is not present (by design, to keep the image small), so uv run fails. +# Instead, we activate the pre-built .venv via PATH and run python directly. +ENV PATH="$EXAMPLE_PATH/.venv/bin:$PATH" +CMD ["python", "example.py"] EXPOSE 5000 diff --git a/packages/pynumaflow/examples/map/even_odd/Dockerfile b/packages/pynumaflow/examples/map/even_odd/Dockerfile index 81ea9d11..2c4e5d58 100644 --- a/packages/pynumaflow/examples/map/even_odd/Dockerfile +++ b/packages/pynumaflow/examples/map/even_odd/Dockerfile @@ -27,7 +27,12 @@ WORKDIR $EXAMPLE_PATH COPY --from=builder $EXAMPLE_PATH/.venv $EXAMPLE_PATH/.venv COPY --from=builder $EXAMPLE_PATH/ $EXAMPLE_PATH/ -ENTRYPOINT [] -CMD ["uv", "run", "python", "example.py"] +# NOTE: We cannot use "uv run python example.py" here because uv run reads the +# example's pyproject.toml, finds the pynumaflow path source (path = "../../../"), +# and tries to resolve it. In the runtime stage, the parent pynumaflow source tree +# is not present (by design, to keep the image small), so uv run fails. +# Instead, we activate the pre-built .venv via PATH and run python directly. +ENV PATH="$EXAMPLE_PATH/.venv/bin:$PATH" +CMD ["python", "example.py"] EXPOSE 5000 diff --git a/packages/pynumaflow/examples/map/flatmap/Dockerfile b/packages/pynumaflow/examples/map/flatmap/Dockerfile index 3e267a3a..82bde66f 100644 --- a/packages/pynumaflow/examples/map/flatmap/Dockerfile +++ b/packages/pynumaflow/examples/map/flatmap/Dockerfile @@ -27,7 +27,12 @@ WORKDIR $EXAMPLE_PATH COPY --from=builder $EXAMPLE_PATH/.venv $EXAMPLE_PATH/.venv COPY --from=builder $EXAMPLE_PATH/ $EXAMPLE_PATH/ -ENTRYPOINT [] -CMD ["uv", "run", "python", "example.py"] +# NOTE: We cannot use "uv run python example.py" here because uv run reads the +# example's pyproject.toml, finds the pynumaflow path source (path = "../../../"), +# and tries to resolve it. In the runtime stage, the parent pynumaflow source tree +# is not present (by design, to keep the image small), so uv run fails. +# Instead, we activate the pre-built .venv via PATH and run python directly. +ENV PATH="$EXAMPLE_PATH/.venv/bin:$PATH" +CMD ["python", "example.py"] EXPOSE 5000 diff --git a/packages/pynumaflow/examples/map/forward_message/Dockerfile b/packages/pynumaflow/examples/map/forward_message/Dockerfile index 05964ef1..22b921b3 100644 --- a/packages/pynumaflow/examples/map/forward_message/Dockerfile +++ b/packages/pynumaflow/examples/map/forward_message/Dockerfile @@ -27,7 +27,12 @@ WORKDIR $EXAMPLE_PATH COPY --from=builder $EXAMPLE_PATH/.venv $EXAMPLE_PATH/.venv COPY --from=builder $EXAMPLE_PATH/ $EXAMPLE_PATH/ -ENTRYPOINT [] -CMD ["uv", "run", "python", "example.py"] +# NOTE: We cannot use "uv run python example.py" here because uv run reads the +# example's pyproject.toml, finds the pynumaflow path source (path = "../../../"), +# and tries to resolve it. In the runtime stage, the parent pynumaflow source tree +# is not present (by design, to keep the image small), so uv run fails. +# Instead, we activate the pre-built .venv via PATH and run python directly. +ENV PATH="$EXAMPLE_PATH/.venv/bin:$PATH" +CMD ["python", "example.py"] EXPOSE 5000 diff --git a/packages/pynumaflow/examples/map/multiproc_map/Dockerfile b/packages/pynumaflow/examples/map/multiproc_map/Dockerfile index 5ece2b20..0afd8cc6 100644 --- a/packages/pynumaflow/examples/map/multiproc_map/Dockerfile +++ b/packages/pynumaflow/examples/map/multiproc_map/Dockerfile @@ -27,7 +27,12 @@ WORKDIR $EXAMPLE_PATH COPY --from=builder $EXAMPLE_PATH/.venv $EXAMPLE_PATH/.venv COPY --from=builder $EXAMPLE_PATH/ $EXAMPLE_PATH/ -ENTRYPOINT [] -CMD ["uv", "run", "python", "example.py"] +# NOTE: We cannot use "uv run python example.py" here because uv run reads the +# example's pyproject.toml, finds the pynumaflow path source (path = "../../../"), +# and tries to resolve it. In the runtime stage, the parent pynumaflow source tree +# is not present (by design, to keep the image small), so uv run fails. +# Instead, we activate the pre-built .venv via PATH and run python directly. +ENV PATH="$EXAMPLE_PATH/.venv/bin:$PATH" +CMD ["python", "example.py"] EXPOSE 5000 diff --git a/packages/pynumaflow/examples/mapstream/flatmap_stream/Dockerfile b/packages/pynumaflow/examples/mapstream/flatmap_stream/Dockerfile index 776aed18..ecad3923 100644 --- a/packages/pynumaflow/examples/mapstream/flatmap_stream/Dockerfile +++ b/packages/pynumaflow/examples/mapstream/flatmap_stream/Dockerfile @@ -27,7 +27,12 @@ WORKDIR $EXAMPLE_PATH COPY --from=builder $EXAMPLE_PATH/.venv $EXAMPLE_PATH/.venv COPY --from=builder $EXAMPLE_PATH/ $EXAMPLE_PATH/ -ENTRYPOINT [] -CMD ["uv", "run", "python", "example.py"] +# NOTE: We cannot use "uv run python example.py" here because uv run reads the +# example's pyproject.toml, finds the pynumaflow path source (path = "../../../"), +# and tries to resolve it. In the runtime stage, the parent pynumaflow source tree +# is not present (by design, to keep the image small), so uv run fails. +# Instead, we activate the pre-built .venv via PATH and run python directly. +ENV PATH="$EXAMPLE_PATH/.venv/bin:$PATH" +CMD ["python", "example.py"] EXPOSE 5000 diff --git a/packages/pynumaflow/examples/reduce/asyncio_reduce/Dockerfile b/packages/pynumaflow/examples/reduce/asyncio_reduce/Dockerfile index 992c4d4d..b6e1789b 100644 --- a/packages/pynumaflow/examples/reduce/asyncio_reduce/Dockerfile +++ b/packages/pynumaflow/examples/reduce/asyncio_reduce/Dockerfile @@ -27,7 +27,12 @@ WORKDIR $EXAMPLE_PATH COPY --from=builder $EXAMPLE_PATH/.venv $EXAMPLE_PATH/.venv COPY --from=builder $EXAMPLE_PATH/ $EXAMPLE_PATH/ -ENTRYPOINT [] -CMD ["uv", "run", "python", "example.py"] +# NOTE: We cannot use "uv run python example.py" here because uv run reads the +# example's pyproject.toml, finds the pynumaflow path source (path = "../../../"), +# and tries to resolve it. In the runtime stage, the parent pynumaflow source tree +# is not present (by design, to keep the image small), so uv run fails. +# Instead, we activate the pre-built .venv via PATH and run python directly. +ENV PATH="$EXAMPLE_PATH/.venv/bin:$PATH" +CMD ["python", "example.py"] EXPOSE 5000 diff --git a/packages/pynumaflow/examples/reduce/counter/Dockerfile b/packages/pynumaflow/examples/reduce/counter/Dockerfile index 947a5bc2..36421be6 100644 --- a/packages/pynumaflow/examples/reduce/counter/Dockerfile +++ b/packages/pynumaflow/examples/reduce/counter/Dockerfile @@ -27,7 +27,12 @@ WORKDIR $EXAMPLE_PATH COPY --from=builder $EXAMPLE_PATH/.venv $EXAMPLE_PATH/.venv COPY --from=builder $EXAMPLE_PATH/ $EXAMPLE_PATH/ -ENTRYPOINT [] -CMD ["uv", "run", "python", "example.py"] +# NOTE: We cannot use "uv run python example.py" here because uv run reads the +# example's pyproject.toml, finds the pynumaflow path source (path = "../../../"), +# and tries to resolve it. In the runtime stage, the parent pynumaflow source tree +# is not present (by design, to keep the image small), so uv run fails. +# Instead, we activate the pre-built .venv via PATH and run python directly. +ENV PATH="$EXAMPLE_PATH/.venv/bin:$PATH" +CMD ["python", "example.py"] EXPOSE 5000 diff --git a/packages/pynumaflow/examples/reducestream/counter/Dockerfile b/packages/pynumaflow/examples/reducestream/counter/Dockerfile index f56f842a..4af8fe8e 100644 --- a/packages/pynumaflow/examples/reducestream/counter/Dockerfile +++ b/packages/pynumaflow/examples/reducestream/counter/Dockerfile @@ -27,7 +27,12 @@ WORKDIR $EXAMPLE_PATH COPY --from=builder $EXAMPLE_PATH/.venv $EXAMPLE_PATH/.venv COPY --from=builder $EXAMPLE_PATH/ $EXAMPLE_PATH/ -ENTRYPOINT [] -CMD ["uv", "run", "python", "example.py"] +# NOTE: We cannot use "uv run python example.py" here because uv run reads the +# example's pyproject.toml, finds the pynumaflow path source (path = "../../../"), +# and tries to resolve it. In the runtime stage, the parent pynumaflow source tree +# is not present (by design, to keep the image small), so uv run fails. +# Instead, we activate the pre-built .venv via PATH and run python directly. +ENV PATH="$EXAMPLE_PATH/.venv/bin:$PATH" +CMD ["python", "example.py"] EXPOSE 5000 diff --git a/packages/pynumaflow/examples/reducestream/sum/Dockerfile b/packages/pynumaflow/examples/reducestream/sum/Dockerfile index a3e52467..01a4cfa3 100644 --- a/packages/pynumaflow/examples/reducestream/sum/Dockerfile +++ b/packages/pynumaflow/examples/reducestream/sum/Dockerfile @@ -27,7 +27,12 @@ WORKDIR $EXAMPLE_PATH COPY --from=builder $EXAMPLE_PATH/.venv $EXAMPLE_PATH/.venv COPY --from=builder $EXAMPLE_PATH/ $EXAMPLE_PATH/ -ENTRYPOINT [] -CMD ["uv", "run", "python", "example.py"] +# NOTE: We cannot use "uv run python example.py" here because uv run reads the +# example's pyproject.toml, finds the pynumaflow path source (path = "../../../"), +# and tries to resolve it. In the runtime stage, the parent pynumaflow source tree +# is not present (by design, to keep the image small), so uv run fails. +# Instead, we activate the pre-built .venv via PATH and run python directly. +ENV PATH="$EXAMPLE_PATH/.venv/bin:$PATH" +CMD ["python", "example.py"] EXPOSE 5000 diff --git a/packages/pynumaflow/examples/sideinput/simple_sideinput/Dockerfile b/packages/pynumaflow/examples/sideinput/simple_sideinput/Dockerfile index 02d0299b..325768ed 100644 --- a/packages/pynumaflow/examples/sideinput/simple_sideinput/Dockerfile +++ b/packages/pynumaflow/examples/sideinput/simple_sideinput/Dockerfile @@ -27,7 +27,12 @@ WORKDIR $EXAMPLE_PATH COPY --from=builder $EXAMPLE_PATH/.venv $EXAMPLE_PATH/.venv COPY --from=builder $EXAMPLE_PATH/ $EXAMPLE_PATH/ -ENTRYPOINT [] -CMD ["uv", "run", "python", "example.py"] +# NOTE: We cannot use "uv run python example.py" here because uv run reads the +# example's pyproject.toml, finds the pynumaflow path source (path = "../../../"), +# and tries to resolve it. In the runtime stage, the parent pynumaflow source tree +# is not present (by design, to keep the image small), so uv run fails. +# Instead, we activate the pre-built .venv via PATH and run python directly. +ENV PATH="$EXAMPLE_PATH/.venv/bin:$PATH" +CMD ["python", "example.py"] EXPOSE 5000 diff --git a/packages/pynumaflow/examples/sideinput/simple_sideinput/udf/Dockerfile b/packages/pynumaflow/examples/sideinput/simple_sideinput/udf/Dockerfile index d9211dd5..a5be34f4 100644 --- a/packages/pynumaflow/examples/sideinput/simple_sideinput/udf/Dockerfile +++ b/packages/pynumaflow/examples/sideinput/simple_sideinput/udf/Dockerfile @@ -27,7 +27,12 @@ WORKDIR $EXAMPLE_PATH COPY --from=builder $EXAMPLE_PATH/.venv $EXAMPLE_PATH/.venv COPY --from=builder $EXAMPLE_PATH/ $EXAMPLE_PATH/ -ENTRYPOINT [] -CMD ["uv", "run", "python", "example.py"] +# NOTE: We cannot use "uv run python example.py" here because uv run reads the +# example's pyproject.toml, finds the pynumaflow path source (path = "../../../"), +# and tries to resolve it. In the runtime stage, the parent pynumaflow source tree +# is not present (by design, to keep the image small), so uv run fails. +# Instead, we activate the pre-built .venv via PATH and run python directly. +ENV PATH="$EXAMPLE_PATH/.venv/bin:$PATH" +CMD ["python", "example.py"] EXPOSE 5000 diff --git a/packages/pynumaflow/examples/sink/all_sinks/Dockerfile b/packages/pynumaflow/examples/sink/all_sinks/Dockerfile index 4b9f927b..f904d37c 100644 --- a/packages/pynumaflow/examples/sink/all_sinks/Dockerfile +++ b/packages/pynumaflow/examples/sink/all_sinks/Dockerfile @@ -27,7 +27,12 @@ WORKDIR $EXAMPLE_PATH COPY --from=builder $EXAMPLE_PATH/.venv $EXAMPLE_PATH/.venv COPY --from=builder $EXAMPLE_PATH/ $EXAMPLE_PATH/ -ENTRYPOINT [] -CMD ["uv", "run", "python", "example.py"] +# NOTE: We cannot use "uv run python example.py" here because uv run reads the +# example's pyproject.toml, finds the pynumaflow path source (path = "../../../"), +# and tries to resolve it. In the runtime stage, the parent pynumaflow source tree +# is not present (by design, to keep the image small), so uv run fails. +# Instead, we activate the pre-built .venv via PATH and run python directly. +ENV PATH="$EXAMPLE_PATH/.venv/bin:$PATH" +CMD ["python", "example.py"] EXPOSE 5000 diff --git a/packages/pynumaflow/examples/sink/async_log/Dockerfile b/packages/pynumaflow/examples/sink/async_log/Dockerfile index ca1fad75..4e202e10 100644 --- a/packages/pynumaflow/examples/sink/async_log/Dockerfile +++ b/packages/pynumaflow/examples/sink/async_log/Dockerfile @@ -27,7 +27,12 @@ WORKDIR $EXAMPLE_PATH COPY --from=builder $EXAMPLE_PATH/.venv $EXAMPLE_PATH/.venv COPY --from=builder $EXAMPLE_PATH/ $EXAMPLE_PATH/ -ENTRYPOINT [] -CMD ["uv", "run", "python", "example.py"] +# NOTE: We cannot use "uv run python example.py" here because uv run reads the +# example's pyproject.toml, finds the pynumaflow path source (path = "../../../"), +# and tries to resolve it. In the runtime stage, the parent pynumaflow source tree +# is not present (by design, to keep the image small), so uv run fails. +# Instead, we activate the pre-built .venv via PATH and run python directly. +ENV PATH="$EXAMPLE_PATH/.venv/bin:$PATH" +CMD ["python", "example.py"] EXPOSE 5000 diff --git a/packages/pynumaflow/examples/sink/async_log/pipeline.yaml b/packages/pynumaflow/examples/sink/async_log/pipeline.yaml index e6799bff..6bf3f4ea 100644 --- a/packages/pynumaflow/examples/sink/async_log/pipeline.yaml +++ b/packages/pynumaflow/examples/sink/async_log/pipeline.yaml @@ -10,10 +10,6 @@ spec: rpu: 1 duration: 1s msgSize: 10 - - name: p1 - udf: - builtin: - name: cat - name: out sink: udsink: @@ -22,19 +18,12 @@ spec: - python - example.py image: quay.io/numaio/numaflow-python/async-sink-log:stable - imagePullPolicy: Always + imagePullPolicy: IfNotPresent env: - name: PYTHONDEBUG value: "true" - name: INVOKE value: "func_handler" - - name: log-output - sink: - log: {} edges: - from: in - to: p1 - - from: p1 to: out - - from: p1 - to: log-output diff --git a/packages/pynumaflow/examples/sink/log/Dockerfile b/packages/pynumaflow/examples/sink/log/Dockerfile index 932a1280..f4660bff 100644 --- a/packages/pynumaflow/examples/sink/log/Dockerfile +++ b/packages/pynumaflow/examples/sink/log/Dockerfile @@ -27,7 +27,12 @@ WORKDIR $EXAMPLE_PATH COPY --from=builder $EXAMPLE_PATH/.venv $EXAMPLE_PATH/.venv COPY --from=builder $EXAMPLE_PATH/ $EXAMPLE_PATH/ -ENTRYPOINT [] -CMD ["uv", "run", "python", "example.py"] +# NOTE: We cannot use "uv run python example.py" here because uv run reads the +# example's pyproject.toml, finds the pynumaflow path source (path = "../../../"), +# and tries to resolve it. In the runtime stage, the parent pynumaflow source tree +# is not present (by design, to keep the image small), so uv run fails. +# Instead, we activate the pre-built .venv via PATH and run python directly. +ENV PATH="$EXAMPLE_PATH/.venv/bin:$PATH" +CMD ["python", "example.py"] EXPOSE 5000 diff --git a/packages/pynumaflow/examples/sink/log/pipeline.yaml b/packages/pynumaflow/examples/sink/log/pipeline.yaml index 903f232a..e608fbd3 100644 --- a/packages/pynumaflow/examples/sink/log/pipeline.yaml +++ b/packages/pynumaflow/examples/sink/log/pipeline.yaml @@ -10,10 +10,6 @@ spec: rpu: 1 duration: 1s msgSize: 10 - - name: p1 - udf: - builtin: - name: cat - name: out sink: udsink: @@ -22,19 +18,12 @@ spec: - python - example.py image: quay.io/numaio/numaflow-python/sink-log:stable - imagePullPolicy: Always + imagePullPolicy: IfNotPresent env: - name: PYTHONDEBUG value: "true" - name: INVOKE value: "func_handler" - - name: log-output - sink: - log: {} edges: - from: in - to: p1 - - from: p1 to: out - - from: p1 - to: log-output diff --git a/packages/pynumaflow/examples/source/simple_source/Dockerfile b/packages/pynumaflow/examples/source/simple_source/Dockerfile index 67fa1d2b..1d7d289b 100644 --- a/packages/pynumaflow/examples/source/simple_source/Dockerfile +++ b/packages/pynumaflow/examples/source/simple_source/Dockerfile @@ -27,7 +27,12 @@ WORKDIR $EXAMPLE_PATH COPY --from=builder $EXAMPLE_PATH/.venv $EXAMPLE_PATH/.venv COPY --from=builder $EXAMPLE_PATH/ $EXAMPLE_PATH/ -ENTRYPOINT [] -CMD ["uv", "run", "python", "example.py"] +# NOTE: We cannot use "uv run python example.py" here because uv run reads the +# example's pyproject.toml, finds the pynumaflow path source (path = "../../../"), +# and tries to resolve it. In the runtime stage, the parent pynumaflow source tree +# is not present (by design, to keep the image small), so uv run fails. +# Instead, we activate the pre-built .venv via PATH and run python directly. +ENV PATH="$EXAMPLE_PATH/.venv/bin:$PATH" +CMD ["python", "example.py"] EXPOSE 5000 diff --git a/packages/pynumaflow/examples/sourcetransform/async_event_time_filter/Dockerfile b/packages/pynumaflow/examples/sourcetransform/async_event_time_filter/Dockerfile index efb0b7c9..8ed06204 100644 --- a/packages/pynumaflow/examples/sourcetransform/async_event_time_filter/Dockerfile +++ b/packages/pynumaflow/examples/sourcetransform/async_event_time_filter/Dockerfile @@ -27,7 +27,12 @@ WORKDIR $EXAMPLE_PATH COPY --from=builder $EXAMPLE_PATH/.venv $EXAMPLE_PATH/.venv COPY --from=builder $EXAMPLE_PATH/ $EXAMPLE_PATH/ -ENTRYPOINT [] -CMD ["uv", "run", "python", "example.py"] +# NOTE: We cannot use "uv run python example.py" here because uv run reads the +# example's pyproject.toml, finds the pynumaflow path source (path = "../../../"), +# and tries to resolve it. In the runtime stage, the parent pynumaflow source tree +# is not present (by design, to keep the image small), so uv run fails. +# Instead, we activate the pre-built .venv via PATH and run python directly. +ENV PATH="$EXAMPLE_PATH/.venv/bin:$PATH" +CMD ["python", "example.py"] EXPOSE 5000 diff --git a/packages/pynumaflow/examples/sourcetransform/event_time_filter/Dockerfile b/packages/pynumaflow/examples/sourcetransform/event_time_filter/Dockerfile index f88784ac..71bfbf6c 100644 --- a/packages/pynumaflow/examples/sourcetransform/event_time_filter/Dockerfile +++ b/packages/pynumaflow/examples/sourcetransform/event_time_filter/Dockerfile @@ -27,7 +27,12 @@ WORKDIR $EXAMPLE_PATH COPY --from=builder $EXAMPLE_PATH/.venv $EXAMPLE_PATH/.venv COPY --from=builder $EXAMPLE_PATH/ $EXAMPLE_PATH/ -ENTRYPOINT [] -CMD ["uv", "run", "python", "example.py"] +# NOTE: We cannot use "uv run python example.py" here because uv run reads the +# example's pyproject.toml, finds the pynumaflow path source (path = "../../../"), +# and tries to resolve it. In the runtime stage, the parent pynumaflow source tree +# is not present (by design, to keep the image small), so uv run fails. +# Instead, we activate the pre-built .venv via PATH and run python directly. +ENV PATH="$EXAMPLE_PATH/.venv/bin:$PATH" +CMD ["python", "example.py"] EXPOSE 5000