Skip to content

Commit 074fd39

Browse files
Disable buffering of output from applications so logging appears immediately.
1 parent bc12413 commit 074fd39

12 files changed

Lines changed: 28 additions & 8 deletions

File tree

2.7/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ MAINTAINER SoftwareCollections.org <sclorg@redhat.com>
77
EXPOSE 8080
88

99
ENV PYTHON_VERSION=2.7 \
10-
PATH=$HOME/.local/bin/:$PATH
10+
PATH=$HOME/.local/bin/:$PATH \
11+
PYTHONUNBUFFERED=1
1112

1213
LABEL io.k8s.description="Platform for building and running Python 2.7 applications" \
1314
io.k8s.display-name="Python 2.7" \

2.7/Dockerfile.rhel7

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ FROM rhscl/s2i-base-rhel7
55
EXPOSE 8080
66

77
ENV PYTHON_VERSION=2.7 \
8-
PATH=$HOME/.local/bin/:$PATH
8+
PATH=$HOME/.local/bin/:$PATH \
9+
PYTHONUNBUFFERED=1
910

1011
# Labels consumed by Red Hat build service.
1112
LABEL com.redhat.component="python27-docker" \

2.7/test/standalone-test-app/app.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
import os
2+
import time
23

34
from gunicorn.app.base import BaseApplication
45
from gunicorn.six import iteritems
56

7+
print('LOADING MODULE %s' % __file__)
68

79
def wsgi_handler(environ, start_response):
10+
print('HANDLE REQUEST %s' % time.time())
811
start_response('200 OK', [('Content-Type','text/html')])
912
return [b"Hello World from standalone WSGI application!"]
1013

3.3/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ MAINTAINER SoftwareCollections.org <sclorg@redhat.com>
77
EXPOSE 8080
88

99
ENV PYTHON_VERSION=3.3 \
10-
PATH=$HOME/.local/bin/:$PATH
10+
PATH=$HOME/.local/bin/:$PATH \
11+
PYTHONUNBUFFERED=1
1112

1213
LABEL io.k8s.description="Platform for building and running Python 3.3 applications" \
1314
io.k8s.display-name="Python 3.3" \

3.3/Dockerfile.rhel7

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ FROM openshift/base-rhel7
55
EXPOSE 8080
66

77
ENV PYTHON_VERSION=3.3 \
8-
PATH=$HOME/.local/bin/:$PATH
8+
PATH=$HOME/.local/bin/:$PATH \
9+
PYTHONUNBUFFERED=1
910

1011
# Labels consumed by Red Hat build service.
1112
LABEL com.redhat.component="openshift-sti-python-docker" \

3.3/test/standalone-test-app/app.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
import os
2+
import time
23

34
from gunicorn.app.base import BaseApplication
45
from gunicorn.six import iteritems
56

7+
print('LOADING MODULE %s' % __file__)
68

79
def wsgi_handler(environ, start_response):
10+
print('HANDLE REQUEST %s' % time.time())
811
start_response('200 OK', [('Content-Type','text/html')])
912
return [b"Hello World from standalone WSGI application!"]
1013

3.4/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ MAINTAINER SoftwareCollections.org <sclorg@redhat.com>
77
EXPOSE 8080
88

99
ENV PYTHON_VERSION=3.4 \
10-
PATH=$HOME/.local/bin/:$PATH
10+
PATH=$HOME/.local/bin/:$PATH \
11+
PYTHONUNBUFFERED=1
1112

1213
LABEL io.k8s.description="Platform for building and running Python 3.4 applications" \
1314
io.k8s.display-name="Python 3.4" \

3.4/Dockerfile.rhel7

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ FROM rhscl/s2i-base-rhel7
55
EXPOSE 8080
66

77
ENV PYTHON_VERSION=3.4 \
8-
PATH=$HOME/.local/bin/:$PATH
8+
PATH=$HOME/.local/bin/:$PATH \
9+
PYTHONUNBUFFERED=1
910

1011
# Labels consumed by Red Hat build service.
1112
LABEL com.redhat.component="rh-python34-docker" \

3.4/test/standalone-test-app/app.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
import os
2+
import time
23

34
from gunicorn.app.base import BaseApplication
45
from gunicorn.six import iteritems
56

7+
print('LOADING MODULE %s' % __file__)
68

79
def wsgi_handler(environ, start_response):
10+
print('HANDLE REQUEST %s' % time.time())
811
start_response('200 OK', [('Content-Type','text/html')])
912
return [b"Hello World from standalone WSGI application!"]
1013

3.5/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ MAINTAINER SoftwareCollections.org <sclorg@redhat.com>
77
EXPOSE 8080
88

99
ENV PYTHON_VERSION=3.5 \
10-
PATH=$HOME/.local/bin/:$PATH
10+
PATH=$HOME/.local/bin/:$PATH \
11+
PYTHONUNBUFFERED=1
1112

1213
LABEL io.k8s.description="Platform for building and running Python 3.5 applications" \
1314
io.k8s.display-name="Python 3.5" \

0 commit comments

Comments
 (0)