You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by wu...@apache.org on 2026/09/10 16:30:51 UTC
(skywalking) branch e2e/vendor-spring-ai-service created (now 50a316096b)
This is an automated email from the ASF dual-hosted git repository.
wu-sheng pushed a change to branch e2e/vendor-spring-ai-service
in repository https://gitbox.apache.org/repos/asf/skywalking.git
at 50a316096b Vendor the GenAI e2e Spring AI application and split out the mock LLM server
This branch includes the following new commits:
new 50a316096b Vendor the GenAI e2e Spring AI application and split out the mock LLM server
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
(skywalking) 01/01: Vendor the GenAI e2e Spring AI application and split out the mock LLM server
Posted by wu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
wu-sheng pushed a commit to branch e2e/vendor-spring-ai-service
in repository https://gitbox.apache.org/repos/asf/skywalking.git
commit 50a316096b737575f7b6eee5c549154294c9c8b1
Author: Wu Sheng <wu...@foxmail.com>
AuthorDate: Fri Sep 11 00:13:52 2026 +0800
Vendor the GenAI e2e Spring AI application and split out the mock LLM server
The virtual-genai case built its Spring AI application at test time by cloning
spring-projects/spring-ai-examples and running Maven inside the image build. That
resolved spring-ai:2.0.0-SNAPSHOT, a line abandoned the day before the 2.0.0 GA
whose older builds have since been pruned, so the fixture was pinned to nothing
released and could no longer be rebuilt from the same bytes.
Replace it with an in-repo e2e-spring-ai-service module on the released Spring AI
2.0.1, and move the mock LLM endpoints out of e2e-service-provider into a dedicated
e2e-mock-llm-server that all three GenAI cases share -- e2e-service-provider was
only ever started in those cases to host that controller.
Spring AI requires Java 17 and Spring Boot 4, while the e2e reactor targets Java 8
and is compiled under JDK 11 on the e2e-test-java-versions leg, so the new module
sits behind a jdk-17 profile and the jobs that build it now pin JDK 17 explicitly.
---
.github/workflows/publish-docker-e2e-service.yaml | 6 ++
.github/workflows/skywalking.yaml | 6 ++
docs/en/changes/changes.md | 1 +
test/Makefile | 14 ++-
.../cases/otlp-virtual-genai/docker-compose.yml | 13 +--
.../e2e-v2/cases/virtual-genai/Dockerfile.provider | 44 ---------
test/e2e-v2/cases/virtual-genai/docker-compose.yml | 29 +++---
.../cases/zipkin-virtual-genai/docker-compose.yml | 11 +--
.../java-test-service/e2e-mock-llm-server/pom.xml | 56 ++++++++++++
.../skywalking/e2e/mockllm}/LLMMockController.java | 2 +-
.../e2e/mockllm/MockLLMServerApplication.java | 34 +++++++
.../src/main/resources/application.yml | 21 +++++
.../e2e-spring-ai-service/pom.xml | 101 +++++++++++++++++++++
.../e2e/springai/SpringAIServiceApplication.java | 33 +++++++
.../e2e/springai/StreamingChatController.java | 52 +++++++++++
.../src/main/resources/application.yml | 22 +++++
test/e2e-v2/java-test-service/pom.xml | 16 ++++
test/e2e-v2/script/docker-compose/base-compose.yml | 18 ++++
18 files changed, 402 insertions(+), 77 deletions(-)
diff --git a/.github/workflows/publish-docker-e2e-service.yaml b/.github/workflows/publish-docker-e2e-service.yaml
index 0887df009d..79fb1385d4 100644
--- a/.github/workflows/publish-docker-e2e-service.yaml
+++ b/.github/workflows/publish-docker-e2e-service.yaml
@@ -43,6 +43,12 @@ jobs:
with:
submodules: true
persist-credentials: false
+ # e2e-spring-ai-service is a Spring Boot 4 / Spring AI module gated behind the reactor's
+ # jdk-17 profile; without an explicit JDK this job rides the runner image default.
+ - uses: actions/setup-java@v4
+ with:
+ distribution: "temurin"
+ java-version: "17"
- name: Cache local Maven repository
uses: actions/cache@v4
with:
diff --git a/.github/workflows/skywalking.yaml b/.github/workflows/skywalking.yaml
index 8d17d3124e..bc059041e7 100644
--- a/.github/workflows/skywalking.yaml
+++ b/.github/workflows/skywalking.yaml
@@ -815,6 +815,12 @@ jobs:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
+ # The virtual-genai case builds e2e-spring-ai-service, which needs Java 17. Without this
+ # the job silently rides whatever JDK the runner image defaults to.
+ - uses: actions/setup-java@v4
+ with:
+ distribution: "temurin"
+ java-version: "17"
- name: Cache maven repository
uses: actions/cache@v4
with:
diff --git a/docs/en/changes/changes.md b/docs/en/changes/changes.md
index 4809b71018..8e14267807 100644
--- a/docs/en/changes/changes.md
+++ b/docs/en/changes/changes.md
@@ -1,6 +1,7 @@
## 11.1.0
#### Project
+* Replace the GenAI e2e cases' Spring AI application with an in-repo `e2e-spring-ai-service` module pinned to the released Spring AI 2.0.1, and move the mock LLM endpoints out of `e2e-service-provider` into a dedicated `e2e-mock-llm-server` module that all three GenAI cases share. The Spring AI application was previously built at test time by cloning `spring-projects/spring-ai-examples` and running Maven inside the image build, which resolved `spring-ai:2.0.0-SNAPSHOT`: a line that has s [...]
#### OAP Server
* Add customizable LLM-as-judge support for AI evaluation, with OpenAI-compatible endpoint / model / API key configuration, and persist the evaluation result as queryable `GenAIEvaluationRecord` rows for later inspection.
diff --git a/test/Makefile b/test/Makefile
index 5b6565dd55..a384e14e70 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -25,6 +25,8 @@ BASE_IMAGE ?= eclipse-temurin:$(JRE)
E2E_SERVICE_PROVIDER_NAME = e2e-service-provider
E2E_SERVICE_CONSUMER_NAME = e2e-service-consumer
+E2E_MOCK_LLM_SERVER_NAME = e2e-mock-llm-server
+E2E_SPRING_AI_SERVICE_NAME = e2e-spring-ai-service
TRACE_MOCKER_NAME = trace-mocker
.PHONY: init
@@ -35,13 +37,17 @@ init:
build.e2e-service:
cd $(SW_ROOT) && ./mvnw --batch-mode -f $(CONTEXT)/pom.xml clean package
-DOCKER_TARGETS:=docker.e2e-service-provider docker.e2e-service-consumer docker.trace-mocker
+DOCKER_TARGETS:=docker.e2e-service-provider docker.e2e-service-consumer docker.e2e-mock-llm-server docker.e2e-spring-ai-service docker.trace-mocker
.PHONY: docker docker.e2e-service
docker: init build.e2e-service docker.e2e-service
%.e2e-service-provider: NAME = $(E2E_SERVICE_PROVIDER_NAME)
%.e2e-service-consumer: NAME = $(E2E_SERVICE_CONSUMER_NAME)
+%.e2e-mock-llm-server: NAME = $(E2E_MOCK_LLM_SERVER_NAME)
+%.e2e-spring-ai-service: NAME = $(E2E_SPRING_AI_SERVICE_NAME)
+# Spring AI requires Java 17; the shared BASE_IMAGE above is a Java 8 JRE.
+%.e2e-spring-ai-service: BASE_IMAGE = eclipse-temurin:17-jre
%.trace-mocker: NAME = $(TRACE_MOCKER_NAME)
docker.%: PLATFORMS =
@@ -52,6 +58,12 @@ push.%: LOAD_OR_PUSH = --push
push.docker.e2e-service-% docker.e2e-service-%: $(CONTEXT)/Dockerfile
$(DOCKER_RULE)
+push.docker.e2e-mock-llm-server docker.e2e-mock-llm-server: $(CONTEXT)/Dockerfile
+ $(DOCKER_RULE)
+
+push.docker.e2e-spring-ai-service docker.e2e-spring-ai-service: $(CONTEXT)/Dockerfile
+ $(DOCKER_RULE)
+
push.docker.trace-mocker docker.trace-mocker: $(CONTEXT)/Dockerfile
$(DOCKER_RULE)
diff --git a/test/e2e-v2/cases/otlp-virtual-genai/docker-compose.yml b/test/e2e-v2/cases/otlp-virtual-genai/docker-compose.yml
index a722b41c2d..7784607579 100644
--- a/test/e2e-v2/cases/otlp-virtual-genai/docker-compose.yml
+++ b/test/e2e-v2/cases/otlp-virtual-genai/docker-compose.yml
@@ -23,7 +23,7 @@ services:
SW_RECEIVER_ZIPKIN: default
SW_AI_EVALUATION: default
SW_AI_EVALUATION_SAMPLE_RATE: 1000000
- AI_EVALUATION_ENDPOINT: http://provider:9090/llm/evaluation/v1/chat/completions
+ AI_EVALUATION_ENDPOINT: http://mock-llm-server:9090/llm/evaluation/v1/chat/completions
AI_EVALUATION_MODEL: e2e-judge
AI_EVALUATION_API_KEY: e2e-api-key
volumes:
@@ -41,15 +41,12 @@ services:
ports:
- 17912
- provider:
+ mock-llm-server:
extends:
file: ../../script/docker-compose/base-compose.yml
- service: provider
+ service: mock-llm-server
ports:
- 9090
- depends_on:
- oap:
- condition: service_healthy
provider-py:
build:
@@ -60,7 +57,7 @@ services:
ports:
- "9091:9091"
environment:
- OPENAI_BASE_URL: http://provider:9090/llm/otlp/v1
+ OPENAI_BASE_URL: http://mock-llm-server:9090/llm/otlp/v1
OPENAI_API_KEY: xxxxxxxxxxxxxxxxxxxxxxxx
OTEL_TRACES_EXPORTER: otlp
OTEL_EXPORTER_OTLP_ENDPOINT: http://oap:11800
@@ -68,7 +65,7 @@ services:
depends_on:
oap:
condition: service_healthy
- provider:
+ mock-llm-server:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://127.0.0.1:9091/"]
diff --git a/test/e2e-v2/cases/virtual-genai/Dockerfile.provider b/test/e2e-v2/cases/virtual-genai/Dockerfile.provider
deleted file mode 100644
index 93f3935f94..0000000000
--- a/test/e2e-v2/cases/virtual-genai/Dockerfile.provider
+++ /dev/null
@@ -1,44 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-ARG SW_AGENT_JDK_VERSION
-ARG SW_AGENT_JAVA_COMMIT
-
-FROM eclipse-temurin:17-jdk AS builder
-
-RUN apt-get update && apt-get install -y git maven && rm -rf /var/lib/apt/lists/*
-
-WORKDIR /source
-RUN git clone https://github.com/spring-projects/spring-ai-examples.git \
- && cd spring-ai-examples \
- && git checkout 2a6088db3d18d5fa6fc208b12adf1172d22f77fd
-
-WORKDIR /source/spring-ai-examples/misc/openai-streaming-response
-RUN mvn clean package -DskipTests
-
-RUN find target/ -maxdepth 1 -name "*.jar" ! -name "*-plain.jar" -exec cp {} /app.jar \;
-
-FROM ghcr.io/apache/skywalking-java/skywalking-java:${SW_AGENT_JAVA_COMMIT}-java${SW_AGENT_JDK_VERSION}
-
-WORKDIR /skywalking
-
-VOLUME /services
-
-COPY --from=builder /app.jar /services/app.jar
-
-EXPOSE 8080
-
-CMD ["sh", "-c", "java -jar /services/app.jar"]
-
diff --git a/test/e2e-v2/cases/virtual-genai/docker-compose.yml b/test/e2e-v2/cases/virtual-genai/docker-compose.yml
index 5d8b86f7cb..4ffa3d4e02 100644
--- a/test/e2e-v2/cases/virtual-genai/docker-compose.yml
+++ b/test/e2e-v2/cases/virtual-genai/docker-compose.yml
@@ -26,7 +26,7 @@ services:
environment:
SW_AI_EVALUATION: default
SW_AI_EVALUATION_SAMPLE_RATE: 1000000
- AI_EVALUATION_ENDPOINT: http://provider:9090/llm/evaluation/v1/chat/completions
+ AI_EVALUATION_ENDPOINT: http://mock-llm-server:9090/llm/evaluation/v1/chat/completions
AI_EVALUATION_MODEL: e2e-judge
AI_EVALUATION_API_KEY: e2e-api-key
networks:
@@ -39,34 +39,31 @@ services:
ports:
- 17912
- provider:
+ mock-llm-server:
extends:
file: ../../script/docker-compose/base-compose.yml
- service: provider
+ service: mock-llm-server
ports:
- 9090
- depends_on:
- oap:
- condition: service_healthy
- spring-ai-examples:
- build:
- context: .
- dockerfile: Dockerfile.provider
- args:
- - SW_AGENT_JDK_VERSION=17
- - SW_AGENT_JAVA_COMMIT=${SW_AGENT_JAVA_COMMIT}
+ # Spring AI needs Java 17, so this pins the agent image's java17 tag rather than the
+ # SW_AGENT_JDK_VERSION the rest of the suite runs at.
+ spring-ai-service:
+ image: "ghcr.io/apache/skywalking-java/skywalking-java:${SW_AGENT_JAVA_COMMIT}-java17"
+ volumes:
+ - ../../java-test-service/e2e-spring-ai-service/target/e2e-spring-ai-service-2.0.0.jar:/services/app.jar
+ command: [ "java", "-jar", "/services/app.jar" ]
ports:
- "9260:8080"
networks:
- e2e
environment:
OPENAI_API_KEY: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
- SPRING_AI_OPENAI_BASE_URL: http://provider:9090/llm/v1
+ SPRING_AI_OPENAI_BASE_URL: http://mock-llm-server:9090/llm/v1
SW_AGENT_COLLECTOR_BACKEND_SERVICES: oap:11800
SW_LOGGING_OUTPUT: CONSOLE
SW_AGENT_NAME: e2e-spring-ai
- SW_AGENT_INSTANCE_NAME: spring-ai-examples
+ SW_AGENT_INSTANCE_NAME: spring-ai-service
SW_PLUGIN_SPRINGAI_COLLECT_INPUT_MESSAGES: "true"
SW_PLUGIN_SPRINGAI_COLLECT_OUTPUT_MESSAGES: "true"
healthcheck:
@@ -77,7 +74,7 @@ services:
depends_on:
oap:
condition: service_healthy
- provider:
+ mock-llm-server:
condition: service_healthy
networks:
diff --git a/test/e2e-v2/cases/zipkin-virtual-genai/docker-compose.yml b/test/e2e-v2/cases/zipkin-virtual-genai/docker-compose.yml
index ce8175c9b1..87d47057e2 100644
--- a/test/e2e-v2/cases/zipkin-virtual-genai/docker-compose.yml
+++ b/test/e2e-v2/cases/zipkin-virtual-genai/docker-compose.yml
@@ -35,15 +35,12 @@ services:
ports:
- 17912
- provider:
+ mock-llm-server:
extends:
file: ../../script/docker-compose/base-compose.yml
- service: provider
+ service: mock-llm-server
ports:
- 9090
- depends_on:
- oap:
- condition: service_healthy
provider-py:
build:
@@ -54,7 +51,7 @@ services:
ports:
- "9091:9091"
environment:
- OPENAI_BASE_URL: http://provider:9090/llm/otlp/v1
+ OPENAI_BASE_URL: http://mock-llm-server:9090/llm/otlp/v1
OPENAI_API_KEY: xxxxxxxxxxxxxxxxxxxxxxxx
OTEL_TRACES_EXPORTER: zipkin_json
OTEL_EXPORTER_ZIPKIN_ENDPOINT: http://oap:9411/api/v2/spans
@@ -62,7 +59,7 @@ services:
depends_on:
oap:
condition: service_healthy
- provider:
+ mock-llm-server:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://127.0.0.1:9091/"]
diff --git a/test/e2e-v2/java-test-service/e2e-mock-llm-server/pom.xml b/test/e2e-v2/java-test-service/e2e-mock-llm-server/pom.xml
new file mode 100644
index 0000000000..c642e8d50c
--- /dev/null
+++ b/test/e2e-v2/java-test-service/e2e-mock-llm-server/pom.xml
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one or more
+ ~ contributor license agreements. See the NOTICE file distributed with
+ ~ this work for additional information regarding copyright ownership.
+ ~ The ASF licenses this file to You under the Apache License, Version 2.0
+ ~ (the "License"); you may not use this file except in compliance with
+ ~ the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ ~
+ -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <parent>
+ <artifactId>apache-skywalking-e2e</artifactId>
+ <groupId>org.apache.skywalking</groupId>
+ <version>2.0.0</version>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <packaging>jar</packaging>
+
+ <artifactId>e2e-mock-llm-server</artifactId>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-maven-plugin</artifactId>
+ <version>${spring.boot.version}</version>
+ <configuration>
+ <executable>true</executable>
+ <addResources>true</addResources>
+ <excludeDevtools>true</excludeDevtools>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>repackage</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/test/e2e-v2/java-test-service/e2e-service-provider/src/main/java/org/apache/skywalking/e2e/controller/LLMMockController.java b/test/e2e-v2/java-test-service/e2e-mock-llm-server/src/main/java/org/apache/skywalking/e2e/mockllm/LLMMockController.java
similarity index 99%
rename from test/e2e-v2/java-test-service/e2e-service-provider/src/main/java/org/apache/skywalking/e2e/controller/LLMMockController.java
rename to test/e2e-v2/java-test-service/e2e-mock-llm-server/src/main/java/org/apache/skywalking/e2e/mockllm/LLMMockController.java
index 97e2899e87..de7e53c83a 100644
--- a/test/e2e-v2/java-test-service/e2e-service-provider/src/main/java/org/apache/skywalking/e2e/controller/LLMMockController.java
+++ b/test/e2e-v2/java-test-service/e2e-mock-llm-server/src/main/java/org/apache/skywalking/e2e/mockllm/LLMMockController.java
@@ -16,7 +16,7 @@
*
*/
-package org.apache.skywalking.e2e.controller;
+package org.apache.skywalking.e2e.mockllm;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
diff --git a/test/e2e-v2/java-test-service/e2e-mock-llm-server/src/main/java/org/apache/skywalking/e2e/mockllm/MockLLMServerApplication.java b/test/e2e-v2/java-test-service/e2e-mock-llm-server/src/main/java/org/apache/skywalking/e2e/mockllm/MockLLMServerApplication.java
new file mode 100644
index 0000000000..8b0423b27d
--- /dev/null
+++ b/test/e2e-v2/java-test-service/e2e-mock-llm-server/src/main/java/org/apache/skywalking/e2e/mockllm/MockLLMServerApplication.java
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.e2e.mockllm;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+/**
+ * A stand-in for the OpenAI-compatible LLM endpoints the GenAI e2e cases talk to. It serves both the
+ * chat completions the instrumented applications call, and the judge completions OAP's AI evaluation
+ * calls, so no case needs a real LLM provider.
+ */
+@SpringBootApplication
+public class MockLLMServerApplication {
+ public static void main(String[] args) {
+ SpringApplication.run(MockLLMServerApplication.class, args);
+ }
+}
diff --git a/test/e2e-v2/java-test-service/e2e-mock-llm-server/src/main/resources/application.yml b/test/e2e-v2/java-test-service/e2e-mock-llm-server/src/main/resources/application.yml
new file mode 100644
index 0000000000..a601b1271e
--- /dev/null
+++ b/test/e2e-v2/java-test-service/e2e-mock-llm-server/src/main/resources/application.yml
@@ -0,0 +1,21 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+server:
+ port: 9090
+
+spring:
+ main:
+ banner-mode: 'off'
diff --git a/test/e2e-v2/java-test-service/e2e-spring-ai-service/pom.xml b/test/e2e-v2/java-test-service/e2e-spring-ai-service/pom.xml
new file mode 100644
index 0000000000..c8c8cdda81
--- /dev/null
+++ b/test/e2e-v2/java-test-service/e2e-spring-ai-service/pom.xml
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one or more
+ ~ contributor license agreements. See the NOTICE file distributed with
+ ~ this work for additional information regarding copyright ownership.
+ ~ The ASF licenses this file to You under the Apache License, Version 2.0
+ ~ (the "License"); you may not use this file except in compliance with
+ ~ the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ ~
+ -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <!--
+ Spring AI requires Java 17 and Spring Boot 4, so this module cannot inherit apache-skywalking-e2e,
+ which builds the rest of the reactor at Java 8. It is listed under the parent's jdk-17 profile
+ instead, and repeats the reactor version so the jar name test/Makefile expects still resolves.
+ -->
+ <parent>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-parent</artifactId>
+ <version>4.1.1</version>
+ <relativePath/>
+ </parent>
+
+ <groupId>org.apache.skywalking</groupId>
+ <artifactId>e2e-spring-ai-service</artifactId>
+ <version>2.0.0</version>
+ <packaging>jar</packaging>
+
+ <properties>
+ <java.version>17</java.version>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <spring-ai.version>2.0.1</spring-ai.version>
+ </properties>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.springframework.ai</groupId>
+ <artifactId>spring-ai-bom</artifactId>
+ <version>${spring-ai.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-web</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework.ai</groupId>
+ <artifactId>spring-ai-starter-model-openai</artifactId>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <!-- spring-boot-starter-parent already binds the repackage goal. -->
+ <plugin>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-maven-plugin</artifactId>
+ </plugin>
+
+ <!-- Repeated from apache-skywalking-e2e, which this module cannot inherit. -->
+ <plugin>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ <version>3.1.0</version>
+ <configuration>
+ <configLocation>${maven.multiModuleProjectDirectory}/apm-checkstyle/checkStyle.xml</configLocation>
+ <encoding>UTF-8</encoding>
+ <consoleOutput>true</consoleOutput>
+ <includeTestSourceDirectory>true</includeTestSourceDirectory>
+ </configuration>
+ <executions>
+ <execution>
+ <id>validate</id>
+ <phase>process-sources</phase>
+ <goals>
+ <goal>check</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/test/e2e-v2/java-test-service/e2e-spring-ai-service/src/main/java/org/apache/skywalking/e2e/springai/SpringAIServiceApplication.java b/test/e2e-v2/java-test-service/e2e-spring-ai-service/src/main/java/org/apache/skywalking/e2e/springai/SpringAIServiceApplication.java
new file mode 100644
index 0000000000..e2a2aa3f5e
--- /dev/null
+++ b/test/e2e-v2/java-test-service/e2e-spring-ai-service/src/main/java/org/apache/skywalking/e2e/springai/SpringAIServiceApplication.java
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.e2e.springai;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+/**
+ * A Spring AI client driven by the GenAI e2e cases. It exists so the Java agent's spring-ai plugin
+ * has something real to instrument; the LLM it calls is e2e-mock-llm-server, not a live provider.
+ */
+@SpringBootApplication
+public class SpringAIServiceApplication {
+ public static void main(String[] args) {
+ SpringApplication.run(SpringAIServiceApplication.class, args);
+ }
+}
diff --git a/test/e2e-v2/java-test-service/e2e-spring-ai-service/src/main/java/org/apache/skywalking/e2e/springai/StreamingChatController.java b/test/e2e-v2/java-test-service/e2e-spring-ai-service/src/main/java/org/apache/skywalking/e2e/springai/StreamingChatController.java
new file mode 100644
index 0000000000..f15879b53e
--- /dev/null
+++ b/test/e2e-v2/java-test-service/e2e-spring-ai-service/src/main/java/org/apache/skywalking/e2e/springai/StreamingChatController.java
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.e2e.springai;
+
+import org.springframework.ai.chat.messages.UserMessage;
+import org.springframework.ai.chat.model.ChatResponse;
+import org.springframework.ai.chat.prompt.Prompt;
+import org.springframework.ai.openai.OpenAiChatModel;
+import org.springframework.http.MediaType;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+import reactor.core.publisher.Flux;
+
+@RestController
+@RequestMapping("/ai")
+public class StreamingChatController {
+ private final OpenAiChatModel chatModel;
+
+ public StreamingChatController(final OpenAiChatModel chatModel) {
+ this.chatModel = chatModel;
+ }
+
+ /**
+ * Streams a chat completion. The e2e trigger calls this; the span the agent produces for the
+ * underlying {@code ChatModel.stream} call is what the GenAI assertions are written against.
+ *
+ * @param message the prompt to send to the model
+ * @return the model's response chunks, as server-sent events
+ */
+ @GetMapping(value = "/generateStream", produces = MediaType.TEXT_EVENT_STREAM_VALUE)
+ public Flux<ChatResponse> generateStream(@RequestParam(defaultValue = "Tell me a joke") final String message) {
+ return chatModel.stream(new Prompt(new UserMessage(message)));
+ }
+}
diff --git a/test/e2e-v2/java-test-service/e2e-spring-ai-service/src/main/resources/application.yml b/test/e2e-v2/java-test-service/e2e-spring-ai-service/src/main/resources/application.yml
new file mode 100644
index 0000000000..9ab3e53424
--- /dev/null
+++ b/test/e2e-v2/java-test-service/e2e-spring-ai-service/src/main/resources/application.yml
@@ -0,0 +1,22 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+spring:
+ main:
+ banner-mode: 'off'
+ ai:
+ openai:
+ api-key: ${OPENAI_API_KEY:e2e-api-key}
+ base-url: ${SPRING_AI_OPENAI_BASE_URL:http://localhost:9090/llm/v1}
diff --git a/test/e2e-v2/java-test-service/pom.xml b/test/e2e-v2/java-test-service/pom.xml
index 1a0e04524e..b3b83575b8 100644
--- a/test/e2e-v2/java-test-service/pom.xml
+++ b/test/e2e-v2/java-test-service/pom.xml
@@ -34,6 +34,7 @@
<module>e2e-protocol</module>
<module>opentelemetry-proto</module>
<module>e2e-mock-baseline-server</module>
+ <module>e2e-mock-llm-server</module>
<module>trace-mocker</module>
</modules>
@@ -178,6 +179,21 @@
</build>
<profiles>
+ <!--
+ Spring AI requires Java 17 and Spring Boot 4, while this reactor targets Java 8 and is
+ compiled by JDK 11 on the e2e-test-java-versions leg of .github/workflows/skywalking.yaml.
+ Gating the module keeps that leg green; every job that actually runs a GenAI case pins JDK 17.
+ -->
+ <profile>
+ <id>jdk-17</id>
+ <activation>
+ <jdk>[17,)</jdk>
+ </activation>
+ <modules>
+ <module>e2e-spring-ai-service</module>
+ </modules>
+ </profile>
+
<profile>
<id>jdk-25</id>
<activation>
diff --git a/test/e2e-v2/script/docker-compose/base-compose.yml b/test/e2e-v2/script/docker-compose/base-compose.yml
index 5d18faf416..9dd1af26e0 100644
--- a/test/e2e-v2/script/docker-compose/base-compose.yml
+++ b/test/e2e-v2/script/docker-compose/base-compose.yml
@@ -132,6 +132,24 @@ services:
timeout: 60s
retries: 120
+ # The OpenAI-compatible stand-in every GenAI case talks to: the chat completions the
+ # instrumented applications call, and the judge completions OAP's AI evaluation calls.
+ # Deliberately runs without the agent -- it is test infrastructure, not a subject.
+ mock-llm-server:
+ image: "eclipse-temurin:8u322-b06-jre-focal"
+ volumes:
+ - ./../../java-test-service/e2e-mock-llm-server/target/e2e-mock-llm-server-2.0.0.jar:/mock-llm-server.jar
+ command: [ "java", "-jar", "/mock-llm-server.jar" ]
+ networks:
+ - e2e
+ expose:
+ - 9090
+ healthcheck:
+ test: ["CMD", "bash", "-c", "cat < /dev/null > /dev/tcp/127.0.0.1/9090"]
+ interval: 5s
+ timeout: 60s
+ retries: 120
+
consumer:
image: "ghcr.io/apache/skywalking-java/skywalking-java:${SW_AGENT_JAVA_COMMIT}-java${SW_AGENT_JDK_VERSION}"
volumes: