Skip to content

Commit

Permalink
Merge pull request #501 from mozilla-iam/gunicorn_settings
Browse files Browse the repository at this point in the history
Adjust gunicorn settings and ensure tracebacks propagate up to logs
  • Loading branch information
dividehex authored Aug 5, 2024
2 parents 09e561b + e02c730 commit efce985
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 6 deletions.
11 changes: 9 additions & 2 deletions clouddeploy/sso-dashboard-dev.template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ spec:
template:
metadata:
annotations:
autoscaling.knative.dev/minScale: '1'
autoscaling.knative.dev/maxScale: '3'
autoscaling.knative.dev/minScale: '0'
autoscaling.knative.dev/maxScale: '1'
run.googleapis.com/cpu-throttling: 'false'
run.googleapis.com/startup-cpu-boost: 'true'
run.googleapis.com/vpc-access-connector: 'redis-connector'
Expand All @@ -41,7 +41,14 @@ spec:
- '--bind'
- '0.0.0.0:8000'
- '--workers=2'
- '--max-requests=1000'
- '--max-requests-jitter=50'
- '--graceful-timeout=30'
- '--timeout=60'
- '--log-level=debug'
- '--error-logfile=-'
- '--reload'
- '--reload-extra-file=/dashboard/data/apps.yml'
ports:
- name: http1
containerPort: 8000
Expand Down
11 changes: 9 additions & 2 deletions clouddeploy/sso-dashboard-prod.template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ spec:
template:
metadata:
annotations:
autoscaling.knative.dev/minScale: '1'
autoscaling.knative.dev/maxScale: '3'
autoscaling.knative.dev/minScale: '0'
autoscaling.knative.dev/maxScale: '2'
run.googleapis.com/cpu-throttling: 'false'
run.googleapis.com/startup-cpu-boost: 'true'
run.googleapis.com/vpc-access-connector: 'redis-connector'
Expand All @@ -41,7 +41,14 @@ spec:
- '--bind'
- '0.0.0.0:8000'
- '--workers=2'
- '--max-requests=1000'
- '--max-requests-jitter=50'
- '--graceful-timeout=30'
- '--timeout=60'
- '--log-level=debug'
- '--error-logfile=-'
- '--reload'
- '--reload-extra-file=/dashboard/data/apps.yml'
ports:
- name: http1
containerPort: 8000
Expand Down
11 changes: 9 additions & 2 deletions clouddeploy/sso-dashboard-staging.template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ spec:
template:
metadata:
annotations:
autoscaling.knative.dev/minScale: '1'
autoscaling.knative.dev/maxScale: '3'
autoscaling.knative.dev/minScale: '0'
autoscaling.knative.dev/maxScale: '1'
run.googleapis.com/cpu-throttling: 'false'
run.googleapis.com/startup-cpu-boost: 'true'
run.googleapis.com/vpc-access-connector: 'redis-connector'
Expand All @@ -41,7 +41,14 @@ spec:
- '--bind'
- '0.0.0.0:8000'
- '--workers=2'
- '--max-requests=1000'
- '--max-requests-jitter=50'
- '--graceful-timeout=30'
- '--timeout=60'
- '--log-level=debug'
- '--error-logfile=-'
- '--reload'
- '--reload-extra-file=/dashboard/data/apps.yml'
ports:
- name: http1
containerPort: 8000
Expand Down
2 changes: 2 additions & 0 deletions dashboard/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ class DefaultConfig(object):

DEBUG = bool(CONFIG("debug", namespace="sso-dashboard", default="True"))
TESTING = bool(CONFIG("testing", namespace="sso-dashboard", default="False"))
PROPAGATE_EXCEPTIONS = bool(CONFIG("propagate_exceptions", namespace="sso-dashboard", default="True"))

CSRF_ENABLED = bool(CONFIG("csrf_enabled", default="True"))
PERMANENT_SESSION = bool(CONFIG("permanent_session", namespace="sso-dashboard", default="True"))
seconds = int(CONFIG("permanent_session_lifetime", namespace="sso-dashboard", default="86400"))
Expand Down

0 comments on commit efce985

Please sign in to comment.