-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
795 additions
and
427 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# SERVING PARAMETERS | ||
SERVICE_MODE=http | ||
|
||
# SERVICE DISCOVERY | ||
SERVICE_NAME=MY_PUNCTUATION_SERVICE | ||
|
||
# CONCURRENCY | ||
CONCURRENCY=2 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# SERVING PARAMETERS | ||
SERVICE_MODE=task | ||
|
||
# SERVICE PARAMETERS | ||
SERVICES_BROKER=redis://192.168.0.1:6379 | ||
BROKER_PASS=password | ||
|
||
# SERVICE DISCOVERY | ||
SERVICE_NAME=my-diarization-service | ||
LANGUAGE=en-US/fr-FR/* | ||
QUEUE_NAME=(Optionnal) | ||
MODEL_INFO=This model does something | ||
|
||
# CONCURRENCY | ||
CONCURRENCY=2 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
FROM python:3.9 | ||
LABEL maintainer="[email protected], [email protected], [email protected]" | ||
FROM python:3.10 | ||
LABEL maintainer="[email protected], [email protected]" | ||
|
||
RUN apt-get update &&\ | ||
apt-get install -y \ | ||
|
@@ -31,6 +31,10 @@ COPY document /usr/src/app/document | |
COPY pyBK/diarizationFunctions.py pyBK/diarizationFunctions.py | ||
COPY docker-entrypoint.sh wait-for-it.sh healthcheck.sh ./ | ||
|
||
# Grep CURRENT VERSION | ||
COPY RELEASE.md ./ | ||
RUN export VERSION=$(awk -v RS='' '/#/ {print; exit}' RELEASE.md | head -1 | sed 's/#//' | sed 's/ //') | ||
|
||
ENV PYTHONPATH="${PYTHONPATH}:/usr/src/app/diarization" | ||
|
||
# Limits on OPENBLAS number of thread prevent SEGFAULT on machine with a large number of cpus | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
.DEFAULT_GOAL := help | ||
|
||
target_dirs := http_server pyBK diarization celery_app | ||
|
||
help: | ||
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' | ||
|
||
style: ## update code style. | ||
black ${target_dirs} | ||
isort ${target_dirs} | ||
|
||
lint: ## run pylint linter. | ||
pylint ${target_dirs} |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,24 @@ | ||
import os | ||
|
||
from celery import Celery | ||
|
||
from diarization import logger | ||
|
||
celery = Celery(__name__, include=['celery_app.tasks']) | ||
celery = Celery(__name__, include=["celery_app.tasks"]) | ||
service_name = os.environ.get("SERVICE_NAME") | ||
broker_url = os.environ.get("SERVICES_BROKER") | ||
if os.environ.get("BROKER_PASS", False): | ||
components = broker_url.split('//') | ||
components = broker_url.split("//") | ||
broker_url = f'{components[0]}//:{os.environ.get("BROKER_PASS")}@{components[1]}' | ||
celery.conf.broker_url = "{}/0".format(broker_url) | ||
celery.conf.result_backend = "{}/1".format(broker_url) | ||
celery.conf.update( | ||
result_expires=3600, | ||
task_acks_late=True, | ||
task_track_started=True) | ||
celery.conf.update(result_expires=3600, task_acks_late=True, task_track_started=True) | ||
|
||
# Queues | ||
celery.conf.update( | ||
{'task_routes': { | ||
'diarization_task': {'queue': 'diarization'}, } | ||
} | ||
{ | ||
"task_routes": { | ||
"diarization_task": {"queue": "diarization"}, | ||
} | ||
} | ||
) |
Oops, something went wrong.