Skip to content

Commit

Permalink
Revert "feat: add healthchecks (#93)"
Browse files Browse the repository at this point in the history
This reverts commit d9ff186.
  • Loading branch information
dilyararimovna committed Oct 25, 2023
1 parent fad3f70 commit 3a9e3f3
Show file tree
Hide file tree
Showing 87 changed files with 61 additions and 190 deletions.
1 change: 0 additions & 1 deletion annotators/IntentCatcherTransformers/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ itsdangerous==2.0.1
gunicorn==19.9.0
requests==2.22.0
sentry-sdk[flask]==0.14.1
six==1.16.0
healthcheck==1.3.3
jinja2<=3.0.3
Werkzeug<=2.0.3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ flask==1.1.1
gunicorn==19.9.0
requests==2.22.0
sentry-sdk[flask]==0.14.1
six==1.16.0
healthcheck==1.3.3
itsdangerous==2.0.1
jinja2<=3.0.3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ flask==1.1.1
gunicorn==19.9.0
requests==2.22.0
sentry-sdk[flask]==0.14.1
six==1.16.0
healthcheck==1.3.3
itsdangerous==2.0.1
jinja2<=3.0.3
Expand Down
3 changes: 0 additions & 3 deletions annotators/combined_classification/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,4 @@ ENV KEEP_ZERO_CONFS=$KEEP_ZERO_CONFS
COPY annotators/combined_classification/ ./
COPY common/ common/

# wait for a server answer ( INTERVAL + TIMEOUT ) * RETRIES seconds after that change stutus to unhealthy
HEALTHCHECK --interval=5s --timeout=5s --retries=3 CMD curl --fail 127.0.0.1:${SERVICE_PORT}/healthcheck || exit 1

CMD gunicorn --workers=1 server:app -b 0.0.0.0:${SERVICE_PORT} --timeout=1200 --preload
2 changes: 0 additions & 2 deletions annotators/combined_classification/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,3 @@ transformers==4.15.0
jinja2<=3.0.3
Werkzeug<=2.0.3
pytorch-crf==0.7.2
six==1.16.0
healthcheck==1.3.3
5 changes: 2 additions & 3 deletions annotators/combined_classification/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
import os
import time

import sentry_sdk
from flask import Flask, request, jsonify
from healthcheck import HealthCheck
import sentry_sdk

from sentry_sdk.integrations.flask import FlaskIntegration
from deeppavlov import build_model
from common.utils import combined_classes
Expand Down Expand Up @@ -66,7 +66,6 @@ def get_result(sentences, sentences_with_history, postannotations=False):
raise e

app = Flask(__name__)
health = HealthCheck(app, "/healthcheck")


@app.route("/model", methods=["POST"])
Expand Down
3 changes: 0 additions & 3 deletions annotators/doc_processor/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,4 @@ COPY annotators/doc_processor /src
COPY documents /src/documents
COPY common /src/common

# wait for a server answer ( INTERVAL + TIMEOUT ) * RETRIES seconds after that change stutus to unhealthy
HEALTHCHECK --interval=5s --timeout=5s --retries=3 CMD curl --fail 127.0.0.1:${SERVICE_PORT}/healthcheck || exit 1

CMD gunicorn --workers=1 server:app -b 0.0.0.0:${SERVICE_PORT} --timeout=1200
4 changes: 1 addition & 3 deletions annotators/doc_processor/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,4 @@ pypdfium2==4.16.0
bs4==0.0.1
python-docx==0.8.11
simplify-docx==0.1.2
filetype==1.2.0
six==1.16.0
healthcheck==1.3.3
filetype==1.2.0
5 changes: 1 addition & 4 deletions annotators/doc_processor/server.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
import logging
import os

import sentry_sdk
from common.files_and_folders_processing import SKILLS_USING_DOC
from flask import Flask, jsonify, request
from healthcheck import HealthCheck
from sentry_sdk.integrations.flask import FlaskIntegration
from utils import upload_documents_save_info
from common.files_and_folders_processing import SKILLS_USING_DOC

# logging here because it conflicts with tf

logging.basicConfig(format="%(asctime)s - %(name)s - %(levelname)s - %(message)s", level=logging.INFO)
logger = logging.getLogger(__name__)
sentry_sdk.init(dsn=os.getenv("SENTRY_DSN"), integrations=[FlaskIntegration()])
app = Flask(__name__)
health = HealthCheck(app, "/healthcheck")

DOC_PATHS_OR_LINKS = os.environ.get("DOC_PATHS_OR_LINKS")
if DOC_PATHS_OR_LINKS:
Expand Down
3 changes: 0 additions & 3 deletions annotators/doc_retriever/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,4 @@ COPY annotators/doc_retriever /src
COPY documents /src/documents
COPY common /src/common

# wait for a server answer ( INTERVAL + TIMEOUT ) * RETRIES seconds after that change stutus to unhealthy
HEALTHCHECK --interval=5s --timeout=5s --retries=3 CMD curl --fail 127.0.0.1:${SERVICE_PORT}/healthcheck || exit 1

CMD gunicorn --workers=1 server:app -b 0.0.0.0:${SERVICE_PORT} --timeout=1200
5 changes: 1 addition & 4 deletions annotators/doc_retriever/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ itsdangerous==2.0.1
gunicorn==19.9.0
requests==2.22.0
sentry-sdk[flask]==0.14.1
six==1.16.0
healthcheck==1.3.3
jinja2<=3.0.3
Werkzeug<=2.0.3
Expand All @@ -13,6 +12,4 @@ spacy==3.5
pypdfium2==4.16.0
bs4==0.0.1
python-docx==0.8.11
simplify-docx==0.1.2
six==1.16.0
healthcheck==1.3.3
simplify-docx==0.1.2
11 changes: 4 additions & 7 deletions annotators/doc_retriever/server.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,21 @@
import logging
import os
from pathlib import PurePath

import requests
import sentry_sdk
from common.files_and_folders_processing import create_folders_if_not_exist
import requests
from pathlib import PurePath
from deeppavlov import build_model
from deeppavlov.core.common.file import read_json
from flask import Flask, jsonify, request
from healthcheck import HealthCheck
from sentry_sdk.integrations.flask import FlaskIntegration
from deeppavlov.core.common.file import read_json
from utils import vectorize_upload_return_attributes, download_files, add_file_id_to_config
from common.files_and_folders_processing import create_folders_if_not_exist

# logging here because it conflicts with tf

logging.basicConfig(format="%(asctime)s - %(name)s - %(levelname)s - %(message)s", level=logging.INFO)
logger = logging.getLogger(__name__)
sentry_sdk.init(dsn=os.getenv("SENTRY_DSN"), integrations=[FlaskIntegration()])
app = Flask(__name__)
health = HealthCheck(app, "/healthcheck")

PARAGRAPHS_NUM = int(os.environ.get("PARAGRAPHS_NUM", 5))
FILE_SERVER_TIMEOUT = float(os.environ.get("FILE_SERVER_TIMEOUT", 30))
Expand Down
1 change: 0 additions & 1 deletion annotators/entity_storer/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ sentry_sdk[flask]==1.19.1
flask==2.2.3
itsdangerous==2.0.1
gunicorn==20.1.0
six==1.16.0
healthcheck==1.3.3
six==1.15.0
spacy==3.5.1
Expand Down
3 changes: 0 additions & 3 deletions annotators/prompt_selector/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,4 @@ ENV SENTENCE_RANKER_SERVICE_URL ${SENTENCE_RANKER_SERVICE_URL}
ARG N_SENTENCES_TO_RETURN
ENV N_SENTENCES_TO_RETURN ${N_SENTENCES_TO_RETURN}

# wait for a server answer ( INTERVAL + TIMEOUT ) * RETRIES seconds after that change stutus to unhealthy
HEALTHCHECK --interval=5s --timeout=5s --retries=3 CMD curl --fail 127.0.0.1:${SERVICE_PORT}/healthcheck || exit 1

CMD gunicorn --workers=1 server:app --bind 0.0.0.0:8000
2 changes: 0 additions & 2 deletions annotators/prompt_selector/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,3 @@ click<=8.0.4
jinja2<=3.1.2
Werkzeug>=2.2.2,<3.0
numpy>=1.17.2
six==1.16.0
healthcheck==1.3.3
2 changes: 0 additions & 2 deletions annotators/prompt_selector/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,12 @@
import numpy as np
import sentry_sdk
from flask import Flask, request, jsonify
from healthcheck import HealthCheck


sentry_sdk.init(getenv("SENTRY_DSN"))
logging.basicConfig(format="%(asctime)s - %(name)s - %(levelname)s - %(message)s", level=logging.DEBUG)
logger = logging.getLogger(__name__)
app = Flask(__name__)
health = HealthCheck(app, "/healthcheck")

SENTENCE_RANKER_SERVICE_URL = getenv("SENTENCE_RANKER_SERVICE_URL")
logger.info(f"prompt-selector considered ranker: {SENTENCE_RANKER_SERVICE_URL}")
Expand Down
13 changes: 13 additions & 0 deletions annotators/prompt_selector/template.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
- name: prompt_selector_template
display_name: Prompt Selector Template
author: [email protected]
# is_customizable: true
description: Template for creating Prompt Selector
endpoints:
- group: annotators
endpoint: respond
config_keys:
# SERVICE_PORT: int
SERVICE_NAME: str
SENTENCE_RANKER_SERVICE_URL: str
N_SENTENCES_TO_RETURN: int
1 change: 0 additions & 1 deletion annotators/toxic_classification_ru/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ flask==1.1.1
gunicorn==19.9.0
requests==2.22.0
sentry-sdk[flask]==0.14.1
six==1.16.0
healthcheck==1.3.3
itsdangerous==2.0.1
jinja2<=3.0.3
Expand Down
1 change: 0 additions & 1 deletion common/dialogflow_framework/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ sentry_sdk[flask]==0.14.3
flask==1.1.1
itsdangerous==2.0.1
gunicorn==19.9.0
six==1.16.0
healthcheck==1.3.3
# dialogflow framework
programy==4.3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,4 @@ ENV FILTER_BADLISTED_WORDS ${FILTER_BADLISTED_WORDS}

COPY . /src/

# wait for a server answer ( INTERVAL + TIMEOUT ) * RETRIES seconds after that change stutus to unhealthy
HEALTHCHECK --interval=5s --timeout=5s --retries=3 CMD curl --fail 127.0.0.1:${SERVICE_PORT}/healthcheck || exit 1

CMD gunicorn --workers=1 --bind 0.0.0.0:3003 server:app
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
confidence-based-response-selector:
name: response_selector
display_name: Response Selector
container_name: confidence-based-response-selector
component_type: null
model_type: Dictionary/Pattern-based
is_customizable: false
author: DeepPavlov
description: Algorithm that selects a final responses among the given list of candidate
responses
ram_usage: 100M
gpu_usage: null
port: 8005
endpoints:
- group: response_selectors
endpoint: respond
build_args:
SERVICE_PORT: '8005'
SERVICE_NAME: response_selector
date_created: '2023-03-16T09:45:32'
10 changes: 10 additions & 0 deletions response_selectors/confidence_based_response_selector/pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
confidence-based-response-selector:
- group: response_selectors
connector:
protocol: http
url: http://confidence-based-response-selector:8005/respond
dialog_formatter: state_formatters.dp_formatters:full_dialog
response_formatter: state_formatters.dp_formatters:base_response_selector_formatter_service
previous_services:
- response_annotators
state_manager_method: add_bot_utterance
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,3 @@ numpy==1.25.0
sentry-sdk==0.12.3
jinja2<=3.0.3
Werkzeug<=2.0.3
six==1.16.0
healthcheck==1.3.3
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@
import time
import requests

import sentry_sdk
from flask import Flask, request, jsonify
from healthcheck import HealthCheck
from os import getenv
import sentry_sdk


sentry_sdk.init(getenv("SENTRY_DSN"))
Expand All @@ -17,7 +16,6 @@
logger = logging.getLogger(__name__)

app = Flask(__name__)
health = HealthCheck(app, "/healthcheck")

BADLIST_URL = getenv("BADLIST_ANNOTATOR_URL", "http://badlisted-words:8018/badlisted_words_batch")
FILTER_BADLISTED_WORDS = getenv("FILTER_BADLISTED_WORDS", 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,4 @@ ENV LANGUAGE ${LANGUAGE}
COPY ./response_selectors/convers_evaluation_based_selector/ ./
COPY ./common/ ./common/

# wait for a server answer ( INTERVAL + TIMEOUT ) * RETRIES seconds after that change stutus to unhealthy
HEALTHCHECK --interval=5s --timeout=5s --retries=3 CMD curl --fail 127.0.0.1:${SERVICE_PORT}/healthcheck || exit 1

CMD gunicorn --workers=2 server:app
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,3 @@ sentry-sdk==0.12.3
nltk==3.2.5
jinja2<=3.0.3
Werkzeug<=2.0.3
six==1.16.0
healthcheck==1.3.3
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import numpy as np
import sentry_sdk
from flask import Flask, request, jsonify
from healthcheck import HealthCheck
from nltk.tokenize import sent_tokenize

from common.greeting import greeting_spec, HI_THIS_IS_DREAM
Expand Down Expand Up @@ -42,7 +41,6 @@
logger = logging.getLogger(__name__)

app = Flask(__name__)
health = HealthCheck(app, "/healthcheck")

CALL_BY_NAME_PROBABILITY = float(getenv("CALL_BY_NAME_PROBABILITY", 0.5)) # if name is already known
TAG_BASED_SELECTION = getenv("TAG_BASED_SELECTION", False)
Expand Down
2 changes: 0 additions & 2 deletions response_selectors/llm_based_response_selector/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,5 @@ COPY ./response_selectors/llm_based_response_selector/ /src/
WORKDIR /src
COPY ./common/ ./common/

# wait for a server answer ( INTERVAL + TIMEOUT ) * RETRIES seconds after that change stutus to unhealthy
HEALTHCHECK --interval=5s --timeout=5s --retries=3 CMD curl --fail 127.0.0.1:${SERVICE_PORT}/healthcheck || exit 1

CMD gunicorn --workers=1 server:app -b 0.0.0.0:${SERVICE_PORT} --timeout=1200
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,3 @@ numpy==1.25.0
sentry-sdk==0.12.3
jinja2<=3.0.3
Werkzeug<=2.0.3
six==1.16.0
healthcheck==1.3.3
3 changes: 0 additions & 3 deletions response_selectors/llm_based_response_selector/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@

import sentry_sdk
from flask import Flask, request, jsonify
from healthcheck import HealthCheck

from common.containers import get_envvars_for_llm, is_container_running
from common.prompts import send_request_to_prompted_generative_service, compose_sending_variables
from common.utils import is_toxic_or_badlisted_utterance
Expand All @@ -23,7 +21,6 @@
logger = logging.getLogger(__name__)

app = Flask(__name__)
health = HealthCheck(app, "/healthcheck")

GENERATIVE_SERVICE_URL = getenv("GENERATIVE_SERVICE_URL")
while True:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,5 @@ COPY ./response_selectors/ranking_and_intent_based_response_selector/ /src/
WORKDIR /src
COPY ./common/ ./common/

# wait for a server answer ( INTERVAL + TIMEOUT ) * RETRIES seconds after that change stutus to unhealthy
HEALTHCHECK --interval=5s --timeout=5s --retries=3 CMD curl --fail 127.0.0.1:${SERVICE_PORT}/healthcheck || exit 1

CMD gunicorn --workers=1 server:app -b 0.0.0.0:${SERVICE_PORT} --timeout=1200
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,3 @@ numpy==1.25.0
sentry-sdk==0.12.3
jinja2<=3.0.3
Werkzeug<=2.0.3
six==1.16.0
healthcheck==1.3.3
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

import sentry_sdk
from flask import Flask, request, jsonify
from healthcheck import HealthCheck
from common.universal_templates import (
is_any_question_sentence_in_utterance,
if_chat_about_particular_topic,
Expand All @@ -32,7 +31,6 @@
logger = logging.getLogger(__name__)

app = Flask(__name__)
health = HealthCheck(app, "/healthcheck")

SENTENCE_RANKER_ANNOTATION_NAME = getenv("SENTENCE_RANKER_ANNOTATION_NAME")
SENTENCE_RANKER_SERVICE_URL = getenv("SENTENCE_RANKER_SERVICE_URL")
Expand Down
2 changes: 0 additions & 2 deletions response_selectors/ranking_based_response_selector/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,5 @@ COPY ./response_selectors/ranking_based_response_selector/ /src/
WORKDIR /src
COPY ./common/ ./common/

# wait for a server answer ( INTERVAL + TIMEOUT ) * RETRIES seconds after that change stutus to unhealthy
HEALTHCHECK --interval=5s --timeout=5s --retries=3 CMD curl --fail 127.0.0.1:${SERVICE_PORT}/healthcheck || exit 1

CMD gunicorn --workers=1 server:app -b 0.0.0.0:${SERVICE_PORT} --timeout=1200
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,3 @@ numpy==1.25.0
sentry-sdk==0.12.3
jinja2<=3.0.3
Werkzeug<=2.0.3
six==1.16.0
healthcheck==1.3.3
Loading

0 comments on commit 3a9e3f3

Please sign in to comment.