Skip to content

Commit

Permalink
Merge pull request #1478 from Agenta-AI/templates-url-in-env-var
Browse files Browse the repository at this point in the history
Templates url in env var
  • Loading branch information
aakrem authored Apr 2, 2024
2 parents 9f2ef27 + dee21f1 commit 7340c7c
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 3 deletions.
6 changes: 3 additions & 3 deletions agenta-backend/agenta_backend/services/templates_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
if os.environ["FEATURE_FLAG"] in ["oss", "cloud"]:
from agenta_backend.services import container_manager

templates_base_url = os.getenv("TEMPLATES_BASE_URL")

from typing import Union


Expand Down Expand Up @@ -118,9 +120,7 @@ async def retrieve_templates_info_from_s3(
return json.loads(cached_data)

# If not cached, fetch data from Docker Hub and cache it in Redis
response = await get_templates_info_from_s3(
"https://llm-app-json.s3.eu-central-1.amazonaws.com/llm_info.json"
)
response = await get_templates_info_from_s3(f"{templates_base_url}/llm_info.json")

# Cache the data in Redis for 60 minutes
r.set("temp_data", json.dumps(response), ex=900)
Expand Down
1 change: 1 addition & 0 deletions docker-compose.gh.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ services:
- DOMAIN_NAME=${DOMAIN_NAME:-http://localhost}
- CELERY_BROKER_URL=amqp://guest@rabbitmq//
- CELERY_RESULT_BACKEND=redis://redis:6379/0
- TEMPLATES_BASE_URL=https://llm-app-json.s3.eu-central-1.amazonaws.com
command:
[
"uvicorn",
Expand Down
1 change: 1 addition & 0 deletions docker-compose.prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ services:
- AGENTA_TEMPLATE_REPO=agentaai/templates_v2
- CELERY_BROKER_URL=amqp://guest@rabbitmq//
- CELERY_RESULT_BACKEND=redis://redis:6379/0
- TEMPLATES_BASE_URL=https://llm-app-json.s3.eu-central-1.amazonaws.com
volumes:
- ./agenta-backend/agenta_backend:/app/agenta_backend
- ./agenta-backend/tests:/app/tests
Expand Down
1 change: 1 addition & 0 deletions docker-compose.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ services:
- OPENAI_API_KEY=${OPENAI_API_KEY}
- AGENTA_TEMPLATE_REPO=agentaai/templates_v2
- POSTHOG_API_KEY=phc_hmVSxIjTW1REBHXgj2aw4HW9X6CXb6FzerBgP9XenC7
- TEMPLATES_BASE_URL=https://llm-app-json.s3.eu-central-1.amazonaws.com
volumes:
- ./agenta-backend/agenta_backend:/app/agenta_backend
- ./agenta-backend/tests:/app/tests
Expand Down
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ services:
- POSTHOG_API_KEY=phc_hmVSxIjTW1REBHXgj2aw4HW9X6CXb6FzerBgP9XenC7
- CELERY_BROKER_URL=amqp://guest@rabbitmq//
- CELERY_RESULT_BACKEND=redis://redis:6379/0
- TEMPLATES_BASE_URL=https://llm-app-json.s3.eu-central-1.amazonaws.com
volumes:
- ./agenta-backend/agenta_backend:/app/agenta_backend
- ./agenta-backend/tests:/app/tests
Expand Down

0 comments on commit 7340c7c

Please sign in to comment.