From 2ba840fbcdebf5436bf5889fc1ebb10ecedb6352 Mon Sep 17 00:00:00 2001 From: Dina Graves Portman <55413432+dinagraves@users.noreply.github.com> Date: Thu, 4 Jun 2020 12:35:18 -0700 Subject: [PATCH] Python Unbuffered (#2534) * Update Dockerfile Using pythonunbuffered so that print() statements and log messages will immediately appear in the logs. * Update docs/serving/samples/hello-world/helloworld-python/Dockerfile Update comment Co-authored-by: Victor Agababov * Update README.md Adding the pythonunbuffered to readme to fix test * Update docs/serving/samples/hello-world/helloworld-python/README.md Co-authored-by: Matt Moore * Update README.md Adding newline - code has to match Dockerfile Co-authored-by: Victor Agababov Co-authored-by: Matt Moore --- docs/serving/samples/hello-world/helloworld-python/Dockerfile | 3 +++ docs/serving/samples/hello-world/helloworld-python/README.md | 3 +++ 2 files changed, 6 insertions(+) diff --git a/docs/serving/samples/hello-world/helloworld-python/Dockerfile b/docs/serving/samples/hello-world/helloworld-python/Dockerfile index f33c7710b..a84faddcb 100644 --- a/docs/serving/samples/hello-world/helloworld-python/Dockerfile +++ b/docs/serving/samples/hello-world/helloworld-python/Dockerfile @@ -2,6 +2,9 @@ # https://hub.docker.com/_/python FROM python:3.7-slim +# Allow statements and log messages to immediately appear in the Knative logs +ENV PYTHONUNBUFFERED True + # Copy local code to the container image. ENV APP_HOME /app WORKDIR $APP_HOME diff --git a/docs/serving/samples/hello-world/helloworld-python/README.md b/docs/serving/samples/hello-world/helloworld-python/README.md index 04ee061ba..94cf4eb4d 100644 --- a/docs/serving/samples/hello-world/helloworld-python/README.md +++ b/docs/serving/samples/hello-world/helloworld-python/README.md @@ -55,6 +55,9 @@ cd knative-docs/docs/serving/samples/hello-world/helloworld-python # https://hub.docker.com/_/python FROM python:3.7-slim + # Allow statements and log messages to immediately appear in the Knative logs + ENV PYTHONUNBUFFERED True + # Copy local code to the container image. ENV APP_HOME /app WORKDIR $APP_HOME