From 3bb30564233b8015fd2b2b2ed6f6469240fcb6da Mon Sep 17 00:00:00 2001 From: jayasankar Date: Mon, 29 Jan 2024 15:46:12 +0530 Subject: [PATCH 1/5] changes made to app definition and openai schema definition --- app/main.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/main.py b/app/main.py index aff11847..e1a2ca7a 100644 --- a/app/main.py +++ b/app/main.py @@ -36,7 +36,8 @@ description=f"The server application that provides APIs to interact \ with the underlying Databases and modules in Vachan-Engine. \ \n • For Vachan-CMS docs: {root_url}/v2/cms/rest/docs,\ -\n • For Vachan-TBT docs: {root_url}/v2/text/translate/token-based/docs") +\n • For Vachan-TBT docs: {root_url}/v2/text/translate/token-based/docs,\ +\n • For Vachan-AI docs: {root_url}/v2/ai/model/docs") template = Jinja2Templates(directory="templates") app.mount("/static", StaticFiles(directory="static"), name="static") @@ -253,6 +254,7 @@ def custom_openapi(): underlying Databases \and modules in Vachan-Engine. " f"
Vachan-TBT docs " f"
Vachan-CMS docs " + f"
Vachan-AI docs " ), routes=app.routes ) From 46c1aabbc0801192c4582449b0b81fe72eef7802 Mon Sep 17 00:00:00 2001 From: jayasankar Date: Mon, 29 Jan 2024 15:48:14 +0530 Subject: [PATCH 2/5] nginx cof changed to integrate vachan-ai to vachan-api --- docker/nginx/default.conf | 5 +++++ docker/nginx/prod/app.conf.template | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/docker/nginx/default.conf b/docker/nginx/default.conf index 31a069b2..00702f47 100644 --- a/docker/nginx/default.conf +++ b/docker/nginx/default.conf @@ -27,6 +27,11 @@ server { proxy_pass http://vachan-tbt:8003; } + location /v2/ai/model/ { + proxy_pass http://vachan_ai:8006; + } + + location /v2/nlp/ { proxy_pass http://vachan-tbt:8003; } diff --git a/docker/nginx/prod/app.conf.template b/docker/nginx/prod/app.conf.template index d4000b76..d47d3c7f 100644 --- a/docker/nginx/prod/app.conf.template +++ b/docker/nginx/prod/app.conf.template @@ -56,8 +56,14 @@ server { location /v2/demos/ { proxy_pass http://vachan-demos:8002; } + + location /v2/ai/model/ { + proxy_pass http://vachan-ai:8006; + } location / { proxy_pass http://vachan-api:8000; } + + } From 335ac68cd18e1c296ae1cb698f0c6cec2cce12a6 Mon Sep 17 00:00:00 2001 From: jayasankar Date: Mon, 29 Jan 2024 15:53:27 +0530 Subject: [PATCH 3/5] vachan-ai added as a new service --- docker/docker-compose.yml | 59 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 56 insertions(+), 3 deletions(-) diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index b5b0bf66..293ed6f5 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -3,7 +3,7 @@ services: kratos-postgresd: image: postgres:9.6 ports: - - "5432:5432" + - "5435:5432" expose: - 5432 restart: always @@ -46,7 +46,7 @@ services: kratos: image: oryd/kratos:v1.0.0 ports: - - '4433:4433' # public + - '4436:4433' # public # -'4434:4434' # admin restart: unless-stopped environment: @@ -290,6 +290,57 @@ services: networks: - VE-network + vachan_ai: + image: jayasankarkk/vachan-ai:0.0.0-alpha.1 + healthcheck: + timeout: 45s + interval: 10s + retries: 10 + environment: + - VACHAN_AI_POSTGRES_HOST=192.168.3.157 + - VACHAN_AI_POSTGRES_USER=${VACHAN_AI_POSTGRES_USER:-postgres} + - VACHAN_AI_POSTGRES_PASSWORD=${VACHAN_AI_POSTGRES_PASSWORD:-secret} + - VACHAN_AI_POSTGRES_DATABASE=${VACHAN_AI_POSTGRES_DATABASE:-vachan_ai_db} + - VACHAN_AI_POSTGRES_SCHEMA=${VACHAN_AI_POSTGRES_DATABASE:-vachan_ai} + + - VACHAN_AI_XLSR_MAX_AUDIO_DURATION=${VACHAN_AI_XLSR_MAX_AUDIO_DURATION:-25} + - VACHAN_AI_XLSR_SAMPLING_RATE=${VACHAN_AI_XLSR_SAMPLING_RATE:-16000} + - VACHAN_AI_NLLB_MAX_SRC_CHARS=${VACHAN_AI_NLLB_MAX_SRC_CHARS:-512} + - VACHAN_AI_NLLB_BATCH_SIZE=${VACHAN_AI_NLLB_BATCH_SIZE:-10} + + + - MLFLOW_TRACKING_URI=${MLFLOW_TRACKING_URI:-http://192.168.3.157:5000} + - VACHAN_AI_ARTIFACT_PATH=${VACHAN_AI_ARTIFACT_PATH:-models} + - VACHAN_AI_SERVED_MODEL_URI=${VACHAN_AI_SERVED_MODEL_URI:-http://192.168.3.157:8080/v2/models} + - VACHAN_AI_MODEL_SETTINGS_DIR=${VACHAN_AI_MODEL_SETTINGS_DIR:-serving_models} + - VACHAN_AI_REQUEST_TIMEOUT=${VACHAN_AI_REQUEST_TIMEOUT:-60} + + - VACHAN_AI_AWS_ACCESS_KEY=${VACHAN_AI_AWS_ACCESS_KEY} + - VACHAN_AI_AWS_SECRET_ACCESS_KEY=${VACHAN_AI_AWS_SECRET_ACCESS_KEY} + - VACHAN_AI_S3_BUCKET=${VACHAN_AI_S3_BUCKET} + - VACHAN_AI_AWS_ACCOUNT_REGION=${VACHAN_AI_AWS_ACCOUNT_REGION} + + + - VACHAN_AI_DATA_PATH=${VACHAN_AI_DATA_PATH:-/var/data-vachan-ai} + - VACHAN_AI_POSTGRES_PORT=5433 + - VACHAN_AI_LOGGING_LEVEL=INFO + - VACHAN_DOMAIN=${VACHAN_DOMAIN:-http://localhost} + - VACHAN_LOGGING_LEVEL=INFO + command: uvicorn main:app --host 0.0.0.0 --port 8006 + volumes: + - ${VACHAN_AI_DATA_PATH}/docker-volumes/ai-logs-vol:/app/logs + - ${VACHAN_AI_DATA_PATH}/cache:/root/.cache + restart: always + depends_on: + - vachan-api + expose: + - 8006 + ports: + - "8006:8006" + networks: + - VE-network + container_name: vachan_ai + # Web Server web-server-local: image: nginx:latest @@ -434,4 +485,6 @@ volumes: logs-test-vol: vachan-db-backup: kratos-db-backup: - vachan-tbt-ml-models-vol: \ No newline at end of file + vachan-tbt-ml-models-vol: + ai-logs-vol: + cache: \ No newline at end of file From 18e13495a39b6da40f1acc233644b67bc09f9f86 Mon Sep 17 00:00:00 2001 From: jayasankar Date: Wed, 31 Jan 2024 12:03:15 +0530 Subject: [PATCH 4/5] ports corrected --- docker/docker-compose.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 8bc119f5..8d4ca063 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -3,7 +3,7 @@ services: kratos-postgresd: image: postgres:9.6 ports: - - "5435:5432" + - "5432:5432" expose: - 5432 restart: always @@ -46,7 +46,7 @@ services: kratos: image: oryd/kratos:v1.0.0 ports: - - '4436:4433' # public + - '4433:4433' # public # -'4434:4434' # admin restart: unless-stopped environment: From 2ee5fdf76079f096ed94a7c12e3bd669d80c4b90 Mon Sep 17 00:00:00 2001 From: jayasankar Date: Fri, 2 Feb 2024 11:23:48 +0530 Subject: [PATCH 5/5] profiles added --- docker/docker-compose.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 8d4ca063..3eb1ab46 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -291,7 +291,7 @@ services: - VE-network vachan_ai: - image: jayasankarkk/vachan-ai:0.0.0-alpha.1 + image: jayasankarkk/vachan-ai:0.0.0-alpha.3 healthcheck: timeout: 45s interval: 10s @@ -326,6 +326,7 @@ services: - VACHAN_AI_LOGGING_LEVEL=INFO - VACHAN_DOMAIN=${VACHAN_DOMAIN:-http://localhost} - VACHAN_LOGGING_LEVEL=INFO + - VACHAN_AI_ENV=${VACHAN_AI_ENV:-Development} command: uvicorn main:app --host 0.0.0.0 --port 8006 volumes: - ${VACHAN_AI_DATA_PATH}/docker-volumes/ai-logs-vol:/app/logs @@ -333,6 +334,9 @@ services: restart: always depends_on: - vachan-api + profiles: + - local-run + - deployment expose: - 8006 ports: @@ -341,6 +345,7 @@ services: - VE-network container_name: vachan_ai + # Web Server web-server-local: image: nginx:latest