diff --git a/Dockerfile b/Dockerfile index c85e544..254cae8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,10 +3,11 @@ FROM docker.io/opendevorg/python-builder as builder COPY . /tmp/src RUN assemble -FROM docker.io/opendevorg/python-base as zuul-storage-proxy +FROM docker.io/opendevorg/uwsgi-base as zuul-storage-proxy COPY --from=builder /output/ /output RUN /output/install-from-bindep EXPOSE 8000 -CMD ["/usr/local/bin/gunicorn", "-k", "eventlet", "-t", "3600", "--workers", "10", "swift_proxy:proxy"] +ENV UWSGI_HTTP_SOCKET=:8000 UWSGI_PROCESSES=10 UWSGI_THREADS=1 +CMD uwsgi --mount /=zuul_storage_proxy:proxy diff --git a/requirements.txt b/requirements.txt index ac8f473..720dbc3 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1 @@ -gunicorn[eventlet] openstacksdk diff --git a/setup.cfg b/setup.cfg index 3f8b672..8135fb9 100644 --- a/setup.cfg +++ b/setup.cfg @@ -6,3 +6,7 @@ requires-dist = [pbr] warnerrors = True + + +[files] +packages = zuul_storage_proxy diff --git a/zuul_storage_proxy/__init__.py b/zuul_storage_proxy/__init__.py index 1240391..caa6be2 100644 --- a/zuul_storage_proxy/__init__.py +++ b/zuul_storage_proxy/__init__.py @@ -102,7 +102,7 @@ def handle_get(start_response, clouds, container, path): start_response( "{} {}".format(response.status_code, response.reason), - response_headers.items()) + list(response_headers.items())) # We want to forward the compressed data stream here so use the raw # response stream. @@ -163,7 +163,6 @@ def swift_proxy(environ, start_response, clouds, container_prefix): path = components[1] container = container_prefix + container - print('%s request %s/%s' % (method, container, path)) try: if method == 'GET': for chunk in handle_get(start_response, clouds, container, path):