Skip to content

Commit

Permalink
chore: two ollama services
Browse files Browse the repository at this point in the history
  • Loading branch information
gary-van-woerkens committed Oct 24, 2024
1 parent 3d5e3ce commit d2d2dc3
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
ovh.conf
.env
test.js
38 changes: 35 additions & 3 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
services:
ollama-service:
ollama-service-1:
restart: always
image: ollama/ollama
tty: true
Expand All @@ -19,15 +19,47 @@ services:
runtime: nvidia
ipc: host
deploy:
replicas: 2
# replicas: 2
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
volumes:
- "./.ollama:/root/.ollama"
- "./.ollama-service-1:/root/.ollama"
networks:
- ollama-network

ollama-service-2:
restart: always
image: ollama/ollama
tty: true
expose:
- "11434"
labels:
- "traefik.enable=true"
- "traefik.http.routers.ollama-service.rule=Host(`${HOST}.nip.io`)"
- "traefik.http.routers.ollama-service.entrypoints=websecure"
- "traefik.http.routers.ollama-service.tls.certresolver=myresolver"
- "traefik.http.middlewares.main-auth.basicauth.users=${CREDENTIALS}"
- "traefik.http.routers.ollama-service.middlewares=main-auth@docker"
- "traefik.http.services.ollama-service.loadbalancer.server.port=11434"
environment:
OLLAMA_KEEP_ALIVE: "-1"
VERBOSE: "${VERBOSE:-0}"
runtime: nvidia
ipc: host
deploy:
# replicas: 2
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
volumes:
- "./.ollama-service-2:/root/.ollama"
networks:
- ollama-network

Expand Down
1 change: 1 addition & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ def indentString(input_string, indent_level=4):
# up docker compose services
docker compose up -d --build
docker exec ollama-ollama-service-1 ollama pull {modelName}
docker exec ollama-ollama-service-2 ollama pull {modelName}
touch /tmp/runcmd_finished
- path: /etc/ssh/sshd_config.d/90-custom-settings.conf
Expand Down

0 comments on commit d2d2dc3

Please sign in to comment.