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

dataroaring pushed a commit to branch branch-3.0
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-3.0 by this push:
     new 3244fab41ca [fix](doris compose) fix docker py exception (#39976)
3244fab41ca is described below

commit 3244fab41caac4caef966852ba177b0db4fb4924
Author: yujun <yu.jun.re...@gmail.com>
AuthorDate: Wed Aug 28 23:04:17 2024 +0800

    [fix](doris compose) fix docker py exception (#39976)
    
    ```
    Exception:
    java.lang.Exception: Exit value: 1 != 0, stdout: {
        "code": 1,
        "err": "Traceback (most recent call last):\n  File 
\"/home/ubuntu/regression-test/doris_master/NEREIDS_ASAN/p0/docker/runtime/doris-compose/command.py\",
 line 336, in run\n    cluster = CLUSTER.Cluster.load(args.NAME)\n  File 
\"/home/ubuntu/regression-test/doris_master/NEREIDS_ASAN/p0/docker/runtime/doris-compose/cluster.py\",
 line 656, in load\n    raise Exception(\nException: Failed to load cluster, 
its directory /tmp/doris/test_coordidator_be_restart not exists.\n\nDuring 
handl [...]
    }
    , stderr: /usr/local/lib/python3.10/dist-packages/paramiko/pkey.py:100: 
CryptographyDeprecationWarning: TripleDES has been moved to 
cryptography.hazmat.decrepit.ciphers.algorithms.TripleDES and will be removed 
from this module in 48.0.0.
      "cipher": algorithms.TripleDES,
    /usr/local/lib/python3.10/dist-packages/paramiko/transport.py:258: 
CryptographyDeprecationWarning: TripleDES has been moved to 
cryptography.hazmat.decrepit.ciphers.algorithms.TripleDES and will be removed 
from this module in 48.0.0.
      "class": algorithms.TripleDES,
      at 
org.apache.doris.regression.suite.SuiteCluster.runCmd(SuiteCluster.groovy:603)
    ```
---
 docker/runtime/doris-compose/Dockerfile                 | 17 +++--------------
 docker/runtime/doris-compose/cluster.py                 | 16 +++++++++++++++-
 docker/runtime/doris-compose/requirements.txt           |  1 +
 .../org/apache/doris/regression/RegressionTest.groovy   |  3 +++
 .../apache/doris/regression/suite/SuiteCluster.groovy   |  2 +-
 5 files changed, 23 insertions(+), 16 deletions(-)

diff --git a/docker/runtime/doris-compose/Dockerfile 
b/docker/runtime/doris-compose/Dockerfile
index 3934ee5cb75..2aabe196205 100644
--- a/docker/runtime/doris-compose/Dockerfile
+++ b/docker/runtime/doris-compose/Dockerfile
@@ -29,16 +29,7 @@ ARG JDK_IMAGE=openjdk:17-jdk-slim
 
 FROM ${JDK_IMAGE}
 
-RUN <<EOF
-    if [ -d "/usr/local/openjdk-17" ]; then
-        ln -s /usr/local/openjdk-17  /usr/local/openjdk
-    else \
-        ln -s /usr/local/openjdk-8  /usr/local/openjdk
-    fi
-EOF
-
 # set environment variables
-ENV JAVA_HOME="/usr/local/openjdk"
 ENV JACOCO_VERSION 0.8.8
 
 RUN mkdir -p /opt/apache-doris/coverage
@@ -58,12 +49,10 @@ RUN curl -f 
https://repo1.maven.org/maven2/org/jacoco/jacoco/${JACOCO_VERSION}/j
 
 # cloud
 COPY cloud/CMakeLists.txt cloud/output* output/ms* /opt/apache-doris/cloud/
-RUN <<EOF
-    mkdir /opt/apache-doris/fdb
-    if [ -d /opt/apache-doris/cloud/bin ]; then
-        sed -i 's/\<chmod\>/echo/g' /opt/apache-doris/cloud/bin/start.sh
+RUN mkdir /opt/apache-doris/fdb
+RUN if [ -d /opt/apache-doris/cloud/bin ]; then                            \
+        sed -i 's/\<chmod\>/echo/g' /opt/apache-doris/cloud/bin/start.sh ; \
     fi
-EOF
 
 # fe and be
 COPY output /opt/apache-doris/
diff --git a/docker/runtime/doris-compose/cluster.py 
b/docker/runtime/doris-compose/cluster.py
index 83005cc0cf5..466ccf79c1d 100644
--- a/docker/runtime/doris-compose/cluster.py
+++ b/docker/runtime/doris-compose/cluster.py
@@ -334,10 +334,16 @@ class Node(object):
             for path in ("/etc/localtime", "/etc/timezone",
                          "/usr/share/zoneinfo") if os.path.exists(path)
         ]
+
         if self.cluster.coverage_dir:
             volumes.append("{}:{}/coverage".format(self.cluster.coverage_dir,
                                                    DOCKER_DORIS_PATH))
 
+        extra_hosts = [
+            "{}:{}".format(node.get_name(), node.get_ip())
+            for node in self.cluster.get_all_nodes()
+        ]
+
         content = {
             "cap_add": ["SYS_PTRACE"],
             "hostname": self.get_name(),
@@ -349,6 +355,7 @@ class Node(object):
                     "ipv4_address": self.get_ip(),
                 }
             },
+            "extra_hosts": extra_hosts,
             "ports": self.docker_ports(),
             "ulimits": {
                 "core": -1
@@ -690,7 +697,14 @@ class Cluster(object):
             raise Exception("No found {} with id {}".format(node_type, id))
         return Node.new(self, node_type, id, meta)
 
-    def get_all_nodes(self, node_type):
+    def get_all_nodes(self, node_type=None):
+        if node_type is None:
+            nodes = []
+            for nt, group in self.groups.items():
+                for id, meta in group.get_all_nodes().items():
+                    nodes.append(Node.new(self, nt, id, meta))
+            return nodes
+
         group = self.groups.get(node_type, None)
         if not group:
             raise Exception("Unknown node_type: {}".format(node_type))
diff --git a/docker/runtime/doris-compose/requirements.txt 
b/docker/runtime/doris-compose/requirements.txt
index ac177eddf82..05258de2df6 100644
--- a/docker/runtime/doris-compose/requirements.txt
+++ b/docker/runtime/doris-compose/requirements.txt
@@ -22,3 +22,4 @@ jsonpickle
 prettytable
 pymysql
 python-dateutil
+requests<=2.31.0
diff --git 
a/regression-test/framework/src/main/groovy/org/apache/doris/regression/RegressionTest.groovy
 
b/regression-test/framework/src/main/groovy/org/apache/doris/regression/RegressionTest.groovy
index 332772271c6..92e92a9b736 100644
--- 
a/regression-test/framework/src/main/groovy/org/apache/doris/regression/RegressionTest.groovy
+++ 
b/regression-test/framework/src/main/groovy/org/apache/doris/regression/RegressionTest.groovy
@@ -453,6 +453,9 @@ class RegressionTest {
             log.warn("install doris compose requirements failed: 
code=${proc.exitValue()}, "
                     + "output: ${sout.toString()}, error: ${serr.toString()}")
         }
+
+        def pipList = 'pip list'.execute().text
+        log.info("python library: ${pipList}")
     }
 
     static void printPassed() {
diff --git 
a/regression-test/framework/src/main/groovy/org/apache/doris/regression/suite/SuiteCluster.groovy
 
b/regression-test/framework/src/main/groovy/org/apache/doris/regression/suite/SuiteCluster.groovy
index 68a57ad27f3..c36deac2e68 100644
--- 
a/regression-test/framework/src/main/groovy/org/apache/doris/regression/suite/SuiteCluster.groovy
+++ 
b/regression-test/framework/src/main/groovy/org/apache/doris/regression/suite/SuiteCluster.groovy
@@ -545,7 +545,7 @@ class SuiteCluster {
     }
 
     private Object runCmd(String cmd, int timeoutSecond = 60) throws Exception 
{
-        def fullCmd = String.format('python %s %s --output-json', 
config.dorisComposePath, cmd)
+        def fullCmd = String.format('python -W ignore %s %s --output-json', 
config.dorisComposePath, cmd)
         logger.info('Run doris compose cmd: {}', fullCmd)
         def proc = fullCmd.execute()
         def outBuf = new StringBuilder()


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to