Skip to content

Commit 51e7273

Browse files
authored
Vendor the GenAI e2e Spring AI application and split out the mock LLM server (#14071)
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.
1 parent afddbd6 commit 51e7273

18 files changed

Lines changed: 402 additions & 77 deletions

File tree

‎.github/workflows/publish-docker-e2e-service.yaml‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,12 @@ jobs:
4343
with:
4444
submodules: true
4545
persist-credentials: false
46+
# e2e-spring-ai-service is a Spring Boot 4 / Spring AI module gated behind the reactor's
47+
# jdk-17 profile; without an explicit JDK this job rides the runner image default.
48+
- uses: actions/setup-java@v4
49+
with:
50+
distribution: "temurin"
51+
java-version: "17"
4652
- name: Cache local Maven repository
4753
uses: actions/cache@v4
4854
with:

‎.github/workflows/skywalking.yaml‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -815,6 +815,12 @@ jobs:
815815
registry: ghcr.io
816816
username: ${{ github.repository_owner }}
817817
password: ${{ secrets.GITHUB_TOKEN }}
818+
# The virtual-genai case builds e2e-spring-ai-service, which needs Java 17. Without this
819+
# the job silently rides whatever JDK the runner image defaults to.
820+
- uses: actions/setup-java@v4
821+
with:
822+
distribution: "temurin"
823+
java-version: "17"
818824
- name: Cache maven repository
819825
uses: actions/cache@v4
820826
with:

‎docs/en/changes/changes.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
## 11.1.0
22

33
#### Project
4+
* 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 since been abandoned, whose surviving builds all predate the 2.0.0 GA by a day and whose older builds have been pruned, so the fixture was pinned to nothing released and could no longer be rebuilt from the same bytes. Both modules are built by the existing e2e reactor and published to `ghcr.io/apache/skywalking` alongside the other e2e service images; `e2e-spring-ai-service` needs Java 17 and Spring Boot 4, so it is gated behind a new `jdk-17` profile in the e2e reactor and the jobs that build it now pin JDK 17 explicitly.
45

56
#### OAP Server
67
* 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.

‎test/Makefile‎

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ BASE_IMAGE ?= eclipse-temurin:$(JRE)
2525

2626
E2E_SERVICE_PROVIDER_NAME = e2e-service-provider
2727
E2E_SERVICE_CONSUMER_NAME = e2e-service-consumer
28+
E2E_MOCK_LLM_SERVER_NAME = e2e-mock-llm-server
29+
E2E_SPRING_AI_SERVICE_NAME = e2e-spring-ai-service
2830
TRACE_MOCKER_NAME = trace-mocker
2931

3032
.PHONY: init
@@ -35,13 +37,17 @@ init:
3537
build.e2e-service:
3638
cd $(SW_ROOT) && ./mvnw --batch-mode -f $(CONTEXT)/pom.xml clean package
3739

38-
DOCKER_TARGETS:=docker.e2e-service-provider docker.e2e-service-consumer docker.trace-mocker
40+
DOCKER_TARGETS:=docker.e2e-service-provider docker.e2e-service-consumer docker.e2e-mock-llm-server docker.e2e-spring-ai-service docker.trace-mocker
3941

4042
.PHONY: docker docker.e2e-service
4143
docker: init build.e2e-service docker.e2e-service
4244

4345
%.e2e-service-provider: NAME = $(E2E_SERVICE_PROVIDER_NAME)
4446
%.e2e-service-consumer: NAME = $(E2E_SERVICE_CONSUMER_NAME)
47+
%.e2e-mock-llm-server: NAME = $(E2E_MOCK_LLM_SERVER_NAME)
48+
%.e2e-spring-ai-service: NAME = $(E2E_SPRING_AI_SERVICE_NAME)
49+
# Spring AI requires Java 17; the shared BASE_IMAGE above is a Java 8 JRE.
50+
%.e2e-spring-ai-service: BASE_IMAGE = eclipse-temurin:17-jre
4551
%.trace-mocker: NAME = $(TRACE_MOCKER_NAME)
4652

4753
docker.%: PLATFORMS =
@@ -52,6 +58,12 @@ push.%: LOAD_OR_PUSH = --push
5258
push.docker.e2e-service-% docker.e2e-service-%: $(CONTEXT)/Dockerfile
5359
$(DOCKER_RULE)
5460

61+
push.docker.e2e-mock-llm-server docker.e2e-mock-llm-server: $(CONTEXT)/Dockerfile
62+
$(DOCKER_RULE)
63+
64+
push.docker.e2e-spring-ai-service docker.e2e-spring-ai-service: $(CONTEXT)/Dockerfile
65+
$(DOCKER_RULE)
66+
5567
push.docker.trace-mocker docker.trace-mocker: $(CONTEXT)/Dockerfile
5668
$(DOCKER_RULE)
5769

‎test/e2e-v2/cases/otlp-virtual-genai/docker-compose.yml‎

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ services:
2323
SW_RECEIVER_ZIPKIN: default
2424
SW_AI_EVALUATION: default
2525
SW_AI_EVALUATION_SAMPLE_RATE: 1000000
26-
AI_EVALUATION_ENDPOINT: http://provider:9090/llm/evaluation/v1/chat/completions
26+
AI_EVALUATION_ENDPOINT: http://mock-llm-server:9090/llm/evaluation/v1/chat/completions
2727
AI_EVALUATION_MODEL: e2e-judge
2828
AI_EVALUATION_API_KEY: e2e-api-key
2929
volumes:
@@ -41,15 +41,12 @@ services:
4141
ports:
4242
- 17912
4343

44-
provider:
44+
mock-llm-server:
4545
extends:
4646
file: ../../script/docker-compose/base-compose.yml
47-
service: provider
47+
service: mock-llm-server
4848
ports:
4949
- 9090
50-
depends_on:
51-
oap:
52-
condition: service_healthy
5350

5451
provider-py:
5552
build:
@@ -60,15 +57,15 @@ services:
6057
ports:
6158
- "9091:9091"
6259
environment:
63-
OPENAI_BASE_URL: http://provider:9090/llm/otlp/v1
60+
OPENAI_BASE_URL: http://mock-llm-server:9090/llm/otlp/v1
6461
OPENAI_API_KEY: xxxxxxxxxxxxxxxxxxxxxxxx
6562
OTEL_TRACES_EXPORTER: otlp
6663
OTEL_EXPORTER_OTLP_ENDPOINT: http://oap:11800
6764
OTEL_EXPORTER_OTLP_PROTOCOL: grpc
6865
depends_on:
6966
oap:
7067
condition: service_healthy
71-
provider:
68+
mock-llm-server:
7269
condition: service_healthy
7370
healthcheck:
7471
test: ["CMD", "curl", "-f", "http://127.0.0.1:9091/"]

‎test/e2e-v2/cases/virtual-genai/Dockerfile.provider‎

Lines changed: 0 additions & 44 deletions
This file was deleted.

‎test/e2e-v2/cases/virtual-genai/docker-compose.yml‎

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ services:
2626
environment:
2727
SW_AI_EVALUATION: default
2828
SW_AI_EVALUATION_SAMPLE_RATE: 1000000
29-
AI_EVALUATION_ENDPOINT: http://provider:9090/llm/evaluation/v1/chat/completions
29+
AI_EVALUATION_ENDPOINT: http://mock-llm-server:9090/llm/evaluation/v1/chat/completions
3030
AI_EVALUATION_MODEL: e2e-judge
3131
AI_EVALUATION_API_KEY: e2e-api-key
3232
networks:
@@ -39,34 +39,31 @@ services:
3939
ports:
4040
- 17912
4141

42-
provider:
42+
mock-llm-server:
4343
extends:
4444
file: ../../script/docker-compose/base-compose.yml
45-
service: provider
45+
service: mock-llm-server
4646
ports:
4747
- 9090
48-
depends_on:
49-
oap:
50-
condition: service_healthy
5148

52-
spring-ai-examples:
53-
build:
54-
context: .
55-
dockerfile: Dockerfile.provider
56-
args:
57-
- SW_AGENT_JDK_VERSION=17
58-
- SW_AGENT_JAVA_COMMIT=${SW_AGENT_JAVA_COMMIT}
49+
# Spring AI needs Java 17, so this pins the agent image's java17 tag rather than the
50+
# SW_AGENT_JDK_VERSION the rest of the suite runs at.
51+
spring-ai-service:
52+
image: "ghcr.io/apache/skywalking-java/skywalking-java:${SW_AGENT_JAVA_COMMIT}-java17"
53+
volumes:
54+
- ../../java-test-service/e2e-spring-ai-service/target/e2e-spring-ai-service-2.0.0.jar:/services/app.jar
55+
command: [ "java", "-jar", "/services/app.jar" ]
5956
ports:
6057
- "9260:8080"
6158
networks:
6259
- e2e
6360
environment:
6461
OPENAI_API_KEY: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
65-
SPRING_AI_OPENAI_BASE_URL: http://provider:9090/llm/v1
62+
SPRING_AI_OPENAI_BASE_URL: http://mock-llm-server:9090/llm/v1
6663
SW_AGENT_COLLECTOR_BACKEND_SERVICES: oap:11800
6764
SW_LOGGING_OUTPUT: CONSOLE
6865
SW_AGENT_NAME: e2e-spring-ai
69-
SW_AGENT_INSTANCE_NAME: spring-ai-examples
66+
SW_AGENT_INSTANCE_NAME: spring-ai-service
7067
SW_PLUGIN_SPRINGAI_COLLECT_INPUT_MESSAGES: "true"
7168
SW_PLUGIN_SPRINGAI_COLLECT_OUTPUT_MESSAGES: "true"
7269
healthcheck:
@@ -77,7 +74,7 @@ services:
7774
depends_on:
7875
oap:
7976
condition: service_healthy
80-
provider:
77+
mock-llm-server:
8178
condition: service_healthy
8279

8380
networks:

‎test/e2e-v2/cases/zipkin-virtual-genai/docker-compose.yml‎

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,12 @@ services:
3535
ports:
3636
- 17912
3737

38-
provider:
38+
mock-llm-server:
3939
extends:
4040
file: ../../script/docker-compose/base-compose.yml
41-
service: provider
41+
service: mock-llm-server
4242
ports:
4343
- 9090
44-
depends_on:
45-
oap:
46-
condition: service_healthy
4744

4845
provider-py:
4946
build:
@@ -54,15 +51,15 @@ services:
5451
ports:
5552
- "9091:9091"
5653
environment:
57-
OPENAI_BASE_URL: http://provider:9090/llm/otlp/v1
54+
OPENAI_BASE_URL: http://mock-llm-server:9090/llm/otlp/v1
5855
OPENAI_API_KEY: xxxxxxxxxxxxxxxxxxxxxxxx
5956
OTEL_TRACES_EXPORTER: zipkin_json
6057
OTEL_EXPORTER_ZIPKIN_ENDPOINT: http://oap:9411/api/v2/spans
6158
OTEL_LOG_LEVEL: debug
6259
depends_on:
6360
oap:
6461
condition: service_healthy
65-
provider:
62+
mock-llm-server:
6663
condition: service_healthy
6764
healthcheck:
6865
test: ["CMD", "curl", "-f", "http://127.0.0.1:9091/"]
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
~ Licensed to the Apache Software Foundation (ASF) under one or more
4+
~ contributor license agreements. See the NOTICE file distributed with
5+
~ this work for additional information regarding copyright ownership.
6+
~ The ASF licenses this file to You under the Apache License, Version 2.0
7+
~ (the "License"); you may not use this file except in compliance with
8+
~ the License. You may obtain a copy of the License at
9+
~
10+
~ http://www.apache.org/licenses/LICENSE-2.0
11+
~
12+
~ Unless required by applicable law or agreed to in writing, software
13+
~ distributed under the License is distributed on an "AS IS" BASIS,
14+
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
~ See the License for the specific language governing permissions and
16+
~ limitations under the License.
17+
~
18+
-->
19+
20+
<project xmlns="http://maven.apache.org/POM/4.0.0"
21+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
22+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
23+
<parent>
24+
<artifactId>apache-skywalking-e2e</artifactId>
25+
<groupId>org.apache.skywalking</groupId>
26+
<version>2.0.0</version>
27+
</parent>
28+
29+
<modelVersion>4.0.0</modelVersion>
30+
31+
<packaging>jar</packaging>
32+
33+
<artifactId>e2e-mock-llm-server</artifactId>
34+
35+
<build>
36+
<plugins>
37+
<plugin>
38+
<groupId>org.springframework.boot</groupId>
39+
<artifactId>spring-boot-maven-plugin</artifactId>
40+
<version>${spring.boot.version}</version>
41+
<configuration>
42+
<executable>true</executable>
43+
<addResources>true</addResources>
44+
<excludeDevtools>true</excludeDevtools>
45+
</configuration>
46+
<executions>
47+
<execution>
48+
<goals>
49+
<goal>repackage</goal>
50+
</goals>
51+
</execution>
52+
</executions>
53+
</plugin>
54+
</plugins>
55+
</build>
56+
</project>

test/e2e-v2/java-test-service/e2e-service-provider/src/main/java/org/apache/skywalking/e2e/controller/LLMMockController.java renamed to test/e2e-v2/java-test-service/e2e-mock-llm-server/src/main/java/org/apache/skywalking/e2e/mockllm/LLMMockController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*
1717
*/
1818

19-
package org.apache.skywalking.e2e.controller;
19+
package org.apache.skywalking.e2e.mockllm;
2020

2121
import org.springframework.web.bind.annotation.PostMapping;
2222
import org.springframework.web.bind.annotation.RequestMapping;

0 commit comments

Comments
 (0)