From d1da79f588167a8be16113663851d663487ea6ec Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 14 Jan 2026 13:39:26 +0000 Subject: [PATCH 1/4] Initial plan From 7807b9b6fcd8d10f4ff468cc788fc43a897f4e23 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 14 Jan 2026 13:48:08 +0000 Subject: [PATCH 2/4] Fix docker compose down to use RI_COMPOSE_FILE_ARG as source - Determine compose file based on SAMPLE_APP before docker compose down - Add RI_COMPOSE_FILE_ARG variable to store the appropriate compose file path - Use -f flag with docker compose down to specify the correct compose file - Simplify copy logic to use the variable Co-authored-by: krish918 <2583180+krish918@users.noreply.github.com> --- .../metro-vision-ai-app-recipe/install.sh | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/metro-ai-suite/metro-vision-ai-app-recipe/install.sh b/metro-ai-suite/metro-vision-ai-app-recipe/install.sh index 555e52a9b..f315bc7c4 100755 --- a/metro-ai-suite/metro-vision-ai-app-recipe/install.sh +++ b/metro-ai-suite/metro-vision-ai-app-recipe/install.sh @@ -59,18 +59,21 @@ fi # Extract SAMPLE_APP variable from .env file SAMPLE_APP=$(grep -E "^SAMPLE_APP=" "$ENV_FILE" | cut -d '=' -f2 | tr -d '"' | tr -d "'") +# Determine appropriate docker-compose file based on SAMPLE_APP +if [ "$SAMPLE_APP" = "smart-intersection" ]; then + RI_COMPOSE_FILE_ARG="compose-scenescape.yml" +else + RI_COMPOSE_FILE_ARG="compose-without-scenescape.yml" +fi + # Bring down the application before updating docker compose file -if docker compose ps >/dev/null 2>&1; then +if docker compose -f "$RI_COMPOSE_FILE_ARG" ps >/dev/null 2>&1; then echo "Bringing down any running containers..." - docker compose down + docker compose -f "$RI_COMPOSE_FILE_ARG" down fi # Copy appropriate docker-compose file -if [ "$SAMPLE_APP" = "smart-intersection" ]; then - cp compose-scenescape.yml docker-compose.yml -else - cp compose-without-scenescape.yml docker-compose.yml -fi +cp "$RI_COMPOSE_FILE_ARG" docker-compose.yml # Check if the directory exists if [ ! -d "$SAMPLE_APP" ]; then From 8d04766d84effe32e561067eebe8545aeee1838b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 14 Jan 2026 13:49:36 +0000 Subject: [PATCH 3/4] Add validation to check if compose file exists before using it Co-authored-by: krish918 <2583180+krish918@users.noreply.github.com> --- metro-ai-suite/metro-vision-ai-app-recipe/install.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/metro-ai-suite/metro-vision-ai-app-recipe/install.sh b/metro-ai-suite/metro-vision-ai-app-recipe/install.sh index f315bc7c4..cac7f0c18 100755 --- a/metro-ai-suite/metro-vision-ai-app-recipe/install.sh +++ b/metro-ai-suite/metro-vision-ai-app-recipe/install.sh @@ -66,6 +66,12 @@ else RI_COMPOSE_FILE_ARG="compose-without-scenescape.yml" fi +# Check if the compose file exists +if [ ! -f "$RI_COMPOSE_FILE_ARG" ]; then + echo "Error: Compose file $RI_COMPOSE_FILE_ARG not found." + exit 1 +fi + # Bring down the application before updating docker compose file if docker compose -f "$RI_COMPOSE_FILE_ARG" ps >/dev/null 2>&1; then echo "Bringing down any running containers..." From bc37e176637cebc6f73b89b9eb33bd7a655fd302 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 14 Jan 2026 13:50:43 +0000 Subject: [PATCH 4/4] Add validation for SAMPLE_APP from .env file Co-authored-by: krish918 <2583180+krish918@users.noreply.github.com> --- metro-ai-suite/metro-vision-ai-app-recipe/install.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/metro-ai-suite/metro-vision-ai-app-recipe/install.sh b/metro-ai-suite/metro-vision-ai-app-recipe/install.sh index cac7f0c18..43c345170 100755 --- a/metro-ai-suite/metro-vision-ai-app-recipe/install.sh +++ b/metro-ai-suite/metro-vision-ai-app-recipe/install.sh @@ -56,9 +56,15 @@ else echo "HOST_IP=$HOST_IP" >> "$ENV_FILE" fi -# Extract SAMPLE_APP variable from .env file +# Extract SAMPLE_APP variable from .env file to ensure consistency SAMPLE_APP=$(grep -E "^SAMPLE_APP=" "$ENV_FILE" | cut -d '=' -f2 | tr -d '"' | tr -d "'") +# Validate that SAMPLE_APP was set correctly +if [ -z "$SAMPLE_APP" ]; then + echo "Error: SAMPLE_APP not found in .env file." + exit 1 +fi + # Determine appropriate docker-compose file based on SAMPLE_APP if [ "$SAMPLE_APP" = "smart-intersection" ]; then RI_COMPOSE_FILE_ARG="compose-scenescape.yml"