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

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

commit 649f04e17c2e1d1783f83cf8d467ff823ffc24ee
Author: yiguolei <yiguo...@gmail.com>
AuthorDate: Wed Mar 6 13:13:26 2024 +0800

    Revert "[feature](doris compose) doris compose use jdk 17 image (#31775)"
    
    This reverts commit 9d2e5f1c00bd04277b492df979b367e1184c09de.
---
 docker/runtime/doris-compose/Dockerfile | 32 ++++++++------------------------
 docker/runtime/doris-compose/command.py | 28 ++++------------------------
 docker/runtime/doris-compose/utils.py   | 28 ++++++++--------------------
 3 files changed, 20 insertions(+), 68 deletions(-)

diff --git a/docker/runtime/doris-compose/Dockerfile 
b/docker/runtime/doris-compose/Dockerfile
index fb1b0331928..2306bf67cd2 100644
--- a/docker/runtime/doris-compose/Dockerfile
+++ b/docker/runtime/doris-compose/Dockerfile
@@ -16,30 +16,14 @@
 # specific language governing permissions and limitations
 # under the License.
 
-#### START ARG ####
-
-# docker build cmd example:
-# docker build -f docker/runtime/doris-compose/Dockerfile -t 
<your-image-name>:<version> .
-
 # choose a base image
-ARG JDK_IMAGE=openjdk:17-jdk-slim
-#ARG JDK_IMAGE=openjdk:8u342-jdk
-
-#### END ARG ####
-
-FROM ${JDK_IMAGE}
+FROM openjdk:8u342-jdk
 
-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
+ARG OUT_DIRECTORY=output
 
 # set environment variables
-ENV JAVA_HOME="/usr/local/openjdk"
-ENV JACOCO_VERSION 0.8.8
+ENV JAVA_HOME="/usr/local/openjdk-8/"
+ENV jacoco_version 0.8.8
 
 RUN mkdir -p /opt/apache-doris/coverage
 
@@ -47,17 +31,17 @@ RUN  sed -i s@/deb.debian.org/@/mirrors.aliyun.com/@g 
/etc/apt/sources.list
 RUN  apt-get clean
 
 RUN apt-get update && \
-    apt-get install -y default-mysql-client python lsof tzdata curl unzip 
patchelf jq procps && \
+    apt-get install -y default-mysql-client python lsof tzdata curl unzip 
patchelf jq && \
     ln -fs /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
     dpkg-reconfigure -f noninteractive tzdata && \
     apt-get clean
 
-RUN curl -f 
https://repo1.maven.org/maven2/org/jacoco/jacoco/${JACOCO_VERSION}/jacoco-${JACOCO_VERSION}.zip
 -o jacoco.zip && \
+RUN curl -f 
https://repo1.maven.org/maven2/org/jacoco/jacoco/$jacoco_version/jacoco-$jacoco_version.zip
 -o jacoco.zip && \
     mkdir /jacoco && \
     unzip jacoco.zip -d /jacoco
 
 # cloud
-COPY cloud/CMakeLists.txt cloud/output* /opt/apache-doris/cloud/
+COPY ${OUT_DIRECTORY}/../cloud/CMakeLists.txt 
${OUT_DIRECTORY}/../cloud/output* /opt/apache-doris/cloud/
 RUN <<EOF
     mkdir /opt/apache-doris/fdb
     if [ -d /opt/apache-doris/cloud/bin ]; then
@@ -66,7 +50,7 @@ RUN <<EOF
 EOF
 
 # fe and be
-COPY output /opt/apache-doris/
+COPY $OUT_DIRECTORY /opt/apache-doris/
 # in docker, run 'chmod 755 doris_be' first time cost 1min, remove it.
 RUN sed -i 's/\<chmod\>/echo/g' /opt/apache-doris/be/bin/start_be.sh
 
diff --git a/docker/runtime/doris-compose/command.py 
b/docker/runtime/doris-compose/command.py
index 31c212eec8a..7e1a4ef695a 100644
--- a/docker/runtime/doris-compose/command.py
+++ b/docker/runtime/doris-compose/command.py
@@ -278,7 +278,7 @@ class UpCommand(Command):
 
         parser.add_argument("--coverage-dir",
                             default="",
-                            help="Set code coverage output directory")
+                            help="code coverage output directory")
 
         parser.add_argument(
             "--fdb-version",
@@ -286,20 +286,6 @@ class UpCommand(Command):
             default="7.1.26",
             help="fdb image version. Only use in cloud cluster.")
 
-        if self._support_boolean_action():
-            parser.add_argument(
-                "--detach",
-                default=True,
-                action=self._get_parser_bool_action(False),
-                help="Detached mode: Run containers in the background. If 
specific --no-detach, "\
-                "will run containers in frontend. ")
-        else:
-            parser.add_argument("--no-detach",
-                                dest='detach',
-                                default=True,
-                                action=self._get_parser_bool_action(False),
-                                help="Run containers in frontend. ")
-
     def run(self, args):
         if not args.NAME:
             raise Exception("Need specific not empty cluster name")
@@ -415,9 +401,7 @@ class UpCommand(Command):
         if not args.start:
             options.append("--no-start")
         else:
-            options += ["--remove-orphans"]
-            if args.detach:
-                options.append("-d")
+            options = ["-d", "--remove-orphans"]
             if args.force_recreate:
                 options.append("--force-recreate")
 
@@ -426,12 +410,8 @@ class UpCommand(Command):
             related_node_num = cluster.get_all_nodes_num()
             related_nodes = None
 
-        output_real_time = args.start and not args.detach
-        utils.exec_docker_compose_command(cluster.get_compose_file(),
-                                          "up",
-                                          options,
-                                          related_nodes,
-                                          output_real_time=output_real_time)
+        utils.exec_docker_compose_command(cluster.get_compose_file(), "up",
+                                          options, related_nodes)
 
         ls_cmd = "python docker/runtime/doris-compose/doris-compose.py ls " + 
cluster.name
         LOG.info("Inspect command: " + utils.render_green(ls_cmd) + "\n")
diff --git a/docker/runtime/doris-compose/utils.py 
b/docker/runtime/doris-compose/utils.py
index 54255b597bc..8b4b39619bc 100644
--- a/docker/runtime/doris-compose/utils.py
+++ b/docker/runtime/doris-compose/utils.py
@@ -179,37 +179,25 @@ def is_dir_empty(dir):
     return False if os.listdir(dir) else True
 
 
-def exec_shell_command(command, ignore_errors=False, output_real_time=False):
+def exec_shell_command(command, ignore_errors=False):
     LOG.info("Exec command: {}".format(command))
     p = subprocess.Popen(command,
                          shell=True,
                          stdout=subprocess.PIPE,
                          stderr=subprocess.STDOUT)
-    out = ''
-    exitcode = None
-    if output_real_time:
-        while p.poll() is None:
-            s = p.stdout.readline().decode('utf-8')
-            if ENABLE_LOG and s.rstrip():
-                print(s.rstrip())
-            out += s
-        exitcode = p.wait()
-    else:
-        out = p.communicate()[0].decode('utf-8')
-        exitcode = p.returncode
-        if ENABLE_LOG and out:
-            print(out)
+    out = p.communicate()[0].decode('utf-8')
     if not ignore_errors:
-        assert exitcode == 0, out
-    return exitcode, out
+        assert p.returncode == 0, out
+    if ENABLE_LOG and out:
+        print(out)
+    return p.returncode, out
 
 
 def exec_docker_compose_command(compose_file,
                                 command,
                                 options=None,
                                 nodes=None,
-                                user_command=None,
-                                output_real_time=False):
+                                user_command=None):
     if nodes != None and not nodes:
         return 0, "Skip"
 
@@ -218,7 +206,7 @@ def exec_docker_compose_command(compose_file,
         " ".join([node.service_name() for node in nodes]) if nodes else "",
         user_command if user_command else "")
 
-    return exec_shell_command(compose_cmd, output_real_time=output_real_time)
+    return exec_shell_command(compose_cmd)
 
 
 def get_docker_subnets_prefix16():


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

Reply via email to