Skip to content

Commit

Permalink
Merge pull request #763 from Jayasankar-kk/version-2
Browse files Browse the repository at this point in the history
integration of Vachan-ai with vachan-api
  • Loading branch information
shimilgithub authored Feb 5, 2024
2 parents b4c8cba + 2ee5fdf commit 277ea5f
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 2 deletions.
4 changes: 3 additions & 1 deletion app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down Expand Up @@ -253,6 +254,7 @@ def custom_openapi():
underlying Databases \and modules in Vachan-Engine. "
f"<br> • <a href=\"{root_url}/v2/text/translate/token-based/docs\" > Vachan-TBT docs </a>"
f"<br> • <a href=\"{root_url}/v2/cms/rest/docs\" > Vachan-CMS docs </a>"
f"<br> • <a href=\"{root_url}/v2/ai/model/docs\" > Vachan-AI docs </a>"
),
routes=app.routes
)
Expand Down
60 changes: 59 additions & 1 deletion docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,62 @@ services:
networks:
- VE-network

vachan_ai:
image: jayasankarkk/vachan-ai:0.0.0-alpha.3
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
- 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
- ${VACHAN_AI_DATA_PATH}/cache:/root/.cache
restart: always
depends_on:
- vachan-api
profiles:
- local-run
- deployment
expose:
- 8006
ports:
- "8006:8006"
networks:
- VE-network
container_name: vachan_ai


# Web Server
web-server-local:
image: nginx:latest
Expand Down Expand Up @@ -432,4 +488,6 @@ volumes:
logs-test-vol:
vachan-db-backup:
kratos-db-backup:
vachan-tbt-ml-models-vol:
vachan-tbt-ml-models-vol:
ai-logs-vol:
cache:
5 changes: 5 additions & 0 deletions docker/nginx/default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
6 changes: 6 additions & 0 deletions docker/nginx/prod/app.conf.template
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,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;
}


}

0 comments on commit 277ea5f

Please sign in to comment.