-
Notifications
You must be signed in to change notification settings - Fork 477
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add a docker-compose-distributed example with multiple workers
- Loading branch information
1 parent
7b20f76
commit 1801e05
Showing
1 changed file
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
version: '3.8' | ||
|
||
services: | ||
xinference: &xinference | ||
image: xprobe/xinference:latest | ||
deploy: | ||
resources: | ||
reservations: | ||
devices: | ||
- capabilities: [gpu] | ||
driver: nvidia | ||
count: all | ||
# volumes: | ||
# # Replace <xinference_home> with your xinference home path on the host machine | ||
# - <xinference_home>:/root/.xinference | ||
# # Replace <huggingface_cache_dir> with your huggingface cache path, default is | ||
# # <home_path>/.cache/huggingface | ||
# - <huggingface_cache_dir>:/root/.cache/huggingface | ||
# # If models are downloaded from modelscope, replace <huggingface_cache_dir> with | ||
# # your modelscope cache path, default is <home_path>/.cache/modelscope | ||
# - <modelscope_cache_dir>:/root/.cache/modelscope | ||
# environment: | ||
# # add envs here. Here's an example, if you want to download model from modelscope | ||
# - XINFERENCE_MODEL_SRC=modelscope | ||
|
||
xinference-supervisor: | ||
<<: *xinference | ||
ports: | ||
- "9997:9997" | ||
- "9999:9999" | ||
command: xinference-supervisor --host xinference-supervisor --port 9997 --supervisor-port 9999 | ||
restart: always | ||
|
||
# This examples is just using two workers. You can add more by incrementing | ||
# the worker suffix and port number. | ||
xinference-worker-1: | ||
<<: *xinference | ||
ports: | ||
- "30001:30001" | ||
command: xinference-worker -e http://xinference-supervisor:9997 --host xinference-worker-1 --worker-port 30001 | ||
restart: always | ||
|
||
xinference-worker-2: | ||
<<: *xinference | ||
ports: | ||
- "30002:30002" | ||
command: xinference-worker -e http://xinference-supervisor:9997 --host xinference-worker-2 --worker-port 30002 | ||
restart: always |