Add instance health checks for all gunicorn workers

Fixes https://jira.coreos.com/browse/QS-121
This commit is contained in:
Joseph Schorr 2018-01-12 16:07:10 -05:00
parent 18f1ccf80b
commit e91b83e1be
3 changed files with 36 additions and 21 deletions

View file

@ -10,7 +10,7 @@ from auth.auth_context import get_authenticated_user
from auth.decorators import process_auth
from auth.permissions import ReadRepositoryPermission
from data import database
from endpoints.decorators import anon_protect, route_show_if, parse_repository_name
from endpoints.decorators import anon_protect, anon_allowed, route_show_if, parse_repository_name
from endpoints.verbs.models_pre_oci import pre_oci_model as model
from endpoints.v2.blob import BLOB_DIGEST_ROUTE
from image.appc import AppCImageFormatter
@ -394,3 +394,9 @@ def get_tag_torrent(namespace_name, repo_name, digest):
metric_queue.repository_pull.Inc(labelvalues=[namespace_name, repo_name, 'torrent', True])
return _torrent_for_blob(blob, repo_is_public)
@verbs.route('/_internal_ping')
@anon_allowed
def internal_ping():
return make_response('true', 200)

View file

@ -67,6 +67,10 @@ STATUS_TAGS = app.config['STATUS_TAGS']
def index(path, **kwargs):
return render_page_template_with_routedata('index.html', **kwargs)
@web.route('/_internal_ping')
@anon_allowed
def internal_ping():
return make_response('true', 200)
@web.route('/500', methods=['GET'])
def internal_error_display():