Skip to content

Commit

Permalink
Configure gunicorn with GUNICORN_CMD_ARGS
Browse files Browse the repository at this point in the history
  • Loading branch information
jennydaman committed Mar 27, 2024
1 parent a8b2206 commit 2b97d8a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 12 deletions.
6 changes: 2 additions & 4 deletions charts/chris/templates/server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 4 additions & 7 deletions charts/chris/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand All @@ -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
Expand Down Expand Up @@ -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:
Expand Down
3 changes: 2 additions & 1 deletion testing/default-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@ 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
memory: 2Gi
requests:
cpu: 1
memory: 2Gi
config:
GUNICORN_CMD_ARGS: "--workers=4 --timeout=3600"

pfcon:
storage:
Expand Down

0 comments on commit 2b97d8a

Please sign in to comment.