This is an automated email from the ASF dual-hosted git repository.

jimin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-seata-samples.git


The following commit(s) were added to refs/heads/master by this push:
     new 8a2522e0 optimize: support docker_jdk in github actions (#719)
8a2522e0 is described below

commit 8a2522e04150b52bcad52f1994d00c4baba6a754
Author: jimin <[email protected]>
AuthorDate: Sun Feb 8 22:36:44 2026 +0800

    optimize: support docker_jdk in github actions (#719)
---
 .github/workflows/E2E.yml                          |  39 +++++-
 .../org/apache/seata/config/ConfigConstants.java   |  47 +++++++
 .../seata/generator/DockerComposeGenerator.java    |  20 ++-
 .../seata/generator/DockerFileForJarGenerator.java |  41 +++++-
 .../generator/SkyWalkingE2EFileGenerator.java      |  19 ++-
 .../resources/template/application-dockerFile.ftl  |  24 +++-
 .../src/main/resources/template/jar-dockerFile.ftl |  22 +++-
 .../seata/controller/SkyWalkingController.java     |  53 ++++++++
 e2e-test/scripts/diagnose-e2e-failure.sh           | 138 +++++++++++++++++++++
 e2e-test/scripts/prepare-test.sh                   |  29 ++++-
 e2e-test/scripts/test-jdk-versions.sh              |  82 ++++++++++++
 e2e-test/scripts/test-run.sh                       |  42 +++++--
 e2e-test/seata-e2e-example.yaml                    | 121 ++++++++++++++++++
 13 files changed, 652 insertions(+), 25 deletions(-)

diff --git a/.github/workflows/E2E.yml b/.github/workflows/E2E.yml
index 276bf3b3..671f6e79 100644
--- a/.github/workflows/E2E.yml
+++ b/.github/workflows/E2E.yml
@@ -15,14 +15,32 @@ on: [ push,pull_request ]
 
 jobs:
   run_e2e:
-    name: Run E2E Test ${{ matrix.java }}, ${{ matrix.os }}
+    name: Run E2E Test (Build JDK${{ matrix.build_jdk }}, Docker JDK${{ 
matrix.docker_jdk }})
     runs-on: ${{ matrix.os }}
     env:
       DEBIAN_FRONTEND: noninteractive
     strategy:
       matrix:
         os: [ ubuntu-latest ]
-        java: [ 8, 11 ]
+        # Build JDK version - used for Maven compilation
+        build_jdk: [ 8, 11, 17 ]
+        # Docker JDK version - used in Docker images for runtime
+        docker_jdk: [ 8, 11, 17 ]
+        # Exclude some combinations to reduce test time
+        exclude:
+          # When building with JDK 8, skip testing with JDK 17
+          - build_jdk: 8
+            docker_jdk: 17
+          - build_jdk: 8
+            docker_jdk: 11
+          - build_jdk: 11
+            docker_jdk: 8
+          - build_jdk: 11
+            docker_jdk: 17
+          - build_jdk: 17
+            docker_jdk: 8
+          - build_jdk: 17
+            docker_jdk: 11
       fail-fast: false
       max-parallel: 2
     steps:
@@ -67,7 +85,7 @@ jobs:
           go-version: 1.18
         id: go
 
-      - name: Build e2e framework (use skywalking-infra-e2e pr137)
+      - name: Build e2e framework (use skywalking-infra-e2e v1.3.0)
         run: |
           cd skywalking-infra-e2e && git checkout 
1485ae03f0ad90496ad7626a5ae4a6a73a1f6296 && make linux
 
@@ -78,11 +96,20 @@ jobs:
           chmod 777 e2e
           cp e2e /usr/local/bin
 
-      - name: Set up JDK ${{ matrix.java }}
+      - name: Set up JDK ${{ matrix.build_jdk }} for build
         uses: actions/setup-java@v3
         with:
           distribution: 'zulu'
-          java-version: ${{ matrix.java }}
+          java-version: ${{ matrix.build_jdk }}
+
+      - name: Set Docker JDK base image
+        run: |
+          echo "=========================================="
+          echo "E2E Test Configuration:"
+          echo "Build JDK Version: ${{ matrix.build_jdk }}"
+          echo "Docker Runtime JDK Version: ${{ matrix.docker_jdk }}"
+          echo "=========================================="
+          echo "E2E_JDK_BASE_IMAGE=${{ matrix.docker_jdk }}" >> $GITHUB_ENV
 
       - name: prepare e2e tests
         run: |
@@ -166,7 +193,7 @@ jobs:
         if: always()  # 无论成败都上传日志(失败时必传,成功时可选)
         uses: actions/upload-artifact@v4
         with:
-          name: e2e-debug-logs-${{ matrix.java }}
+          name: e2e-debug-logs-${{ matrix.build_jdk }}
           path: |
             e2e-test/scripts/e2e-test-log.txt
             /var/log/docker.log || true
diff --git 
a/e2e-test/e2e-test-builder/src/main/java/org/apache/seata/config/ConfigConstants.java
 
b/e2e-test/e2e-test-builder/src/main/java/org/apache/seata/config/ConfigConstants.java
index a0830882..dc2d6ae7 100644
--- 
a/e2e-test/e2e-test-builder/src/main/java/org/apache/seata/config/ConfigConstants.java
+++ 
b/e2e-test/e2e-test-builder/src/main/java/org/apache/seata/config/ConfigConstants.java
@@ -16,6 +16,9 @@
  */
 package org.apache.seata.config;
 
+import java.util.HashMap;
+import java.util.Map;
+
 /**
  * @author [email protected]
  */
@@ -30,4 +33,48 @@ public class ConfigConstants {
     public static final String IMAGE_VERSION = "0.0.1";
     public static final String DOCKER_SERVICE_JAR_TYPE = "Jar";
     public static final String DOCKER_SERVICE_APPLICATION_TYPE = "Application";
+    
+    // JDK base image configuration
+    public static final String DEFAULT_BASE_IMAGE = "openjdk:8-jdk-alpine";
+    public static final String ENV_JDK_BASE_IMAGE = "E2E_JDK_BASE_IMAGE";
+    
+    // Predefined JDK image mapping
+    private static final Map<String, String> JDK_IMAGE_MAP = new 
HashMap<String, String>() {{
+        put("8", "eclipse-temurin:8-jdk-alpine");
+        put("11", "eclipse-temurin:8-jdk-alpine");
+        put("17", "eclipse-temurin:17-jdk-alpine");
+        put("21", "eclipse-temurin:21-jdk-alpine");
+        // Support for different distributions
+        put("8-zulu", "azul/zulu-openjdk:8");
+        put("11-zulu", "azul/zulu-openjdk:11");
+        put("17-zulu", "azul/zulu-openjdk:17");
+        put("21-zulu", "azul/zulu-openjdk:21");
+    }};
+    
+    /**
+     * Get base image for Docker build
+     * Priority: Environment Variable > Default Value
+     * 
+     * @return base image string
+     */
+    public static String getBaseImage() {
+        String envImage = System.getenv(ENV_JDK_BASE_IMAGE);
+        if (envImage != null && !envImage.isEmpty()) {
+            // If it's a full image name (contains : or /), use it directly
+            if (envImage.contains(":") || envImage.contains("/")) {
+                System.out.println("[E2E] Using custom base image from 
environment: " + envImage);
+                return envImage;
+            }
+            // Otherwise, lookup from the predefined mapping
+            String mappedImage = JDK_IMAGE_MAP.get(envImage);
+            if (mappedImage != null) {
+                System.out.println("[E2E] Using mapped base image for JDK " + 
envImage + ": " + mappedImage);
+                return mappedImage;
+            }
+            System.out.println("[E2E] Warning: Unknown JDK version '" + 
envImage + "', using default: " + DEFAULT_BASE_IMAGE);
+        } else {
+            System.out.println("[E2E] Using default base image: " + 
DEFAULT_BASE_IMAGE);
+        }
+        return DEFAULT_BASE_IMAGE;
+    }
 }
diff --git 
a/e2e-test/e2e-test-builder/src/main/java/org/apache/seata/generator/DockerComposeGenerator.java
 
b/e2e-test/e2e-test-builder/src/main/java/org/apache/seata/generator/DockerComposeGenerator.java
index 109695d8..a737a88f 100644
--- 
a/e2e-test/e2e-test-builder/src/main/java/org/apache/seata/generator/DockerComposeGenerator.java
+++ 
b/e2e-test/e2e-test-builder/src/main/java/org/apache/seata/generator/DockerComposeGenerator.java
@@ -27,6 +27,7 @@ import org.slf4j.LoggerFactory;
 import java.io.File;
 import java.io.FileWriter;
 import java.io.IOException;
+import java.nio.file.Files;
 import java.util.HashMap;
 import java.util.Map;
 
@@ -58,8 +59,25 @@ public class DockerComposeGenerator {
             Modules modules = e2EConfig.getModules();
             Map<String, Object> map = new HashMap<>();
             map.put("modules", modules);
+            
+            File composeFile = new File(file, COMPOSE_FILE);
             cfg.getTemplate("dockercompose.ftl")
-                    .process(map, new FileWriter(new File(file, 
COMPOSE_FILE)));
+                    .process(map, new FileWriter(composeFile));
+            
+            // Log the generated docker-compose.yaml content
+            LOGGER.info("==========================================");
+            LOGGER.info("Generated docker-compose.yaml for scene: {}", 
e2EConfig.getScene_name());
+            LOGGER.info("Location: {}", composeFile.getAbsolutePath());
+            LOGGER.info("==========================================");
+            
+            try {
+                String content = new 
String(Files.readAllBytes(composeFile.toPath()));
+                LOGGER.info("Content:\n{}", content);
+                LOGGER.info("==========================================");
+            } catch (IOException ex) {
+                LOGGER.warn("Could not read docker-compose.yaml content for 
logging", ex);
+            }
+            
         } catch (TemplateException | IOException e) {
             LOGGER.error(String.format("generate docker-compose file for %s 
fail", e2EConfig.getScene_name()
                     + "-" + e2EConfig.getScene_name()), e);
diff --git 
a/e2e-test/e2e-test-builder/src/main/java/org/apache/seata/generator/DockerFileForJarGenerator.java
 
b/e2e-test/e2e-test-builder/src/main/java/org/apache/seata/generator/DockerFileForJarGenerator.java
index 5f67c47a..fa0c2771 100644
--- 
a/e2e-test/e2e-test-builder/src/main/java/org/apache/seata/generator/DockerFileForJarGenerator.java
+++ 
b/e2e-test/e2e-test-builder/src/main/java/org/apache/seata/generator/DockerFileForJarGenerator.java
@@ -83,10 +83,28 @@ public class DockerFileForJarGenerator {
         String moduleComposeDir = new File(composeDir, 
e2EConfig.getScene_name() + "-"
                 + module.getName()).getAbsolutePath();
         try {
+            String baseImage = ConfigConstants.getBaseImage();
             Map<String, Object> props = new HashMap<>();
             props.put("sourceJar", module.getName() + ".jar");
+            props.put("baseImage", baseImage);
+            LOGGER.info("Generating Dockerfile for module {} with base image: 
{}", module.getName(), baseImage);
+            
+            File dockerFile = new File(moduleComposeDir, "Dockerfile");
             cfg.getTemplate("application-dockerFile.ftl")
-                    .process(props, new FileWriter(new File(moduleComposeDir, 
"Dockerfile")));
+                    .process(props, new FileWriter(dockerFile));
+            
+            // Log the generated Dockerfile content
+            LOGGER.info("------------------------------------------");
+            LOGGER.info("Dockerfile for module: {}", module.getName());
+            LOGGER.info("Location: {}", dockerFile.getAbsolutePath());
+            LOGGER.info("------------------------------------------");
+            try {
+                String content = new 
String(Files.readAllBytes(dockerFile.toPath()));
+                LOGGER.info("Content:\n{}", content);
+                LOGGER.info("------------------------------------------");
+            } catch (IOException ex) {
+                LOGGER.warn("Could not read Dockerfile content for logging", 
ex);
+            }
         } catch (TemplateException | IOException e) {
             LOGGER.error(String.format("generate docker file %s fail", 
e2EConfig.getScene_name()
                     + "-" + module.getName()), e);
@@ -97,13 +115,32 @@ public class DockerFileForJarGenerator {
         String moduleComposeDir = new File(composeDir, 
e2EConfig.getScene_name() + "-"
                 + module.getName()).getAbsolutePath();
         try {
+            String baseImage = ConfigConstants.getBaseImage();
             Map<String, Object> props = new HashMap<>();
             props.put("sourceJar", module.getName() + ".jar");
+            props.put("baseImage", baseImage);
+            LOGGER.info("Generating Dockerfile (Jar mode) for module {} with 
base image: {}", module.getName(), baseImage);
+            
+            File dockerFile = new File(moduleComposeDir, "Dockerfile");
             cfg.getTemplate("jar-dockerFile.ftl")
-                    .process(props, new FileWriter(new File(moduleComposeDir, 
"Dockerfile")));
+                    .process(props, new FileWriter(dockerFile));
+            
             URL entryPoint = 
this.getClass().getClassLoader().getResource("sh/entrypoint.sh");
             Path destPath = Paths.get(moduleComposeDir, "entrypoint.sh");
             Files.copy(Paths.get(entryPoint.toURI()), destPath, 
StandardCopyOption.REPLACE_EXISTING);
+            
+            // Log the generated Dockerfile content
+            LOGGER.info("------------------------------------------");
+            LOGGER.info("Dockerfile (Jar mode) for module: {}", 
module.getName());
+            LOGGER.info("Location: {}", dockerFile.getAbsolutePath());
+            LOGGER.info("------------------------------------------");
+            try {
+                String content = new 
String(Files.readAllBytes(dockerFile.toPath()));
+                LOGGER.info("Content:\n{}", content);
+                LOGGER.info("------------------------------------------");
+            } catch (IOException ex) {
+                LOGGER.warn("Could not read Dockerfile content for logging", 
ex);
+            }
         } catch (TemplateException | IOException | URISyntaxException e) {
             LOGGER.error(String.format("generate docker file %s fail", 
e2EConfig.getScene_name()
                     + "-" + module.getName()), e);
diff --git 
a/e2e-test/e2e-test-builder/src/main/java/org/apache/seata/generator/SkyWalkingE2EFileGenerator.java
 
b/e2e-test/e2e-test-builder/src/main/java/org/apache/seata/generator/SkyWalkingE2EFileGenerator.java
index c93eb81c..b9302bbb 100644
--- 
a/e2e-test/e2e-test-builder/src/main/java/org/apache/seata/generator/SkyWalkingE2EFileGenerator.java
+++ 
b/e2e-test/e2e-test-builder/src/main/java/org/apache/seata/generator/SkyWalkingE2EFileGenerator.java
@@ -27,6 +27,7 @@ import org.slf4j.LoggerFactory;
 import java.io.File;
 import java.io.FileWriter;
 import java.io.IOException;
+import java.nio.file.Files;
 import java.util.HashMap;
 import java.util.Map;
 
@@ -56,8 +57,24 @@ public class SkyWalkingE2EFileGenerator {
             Map<String, Object> map = new HashMap<>();
             map.put("retry", e2EConfig.getRetry());
             map.put("cases", e2EConfig.getCases());
+            
+            File e2eFile = new File(file, 
ConfigConstants.SKY_WALKING_E2E_FILE);
             cfg.getTemplate("skywalking-e2e.ftl")
-                    .process(map, new FileWriter(new File(file, 
ConfigConstants.SKY_WALKING_E2E_FILE)));
+                    .process(map, new FileWriter(e2eFile));
+            
+            // Log the generated e2e.yaml content
+            LOGGER.info("==========================================");
+            LOGGER.info("Generated e2e.yaml for scene: {}", 
e2EConfig.getScene_name());
+            LOGGER.info("Location: {}", e2eFile.getAbsolutePath());
+            LOGGER.info("==========================================");
+            
+            try {
+                String content = new 
String(Files.readAllBytes(e2eFile.toPath()));
+                LOGGER.info("Content:\n{}", content);
+                LOGGER.info("==========================================");
+            } catch (IOException ex) {
+                LOGGER.warn("Could not read e2e.yaml content for logging", ex);
+            }
         } catch (TemplateException | IOException e) {
             LOGGER.error(String.format("generate SkyWalking e2e test file for 
%s fail", e2EConfig.getScene_name()
                     + "-" + e2EConfig.getScene_name()), e);
diff --git 
a/e2e-test/e2e-test-builder/src/main/resources/template/application-dockerFile.ftl
 
b/e2e-test/e2e-test-builder/src/main/resources/template/application-dockerFile.ftl
index 8207af62..8de118b4 100644
--- 
a/e2e-test/e2e-test-builder/src/main/resources/template/application-dockerFile.ftl
+++ 
b/e2e-test/e2e-test-builder/src/main/resources/template/application-dockerFile.ftl
@@ -15,7 +15,25 @@
     limitations under the License.
 -->
 
-FROM eclipse-temurin:8-jdk-alpine
-RUN apk --no-cache add curl
+FROM ${baseImage!"eclipse-temurin:8-jdk-alpine"}
+RUN apk --no-cache add curl bash
 COPY ${sourceJar} /app.jar
-ENTRYPOINT ["java","-jar","/app.jar"]
\ No newline at end of file
+
+# Create startup script with JDK version logging
+RUN printf '#!/bin/bash\n\
+echo "=========================================="\n\
+echo "Seata E2E Test Container Starting..."\n\
+echo "=========================================="\n\
+echo "Base Image: ${baseImage!"openjdk:8-jdk-alpine"}"\n\
+echo "Java Version:"\n\
+java -version 2>&1\n\
+echo "=========================================="\n\
+echo "Container Info:"\n\
+echo "Hostname: $(hostname)"\n\
+echo "Start Time: $(date)"\n\
+echo "=========================================="\n\
+echo "Starting Application..."\n\
+exec java -jar /app.jar\n' > /startup.sh && \
+    chmod +x /startup.sh
+
+ENTRYPOINT ["/startup.sh"]
\ No newline at end of file
diff --git 
a/e2e-test/e2e-test-builder/src/main/resources/template/jar-dockerFile.ftl 
b/e2e-test/e2e-test-builder/src/main/resources/template/jar-dockerFile.ftl
index ff7ca87c..7729d67a 100644
--- a/e2e-test/e2e-test-builder/src/main/resources/template/jar-dockerFile.ftl
+++ b/e2e-test/e2e-test-builder/src/main/resources/template/jar-dockerFile.ftl
@@ -15,8 +15,26 @@
     limitations under the License.
 -->
 
-FROM eclipse-temurin:8-jdk-alpine
+FROM ${baseImage!"eclipse-temurin:8-jdk-alpine"}
+RUN apk --no-cache add bash
 COPY ${sourceJar} /app.jar
 COPY entrypoint.sh /entrypoint.sh
 RUN chmod +x /entrypoint.sh
-ENTRYPOINT ["/entrypoint.sh"]
\ No newline at end of file
+
+# Log JDK version information on container start
+RUN printf '#!/bin/bash\n\
+echo "=========================================="\n\
+echo "Seata E2E Test Container (Jar Mode)"\n\
+echo "=========================================="\n\
+echo "Base Image: ${baseImage!"openjdk:8-jdk-alpine"}"\n\
+echo "Java Version:"\n\
+java -version 2>&1\n\
+echo "=========================================="\n\
+echo "Container Info:"\n\
+echo "Hostname: $(hostname)"\n\
+echo "Start Time: $(date)"\n\
+echo "=========================================="\n\
+exec /entrypoint.sh\n' > /log-jdk-info.sh && \
+    chmod +x /log-jdk-info.sh
+
+ENTRYPOINT ["/log-jdk-info.sh"]
\ No newline at end of file
diff --git 
a/e2e-test/e2e-test-runner/src/main/java/org/apache/seata/controller/SkyWalkingController.java
 
b/e2e-test/e2e-test-runner/src/main/java/org/apache/seata/controller/SkyWalkingController.java
index 2e4d1729..e554fb0e 100644
--- 
a/e2e-test/e2e-test-runner/src/main/java/org/apache/seata/controller/SkyWalkingController.java
+++ 
b/e2e-test/e2e-test-runner/src/main/java/org/apache/seata/controller/SkyWalkingController.java
@@ -118,6 +118,10 @@ public class SkyWalkingController {
             if (exitCode != 0) {
                 LOGGER.warn(String.format(" Seate e2e test %s by 
SkyWalking-E2E fail with exit code %d",
                         file.getName(), exitCode));
+                
+                // Print diagnostic information on failure
+                printDiagnosticInfo(file);
+                
                 return exitCode;
             }
         } catch (Exception e) {
@@ -127,4 +131,53 @@ public class SkyWalkingController {
 
         return 0;
     }
+    
+    private static void printDiagnosticInfo(File testDir) {
+        LOGGER.error("==========================================");
+        LOGGER.error("DIAGNOSTIC INFORMATION FOR FAILED TEST");
+        LOGGER.error("Test Directory: {}", testDir.getAbsolutePath());
+        LOGGER.error("==========================================");
+        
+        // Print docker-compose.yaml
+        File composeFile = new File(testDir, "docker-compose.yaml");
+        if (composeFile.exists()) {
+            try {
+                String content = new 
String(java.nio.file.Files.readAllBytes(composeFile.toPath()));
+                LOGGER.error("docker-compose.yaml content:\n{}", content);
+            } catch (Exception e) {
+                LOGGER.error("Failed to read docker-compose.yaml", e);
+            }
+        } else {
+            LOGGER.error("docker-compose.yaml NOT FOUND!");
+        }
+        
+        LOGGER.error("------------------------------------------");
+        
+        // Print e2e.yaml
+        File e2eFile = new File(testDir, "e2e.yaml");
+        if (e2eFile.exists()) {
+            try {
+                String content = new 
String(java.nio.file.Files.readAllBytes(e2eFile.toPath()));
+                LOGGER.error("e2e.yaml content:\n{}", content);
+            } catch (Exception e) {
+                LOGGER.error("Failed to read e2e.yaml", e);
+            }
+        }
+        
+        LOGGER.error("------------------------------------------");
+        
+        // Try to get docker-compose logs
+        try {
+            LOGGER.error("Attempting to get docker-compose logs...");
+            ProcessBuilder logsBuilder = new ProcessBuilder("docker-compose", 
"logs", "--tail=50");
+            logsBuilder.directory(testDir);
+            Process logsProcess = logsBuilder.start();
+            printProcessLog(LOGGER, logsProcess);
+            logsProcess.waitFor();
+        } catch (Exception e) {
+            LOGGER.error("Failed to get docker-compose logs", e);
+        }
+        
+        LOGGER.error("==========================================");
+    }
 }
diff --git a/e2e-test/scripts/diagnose-e2e-failure.sh 
b/e2e-test/scripts/diagnose-e2e-failure.sh
new file mode 100644
index 00000000..d4586b0e
--- /dev/null
+++ b/e2e-test/scripts/diagnose-e2e-failure.sh
@@ -0,0 +1,138 @@
+#!/bin/bash
+
+#
+# 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.
+#
+
+# E2E Test Failure Diagnostic Script
+
+SCENE_NAME=${1:-"saga-spring-seata-saga"}
+
+echo "=========================================="
+echo "E2E Test Failure Diagnostic Tool"
+echo "=========================================="
+echo "Diagnosing scene: $SCENE_NAME"
+echo ""
+
+DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+PROJECT_DIR="$(dirname "$(dirname "$DIR")")"
+SCENE_DIR="$PROJECT_DIR/tmp/scene-test/$SCENE_NAME"
+
+if [ ! -d "$SCENE_DIR" ]; then
+    echo "[ERROR] Scene directory not found: $SCENE_DIR"
+    echo "Please run prepare-test.sh first."
+    exit 1
+fi
+
+cd "$SCENE_DIR"
+
+echo "[INFO] Checking docker-compose.yaml..."
+if [ -f "docker-compose.yaml" ]; then
+    echo "✓ docker-compose.yaml exists"
+    echo ""
+    echo "--- docker-compose.yaml content (first 30 lines) ---"
+    head -n 30 docker-compose.yaml
+    echo ""
+else
+    echo "✗ docker-compose.yaml NOT found!"
+    exit 1
+fi
+
+echo "[INFO] Checking generated Dockerfiles..."
+IMAGE_DIRS=$(find "$PROJECT_DIR/tmp/images" -type d -name "${SCENE_NAME}*" 
2>/dev/null)
+if [ -n "$IMAGE_DIRS" ]; then
+    for img_dir in $IMAGE_DIRS; do
+        echo ""
+        echo "--- Dockerfile in $img_dir ---"
+        if [ -f "$img_dir/Dockerfile" ]; then
+            cat "$img_dir/Dockerfile"
+            echo ""
+            
+            # Try to build the image
+            echo "[INFO] Testing Docker image build..."
+            cd "$img_dir"
+            docker build --no-cache -t "test-$(basename $img_dir)" . 2>&1 | 
tail -n 20
+            BUILD_RESULT=${PIPESTATUS[0]}
+            if [ $BUILD_RESULT -eq 0 ]; then
+                echo "✓ Docker image built successfully"
+            else
+                echo "✗ Docker image build FAILED (exit code: $BUILD_RESULT)"
+            fi
+        fi
+    done
+fi
+
+cd "$SCENE_DIR"
+
+echo ""
+echo "[INFO] Validating docker-compose configuration..."
+docker-compose config > /dev/null 2>&1
+if [ $? -eq 0 ]; then
+    echo "✓ docker-compose.yaml syntax is valid"
+else
+    echo "✗ docker-compose.yaml has syntax errors:"
+    docker-compose config 2>&1
+    exit 1
+fi
+
+echo ""
+echo "[INFO] Attempting to start services with detailed logs..."
+echo "This will start the containers and show startup logs..."
+echo ""
+
+# Clean up any existing containers
+docker-compose down -v 2>/dev/null
+
+# Try to start with logs
+timeout 60s docker-compose up --abort-on-container-exit 2>&1 | tee 
/tmp/docker-compose-diagnostic.log
+
+echo ""
+echo "=========================================="
+echo "Diagnostic Summary"
+echo "=========================================="
+
+# Check for common issues in logs
+if grep -q "port is already allocated" /tmp/docker-compose-diagnostic.log; then
+    echo "⚠ Port conflict detected - some ports are already in use"
+fi
+
+if grep -q "No such file or directory" /tmp/docker-compose-diagnostic.log; then
+    echo "⚠ Missing file detected - check volume mounts"
+fi
+
+if grep -q "executable file not found" /tmp/docker-compose-diagnostic.log; then
+    echo "⚠ Script execution error - check entrypoint scripts"
+fi
+
+if grep -q "cannot execute binary file" /tmp/docker-compose-diagnostic.log; 
then
+    echo "⚠ Binary compatibility issue - check base image architecture"
+fi
+
+echo ""
+echo "[INFO] Full diagnostic log saved to: /tmp/docker-compose-diagnostic.log"
+echo ""
+echo "To manually inspect:"
+echo "  cd $SCENE_DIR"
+echo "  docker-compose up"
+echo ""
+echo "To check container logs:"
+echo "  docker-compose logs <service_name>"
+echo ""
+echo "To clean up:"
+echo "  cd $SCENE_DIR"
+echo "  docker-compose down -v"
+echo ""
+
diff --git a/e2e-test/scripts/prepare-test.sh b/e2e-test/scripts/prepare-test.sh
index 6c31af70..4ac79b53 100644
--- a/e2e-test/scripts/prepare-test.sh
+++ b/e2e-test/scripts/prepare-test.sh
@@ -17,18 +17,41 @@
 # limitations under the License.
 #
 
-echo "start prepare Seata e2e test scene"
+echo "=========================================="
+echo "Start Preparing Seata E2E Test Scenes"
+echo "=========================================="
+
+# Print environment information
+echo "[INFO] Build Environment:"
+echo "  - Build Time: $(date)"
+echo "  - Java Version: $(java -version 2>&1 | head -n 1)"
+if [ -n "$E2E_JDK_BASE_IMAGE" ]; then
+  echo "  - Docker Base Image: $E2E_JDK_BASE_IMAGE"
+else
+  echo "  - Docker Base Image: openjdk:8-jdk-alpine (default)"
+fi
+echo "=========================================="
+
 DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
 TEST_DIR="$(dirname "$DIR")"
 PROJECT_DIR="$(dirname "$(dirname "$DIR")")"
+
+echo "[INFO] Building e2e-test-builder module..."
 cd $TEST_DIR/e2e-test-builder
 mvn clean install -DskipTests
 result=$?
 if [ $result -ne 0 ]; then
-  echo "Build seata e2e-test-builder failure"
+  echo "[ERROR] Build seata e2e-test-builder failure"
   exit $result
 fi
+
+echo "[INFO] Copying e2e-test-builder jar..."
 cd $PROJECT_DIR
 cp 
$TEST_DIR/e2e-test-builder/target/e2e-test-builder-*-jar-with-dependencies.jar 
$PROJECT_DIR/e2e-test-builder.jar
+
+echo "[INFO] Generating test scenes and Docker images..."
 java -jar ./e2e-test-builder.jar ./
-echo "finish prepare Seata e2e test scene"
\ No newline at end of file
+
+echo "=========================================="
+echo "Finish Preparing Seata E2E Test Scenes"
+echo "=========================================="
\ No newline at end of file
diff --git a/e2e-test/scripts/test-jdk-versions.sh 
b/e2e-test/scripts/test-jdk-versions.sh
new file mode 100644
index 00000000..7a0081ae
--- /dev/null
+++ b/e2e-test/scripts/test-jdk-versions.sh
@@ -0,0 +1,82 @@
+#!/bin/bash
+
+#
+# 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.
+#
+
+# This script tests different JDK versions for E2E testing
+
+echo "=========================================="
+echo "Seata E2E Multi-JDK Version Test Script"
+echo "=========================================="
+
+# Array of JDK versions to test
+JDK_VERSIONS=("8" "11" "17")
+
+DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+PROJECT_DIR="$(dirname "$(dirname "$DIR")")"
+
+# Test each JDK version
+for jdk_version in "${JDK_VERSIONS[@]}"
+do
+    echo ""
+    echo "=========================================="
+    echo "Testing with JDK Version: $jdk_version"
+    echo "=========================================="
+    
+    export E2E_JDK_BASE_IMAGE="$jdk_version"
+    
+    echo "[INFO] Running prepare-test.sh with JDK $jdk_version..."
+    cd "$DIR"
+    sh prepare-test.sh
+    
+    if [ $? -ne 0 ]; then
+        echo "[ERROR] prepare-test.sh failed for JDK $jdk_version"
+        exit 1
+    fi
+    
+    echo "[INFO] Checking generated Dockerfile..."
+    # Find first generated Dockerfile and verify it contains the correct base 
image
+    dockerfile=$(find "$PROJECT_DIR/tmp/images" -name "Dockerfile" -type f | 
head -n 1)
+    if [ -n "$dockerfile" ]; then
+        echo "[INFO] Sample Dockerfile content:"
+        head -n 5 "$dockerfile"
+        
+        # Verify base image is correct
+        if grep -q "FROM.*$jdk_version" "$dockerfile" || grep -q "FROM 
openjdk:$jdk_version" "$dockerfile"; then
+            echo "[SUCCESS] ✓ Dockerfile contains correct JDK version"
+        else
+            echo "[WARNING] ⚠ Dockerfile may not contain expected JDK version"
+        fi
+    else
+        echo "[WARNING] No Dockerfile found in tmp/images"
+    fi
+    
+    echo "[INFO] Cleaning up tmp directory..."
+    rm -rf "$PROJECT_DIR/tmp"
+    
+    echo "[SUCCESS] JDK $jdk_version test preparation completed"
+done
+
+echo ""
+echo "=========================================="
+echo "All JDK version tests completed!"
+echo "=========================================="
+echo ""
+echo "Note: This script only tests the preparation phase."
+echo "To run full E2E tests, use: sh test-run.sh"
+echo ""
+
diff --git a/e2e-test/scripts/test-run.sh b/e2e-test/scripts/test-run.sh
index 1cc81079..ef58caf9 100644
--- a/e2e-test/scripts/test-run.sh
+++ b/e2e-test/scripts/test-run.sh
@@ -17,32 +17,60 @@
 # limitations under the License.
 #
 
-echo "start run Seata e2e test scene"
+echo "=========================================="
+echo "Start Running Seata E2E Test Scenes"
+echo "=========================================="
+
+# Print test environment information
+echo "[INFO] Test Environment:"
+echo "  - Test Time: $(date)"
+echo "  - Java Version: $(java -version 2>&1 | head -n 1)"
+if [ -n "$E2E_JDK_BASE_IMAGE" ]; then
+  echo "  - Docker Runtime JDK: $E2E_JDK_BASE_IMAGE"
+else
+  echo "  - Docker Runtime JDK: openjdk:8-jdk-alpine (default)"
+fi
+echo "=========================================="
+
 DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
 TEST_DIR="$(dirname "$DIR")"
 PROJECT_DIR="$(dirname "$(dirname "$DIR")")"
+
+echo "[INFO] Building e2e-test module..."
 cd $TEST_DIR
 mvn clean install -DskipTests
 result=$?
 if [ $result -ne 0 ]; then
-  echo "Build seata e2e-test failure"
+  echo "[ERROR] Build seata e2e-test failure"
   exit $result
 fi
+
+echo "[INFO] Building e2e-test-runner module..."
 cd $TEST_DIR/e2e-test-runner
 mvn clean install -DskipTests
 result=$?
 if [ $result -ne 0 ]; then
-  echo "Build seata e2e-test-runner failure"
+  echo "[ERROR] Build seata e2e-test-runner failure"
   exit $result
 fi
+
+echo "[INFO] Copying e2e-test-runner jar..."
 cd $PROJECT_DIR
 cp 
$TEST_DIR/e2e-test-runner/target/e2e-test-runner-*-jar-with-dependencies.jar 
$PROJECT_DIR/e2e-test-runner.jar
-echo "start run seata test by skywalking e2e framework"
+
+echo "=========================================="
+echo "[INFO] Running tests by SkyWalking E2E framework"
+echo "=========================================="
 pwd
 java -jar ./e2e-test-runner.jar ./tmp/scene-test
 result=$?
+
+echo "=========================================="
 if [ $result -ne 0 ]; then
-  echo "run seata e2e-test-runner failure"
+  echo "[ERROR] E2E test execution failed with exit code: $result"
+  echo "=========================================="
   exit $result
-fi
-echo "finish run Seata e2e test scene"
\ No newline at end of file
+else
+  echo "[SUCCESS] All E2E tests passed!"
+  echo "=========================================="
+fi
\ No newline at end of file
diff --git a/e2e-test/seata-e2e-example.yaml b/e2e-test/seata-e2e-example.yaml
new file mode 100644
index 00000000..009d4252
--- /dev/null
+++ b/e2e-test/seata-e2e-example.yaml
@@ -0,0 +1,121 @@
+#
+# 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.
+#
+
+# Seata E2E Configuration Example with Module Type
+# This file demonstrates how to configure different module types
+
+e2e:
+  scene_name: example-scene
+  
+  # Retry configuration
+  retry:
+    max: 5
+    interval: 20s
+    total_timeout: 20m
+  
+  # Service modules
+  modules:
+    # Consumer services (业务调用方)
+    consumers:
+      - name: business-service
+        # Optional: Specify module type
+        # - "Application": Use application-dockerFile.ftl (auto-start with 
java -jar)
+        # - "Jar": Use jar-dockerFile.ftl (container keeps running, manual 
start)
+        # - If not specified: defaults to "Application"
+        moduleType: Application
+        docker_service:
+          hostname: business-service
+          restart: on-failure
+          container_name: test
+          depends_on:
+            account-service:
+              condition: service_started
+          environment:
+            SEATA_SERVER: seata
+    
+    # Provider services (业务服务提供方)
+    providers:
+      - name: account-service
+        # Example: Using Jar mode (container keeps running)
+        moduleType: Jar
+        docker_service:
+          hostname: account-service
+          restart: on-failure
+          depends_on:
+            mysql:
+              condition: service_healthy
+          environment:
+            MYSQL_HOST: mysql
+            
+      - name: order-service
+        # Default mode (Application) - no need to specify
+        docker_service:
+          hostname: order-service
+          restart: on-failure
+          depends_on:
+            mysql:
+              condition: service_healthy
+    
+    # Infrastructure services (基础设施)
+    infrastructures:
+      - name: mysql
+        docker_service:
+          hostname: mysql
+          image: mysql:5.7
+          volumes:
+            - ./e2e-files/init.sql:/docker-entrypoint-initdb.d/init.sql
+          restart: always
+          environment:
+            MYSQL_ROOT_PASSWORD: 123456
+            MYSQL_DATABASE: seata
+          healthcheck:
+            test: '[ "CMD", "mysqladmin" ,"ping", "-h", "localhost" ]'
+            interval: 5s
+            timeout: 10s
+            retries: 10
+            
+      - name: seata-server
+        docker_service:
+          hostname: seata
+          image: apache/seata-server:2.1.0
+          environment:
+            SEATA_PORT: 8091
+            STORE_MODE: file
+
+  # Test cases to verify
+  cases:
+    - name: rollback test
+      invoke: 'docker exec test curl http://127.0.0.1:8080/testRollback'
+      verify: './e2e-files/rollback.yaml'
+    
+    - name: commit test
+      invoke: 'docker exec test curl http://127.0.0.1:8080/testCommit'
+      verify: './e2e-files/commit.yaml'
+
+# JDK Version Configuration (via environment variable)
+# Set E2E_JDK_BASE_IMAGE environment variable before running prepare-test.sh:
+#
+# Quick version (uses predefined mapping):
+#   export E2E_JDK_BASE_IMAGE=11
+#   export E2E_JDK_BASE_IMAGE=17
+#
+# Full image name:
+#   export E2E_JDK_BASE_IMAGE=openjdk:11-jdk-alpine
+#   export E2E_JDK_BASE_IMAGE=azul/zulu-openjdk-alpine:17
+#
+# Default (if not set): openjdk:8-jdk-alpine
+


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]


Reply via email to