Skip to content

Commit

Permalink
Update of-watchdog to 0.10.4
Browse files Browse the repository at this point in the history
Includes optional X-Timeout header and better streamed
responses support, without buffering into memory first.

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <[email protected]>
  • Loading branch information
alexellis committed Jul 16, 2024
1 parent fd09fa7 commit 2bf8850
Show file tree
Hide file tree
Showing 9 changed files with 66 additions and 8 deletions.
2 changes: 1 addition & 1 deletion template/bun/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM --platform=${TARGETPLATFORM:-linux/amd64} ghcr.io/openfaas/of-watchdog:0.10.1 as watchdog
FROM --platform=${TARGETPLATFORM:-linux/amd64} ghcr.io/openfaas/of-watchdog:0.10.4 as watchdog
FROM --platform=${TARGETPLATFORM:-linux/amd64} oven/bun:1.0-alpine as ship

ARG TARGETPLATFORM
Expand Down
2 changes: 1 addition & 1 deletion template/java11-vert-x/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ COPY . /home/app/

RUN gradle build

FROM ghcr.io/openfaas/of-watchdog:0.10.1 as watchdog
FROM ghcr.io/openfaas/of-watchdog:0.10.4 as watchdog
FROM openjdk:11-jre-slim as ship

COPY --from=watchdog /fwatchdog /usr/bin/fwatchdog
Expand Down
2 changes: 1 addition & 1 deletion template/java11/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ COPY . /home/app/
RUN gradle build
RUN find .

FROM ghcr.io/openfaas/of-watchdog:0.10.1 as watchdog
FROM ghcr.io/openfaas/of-watchdog:0.10.4 as watchdog

FROM openjdk:11-jre-slim as ship
RUN apt-get update -qqy \
Expand Down
2 changes: 1 addition & 1 deletion template/node14/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM --platform=${TARGETPLATFORM:-linux/amd64} ghcr.io/openfaas/of-watchdog:0.10.1 as watchdog
FROM --platform=${TARGETPLATFORM:-linux/amd64} ghcr.io/openfaas/of-watchdog:0.10.4 as watchdog
FROM --platform=${TARGETPLATFORM:-linux/amd64} node:14-alpine as ship

ARG TARGETPLATFORM
Expand Down
2 changes: 1 addition & 1 deletion template/node16/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM --platform=${TARGETPLATFORM:-linux/amd64} ghcr.io/openfaas/of-watchdog:0.10.1 as watchdog
FROM --platform=${TARGETPLATFORM:-linux/amd64} ghcr.io/openfaas/of-watchdog:0.10.4 as watchdog
FROM --platform=${TARGETPLATFORM:-linux/amd64} node:16-alpine as ship

ARG TARGETPLATFORM
Expand Down
2 changes: 1 addition & 1 deletion template/node17/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM --platform=${TARGETPLATFORM:-linux/amd64} ghcr.io/openfaas/of-watchdog:0.10.1 as watchdog
FROM --platform=${TARGETPLATFORM:-linux/amd64} ghcr.io/openfaas/of-watchdog:0.10.4 as watchdog
FROM --platform=${TARGETPLATFORM:-linux/amd64} node:17-alpine as ship

ARG TARGETPLATFORM
Expand Down
2 changes: 1 addition & 1 deletion template/node18/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM --platform=${TARGETPLATFORM:-linux/amd64} ghcr.io/openfaas/of-watchdog:0.10.1 as watchdog
FROM --platform=${TARGETPLATFORM:-linux/amd64} ghcr.io/openfaas/of-watchdog:0.10.4 as watchdog
FROM --platform=${TARGETPLATFORM:-linux/amd64} node:18-alpine as ship

ARG TARGETPLATFORM
Expand Down
2 changes: 1 addition & 1 deletion template/node20/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM --platform=${TARGETPLATFORM:-linux/amd64} ghcr.io/openfaas/of-watchdog:0.10.1 as watchdog
FROM --platform=${TARGETPLATFORM:-linux/amd64} ghcr.io/openfaas/of-watchdog:0.10.4 as watchdog
FROM --platform=${TARGETPLATFORM:-linux/amd64} node:20-alpine as ship

ARG TARGETPLATFORM
Expand Down
58 changes: 58 additions & 0 deletions template/python3-streaming/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
ARG PYTHON_VERSION=3
FROM --platform=${TARGETPLATFORM:-linux/amd64} ghcr.io/openfaas/of-watchdog:0.10.4 as watchdog
FROM --platform=${TARGETPLATFORM:-linux/amd64} python:${PYTHON_VERSION}-alpine

ARG TARGETPLATFORM
ARG BUILDPLATFORM

# Allows you to add additional packages via build-arg
ARG ADDITIONAL_PACKAGE

COPY --from=watchdog /fwatchdog /usr/bin/fwatchdog
RUN chmod +x /usr/bin/fwatchdog
RUN apk --no-cache add ca-certificates ${ADDITIONAL_PACKAGE}


# Add non root user
RUN addgroup -S app && adduser app -S -G app

WORKDIR /home/app/

COPY index.py .
COPY requirements.txt .

RUN chown -R app /home/app && \
mkdir -p /home/app/python && chown -R app /home/app
USER app
ENV PATH=$PATH:/home/app/.local/bin:/home/app/python/bin/
ENV PYTHONPATH=$PYTHONPATH:/home/app/python

RUN pip install -r requirements.txt --target=/home/app/python

RUN mkdir -p function
RUN touch ./function/__init__.py

WORKDIR /home/app/function/
COPY function/requirements.txt .

RUN pip install -r requirements.txt --target=/home/app/python

WORKDIR /home/app/

USER root

COPY function function

# Allow any user-id for OpenShift users.
RUN chown -R app:app ./ && \
chmod -R 777 /home/app/python

USER app

ENV fprocess="python3 index.py"
ENV mode="streaming"
EXPOSE 8080

HEALTHCHECK --interval=3s CMD [ -e /tmp/.lock ] || exit 1

CMD ["fwatchdog"]

0 comments on commit 2bf8850

Please sign in to comment.