Skip to content
Merged
Show file tree
Hide file tree
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
28 changes: 28 additions & 0 deletions .github/workflows/itk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,36 @@ jobs:
- name: Install uv
uses: astral-sh/setup-uv@v7

- name: Clone a2a-itk
uses: actions/checkout@v6
with:
repository: a2aproject/a2a-itk
ref: main
path: itk/a2a-itk

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build itk_service image (GHA layer cache)
uses: docker/build-push-action@v6
with:
context: itk/a2a-itk
tags: itk_service:latest
load: true
cache-from: type=gha,scope=itk_service
cache-to: type=gha,mode=max,scope=itk_service

- name: Cache launcher peer-SDK checkouts + build outputs
uses: actions/cache@v4
with:
path: ~/.cache/a2a-itk-launcher
key: itk-launcher-${{ runner.os }}-${{ github.sha }}
restore-keys: |
itk-launcher-${{ runner.os }}-

- name: Run ITK Tests
run: bash run_itk.sh
working-directory: itk
env:
A2A_ITK_REVISION: main
ITK_SKIP_BUILD: "1"
28 changes: 28 additions & 0 deletions .github/workflows/nightly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,40 @@ jobs:
- name: Install uv
uses: astral-sh/setup-uv@v7

- name: Clone a2a-itk
uses: actions/checkout@v6
with:
repository: a2aproject/a2a-itk
ref: main
path: itk/a2a-itk

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build itk_service image (GHA layer cache)
uses: docker/build-push-action@v6
with:
context: itk/a2a-itk
tags: itk_service:latest
load: true
cache-from: type=gha,scope=itk_service
cache-to: type=gha,mode=max,scope=itk_service

- name: Cache launcher peer-SDK checkouts + build outputs
uses: actions/cache@v4
with:
path: ~/.cache/a2a-itk-launcher
key: itk-launcher-${{ runner.os }}-${{ github.sha }}
restore-keys: |
itk-launcher-${{ runner.os }}-

- name: Run Nightly ITK Tests
run: bash run_itk.sh
working-directory: itk
env:
A2A_ITK_REVISION: main
ITK_NIGHTLY_RUN: "True"
ITK_SKIP_BUILD: "1"

- name: Upload Results to Rolling Release
uses: softprops/action-gh-release@v3
Expand Down
17 changes: 14 additions & 3 deletions itk/run_itk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,11 @@ uv run --with grpcio-tools python -m grpc_tools.protoc \
# Fix imports in generated file
sed -i 's/^import instruction_pb2 as instruction__pb2/from . import instruction_pb2 as instruction__pb2/' pyproto/instruction_pb2_grpc.py

# 4. Build jit itk_service docker image from root of a2a-itk
# We run docker build from the root directory of a2a-itk
docker build -t itk_service a2a-itk
# 4. Build jit itk_service docker image from root of a2a-itk (skipped in CI
# where the workflow builds via docker/build-push-action for GHA caching).
if [ "${ITK_SKIP_BUILD:-0}" != "1" ]; then
docker build -t itk_service a2a-itk
fi

# 5. Start docker service
# Mounting a2a-python as repo and itk as current agent
Expand All @@ -76,18 +78,27 @@ if [ "${ITK_LOG_LEVEL^^}" = "DEBUG" ]; then
DOCKER_MOUNT_LOGS="-v $ITK_DIR/logs:/app/logs"
fi

mkdir -p "$HOME/.cache/a2a-itk-launcher"

docker run -d --name itk-service \
-v "$A2A_PYTHON_ROOT:/app/agents/repo" \
-v "$ITK_DIR:/app/agents/repo/itk" \
-v "$HOME/.cache/a2a-itk-launcher:/root/.cache/a2a-itk" \
$DOCKER_MOUNT_LOGS \
-e ITK_LOG_LEVEL="$ITK_LOG_LEVEL" \
-e ITK_ENTRYPOINT="${ITK_ENTRYPOINT:-itk_service_v2.py}" \
-e ITK_READINESS_TIMEOUT="${ITK_READINESS_TIMEOUT:-180}" \
-e ITK_MAX_WORKERS="${ITK_MAX_WORKERS:-2}" \
-p 8000:8000 \
itk_service

# 5.1. Fix dubious ownership for git (needed for uv-dynamic-versioning)
docker exec -u root itk-service git config --system --add safe.directory /app/agents/repo
docker exec -u root itk-service git config --system --add safe.directory /app/agents/repo/itk
docker exec -u root itk-service git config --system core.multiPackIndex false
# Launcher's peer checkouts under /root/.cache/a2a-itk are host-owned; trust
# only repos under the launcher cache dir so container-side git accepts them.
docker exec -u root itk-service bash -lc 'while IFS= read -r -d "" d; do git config --system --add safe.directory "${d%/.git}"; done < <(find /root/.cache/a2a-itk -type d -name .git -print0)'

# 6. Verify service is up and send post request
MAX_RETRIES=30
Expand Down
Loading