Merge "api: Replace conflicting environment variable"

This commit is contained in:
Zuul 2018-10-18 15:38:40 +00:00 committed by Gerrit Code Review
commit 5476454e4a
2 changed files with 20 additions and 11 deletions

View File

@ -197,10 +197,19 @@ conf:
pod:
env:
# NOTE(@drewwalters96): These configuration values change the Armada API's
# uWSGI configuration.
armada_api:
# ARMADA_API_PORT should = conf.armada.armada_api.bind_port in standard cases
- name: ARMADA_API_PORT
value: 8000
# # NOTE: ARMADA_UWSGI_PORT should match conf.armada.armada_api.bind_port in
# # standard use cases
# - name: ARMADA_UWSGI_PORT
# value: "8000"
# - name: ARMADA_UWSGI_TIMEOUT
# value: "3600"
# - name: ARMADA_UWSGI_WORKERS
# value: "4"
# - name: ARMADA_UWSGI_THREADS
# value: "1"
# - name: http_proxy
# value: http://proxy.example.com:8080
# - name: https_proxy

View File

@ -19,13 +19,13 @@ set -ex
CMD="armada"
# Define port
ARMADA_API_PORT=${ARMADA_API_PORT:-8000}
ARMADA_UWSGI_PORT=${ARMADA_UWSGI_PORT:-8000}
# How long uWSGI should wait for each Armada response
ARMADA_API_TIMEOUT=${ARMADA_API_TIMEOUT:-"3600"}
ARMADA_UWSGI_TIMEOUT=${ARMADA_UWSGI_TIMEOUT:-"3600"}
# Number of uWSGI workers to handle API requests
ARMADA_API_WORKERS=${ARMADA_API_WORKERS:-"4"}
ARMADA_UWSGI_WORKERS=${ARMADA_UWSGI_WORKERS:-"4"}
# Threads per worker
ARMADA_API_THREADS=${ARMADA_API_THREADS:-"1"}
ARMADA_UWSGI_THREADS=${ARMADA_UWSGI_THREADS:-"1"}
# Start Armada application
# TODO(fmontei): Should be specifying callable too. But Armada spins up the
@ -34,16 +34,16 @@ if [ "$1" = 'server' ]; then
exec uwsgi \
-b 32768 \
--die-on-term \
--http :${ARMADA_API_PORT} \
--http-timeout $ARMADA_API_TIMEOUT \
--http :${ARMADA_UWSGI_PORT} \
--http-timeout $ARMADA_UWSGI_TIMEOUT \
--enable-threads \
-L \
--lazy-apps \
--master \
--paste config:/etc/armada/api-paste.ini \
--pyargv "--config-file /etc/armada/armada.conf" \
--threads $ARMADA_API_THREADS \
--workers $ARMADA_API_WORKERS
--threads $ARMADA_UWSGI_THREADS \
--workers $ARMADA_UWSGI_WORKERS
else
exec $CMD "$@"
fi