From c563aa505018f8a14931a16a9061d361b5d4c383 Mon Sep 17 00:00:00 2001 From: Julius Unverfehrt Date: Tue, 21 Jun 2022 15:10:19 +0200 Subject: [PATCH] test bamboo build --- image_prediction/flask.py | 10 ---------- requirements.txt | 3 +-- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/image_prediction/flask.py b/image_prediction/flask.py index 4297a6f..b1473da 100644 --- a/image_prediction/flask.py +++ b/image_prediction/flask.py @@ -3,7 +3,6 @@ import traceback from typing import Callable from flask import Flask, request, jsonify -from prometheus_client import generate_latest, CollectorRegistry, Summary from image_prediction.utils import get_logger @@ -35,10 +34,6 @@ def wrap_in_process(func_to_wrap): def make_prediction_server(predict_fn: Callable): app = Flask(__name__) - registry = CollectorRegistry(auto_describe=True) - metric = Summary( - f"redactmanager_imageClassification_seconds", f"Time spent on image-service classification.", registry=registry - ) @app.route("/ready", methods=["GET"]) def ready(): @@ -59,7 +54,6 @@ def make_prediction_server(predict_fn: Callable): @app.route("/predict", methods=["POST"]) @app.route("/", methods=["POST"]) - @metric.time() def predict(): # Tensorflow does not free RAM. Workaround: Run prediction function (which instantiates a model) in sub-process. @@ -77,8 +71,4 @@ def make_prediction_server(predict_fn: Callable): logger.error("Analysis failed.") return __failure() - @app.route("/prometheus", methods=["GET"]) - def prometheus(): - return generate_latest(registry=registry) - return app diff --git a/requirements.txt b/requirements.txt index 56fd8aa..ffcb5ca 100644 --- a/requirements.txt +++ b/requirements.txt @@ -20,5 +20,4 @@ coverage==6.3.2 Pillow==9.1.0 PDFNetPython3==9.1.0 pdf2image==1.16.0 -frozendict==2.3.0 -prometheus-client==0.13.1 \ No newline at end of file +frozendict==2.3.0 \ No newline at end of file