Enable Multi-Workers/Threads for Shipyard

Updates to entry.sh to allow for multi-workers/threads
Updates Shipyard chart to allow parametrs to be configurable

Change-Id: I6ad9d198ac4df4c7c85dfcf5c04afd3c7966f0f0
This commit is contained in:
Krysta 2018-01-11 09:30:21 -06:00
parent b85e699c3e
commit 5cc0b5b986
3 changed files with 16 additions and 2 deletions

View File

@ -44,6 +44,11 @@ spec:
{{ tuple $envAll $dependencies $mounts_shipyard_init | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }}
containers:
- name: shipyard
env:
- name: 'SHIPYARD_API_WORKERS'
value: {{ .Values.conf.uwsgi.workers | quote }}
- name: 'SHIPYARD_API_THREADS'
value: {{ .Values.conf.uwsgi.threads | quote }}
image: {{ .Values.images.tags.shipyard }}
imagePullPolicy: {{ .Values.images.pull_policy }}
{{ tuple $envAll $envAll.Values.pod.resources.shipyard_api | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }}

View File

@ -290,6 +290,9 @@ database:
db_root_user: postgres
conf:
uwsgi:
threads: 1
workers: 4
policy:
admin_required: role:admin
workflow_orchestrator:list_actions: rule:admin_required

View File

@ -17,7 +17,11 @@
set -ex
CMD="shipyard"
PORT="9000"
PORT=${PORT:-9000}
# Number of uWSGI workers to handle API request
SHIPYARD_API_WORKERS=${SHIPYARD_API_WORKERS:-"4"}
#Threads per worker
SHIPYARD_API_THREADS=${SHIPYARD_API_THREADS:-"1"}
if [ "$1" = 'server' ]; then
# Start shipyard application
@ -26,7 +30,9 @@ if [ "$1" = 'server' ]; then
--paste config:/etc/shipyard/api-paste.ini \
--enable-threads \
-L \
--pyargv "--config-file /etc/shipyard/shipyard.conf"
--pyargv "--config-file /etc/shipyard/shipyard.conf" \
--threads $SHIPYARD_API_THREADS \
--workers $SHIPYARD_API_WORKERS
else
# Execute shipyard command
exec ${CMD} $@