Skip to content

Commit 6693a4e

Browse files
authored
Merge pull request sclorg#169 from GrahamDumpleton/unbuffered-output
Disable buffering of output from applications so logging appears immediately.
2 parents ab0ebff + 095888a commit 6693a4e

12 files changed

Lines changed: 20 additions & 1 deletion

File tree

2.7/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ EXPOSE 8080
88

99
ENV PYTHON_VERSION=2.7 \
1010
PATH=$HOME/.local/bin/:$PATH \
11+
PYTHONUNBUFFERED=1 \
1112
PYTHONIOENCODING=UTF-8 \
1213
LC_ALL=en_US.UTF-8 \
1314
LANG=en_US.UTF-8 \
1415
PIP_NO_CACHE_DIR=off
1516

16-
1717
LABEL io.k8s.description="Platform for building and running Python 2.7 applications" \
1818
io.k8s.display-name="Python 2.7" \
1919
io.openshift.expose-services="8080:http" \

2.7/Dockerfile.rhel7

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ EXPOSE 8080
66

77
ENV PYTHON_VERSION=2.7 \
88
PATH=$HOME/.local/bin/:$PATH \
9+
PYTHONUNBUFFERED=1 \
910
PYTHONIOENCODING=UTF-8 \
1011
LC_ALL=en_US.UTF-8 \
1112
LANG=en_US.UTF-8 \

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: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ EXPOSE 8080
88

99
ENV PYTHON_VERSION=3.3 \
1010
PATH=$HOME/.local/bin/:$PATH \
11+
PYTHONUNBUFFERED=1 \
1112
PYTHONIOENCODING=UTF-8 \
1213
LC_ALL=en_US.UTF-8 \
1314
LANG=en_US.UTF-8 \

3.3/Dockerfile.rhel7

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ EXPOSE 8080
66

77
ENV PYTHON_VERSION=3.3 \
88
PATH=$HOME/.local/bin/:$PATH \
9+
PYTHONUNBUFFERED=1 \
910
PYTHONIOENCODING=UTF-8 \
1011
LC_ALL=en_US.UTF-8 \
1112
LANG=en_US.UTF-8 \

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: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ EXPOSE 8080
88

99
ENV PYTHON_VERSION=3.4 \
1010
PATH=$HOME/.local/bin/:$PATH \
11+
PYTHONUNBUFFERED=1 \
1112
PYTHONIOENCODING=UTF-8 \
1213
LC_ALL=en_US.UTF-8 \
1314
LANG=en_US.UTF-8 \

3.4/Dockerfile.rhel7

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ EXPOSE 8080
66

77
ENV PYTHON_VERSION=3.4 \
88
PATH=$HOME/.local/bin/:$PATH \
9+
PYTHONUNBUFFERED=1 \
910
PYTHONIOENCODING=UTF-8 \
1011
LC_ALL=en_US.UTF-8 \
1112
LANG=en_US.UTF-8 \

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: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ EXPOSE 8080
88

99
ENV PYTHON_VERSION=3.5 \
1010
PATH=$HOME/.local/bin/:$PATH \
11+
PYTHONUNBUFFERED=1 \
1112
PYTHONIOENCODING=UTF-8 \
1213
LC_ALL=en_US.UTF-8 \
1314
LANG=en_US.UTF-8 \

0 commit comments

Comments
 (0)