Add cpu and rocm profiles. Let invokeai-nvidia service be the default.

This commit is contained in:
Wilson E. Alvarez 2023-12-07 11:17:11 -05:00 committed by Kent Keirsey
parent d1d8ee71fc
commit 296060db63
2 changed files with 13 additions and 7 deletions

View File

@ -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

View File

@ -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
}