mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-26 02:11:41 -05:00
deploys take up to five minutes, during which notify-paas-autoscaler can't scale the app. We saw 502s due to a large volume of traffic coming in during that time, and we couldn't react cos we were deploying. scale up to 25 instances, the autoscaler won't be able to downscale until after the deploy has finished.
110 lines
3.6 KiB
Django/Jinja
110 lines
3.6 KiB
Django/Jinja
{%- set app_vars = {
|
|
'notify-api': {
|
|
'NOTIFY_APP_NAME': 'api',
|
|
'disk_quota': '2G',
|
|
'sqlalchemy_pool_size': 20,
|
|
'routes': {
|
|
'preview': ['api.notify.works'],
|
|
'staging': ['api.staging-notify.works'],
|
|
'production': ['api.notifications.service.gov.uk'],
|
|
},
|
|
'health-check-type': 'port',
|
|
'instances': {
|
|
'preview': None,
|
|
'staging': None,
|
|
'production': 25
|
|
},
|
|
},
|
|
'notify-api-db-migration': {
|
|
'NOTIFY_APP_NAME': 'api',
|
|
'instances': {
|
|
'preview': 0,
|
|
'staging': 0,
|
|
'production': 0
|
|
},
|
|
},
|
|
|
|
'notify-delivery-celery-beat': {'memory': '128M'},
|
|
'notify-delivery-worker-jobs': {},
|
|
'notify-delivery-worker-research': {},
|
|
'notify-delivery-worker-sender': {'disk_quota': '2G', 'memory': '3G'},
|
|
'notify-delivery-worker-periodic': {},
|
|
'notify-delivery-worker-reporting': {},
|
|
'notify-delivery-worker-priority': {},
|
|
'notify-delivery-worker-letters': {},
|
|
'notify-delivery-worker-retry-tasks': {},
|
|
'notify-delivery-worker-internal': {},
|
|
'notify-delivery-worker-receipts': {},
|
|
'notify-delivery-worker-service-callbacks': {'disk_quota': '2G'},
|
|
} -%}
|
|
|
|
{%- set app = app_vars[CF_APP] -%}
|
|
{%- set instance_count = app.get('instances', {}).get(environment) -%}
|
|
|
|
---
|
|
|
|
applications:
|
|
- name: {{ CF_APP }}
|
|
buildpack: python_buildpack
|
|
{% if instance_count is not none %}
|
|
instances: {{ instance_count }}
|
|
{%- endif %}
|
|
memory: {{ app.get('memory', '1G') }}
|
|
disk_quota: {{ app.get('disk_quota', '1G')}}
|
|
|
|
routes:
|
|
{%- for route in app.get('routes', {}).get(environment, []) %}
|
|
- route: {{ route }}
|
|
{%- endfor%}
|
|
- route: {{ CF_APP }}-{{ environment }}.cloudapps.digital
|
|
health-check-type: {{ app.get('health-check-type', 'process') }}
|
|
|
|
services:
|
|
- notify-db
|
|
- logit-ssl-syslog-drain
|
|
|
|
env:
|
|
NOTIFY_APP_NAME: {{ app.get('NOTIFY_APP_NAME', CF_APP.replace('notify-', '')) }}
|
|
SQLALCHEMY_POOL_SIZE: {{ app.get('sqlalchemy_pool_size', 1) }}
|
|
FLASK_APP: application.py
|
|
|
|
# Credentials variables
|
|
ADMIN_BASE_URL: '{{ ADMIN_BASE_URL }}'
|
|
ADMIN_CLIENT_SECRET: '{{ ADMIN_CLIENT_SECRET }}'
|
|
API_HOST_NAME: '{{ API_HOST_NAME }}'
|
|
DANGEROUS_SALT: '{{ DANGEROUS_SALT }}'
|
|
SECRET_KEY: '{{ SECRET_KEY }}'
|
|
ROUTE_SECRET_KEY_1: '{{ ROUTE_SECRET_KEY_1 }}'
|
|
ROUTE_SECRET_KEY_2: '{{ ROUTE_SECRET_KEY_2 }}'
|
|
CRONITOR_KEYS: '{{ CRONITOR_KEYS | tojson }}'
|
|
|
|
PERFORMANCE_PLATFORM_ENDPOINTS: '{{ PERFORMANCE_PLATFORM_ENDPOINTS | tojson }}'
|
|
|
|
DOCUMENT_DOWNLOAD_API_HOST: '{{ DOCUMENT_DOWNLOAD_API_HOST }}'
|
|
DOCUMENT_DOWNLOAD_API_KEY: '{{ DOCUMENT_DOWNLOAD_API_KEY }}'
|
|
|
|
NOTIFICATION_QUEUE_PREFIX: '{{ NOTIFICATION_QUEUE_PREFIX }}'
|
|
AWS_ACCESS_KEY_ID: '{{ AWS_ACCESS_KEY_ID }}'
|
|
AWS_SECRET_ACCESS_KEY: '{{ AWS_SECRET_ACCESS_KEY }}'
|
|
|
|
STATSD_HOST: "notify-statsd-exporter-{{ environment }}.apps.internal"
|
|
STATSD_PREFIX: ""
|
|
|
|
ZENDESK_API_KEY: '{{ ZENDESK_API_KEY }}'
|
|
|
|
MMG_URL: '{{ MMG_URL }}'
|
|
MMG_API_KEY: '{{ MMG_API_KEY }}'
|
|
MMG_INBOUND_SMS_AUTH: '{{ MMG_INBOUND_SMS_AUTH | tojson }}'
|
|
MMG_INBOUND_SMS_USERNAME: '{{ MMG_INBOUND_SMS_USERNAME | tojson }}'
|
|
|
|
FIRETEXT_URL: '{{ FIRETEXT_URL }}'
|
|
FIRETEXT_API_KEY: '{{ FIRETEXT_API_KEY }}'
|
|
LOADTESTING_API_KEY: '{{ LOADTESTING_API_KEY }}'
|
|
FIRETEXT_INBOUND_SMS_AUTH: '{{ FIRETEXT_INBOUND_SMS_AUTH | tojson }}'
|
|
|
|
REDIS_ENABLED: '{{ REDIS_ENABLED }}'
|
|
REDIS_URL: '{{ REDIS_URL }}'
|
|
|
|
TEMPLATE_PREVIEW_API_HOST: '{{ TEMPLATE_PREVIEW_API_HOST }}'
|
|
TEMPLATE_PREVIEW_API_KEY: '{{ TEMPLATE_PREVIEW_API_KEY }}'
|