Created
October 29, 2019 15:27
-
-
Save patmigliaccio/c5281971592a327ff0a44469841bfd54 to your computer and use it in GitHub Desktop.
patmigliaccio.com/lessons-ml-gcp 10/29/19
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
@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