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

fix: Fix deployment docker compose and move temporal into separate service #471

Merged
merged 6 commits into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
2 changes: 1 addition & 1 deletion agents-api/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.10-slim
FROM python:3.11-slim

ENV PYTHONUNBUFFERED True
ENV POETRY_CACHE_DIR=/tmp/poetry_cache
Expand Down
4 changes: 0 additions & 4 deletions agents-api/Dockerfile.temporal

This file was deleted.

2 changes: 1 addition & 1 deletion agents-api/Dockerfile.worker
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.10-slim
FROM python:3.11-slim

ENV PYTHONUNBUFFERED True
ENV POETRY_CACHE_DIR=/tmp/poetry_cache
Expand Down
35 changes: 9 additions & 26 deletions agents-api/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
name: julep-agents-api
version: "3"

services:
agents-api:
image: julepai/agents-api:dev
env_file: "../.env"

image: julepai/agents-api:${TAG:-dev}
env_file:
- ../.env
container_name: agents-api
depends_on:
memory-store:
Expand All @@ -31,8 +30,9 @@ services:
path: Dockerfile

worker:
image: julepai/worker:dev
env_file: "../.env"
image: julepai/worker:${TAG:-dev}
env_file:
- ../.env

build:
context: .
Expand Down Expand Up @@ -76,27 +76,10 @@ services:
capabilities: [gpu]


temporal:
image: julepai/temporal:dev
container_name: temporal
env_file: "../.env"

build:
context: .
dockerfile: Dockerfile.temporal
ports:
- 7233:7233
volumes:
- temporal_data:/home/temporal

develop:
watch:
- action: rebuild
path: Dockerfile.temporal

cozo-migrate:
image: julepai/cozo-migrate:dev
env_file: "../.env"
image: julepai/cozo-migrate:${TAG:-dev}
env_file:
- ../.env

container_name: cozo-migrate
depends_on:
Expand Down
2 changes: 1 addition & 1 deletion agents-api/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion agents-api/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ openai = "^1.41.0"
httpx = "^0.27.0"
sentry-sdk = {extras = ["fastapi"], version = "^2.13.0"}
temporalio = "^1.6.0"
pydantic = "^2.8.2"
pydantic = {extras = ["email"], version = "^2.8.2"}
arrow = "^1.3.0"
jinja2 = "^3.1.4"
jinja2schema = "^0.1.4"
Expand Down
10 changes: 5 additions & 5 deletions deploy/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: julep-api

services:
memory-store:
image: julepai/memory-store:dev
image: julepai/memory-store:${TAG:-dev}
platform: linux/x86_64
environment:
- COZO_AUTH_TOKEN=${COZO_AUTH_TOKEN}
Expand All @@ -17,7 +17,7 @@ services:
- "9070:9070"

agents-api:
image: julepai/agents-api:dev
image: julepai/agents-api:${TAG:-dev}
platform: linux/x86_64
container_name: julep-agents-api
depends_on:
Expand All @@ -31,7 +31,7 @@ services:
- .env

worker:
image: julepai/worker:dev
image: julepai/worker:${TAG:-dev}
platform: linux/x86_64
container_name: julep-worker
depends_on:
Expand Down Expand Up @@ -74,7 +74,7 @@ services:
- .env

temporal:
image: julepai/temporal:dev
image: julepai/temporal:${TAG:-dev}
platform: linux/x86_64
container_name: julep-temporal
ports:
Expand All @@ -93,7 +93,7 @@ services:
- COZO_HOST=http://memory-store:9070
env_file:
- .env
image: julepai/cozo-migrate:dev
image: julepai/cozo-migrate:${TAG:-dev}
platform: linux/x86_64
container_name: julep-cozo-migrate
depends_on:
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: julep
version: "3"

include:
- ./memory-store/docker-compose.yml
- ./gateway/docker-compose.yml
- ./agents-api/docker-compose.yml
- ./scheduler/docker-compose.yml
- ./llm-proxy/docker-compose.yml

# TODO: Enable after testing
Expand Down
13 changes: 4 additions & 9 deletions gateway/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
name: julep-gateway
version: "3"

include:
- ../agents-api/docker-compose.yml

services:
gateway:
image: julepai/gateway:dev
image: julepai/gateway:${TAG:-dev}
env_file: "../.env"

environment:
- GATEWAY_PORT=80
- JWT_SHARED_KEY=${JWT_SHARED_KEY}
- MODEL_API_URL=${MODEL_API_URL}
- MODEL_API_KEY=${MODEL_API_KEY}
- MODEL_API_KEY_HEADER_NAME=${MODEL_API_KEY_HEADER_NAME}
# - MODEL_API_URL=${MODEL_API_URL}
# - MODEL_API_KEY=${MODEL_API_KEY}
# - MODEL_API_KEY_HEADER_NAME=${MODEL_API_KEY_HEADER_NAME}
- AGENTS_API_URL=${AGENTS_API_URL}
- AGENTS_API_KEY=${AGENTS_API_KEY}
- AGENTS_API_KEY_HEADER_NAME=${AGENTS_API_KEY_HEADER_NAME}
Expand Down
3 changes: 2 additions & 1 deletion gateway/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/bin/sh

# Check the environment variables
for var_name in GATEWAY_PORT JWT_SHARED_KEY AGENTS_API_KEY MODEL_API_KEY MODEL_API_URL AGENTS_API_URL AGENTS_API_KEY_HEADER_NAME MODEL_API_KEY_HEADER_NAME
# REMOVED: MODEL_API_KEY MODEL_API_URL MODEL_API_KEY_HEADER_NAME
for var_name in GATEWAY_PORT JWT_SHARED_KEY AGENTS_API_KEY AGENTS_API_URL AGENTS_API_KEY_HEADER_NAME
do
if [ -z "`eval echo \\\$$var_name`" ]; then
echo "Error: Environment variable '$var_name' is not set."
Expand Down
74 changes: 37 additions & 37 deletions gateway/traefik.yml.template
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,24 @@ log:

http:
routers:
model-serving:
entryPoints:
- web
rule: Path(`/v1{path:.*}`)
middlewares:
- model-serving-chain
- corsHeaders
service: service-model-serving

model-serving-jwt:
entryPoints:
- web
rule: Path(`/jwt/v1{path:.*}`)
middlewares:
- model-serving-chain
- model-serving-strip-prefix-jwt
- corsHeaders
service: service-model-serving
# model-serving:
# entryPoints:
# - web
# rule: Path(`/v1{path:.*}`)
# middlewares:
# - model-serving-chain
# - corsHeaders
# service: service-model-serving

# model-serving-jwt:
# entryPoints:
# - web
# rule: Path(`/jwt/v1{path:.*}`)
# middlewares:
# - model-serving-chain
# - model-serving-strip-prefix-jwt
# - corsHeaders
# service: service-model-serving

agents-api:
entryPoints:
Expand Down Expand Up @@ -65,33 +65,33 @@ http:
accessControlAllowOriginList: "*"
addVaryHeader: true

model-serving-chain:
chain:
middlewares:
- my-jwt
- model-serving-add-headers
# model-serving-chain:
# chain:
# middlewares:
# - my-jwt
# - model-serving-add-headers

agents-api-add-headers:
headers:
customrequestheaders:
$AGENTS_API_KEY_HEADER_NAME: $AGENTS_API_KEY

model-serving-add-headers:
headers:
customrequestheaders:
$MODEL_API_KEY_HEADER_NAME: $MODEL_API_KEY
# model-serving-add-headers:
# headers:
# customrequestheaders:
# $MODEL_API_KEY_HEADER_NAME: $MODEL_API_KEY

agents-api-chain:
chain:
middlewares:
- my-jwt
- agents-api-add-headers

model-serving-strip-prefix-jwt:
stripprefix:
prefixes:
- /jwt
forceSlash: false
# model-serving-strip-prefix-jwt:
# stripprefix:
# prefixes:
# - /jwt
# forceSlash: false

agents-api-strip-prefix-api:
stripprefix:
Expand Down Expand Up @@ -124,11 +124,11 @@ http:
OpaHttpStatusField: allow_status_code

services:
service-model-serving:
loadBalancer:
passHostHeader: false
servers:
- url: $MODEL_API_URL
# service-model-serving:
# loadBalancer:
# passHostHeader: false
# servers:
# - url: $MODEL_API_URL

service-agents-api:
loadBalancer:
Expand Down
16 changes: 12 additions & 4 deletions llm-proxy/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
name: julep-llm-proxy

services:
litellm:
image: ghcr.io/berriai/litellm:main-stable
Expand Down Expand Up @@ -25,16 +27,22 @@ services:
- litellm-redis

litellm-db:
image: postgres
image: postgres:16
restart: always
volumes:
- litellm-db-data:/var/lib/postgresql/data
ports:
- "5432:5432"
- "15432:5432"

# FIXME: This combination of env_file and environment is not working
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment indicates that the combination of env_file and environment is not working as expected. Consider using only one method to set environment variables to avoid conflicts or unexpected behavior.

env_file:
- ../.env
environment:
- POSTGRES_DB=${LITELLM_POSTGRES_DB}
- POSTGRES_USER=${LITELLM_POSTGRES_USER}
- POSTGRES_PASSWORD=${LITELLM_POSTGRES_PASSWORD}
healthcheck:
test: [ "CMD-SHELL", "pg_isready -d litellm -U llmproxy" ]
test: [ "CMD-SHELL", "pg_isready -d ${LITELLM_POSTGRES_DB} -U ${LITELLM_POSTGRES_USER}" ]
interval: 1s
timeout: 5s
retries: 10
Expand All @@ -45,7 +53,7 @@ services:
volumes:
- litellm-redis-data:/data
ports:
- "6379:6379"
- "16379:6379"
env_file:
- ../.env

Expand Down
4 changes: 1 addition & 3 deletions memory-store/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
name: julep-memory-store
version: "3"

services:
memory-store:
image: julepai/memory-store:dev
image: julepai/memory-store:${TAG:-dev}
env_file: "../.env"
environment:
- COZO_AUTH_TOKEN=${COZO_AUTH_TOKEN}
- COZO_PORT=${COZO_PORT}
- MNT_DIR=/data
- COZO_BACKUP_DIR=/backup
container_name: memory-store
volumes:
- cozo_data:/data
build:
Expand Down
1 change: 0 additions & 1 deletion monitoring/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
name: julep-monitoring
version: "3"

services:
portainer:
Expand Down
Loading
Loading