From 2b97d8ae42cda7729149975bb31a783f29af2f48 Mon Sep 17 00:00:00 2001 From: Jennings Zhang Date: Wed, 27 Mar 2024 19:34:27 -0400 Subject: [PATCH] Configure gunicorn with GUNICORN_CMD_ARGS --- charts/chris/templates/server.yml | 6 ++---- charts/chris/values.yaml | 11 ++++------- testing/default-values.yaml | 3 ++- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/charts/chris/templates/server.yml b/charts/chris/templates/server.yml index aa1d1a9..d2d1a3b 100644 --- a/charts/chris/templates/server.yml +++ b/charts/chris/templates/server.yml @@ -33,10 +33,8 @@ spec: {{- include "cube.waitServerReady" . | nindent 8 }} containers: - name: server - {{- if .Values.cube.server.command }} - command: - {{ .Values.cube.server.command | toYaml | nindent 10 }} - {{- end }} + command: [ "gunicorn" ] + args: ["-b", "0.0.0.0:8000", "config.wsgi:application"] {{- include "cube.container" . | nindent 10 }} ports: - name: http diff --git a/charts/chris/values.yaml b/charts/chris/values.yaml index 6a6fd34..c011e3c 100644 --- a/charts/chris/values.yaml +++ b/charts/chris/values.yaml @@ -68,7 +68,7 @@ route: chris_admin: username: khris - email: noreply@babyMRI.org + email: noreply@babymri.org # If no password is set, then a random password is created for you. # password: @@ -91,6 +91,9 @@ cube: # Configuration ##################### config: + # Configuration of the gunicorn WSGI server. + # ref: https://docs.gunicorn.org/en/stable/settings.html + GUNICORN_CMD_ARGS: "--workers=4 --timeout=3600" # smaller values increases responsiveness at the cost of resource usage and possibly concurrency bugs CUBE_CELERY_POLL_INTERVAL: "5.0" # HTTP server security settings @@ -159,12 +162,6 @@ cube: # nodePort: ## nodePortHost does nothing. It is simply used to print the URL of CUBE in the NOTES # nodePortHost: - - # In the command, you can customize the number of workers, timeout, etc. - # *do not* change the value for -b - # *do not* change the positional argument "config.wsgi:application" - # You may change -t (timeout in seconds) and/or -w (workers) - command: ["gunicorn", "-b", "0.0.0.0:8000", "-w", "4", "-t", "3600", "config.wsgi:application"] ## resources for the HTTP server (WSGI). ## Default values should be okay. About 256Mi of memory is needed per idle worker. resources: diff --git a/testing/default-values.yaml b/testing/default-values.yaml index b4c903b..3882503 100644 --- a/testing/default-values.yaml +++ b/testing/default-values.yaml @@ -8,7 +8,6 @@ cube: service: type: NodePort nodePort: 32000 - command: ["gunicorn", "-b", "0.0.0.0:8000", "-w", "4", "-t", "300", "config.wsgi:application"] resources: limits: cpu: 1 @@ -16,6 +15,8 @@ cube: requests: cpu: 1 memory: 2Gi + config: + GUNICORN_CMD_ARGS: "--workers=4 --timeout=3600" pfcon: storage: