2019-02-26 18:41:23 +03:00
|
|
|
# This file defines the processes that will be run on Heroku.
|
|
|
|
# Each line must be in the format `<process type>: <command>`.
|
|
|
|
# https://devcenter.heroku.com/articles/how-heroku-works#knowing-what-to-execute
|
|
|
|
# https://devcenter.heroku.com/articles/procfile
|
|
|
|
|
|
|
|
# The `release` process type specifies the command to run during deployment, and is where
|
|
|
|
# we run DB migrations and other tasks that are 'release' rather than 'build' specific:
|
|
|
|
# https://devcenter.heroku.com/articles/release-phase
|
2019-03-12 00:39:34 +03:00
|
|
|
# https://devcenter.heroku.com/articles/runtime-principles#build-release-run
|
2019-02-26 18:41:23 +03:00
|
|
|
release: ./bin/pre_deploy
|
|
|
|
|
|
|
|
# The `web` process type is the only one that receives external traffic from Heroku's routers.
|
|
|
|
# We set the maximum request duration to 20 seconds, to ensure that poorly performing API
|
|
|
|
# queries do not consume a gunicorn worker for unbounded lengths of time. See:
|
|
|
|
# https://devcenter.heroku.com/articles/python-gunicorn
|
|
|
|
# The Heroku Python buildpack sets some sensible gunicorn defaults via environment variables:
|
|
|
|
# https://github.com/heroku/heroku-buildpack-python/blob/master/vendor/python.gunicorn.sh
|
2019-03-12 00:39:34 +03:00
|
|
|
# https://github.com/heroku/heroku-buildpack-python/blob/master/vendor/WEB_CONCURRENCY.sh
|
2019-02-26 18:41:23 +03:00
|
|
|
# TODO: Experiment with different dyno sizes and gunicorn concurrency/worker types (bug 1175472).
|
2017-08-04 18:49:17 +03:00
|
|
|
web: newrelic-admin run-program gunicorn treeherder.config.wsgi:application --timeout 20
|
2019-02-26 18:41:23 +03:00
|
|
|
|
|
|
|
# All other process types can have arbitrary names.
|
|
|
|
# The Celery options such as `--without-heartbeat` are from the recommendations here:
|
|
|
|
# https://www.cloudamqp.com/docs/celery.html
|
2019-03-04 19:09:07 +03:00
|
|
|
# The REMAP_SIGTERM is as recommended by:
|
|
|
|
# https://devcenter.heroku.com/articles/celery-heroku#using-remap_sigterm
|
2019-02-26 18:41:23 +03:00
|
|
|
|
2019-03-12 00:39:34 +03:00
|
|
|
# This schedules (but does not run itself) the cron-like tasks listed in `CELERY_BEAT_SCHEDULE`.
|
2019-02-26 18:41:23 +03:00
|
|
|
# However we're moving away from using this in favour of the Heroku scheduler addon.
|
2019-03-12 00:39:34 +03:00
|
|
|
# NB: This should not be scaled up to more than 1 dyno otherwise duplicate tasks will be scheduled.
|
2019-02-26 18:41:23 +03:00
|
|
|
# TODO: Move the remaining tasks to the addon and remove this process type (deps of bug 1176492).
|
2019-03-04 19:09:07 +03:00
|
|
|
celery_scheduler: REMAP_SIGTERM=SIGQUIT newrelic-admin run-program celery beat -A treeherder
|
2019-02-26 18:41:23 +03:00
|
|
|
|
|
|
|
# Push/job data is consumed from exchanges on pulse.mozilla.org using these kombu-powered
|
|
|
|
# Django management commands. They do not ingest the data themselves, instead adding tasks
|
2019-02-26 18:49:20 +03:00
|
|
|
# to the `store_pulse_{pushes,jobs}` queues for `worker_store_pulse_data` to process.
|
2019-02-26 18:41:23 +03:00
|
|
|
# NB: These should not be scaled up to more than 1 of each.
|
2019-03-12 00:39:34 +03:00
|
|
|
# TODO: Merge these two listeners into one since they use so little CPU each (bug 1530965).
|
2019-02-26 18:53:31 +03:00
|
|
|
pulse_listener_pushes: newrelic-admin run-program ./manage.py pulse_listener_pushes
|
2019-06-06 17:24:32 +03:00
|
|
|
pulse_listener_tasks: newrelic-admin run-program ./manage.py pulse_listener_tasks
|
2019-02-26 18:41:23 +03:00
|
|
|
|
|
|
|
# Processes pushes/jobs from Pulse that were collected by `pulse_listener_{pushes,jobs)`.
|
2019-06-06 17:24:32 +03:00
|
|
|
worker_store_pulse_data: REMAP_SIGTERM=SIGQUIT newrelic-admin run-program celery worker -A treeherder --without-gossip --without-mingle --without-heartbeat -Q store_pulse_pushes,store_pulse_tasks --concurrency=3
|
2019-02-26 18:41:23 +03:00
|
|
|
|
|
|
|
# Handles the log parsing tasks scheduled by `worker_store_pulse_data` as part of job ingestion.
|
2019-03-05 09:50:46 +03:00
|
|
|
worker_log_parser: REMAP_SIGTERM=SIGQUIT newrelic-admin run-program celery worker -A treeherder --without-gossip --without-mingle --without-heartbeat -Q log_parser,log_parser_fail,log_autoclassify,log_autoclassify_fail --concurrency=7
|
2016-03-11 14:33:25 +03:00
|
|
|
|
2019-02-26 18:41:23 +03:00
|
|
|
# Tasks that don't need a dedicated worker.
|
2019-03-04 19:09:07 +03:00
|
|
|
worker_misc: REMAP_SIGTERM=SIGQUIT newrelic-admin run-program celery worker -A treeherder --without-gossip --without-mingle --without-heartbeat -Q default,generate_perf_alerts,pushlog,seta_analyze_failures --concurrency=3
|