Skip to content

Commit

Permalink
fix: Fix deployment docker compose and move temporal into separate se…
Browse files Browse the repository at this point in the history
…rvice

Signed-off-by: Diwank Tomer <[email protected]>
  • Loading branch information
Diwank Tomer committed Aug 27, 2024
1 parent ea74887 commit c0c9739
Show file tree
Hide file tree
Showing 10 changed files with 118 additions and 76 deletions.
4 changes: 0 additions & 4 deletions agents-api/Dockerfile.temporal

This file was deleted.

28 changes: 6 additions & 22 deletions agents-api/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ version: "3"
services:
agents-api:
image: julepai/agents-api:dev
env_file: "../.env"

env_file:
- ../.env
container_name: agents-api
depends_on:
memory-store:
Expand All @@ -32,7 +32,8 @@ services:

worker:
image: julepai/worker:dev
env_file: "../.env"
env_file:
- ../.env

build:
context: .
Expand Down Expand Up @@ -76,27 +77,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"
env_file:
- ../.env

container_name: cozo-migrate
depends_on:
Expand Down
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ 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
10 changes: 3 additions & 7 deletions gateway/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
name: julep-gateway
version: "3"

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

services:
gateway:
image: julepai/gateway: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
14 changes: 10 additions & 4 deletions llm-proxy/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,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
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 +51,7 @@ services:
volumes:
- litellm-redis-data:/data
ports:
- "6379:6379"
- "16379:6379"
env_file:
- ../.env

Expand Down
1 change: 0 additions & 1 deletion memory-store/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ services:
- COZO_PORT=${COZO_PORT}
- MNT_DIR=/data
- COZO_BACKUP_DIR=/backup
container_name: memory-store
volumes:
- cozo_data:/data
build:
Expand Down
53 changes: 53 additions & 0 deletions scheduler/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: julep-scheduler
version: "3"

services:
temporal:
depends_on:
- temporal-db
env_file:
- ../.env
environment:
- DB=postgres12
- DB_PORT=5432
- DB_HOST=temporal-db
- POSTGRES_USER=${TEMPORAL_POSTGRES_USER}
- POSTGRES_PWD=${TEMPORAL_POSTGRES_PASSWORD}
- POSTGRES_SEEDS=temporal-db
- DYNAMIC_CONFIG_FILE_PATH=config/dynamicconfig/development-sql.yaml
image: temporalio/auto-setup:1.24
ports:
- 7233:7233
volumes:
- ./dynamicconfig:/etc/temporal/config/dynamicconfig

temporal-admin-tools:
depends_on:
- temporal
environment:
- TEMPORAL_ADDRESS=temporal:7233
- TEMPORAL_CLI_ADDRESS=temporal:7233
image: temporalio/admin-tools:1.24
stdin_open: true
tty: true

temporal-db:
image: postgres:16
env_file:
- ../.env
environment:
- POSTGRES_DB=${TEMPORAL_POSTGRES_DB}
- POSTGRES_USER=${TEMPORAL_POSTGRES_USER}
- POSTGRES_PASSWORD=${TEMPORAL_POSTGRES_PASSWORD}
ports:
- 25432:5432
volumes:
- temporal-db-data:/var/lib/postgresql/data
healthcheck:
test: [ "CMD-SHELL", "pg_isready -d ${TEMPORAL_POSTGRES_DB} -U ${TEMPORAL_POSTGRES_USER}" ]
interval: 1s
timeout: 5s
retries: 10

volumes:
temporal-db-data:
6 changes: 6 additions & 0 deletions scheduler/dynamicconfig/development-sql.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
limit.maxIDLength:
- value: 255
constraints: {}
system.forceSearchAttributesCacheRefreshOnRead:
- value: true # Dev setup only. Please don't turn this on in production.
constraints: {}

0 comments on commit c0c9739

Please sign in to comment.