mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
Add cpu and rocm profiles. Let invokeai-nvidia service be the default.
This commit is contained in:
parent
d1d8ee71fc
commit
296060db63
@ -37,9 +37,6 @@ x-invokeai: &invokeai
|
||||
# invokeai-nodes-web --host 0.0.0.0
|
||||
|
||||
services:
|
||||
invokeai-cpu:
|
||||
<<: *invokeai
|
||||
|
||||
invokeai-nvidia:
|
||||
<<: *invokeai
|
||||
deploy:
|
||||
@ -50,8 +47,15 @@ services:
|
||||
count: 1
|
||||
capabilities: [gpu]
|
||||
|
||||
invokeai-cpu:
|
||||
<<: *invokeai
|
||||
profiles:
|
||||
- cpu
|
||||
|
||||
invokeai-rocm:
|
||||
<<: *invokeai
|
||||
devices:
|
||||
- /dev/kfd:/dev/kfd
|
||||
- /dev/dri:/dev/dri
|
||||
profiles:
|
||||
- rocm
|
||||
|
@ -6,11 +6,13 @@ run() {
|
||||
cd "$scriptdir" || exit 1
|
||||
|
||||
local build_args=""
|
||||
local service_name="invokeai-cpu"
|
||||
local profile=""
|
||||
|
||||
[[ -f ".env" ]] &&
|
||||
build_args=$(awk '$1 ~ /=[^$]/ {print "--build-arg " $0 " "}' .env) &&
|
||||
service_name="invokeai-$(awk -F '=' '/GPU_DRIVER/ {print $2}' .env)"
|
||||
build_args=$(awk '$1 ~ /=[^$]/ && $0 !~ /^#/ {print "--build-arg " $0 " "}' .env) &&
|
||||
profile="$(awk -F '=' '/GPU_DRIVER/ {print $2}' .env)"
|
||||
|
||||
local service_name="invokeai-$profile"
|
||||
|
||||
printf "%s\n" "docker compose build args:"
|
||||
printf "%s\n" "$build_args"
|
||||
@ -19,7 +21,7 @@ run() {
|
||||
unset build_args
|
||||
|
||||
printf "%s\n" "starting service $service_name"
|
||||
docker compose up -d $service_name
|
||||
docker compose --profile "$profile" up -d "$service_name"
|
||||
docker compose logs -f
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user