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

feat: new docker compose yaml for multi model #19

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
16 changes: 8 additions & 8 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ TORA_DEBUG=true # true | false
CHAINS='["sepolia"]' # you can find supported chains below, please replac whitespace with underscore

# general - provider url
MAINNET_WSS=""
MAINNET_HTTP=""
SEPOLIA_WSS=""
SEPOLIA_HTTP=""
ARBITRUM_WSS=""
ARBITRUM_HTTP=""
ARBITRUM_SEPOLIA_WSS=""
Expand All @@ -18,8 +22,6 @@ BASE_WSS=""
BASE_HTTP=""
LINEA_WSS=""
LINEA_HTTP=""
MAINNET_WSS=""
MAINNET_HTTP=""
MANTA_WSS=""
MANTA_HTTP=""
MANTA_SEPOLIA_WSS=""
Expand All @@ -34,8 +36,6 @@ OP_SEPOLIA_WSS=""
OP_SEPOLIA_HTTP=""
POLYGON_WSS=""
POLYGON_HTTP=""
SEPOLIA_WSS=""
SEPOLIA_HTTP=""

# general - crosscheck
USE_CROSSCHECK=false
Expand All @@ -51,12 +51,12 @@ REDIS_TTL=86400000 # 1 day in ms

# general - store ttl
TASK_TTL=2592000000
TASK_DONE_TTL = 2592000000 # comment out -> no ttl limit
TASK_DONE_TTL=2592000000 # comment out -> no ttl limit
CC_TTL=2592000000 # 2 hr in ms

############### App specific config ###############
# confirm - general
CONFIRM_MODEL_SERVER_11=""
CONFIRM_MODEL_SERVER_13="http://openlm:5000/"
CONFIRM_MODEL_SERVER_50=""
CONFIRM_MODELS='[13]' # 13: OpenLM; 50: Stable Difussion; 11: Llama3
CONFIRM_MODEL_SERVER_14="http://openlm-chat:5000/"
CONFIRM_MODEL_SERVER_15="http://openlm-score:5000/"
CONFIRM_MODELS='[13]' # 13: OpenLM; 50: Stable Difussion; 11: Llama3
63 changes: 63 additions & 0 deletions docker-compose.multimodel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# ora node docker-compose
version: '3'
services:
confirm:
image: oraprotocol/tora:confirm
container_name: ora-tora
depends_on:
- redis
command:
- "--confirm"
env_file:
- .env
environment:
REDIS_HOST: 'redis'
REDIS_PORT: 6379
CONFIRM_MODEL_SERVER_13: 'http://openlm:5000/'
networks:
- private_network
redis:
image: oraprotocol/redis:latest
container_name: ora-redis
restart: always
networks:
- private_network
openlm:
image: oraprotocol/openlm:latest
container_name: ora-openlm
restart: always
networks:
- private_network
openlm-chat:
image: oraprotocol/openlm-chat:latest
container_name: ora-openlm-chat
restart: always
networks:
- private_network
openlm-score:
image: oraprotocol/openlm-score:latest
container_name: ora-openlm-score
restart: always
networks:
- private_network
diun:
image: crazymax/diun:latest
container_name: diun
command: serve
volumes:
- "./data:/data"
- "/var/run/docker.sock:/var/run/docker.sock"
environment:
- "TZ=Asia/Shanghai"
- "LOG_LEVEL=info"
- "LOG_JSON=false"
- "DIUN_WATCH_WORKERS=5"
- "DIUN_WATCH_JITTER=30"
- "DIUN_WATCH_SCHEDULE=0 0 * * *"
- "DIUN_PROVIDERS_DOCKER=true"
- "DIUN_PROVIDERS_DOCKER_WATCHBYDEFAULT=true"
restart: always

networks:
private_network:
driver: bridge
17 changes: 17 additions & 0 deletions start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

if [ -z "$1" ]; then
echo "No argument provided. Running 'docker-compose up -d'..."
docker-compose up -d
exit 0
fi

VALID_MODELS=("openlm" "openlm-chat" "openlm-score")

if [[ ! " ${VALID_MODELS[@]} " =~ " $1 " ]]; then
echo "Error: Invalid argument '$1'. Allowed values are: ${VALID_MODELS[*]}"
exit 1
fi

echo "Running 'docker-compose up confirm redis diun $1 -d'..."
docker-compose -f docker-compose.multimodel.yml up -d confirm redis diun "$1"