Skip to content

Instantly share code, notes, and snippets.

@patmigliaccio
Created October 29, 2019 15:27
Show Gist options
  • Save patmigliaccio/c5281971592a327ff0a44469841bfd54 to your computer and use it in GitHub Desktop.
Save patmigliaccio/c5281971592a327ff0a44469841bfd54 to your computer and use it in GitHub Desktop.
patmigliaccio.com/lessons-ml-gcp 10/29/19
...
@app.before_first_request
def _load_model():
global MODEL
# Note: In GKE, health check triggers loading of the model
MODEL = load_model(_logger=app.logger)
@app.route('/healthz', methods=['GET'])
def health():
"""Health check probe route for Kubernetes Ingress"""
return jsonify(code='200', message='Ok')
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment