Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion itk/run_itk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ cleanup() {
trap cleanup EXIT

# 1. Pull a2a-samples and checkout revision
: "${A2A_SAMPLES_REVISION:?A2A_SAMPLES_REVISION environment variable must be set}"
: "${A2A_SAMPLES_REVISION:=$(grep "A2A_SAMPLES_REVISION:" ../.github/workflows/itk.yaml | head -n 1 | awk '{print $2}')}"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

low

The extraction of A2A_SAMPLES_REVISION from the YAML file might include surrounding quotes (e.g., "v1.0.0") if they are present in the workflow file. This would cause the git checkout command on line 31 to fail. It is safer to strip any quotes from the extracted value. Additionally, using a more specific regex prevents matching commented-out lines.

Suggested change
: "${A2A_SAMPLES_REVISION:=$(grep "A2A_SAMPLES_REVISION:" ../.github/workflows/itk.yaml | head -n 1 | awk '{print $2}')}"
: "${A2A_SAMPLES_REVISION:=$(grep \"^ *A2A_SAMPLES_REVISION:\" ../.github/workflows/itk.yaml | head -n 1 | awk '{print $2}' | tr -d '\"' | tr -d \"'\")}"


if [ ! -d "a2a-samples" ]; then
git clone https://github.com/a2aproject/a2a-samples.git a2a-samples
Expand Down Expand Up @@ -66,13 +66,15 @@ docker rm -f itk-service || true
docker run -d --name itk-service \
-v "$A2A_PYTHON_ROOT:/app/agents/repo" \
-v "$ITK_DIR:/app/agents/repo/itk" \
-v "$A2A_PYTHON_ROOT/.git:/app/agents/repo/.git" \
-p 8000:8000 \
itk_service

# 5.1. Fix dubious ownership for git (needed for uv-dynamic-versioning)
docker exec itk-service git config --global --add safe.directory /app/agents/repo
docker exec itk-service git config --global --add safe.directory /app/agents/repo/itk


# 6. Verify service is up and send post request
MAX_RETRIES=30
echo "Waiting for ITK service to start on 127.0.0.1:8000..."
Expand Down
Loading