Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

base path added, redis woker added #783

Merged
merged 2 commits into from
Mar 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading