From 6dc366cee8539c2d1d9b39a1c63036440125464a Mon Sep 17 00:00:00 2001 From: John Romkey <58883+romkey@users.noreply.github.com> Date: Mon, 26 Oct 2026 16:45:24 -0700 Subject: [PATCH] bin/lib.sh: honor COMPOSE_FILE in start_app and start_app_service Both ran `docker compose -f /docker-compose.yml`, and an explicit -f makes Compose ignore COMPOSE_FILE from the app's .env. Since #15 moved the GPU reservation for ollama and vllm into docker-compose.nvidia.yml, the install scripts started them on the CPU; NFS and macvlan overrides were already being dropped the same way. Run from the app directory without -f, as start_experiment already does. The project name is unchanged (it was already the app directory name). Also move the start_app_service comment back above start_app_service. Reported by Cursor Bugbot on #15. Co-Authored-By: Claude Opus 5.5 --- bin/lib.sh | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/bin/lib.sh b/bin/lib.sh index 39b2f9b..eec18f8 100755 --- a/bin/lib.sh +++ b/bin/lib.sh @@ -92,18 +92,17 @@ install_default_config() { start_app() { app_dir="$APPS_ROOT/$1" - if ! docker compose -f "$app_dir/docker-compose.yml" ps 2>/dev/null | grep -q 'Up'; then + # Run from the app directory without -f so COMPOSE_FILE in its .env + # (hardware, NFS or macvlan overrides) is honored. + if ! (cd "$app_dir" && docker compose ps 2>/dev/null) | grep -q 'Up'; then echo "Starting $1..." - docker compose -f "$app_dir/docker-compose.yml" up -d + (cd "$app_dir" && docker compose up -d) echo "$1 started." else echo "$1 is already running." fi } -# Start a single named service within an app's compose file, leaving other -# services in that file untouched. -# Usage: start_app_service start_experiment() { exp_dir="$EXPERIMENTS_ROOT/$1" if [ ! -d "$exp_dir" ]; then @@ -121,12 +120,16 @@ start_experiment() { fi } +# Start a single named service within an app's compose file, leaving other +# services in that file untouched. Like start_app, runs without -f so +# COMPOSE_FILE in the app's .env is honored. +# Usage: start_app_service start_app_service() { app_dir="$APPS_ROOT/$1" service="$2" - if ! docker compose -f "$app_dir/docker-compose.yml" ps "$service" 2>/dev/null | grep -q 'Up'; then + if ! (cd "$app_dir" && docker compose ps "$service" 2>/dev/null) | grep -q 'Up'; then echo "Starting $1/$service..." - docker compose -f "$app_dir/docker-compose.yml" up -d "$service" + (cd "$app_dir" && docker compose up -d "$service") echo "$1/$service started." else echo "$1/$service is already running."