Skip to content
Open
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
37 changes: 37 additions & 0 deletions itk/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,45 @@
</dependency>
</dependencies>

<properties>
<!--
Single-source location of the canonical .proto files. The a2a-itk
repository is fetched at the ref pinned by A2A_ITK_REVISION (see
run_itk.sh) into ${project.basedir}/a2a-itk. Override via
-Da2a.itk.proto.dir=... when building outside run_itk.sh.
-->
<a2a.itk.proto.dir>${project.basedir}/a2a-itk/protos</a2a.itk.proto.dir>
<protobuf-maven-plugin.version>4.1.2</protobuf-maven-plugin.version>
</properties>

<build>
<plugins>
<plugin>
<!--
Generates Java classes from the canonical instruction.proto
fetched from a2a-itk. Mirrors the baseline configuration used
by a2a-itk/agents/java/v10 so generated code (package `itk`,
outer class `InstructionOuterClass`) stays byte-identical
across the two paths during the strangler migration.
-->
<groupId>io.github.ascopes</groupId>
<artifactId>protobuf-maven-plugin</artifactId>
<version>${protobuf-maven-plugin.version}</version>
<configuration>
<protoc>${protobuf-java.version}</protoc>
<sourceDirectories>
<sourceDirectory>${a2a.itk.proto.dir}</sourceDirectory>
</sourceDirectories>
</configuration>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-maven-plugin</artifactId>
Expand Down
14 changes: 7 additions & 7 deletions itk/run_itk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ cleanup() {
# Register cleanup function to run on script exit
trap cleanup EXIT

# 1. Pull a2a-itk and checkout revision
# 1. Pull a2a-itk and checkout revision.
# The clone doubles as the single source of truth for instruction.proto:
# protobuf-maven-plugin in itk/pom.xml reads it directly from
# ${project.basedir}/a2a-itk/protos (see the `a2a.itk.proto.dir` property).
: "${A2A_ITK_REVISION:?A2A_ITK_REVISION environment variable must be set}"

if [ ! -d "a2a-itk" ]; then
Expand All @@ -47,17 +50,14 @@ if git symbolic-ref -q HEAD > /dev/null; then
fi
cd ..

# 2. Copy latest instruction.proto from a2a-itk
cp a2a-itk/protos/instruction.proto src/main/proto/instruction.proto

# 3. Build itk_service container image from root of a2a-itk
# 2. Build itk_service container image from root of a2a-itk
CONTAINER_BUILD_ARGS=""
if [ "$CONTAINER_RT" = "podman" ]; then
CONTAINER_BUILD_ARGS="--format docker"
fi
$CONTAINER_RT build $CONTAINER_BUILD_ARGS -t itk_service a2a-itk

# 4. Start container service with a single mount: the a2a-java repo
# 3. Start container service with a single mount: the a2a-java repo
A2A_JAVA_ROOT=$(cd .. && pwd)

# Stop existing container if any
Expand All @@ -80,7 +80,7 @@ $CONTAINER_RT run -d --name itk-service \
-p 8000:8000 \
itk_service

# 5. Verify service is up and send post request
# 4. 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
Expand Down
60 changes: 0 additions & 60 deletions itk/src/main/proto/instruction.proto

This file was deleted.

22 changes: 20 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -599,8 +599,13 @@
<module>transport/grpc</module>
<module>transport/rest</module>

<!-- ITK (Integration Test Kit) agent -->
<module>itk</module>
<!--
ITK (Integration Test Kit) agent is intentionally NOT in the
default reactor because it consumes instruction.proto directly
from a sibling clone of a2a-itk that only exists at ITK test
time (fetched by itk/run_itk.sh). Enable via -Pitk when running
the ITK workflow.
-->

<!-- A2A Protocol v0.3 backward compatibility layer -->
<module>compat-0.3</module>
Expand Down Expand Up @@ -648,6 +653,19 @@
</plugins>
</build>
</profile>
<profile>
<!--
Adds the ITK (Integration Test Kit) agent module to the reactor.
Enabled by itk/run_itk.sh (via test_suite/current.py) which
fetches a2a-itk into itk/a2a-itk, providing the .proto sources
the module needs at generate-sources time. Off by default so
the standard reactor build works without an a2a-itk checkout.
-->
<id>itk</id>
<modules>
<module>itk</module>
</modules>
</profile>
<profile>
<!--
This profile gis required for old JDK that don't support reading type use annotations from bytecodes.
Expand Down
Loading