Skip to content

Commit 61195e5

Browse files
authored
fix: modify Dockerfiles to fix failing image builds (#180)
Signed-off-by: a3hadi <[email protected]>
1 parent b847504 commit 61195e5

File tree

23 files changed

+102
-125
lines changed

23 files changed

+102
-125
lines changed

examples/map/even_odd/Dockerfile

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@ ENV PYTHONFAULTHANDLER=1 \
1414
POETRY_HOME="/opt/poetry" \
1515
POETRY_VIRTUALENVS_IN_PROJECT=true \
1616
POETRY_NO_INTERACTION=1 \
17-
PYSETUP_PATH="/opt/pysetup" \
18-
VENV_PATH="/opt/pysetup/.venv"
17+
PYSETUP_PATH="/opt/pysetup"
1918

19+
ENV EXAMPLE_PATH="$PYSETUP_PATH/examples/map/even_odd"
20+
ENV VENV_PATH="$EXAMPLE_PATH/.venv"
2021
ENV PATH="$POETRY_HOME/bin:$VENV_PATH/bin:$PATH"
2122

2223
RUN apt-get update \
@@ -41,16 +42,13 @@ FROM builder AS udf
4142
WORKDIR $PYSETUP_PATH
4243
COPY ./ ./
4344

44-
WORKDIR $PYSETUP_PATH/examples/map/even_odd
45+
WORKDIR $EXAMPLE_PATH
4546
RUN poetry install --no-cache --no-root && \
4647
rm -rf ~/.cache/pypoetry/
4748

48-
COPY examples/map/even_odd /app
49-
WORKDIR /app
50-
5149
RUN chmod +x entry.sh
5250

5351
ENTRYPOINT ["/dumb-init", "--"]
54-
CMD ["/app/entry.sh"]
52+
CMD ["sh", "-c", "$EXAMPLE_PATH/entry.sh"]
5553

56-
EXPOSE 5000
54+
EXPOSE 5000

examples/map/even_odd/pipeline.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ spec:
1818
- python
1919
- example.py
2020
image: quay.io/numaio/numaflow-python/even-odd:stable
21+
imagePullPolicy: Always
2122
- name: even-sink
2223
scale:
2324
min: 1

examples/map/flatmap/Dockerfile

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@ ENV PYTHONFAULTHANDLER=1 \
1414
POETRY_HOME="/opt/poetry" \
1515
POETRY_VIRTUALENVS_IN_PROJECT=true \
1616
POETRY_NO_INTERACTION=1 \
17-
PYSETUP_PATH="/opt/pysetup" \
18-
VENV_PATH="/opt/pysetup/.venv"
17+
PYSETUP_PATH="/opt/pysetup"
1918

19+
ENV EXAMPLE_PATH="$PYSETUP_PATH/examples/map/flatmap"
20+
ENV VENV_PATH="$EXAMPLE_PATH/.venv"
2021
ENV PATH="$POETRY_HOME/bin:$VENV_PATH/bin:$PATH"
2122

2223
RUN apt-get update \
@@ -41,16 +42,13 @@ FROM builder AS udf
4142
WORKDIR $PYSETUP_PATH
4243
COPY ./ ./
4344

44-
WORKDIR $PYSETUP_PATH/examples/map/flatmap
45+
WORKDIR $EXAMPLE_PATH
4546
RUN poetry install --no-cache --no-root && \
4647
rm -rf ~/.cache/pypoetry/
4748

48-
COPY examples/map/even_odd /app
49-
WORKDIR /app
50-
5149
RUN chmod +x entry.sh
5250

5351
ENTRYPOINT ["/dumb-init", "--"]
54-
CMD ["/app/entry.sh"]
52+
CMD ["sh", "-c", "$EXAMPLE_PATH/entry.sh"]
5553

56-
EXPOSE 5000
54+
EXPOSE 5000

examples/map/flatmap/pipeline.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ spec:
1616
udf:
1717
container:
1818
image: quay.io/numaio/numaflow-python/map-flatmap:stable
19+
imagePullPolicy: Always
1920
env:
2021
- name: PYTHONDEBUG
2122
value: "true"

examples/map/forward_message/Dockerfile

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@ ENV PYTHONFAULTHANDLER=1 \
1414
POETRY_HOME="/opt/poetry" \
1515
POETRY_VIRTUALENVS_IN_PROJECT=true \
1616
POETRY_NO_INTERACTION=1 \
17-
PYSETUP_PATH="/opt/pysetup" \
18-
VENV_PATH="/opt/pysetup/.venv"
17+
PYSETUP_PATH="/opt/pysetup"
1918

19+
ENV EXAMPLE_PATH="$PYSETUP_PATH/examples/map/forward_message"
20+
ENV VENV_PATH="$EXAMPLE_PATH/.venv"
2021
ENV PATH="$POETRY_HOME/bin:$VENV_PATH/bin:$PATH"
2122

2223
RUN apt-get update \
@@ -41,16 +42,13 @@ FROM builder AS udf
4142
WORKDIR $PYSETUP_PATH
4243
COPY ./ ./
4344

44-
WORKDIR $PYSETUP_PATH/examples/map/forward_message
45+
WORKDIR $EXAMPLE_PATH
4546
RUN poetry install --no-cache --no-root && \
4647
rm -rf ~/.cache/pypoetry/
4748

48-
COPY examples/map/forward_message /app
49-
WORKDIR /app
50-
5149
RUN chmod +x entry.sh
5250

5351
ENTRYPOINT ["/dumb-init", "--"]
54-
CMD ["/app/entry.sh"]
52+
CMD ["sh", "-c", "$EXAMPLE_PATH/entry.sh"]
5553

56-
EXPOSE 5000
54+
EXPOSE 5000

examples/map/forward_message/pipeline.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ spec:
1818
- python
1919
- example.py
2020
image: quay.io/numaio/numaflow-python/map-forward-message:stable
21+
imagePullPolicy: Always
2122
- name: log-output
2223
sink:
2324
log: {}

examples/map/multiproc_map/Dockerfile

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@ ENV PYTHONFAULTHANDLER=1 \
1414
POETRY_HOME="/opt/poetry" \
1515
POETRY_VIRTUALENVS_IN_PROJECT=true \
1616
POETRY_NO_INTERACTION=1 \
17-
PYSETUP_PATH="/opt/pysetup" \
18-
VENV_PATH="/opt/pysetup/.venv"
17+
PYSETUP_PATH="/opt/pysetup"
1918

19+
ENV EXAMPLE_PATH="$PYSETUP_PATH/examples/map/multiproc_map"
20+
ENV VENV_PATH="$EXAMPLE_PATH/.venv"
2021
ENV PATH="$POETRY_HOME/bin:$VENV_PATH/bin:$PATH"
2122

2223
RUN apt-get update \
@@ -41,16 +42,13 @@ FROM builder AS udf
4142
WORKDIR $PYSETUP_PATH
4243
COPY ./ ./
4344

44-
WORKDIR $PYSETUP_PATH/examples/map/multiproc_map
45+
WORKDIR $EXAMPLE_PATH
4546
RUN poetry install --no-cache --no-root && \
4647
rm -rf ~/.cache/pypoetry/
4748

48-
COPY examples/map/multiproc_map /app
49-
WORKDIR /app
50-
5149
RUN chmod +x entry.sh
5250

5351
ENTRYPOINT ["/dumb-init", "--"]
54-
CMD ["/app/entry.sh"]
52+
CMD ["sh", "-c", "$EXAMPLE_PATH/entry.sh"]
5553

56-
EXPOSE 5000
54+
EXPOSE 5000

examples/map/multiproc_map/pipeline.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ spec:
1616
udf:
1717
container:
1818
image: quay.io/numaio/numaflow-python/multiproc:stable
19+
imagePullPolicy: Always
1920
env:
2021
- name: PYTHONDEBUG
2122
value: "true"

examples/mapstream/flatmap_stream/Dockerfile

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@ ENV PYTHONFAULTHANDLER=1 \
1414
POETRY_HOME="/opt/poetry" \
1515
POETRY_VIRTUALENVS_IN_PROJECT=true \
1616
POETRY_NO_INTERACTION=1 \
17-
PYSETUP_PATH="/opt/pysetup" \
18-
VENV_PATH="/opt/pysetup/.venv"
17+
PYSETUP_PATH="/opt/pysetup"
1918

19+
ENV EXAMPLE_PATH="$PYSETUP_PATH/examples/mapstream/flatmap_stream"
20+
ENV VENV_PATH="$EXAMPLE_PATH/.venv"
2021
ENV PATH="$POETRY_HOME/bin:$VENV_PATH/bin:$PATH"
2122

2223
RUN apt-get update \
@@ -41,16 +42,13 @@ FROM builder AS udf
4142
WORKDIR $PYSETUP_PATH
4243
COPY ./ ./
4344

44-
WORKDIR $PYSETUP_PATH/examples/mapstream/flatmap_stream
45+
WORKDIR $EXAMPLE_PATH
4546
RUN poetry install --no-cache --no-root && \
4647
rm -rf ~/.cache/pypoetry/
4748

48-
COPY examples/mapstream/flatmap_stream /app
49-
WORKDIR /app
50-
5149
RUN chmod +x entry.sh
5250

5351
ENTRYPOINT ["/dumb-init", "--"]
54-
CMD ["/app/entry.sh"]
52+
CMD ["sh", "-c", "$EXAMPLE_PATH/entry.sh"]
5553

56-
EXPOSE 5000
54+
EXPOSE 5000

examples/reduce/asyncio_reduce/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,4 @@ RUN chmod +x entry.sh
5151
ENTRYPOINT ["/dumb-init", "--"]
5252
CMD ["/app/entry.sh"]
5353

54-
EXPOSE 5000
54+
EXPOSE 5000

examples/reduce/counter/Dockerfile

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@ ENV PYTHONFAULTHANDLER=1 \
1414
POETRY_HOME="/opt/poetry" \
1515
POETRY_VIRTUALENVS_IN_PROJECT=true \
1616
POETRY_NO_INTERACTION=1 \
17-
PYSETUP_PATH="/opt/pysetup" \
18-
VENV_PATH="/opt/pysetup/.venv"
17+
PYSETUP_PATH="/opt/pysetup"
1918

19+
ENV EXAMPLE_PATH="$PYSETUP_PATH/examples/reduce/counter"
20+
ENV VENV_PATH="$EXAMPLE_PATH/.venv"
2021
ENV PATH="$POETRY_HOME/bin:$VENV_PATH/bin:$PATH"
2122

2223
RUN apt-get update \
@@ -41,16 +42,13 @@ FROM builder AS udf
4142
WORKDIR $PYSETUP_PATH
4243
COPY ./ ./
4344

44-
WORKDIR $PYSETUP_PATH/examples/reduce/counter
45+
WORKDIR $EXAMPLE_PATH
4546
RUN poetry install --no-cache --no-root && \
4647
rm -rf ~/.cache/pypoetry/
4748

48-
COPY examples/reduce/counter /app
49-
WORKDIR /app
50-
5149
RUN chmod +x entry.sh
5250

5351
ENTRYPOINT ["/dumb-init", "--"]
54-
CMD ["/app/entry.sh"]
52+
CMD ["sh", "-c", "$EXAMPLE_PATH/entry.sh"]
5553

56-
EXPOSE 5000
54+
EXPOSE 5000

examples/reduce/counter/pipeline.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ spec:
1414
container:
1515
# Tell the input number is even or odd, see https://github.com/numaproj/numaflow-go/tree/main/pkg/mapper/examples/even_odd
1616
image: quay.io/numaio/numaflow-go/map-even-odd:stable
17+
imagePullPolicy: Always
1718
- name: compute-sum
1819
udf:
1920
container:

examples/reducestream/counter/Dockerfile

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@ ENV PYTHONFAULTHANDLER=1 \
1414
POETRY_HOME="/opt/poetry" \
1515
POETRY_VIRTUALENVS_IN_PROJECT=true \
1616
POETRY_NO_INTERACTION=1 \
17-
PYSETUP_PATH="/opt/pysetup" \
18-
VENV_PATH="/opt/pysetup/.venv"
17+
PYSETUP_PATH="/opt/pysetup"
1918

19+
ENV EXAMPLE_PATH="$PYSETUP_PATH/examples/reducestream/counter"
20+
ENV VENV_PATH="$EXAMPLE_PATH/.venv"
2021
ENV PATH="$POETRY_HOME/bin:$VENV_PATH/bin:$PATH"
2122

2223
RUN apt-get update \
@@ -41,16 +42,13 @@ FROM builder AS udf
4142
WORKDIR $PYSETUP_PATH
4243
COPY ./ ./
4344

44-
WORKDIR $PYSETUP_PATH/examples/reducestream/counter
45+
WORKDIR $EXAMPLE_PATH
4546
RUN poetry install --no-cache --no-root && \
4647
rm -rf ~/.cache/pypoetry/
4748

48-
COPY examples/reducestream/counter /app
49-
WORKDIR /app
50-
5149
RUN chmod +x entry.sh
5250

5351
ENTRYPOINT ["/dumb-init", "--"]
54-
CMD ["/app/entry.sh"]
52+
CMD ["sh", "-c", "$EXAMPLE_PATH/entry.sh"]
5553

56-
EXPOSE 5000
54+
EXPOSE 5000

examples/reducestream/counter/pipeline.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,13 @@ spec:
1313
udf:
1414
container:
1515
# Tell the input number is even or odd, see https://github.com/numaproj/numaflow-go/tree/main/pkg/mapper/examples/even_odd
16-
image: quay.io/numaio/numaflow-go/map-even-odd:v0.6.1
16+
image: quay.io/numaio/numaflow-go/map-even-odd:stable
17+
imagePullPolicy: Always
1718
- name: compute-sum
1819
udf:
1920
container:
2021
# compute the sum
21-
image: quay.io/numaio/numaflow-python/reduce-stream-counter:v0.7.0
22+
image: quay.io/numaio/numaflow-python/reduce-stream-counter:stable
2223
imagePullPolicy: Always
2324
env:
2425
- name: PYTHONDEBUG

examples/reducestream/sum/Dockerfile

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@ ENV PYTHONFAULTHANDLER=1 \
1414
POETRY_HOME="/opt/poetry" \
1515
POETRY_VIRTUALENVS_IN_PROJECT=true \
1616
POETRY_NO_INTERACTION=1 \
17-
PYSETUP_PATH="/opt/pysetup" \
18-
VENV_PATH="/opt/pysetup/.venv"
17+
PYSETUP_PATH="/opt/pysetup"
1918

19+
ENV EXAMPLE_PATH="$PYSETUP_PATH/examples/reducestream/sum"
20+
ENV VENV_PATH="$EXAMPLE_PATH/.venv"
2021
ENV PATH="$POETRY_HOME/bin:$VENV_PATH/bin:$PATH"
2122

2223
RUN apt-get update \
@@ -41,16 +42,13 @@ FROM builder AS udf
4142
WORKDIR $PYSETUP_PATH
4243
COPY ./ ./
4344

44-
WORKDIR $PYSETUP_PATH/examples/reducestream/sum
45+
WORKDIR $EXAMPLE_PATH
4546
RUN poetry install --no-cache --no-root && \
4647
rm -rf ~/.cache/pypoetry/
4748

48-
COPY examples/reducestream/sum /app
49-
WORKDIR /app
50-
5149
RUN chmod +x entry.sh
5250

5351
ENTRYPOINT ["/dumb-init", "--"]
54-
CMD ["/app/entry.sh"]
52+
CMD ["sh", "-c", "$EXAMPLE_PATH/entry.sh"]
5553

56-
EXPOSE 5000
54+
EXPOSE 5000

examples/reducestream/sum/pipeline.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,13 @@ spec:
1313
udf:
1414
container:
1515
# Tell the input number is even or odd, see https://github.com/numaproj/numaflow-go/tree/main/pkg/mapper/examples/even_odd
16-
image: quay.io/numaio/numaflow-go/map-even-odd:v0.6.1
16+
image: quay.io/numaio/numaflow-go/map-even-odd:stable
17+
imagePullPolicy: Always
1718
- name: compute-sum
1819
udf:
1920
container:
2021
# compute the sum
21-
image: quay.io/numaio/numaflow-python/reduce-stream-sum:v0.7.0
22+
image: quay.io/numaio/numaflow-python/reduce-stream-sum:stable
2223
imagePullPolicy: Always
2324
env:
2425
- name: PYTHONDEBUG

examples/sideinput/simple_sideinput/Dockerfile

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@ ENV PYTHONFAULTHANDLER=1 \
1414
POETRY_HOME="/opt/poetry" \
1515
POETRY_VIRTUALENVS_IN_PROJECT=true \
1616
POETRY_NO_INTERACTION=1 \
17-
PYSETUP_PATH="/opt/pysetup" \
18-
VENV_PATH="/opt/pysetup/.venv"
17+
PYSETUP_PATH="/opt/pysetup"
1918

19+
ENV EXAMPLE_PATH="$PYSETUP_PATH/examples/sideinput/simple_sideinput"
20+
ENV VENV_PATH="$EXAMPLE_PATH/.venv"
2021
ENV PATH="$POETRY_HOME/bin:$VENV_PATH/bin:$PATH"
2122

2223
RUN apt-get update \
@@ -41,16 +42,13 @@ FROM builder AS udf
4142
WORKDIR $PYSETUP_PATH
4243
COPY ./ ./
4344

44-
WORKDIR $PYSETUP_PATH/examples/sideinput/simple_sideinput
45+
WORKDIR $EXAMPLE_PATH
4546
RUN poetry install --no-cache --no-root && \
4647
rm -rf ~/.cache/pypoetry/
4748

48-
COPY examples/sideinput/simple_sideinput /app
49-
WORKDIR /app
50-
5149
RUN chmod +x entry.sh
5250

5351
ENTRYPOINT ["/dumb-init", "--"]
54-
CMD ["/app/entry.sh"]
52+
CMD ["sh", "-c", "$EXAMPLE_PATH/entry.sh"]
5553

56-
EXPOSE 5000
54+
EXPOSE 5000

0 commit comments

Comments
 (0)