Skip to content

Commit

Permalink
Merge pull request #783 from Jayasankar-kk/ai_integrate2
Browse files Browse the repository at this point in the history
base path added, redis woker added
  • Loading branch information
shimilgithub authored Mar 18, 2024
2 parents 45140d4 + 7b10585 commit e822ff8
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 17 deletions.
4 changes: 2 additions & 2 deletions app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
\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-Auth docs: {root_url}/v2/auth/docs,\
\n • For Vachan-AI docs: {root_url}/v2/ai/model/docs")
\n • For Vachan-AI docs: {root_url}/v2/ai/docs")
template = Jinja2Templates(directory="templates")
app.mount("/static", StaticFiles(directory="static"), name="static")

Expand Down Expand Up @@ -246,7 +246,7 @@ def custom_openapi():
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/auth/docs\" > Vachan-Auth docs </a>"
f"<br> • <a href=\"{root_url}/v2/ai/model/docs\" > Vachan-AI docs </a>"
f"<br> • <a href=\"{root_url}/v2/ai/docs\" > Vachan-AI docs </a>"

),
routes=app.routes
Expand Down
48 changes: 41 additions & 7 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ services:


vachan-ai:
image: jayasankarkk/vachan-ai:0.0.0-alpha.4
image: jayasankarkk/vachan-ai:0.0.0-alpha.5
healthcheck:
timeout: 45s
interval: 10s
Expand Down Expand Up @@ -379,13 +379,14 @@ services:
- 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_AI_DOMAIN=http://vachan-api
- VACHAN_LOGGING_LEVEL=INFO
- VACHAN_AI_ENV=${VACHAN_AI_ENV:-Development}
- VACHAN_AI_ENV=${VACHAN_AI_ENV:-Production}
- PYTHONPATH=/app/app/core/model_access/ai_model_core.py:/app/app/core/cloud_operations
- VACHAN_REDIS_PASS=${VACHAN_REDIS_PASS:-vsfrgetd}
command: uvicorn main:app --host 0.0.0.0 --port 8006
- VACHAN_AI_BASEPATH=/v2/ai
- VACHAN_DOMAIN=${VACHAN_DOMAIN:-http://localhost}
- VACHAN_AI_DOMAIN=http://vachan-api
command: uvicorn main:app --host 0.0.0.0 --port 8008
volumes:
- ${VACHAN_AI_DATA_PATH}/docker-volumes/ai-logs-vol:/app/logs
- ${VACHAN_AI_DATA_PATH}/cache:/root/.cache
Expand All @@ -397,14 +398,47 @@ services:
- local-run
- deployment
expose:
- 8006
- 8008
ports:
- "8006:8006"
- "8008:8008"
networks:
- VE-network
container_name: vachan-ai


worker:
image: jayasankarkk/vachan-ai:0.0.0-alpha.5
healthcheck:
timeout: 45s
interval: 10s
retries: 10
environment:
- REDIS_HOST=redis
- REDIS_PORT=6379
- VACHAN_AI_POSTGRES_HOST=dov2conn.bridgeconn.com
- 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_SCHEMA:-aischema}
- VACHAN_AI_POSTGRES_PORT=5433
- VACHAN_AI_SERVED_MODEL_URI=${VACHAN_AI_SERVED_MODEL_URI:-http://dov2conn.bridgeconn.com:8085/v2/models}
- PYTHONPATH=/app/app/core/model_access/ai_model_core.py:/app/app/core/cloud_operations
- VACHAN_REDIS_PASS=vsfrgetd
command: rq worker --url redis://:vsfrgetd@redis:6379
links:
- redis
depends_on:
- redis
- vachan-api
volumes:
- ${VACHAN_AI_DATA_PATH}/docker-volumes/redis_worker-logs-vol:/app/rqlogs
profiles:
- local-run
- deployment
networks:
- VE-network
container_name: redis-worker


# Web Server
web-server-local:
Expand Down
9 changes: 5 additions & 4 deletions docker/nginx/default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,15 @@ server {
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto $scheme;
}

location /v2/ai/ {
proxy_pass http://vachan-ai:8008;
}

location /v2/auth/ {
proxy_pass http://vachan-access:8007;
}

location /v2/ai/model/ {
proxy_pass http://vachan-ai:8006;
}


location /v2/cms/rest/ {
proxy_pass http://vachan-cms-rest:8005;
Expand Down
8 changes: 4 additions & 4 deletions docker/nginx/prod/app.conf.template
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ server {
ssl_certificate_key /etc/nginx/ssl/live/${VACHAN_DOMAIN}/privkey.pem;


location /v2/auth/ {
proxy_pass http://vachan-access:8007;
location /v2/ai/ {
proxy_pass http://vachan-ai:8008;
}

location /v2/ai/model/ {
proxy_pass http://vachan-ai:8006;
location /v2/auth/ {
proxy_pass http://vachan-access:8007;
}

location /v2/cms/rest/ {
Expand Down

0 comments on commit e822ff8

Please sign in to comment.