Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
7a4c332
Add run_itk.sh bash script.
bartek-gralewicz Apr 8, 2026
063d11c
Add ITK workflow.
bartek-gralewicz Apr 8, 2026
5c5fe4e
Apply PR suggestions.
bartek-gralewicz Apr 8, 2026
5ad4f8a
Enable ITK test suite.
bartek-gralewicz Apr 13, 2026
d530a9a
Add node setup to the ITK CI workflow.
bartek-gralewicz Apr 13, 2026
cd55661
Update tag and remove redundant state_map definitions.
bartek-gralewicz Apr 13, 2026
4ba1f84
Add middle layer comment and update npm env setup in the CI workflow,
bartek-gralewicz Apr 14, 2026
882ada7
Move the middle layer comment under the imports.
bartek-gralewicz Apr 14, 2026
748cca7
Mode adaptation mechanisms to the middle layer instead of transport i…
bartek-gralewicz Apr 14, 2026
b96dacb
Fix lint formatting.
bartek-gralewicz Apr 14, 2026
e5fa80f
Merge remote-tracking branch 'origin/epic/1.0_breaking_changes' into …
bartek-gralewicz Apr 14, 2026
3a877ca
Update ITK to transport agnostic orchestrator.
bartek-gralewicz Apr 14, 2026
34dc9b9
Remove no longer needed method mapping.
bartek-gralewicz Apr 14, 2026
8f60af4
Switch a2a-samples revision to a tag.
bartek-gralewicz Apr 15, 2026
ac39c21
Fix typo in tag name.
bartek-gralewicz Apr 15, 2026
2ee7aa3
Tag is in a broken state. Switching to a branch instead.
bartek-gralewicz Apr 15, 2026
611a9d9
Switch to itk v014 tag once it got fixed.
bartek-gralewicz Apr 15, 2026
36f6d26
Merge remote-tracking branch 'origin/epic/1.0_breaking_changes' into …
bartek-gralewicz Apr 15, 2026
a5679ec
Merge remote-tracking branch 'origin/epic/1.0_breaking_changes' into …
bartek-gralewicz Apr 16, 2026
973c023
Used toJSON for JSON-RPC server side. Simplified clients usage and pr…
bartek-gralewicz Apr 16, 2026
634b60e
Update StreamResponse so that is returns properly serializable object…
bartek-gralewicz Apr 16, 2026
b546372
Add a TODO comment over the payload conversion in jsonrpc transport h…
bartek-gralewicz Apr 16, 2026
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
34 changes: 34 additions & 0 deletions .github/workflows/run-itk.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Run ITK

on:
push:
branches: [ "main", "epic" ]
pull_request:
paths:
- 'src/**'
- 'itk/**'

permissions:
contents: read

# Only run the latest job
concurrency:
group: '${{ github.workflow }} @ ${{ github.head_ref || github.ref }}'
cancel-in-progress: true

jobs:
itk-test:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v6

- name: Install uv
uses: astral-sh/setup-uv@v7

- name: Run ITK Tests
run: bash run_itk.sh
working-directory: itk
env:
A2A_SAMPLES_REVISION: itk-v.0.11-alpha
165 changes: 165 additions & 0 deletions itk/run_itk.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
#!/bin/bash
set -ex

# Initialize default exit code
RESULT=1

# Cleanup function to be called on exit
cleanup() {
set +x
echo "Cleaning up artifacts..."
docker stop itk-service > /dev/null 2>&1 || true
docker rm itk-service > /dev/null 2>&1 || true
docker rmi itk_service > /dev/null 2>&1 || true
rm -rf a2a-samples > /dev/null 2>&1 || true
rm -rf pyproto > /dev/null 2>&1 || true
rm -f instruction.proto > /dev/null 2>&1 || true
echo "Done. Final exit code: $RESULT"
}

# Register cleanup function to run on script exit
trap cleanup EXIT

# 1. Pull a2a-samples and checkout revision
: "${A2A_SAMPLES_REVISION:?A2A_SAMPLES_REVISION environment variable must be set}"

if [ ! -d "a2a-samples" ]; then
git clone https://github.com/a2aproject/a2a-samples.git a2a-samples
fi
cd a2a-samples
git fetch origin
git checkout "$A2A_SAMPLES_REVISION"

# Only pull if it's a branch (not a detached HEAD)
if git symbolic-ref -q HEAD > /dev/null; then
git pull origin "$A2A_SAMPLES_REVISION"
fi
cd ..

# 2. Copy instruction.proto from a2a-samples
cp a2a-samples/itk/protos/instruction.proto ./instruction.proto

# 3. Build pyproto library
mkdir -p pyproto
touch pyproto/__init__.py
uv run --with grpcio-tools python -m grpc_tools.protoc \
-I. \
--python_out=pyproto \
--grpc_python_out=pyproto \
instruction.proto

# 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-samples/itk
# We run docker build from the itk directory inside a2a-samples
docker build -t itk_service a2a-samples/itk

# 5. Start docker service
# Mounting a2a-python as repo and itk as current agent
A2A_PYTHON_ROOT=$(cd .. && pwd)
ITK_DIR=$(pwd)
Comment thread
bartek-gralewicz marked this conversation as resolved.
Outdated

# Stop existing container if any
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" \
-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..."
set +e
for i in $(seq 1 $MAX_RETRIES); do
if curl -s http://127.0.0.1:8000/ > /dev/null; then
echo "Service is up!"
break
fi
echo "Still waiting... ($i/$MAX_RETRIES)"
sleep 2
done

# If we reached the end of the loop without success
if ! curl -s http://127.0.0.1:8000/ > /dev/null; then
echo "Error: ITK service failed to start on port 8000"
docker logs itk-service
exit 1
fi

echo "ITK Service is up! Sending compatibility test request..."
RESPONSE=$(curl -s -X POST http://127.0.0.1:8000/run \
-H "Content-Type: application/json" \
-d '{
"tests": [
{
"name": "Star Topology (Full) - JSONRPC & GRPC",
"sdks": ["current", "python_v10", "python_v03", "go_v10", "go_v03"],
"traversal": "euler",
"edges": ["0->1", "0->2", "0->3", "0->4", "1->0", "2->0", "3->0", "4->0"],
"protocols": ["jsonrpc", "grpc"]
},
{
"name": "Star Topology (No Go v03) - HTTP_JSON",
"sdks": ["current", "python_v10", "python_v03", "go_v10"],
"traversal": "euler",
"edges": ["0->1", "0->2", "0->3", "1->0", "2->0", "3->0"],
"protocols": ["http_json"]
},
{
"name": "Star Topology (Full) - JSONRPC & GRPC (Streaming)",
"sdks": ["current", "python_v10", "python_v03", "go_v10", "go_v03"],
"traversal": "euler",
"edges": ["0->1", "0->2", "0->3", "0->4", "1->0", "2->0", "3->0", "4->0"],
"protocols": ["jsonrpc", "grpc"],
"streaming": true
},
{
"name": "Star Topology (No Go v03) - HTTP_JSON (Streaming)",
"sdks": ["current", "python_v10", "python_v03", "go_v10"],
"traversal": "euler",
"edges": ["0->1", "0->2", "0->3", "1->0", "2->0", "3->0"],
"protocols": ["http_json"],
"streaming": true
}
]
}')

echo "--------------------------------------------------------"
echo "ITK TEST RESULTS:"
echo "--------------------------------------------------------"
echo "$RESPONSE" | python3 -c "
import sys, json
try:
data = json.load(sys.stdin)
all_passed = data.get('all_passed', False)
results = data.get('results', {})
for test, passed in results.items():
status = 'PASSED' if passed else 'FAILED'
print(f'{test}: {status}')
print('--------------------------------------------------------')
print(f'OVERALL STATUS: {\"PASSED\" if all_passed else \"FAILED\"}')
if not all_passed:
sys.exit(1)
except Exception as e:
print(f'Error parsing results: {e}')
print(f'Raw response: {data if \"data\" in locals() else \"no data\"}')
sys.exit(1)
"
Comment thread
bartek-gralewicz marked this conversation as resolved.
Outdated
RESULT=$?
set -e

if [ $RESULT -ne 0 ]; then
echo "Tests failed. Container logs:"
docker logs itk-service
fi
echo "--------------------------------------------------------"

# Final exit result will be captured by trap cleanup
exit $RESULT
Loading