Skip to content

Commit

Permalink
fix(manager): uvicorn worker overrides gunicorn logging settings
Browse files Browse the repository at this point in the history
  • Loading branch information
jdobes authored and psegedy committed Apr 17, 2024
1 parent 4a522dd commit 068dd08
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
6 changes: 3 additions & 3 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ if [[ ! -z $1 ]]; then
if [[ "$1" == "vmaas-sync" ]]; then
exec python3 -m vmaas_sync.vmaas_sync
elif [[ "$1" == "manager" ]]; then
exec gunicorn -c manager/gunicorn_conf.py -w ${GUNICORN_WORKERS:-4} -k uvicorn.workers.UvicornWorker --bind=0.0.0.0:$(public_port) --bind=0.0.0.0:$(metrics_port) --timeout=60 --limit-request-field_size=65535 manager.main
exec gunicorn -c manager/gunicorn_conf.py -w ${GUNICORN_WORKERS:-4} --bind=0.0.0.0:$(public_port) --bind=0.0.0.0:$(metrics_port) --timeout=60 --limit-request-field_size=65535 manager.main
elif [[ "$1" == "manager-dev" ]]; then
exec gunicorn --reload -c manager/gunicorn_conf.py -w ${GUNICORN_WORKERS:-4} -k uvicorn.workers.UvicornWorker --bind=0.0.0.0:$(public_port) --bind=0.0.0.0:$(metrics_port) --timeout=60 --limit-request-field_size=65535 manager.main
exec gunicorn --reload -c manager/gunicorn_conf.py -w ${GUNICORN_WORKERS:-4} --bind=0.0.0.0:$(public_port) --bind=0.0.0.0:$(metrics_port) --timeout=60 --limit-request-field_size=65535 manager.main
elif [[ "$1" == "manager-admin" ]]; then
exec gunicorn -c manager/gunicorn_conf.py -w ${GUNICORN_WORKERS:-4} -k uvicorn.workers.UvicornWorker --bind=0.0.0.0:$(public_port) --bind=0.0.0.0:$(metrics_port) --timeout=60 --limit-request-field_size=65535 manager.admin
exec gunicorn -c manager/gunicorn_conf.py -w ${GUNICORN_WORKERS:-4} --bind=0.0.0.0:$(public_port) --bind=0.0.0.0:$(metrics_port) --timeout=60 --limit-request-field_size=65535 manager.admin
elif [[ "$1" == "taskomatic" ]]; then
exec python3 -m taskomatic.taskomatic
elif [[ "$1" == "notificator" ]]; then
Expand Down
3 changes: 2 additions & 1 deletion manager/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from traceback import format_exc

import connexion
from a2wsgi import ASGIMiddleware
from connexion import context
from connexion.options import SwaggerUIOptions
from connexion.resolver import RestyResolver
Expand Down Expand Up @@ -117,7 +118,7 @@ def _on_first_request():

app.add_middleware(ErrorHandlerMiddleware, position=connexion.middleware.MiddlewarePosition.BEFORE_EXCEPTION)

return app
return ASGIMiddleware(app)


init_logging(num_servers=int(CFG.gunicorn_workers))
Expand Down
2 changes: 1 addition & 1 deletion tests/manager_tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def feature_is_enabled(feature_name, context=None, fallback_function=None):

@pytest.fixture
def client(app):
with app.test_client() as client:
with app.app.test_client() as client:
yield client


Expand Down

0 comments on commit 068dd08

Please sign in to comment.