diff --git a/docker/runtime/doris-compose/Dockerfile b/docker/runtime/doris-compose/Dockerfile index fb1b033192..2306bf67cd 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 : . - # choose a base image -ARG JDK_IMAGE=openjdk:17-jdk-slim -#ARG JDK_IMAGE=openjdk:8u342-jdk +FROM openjdk:8u342-jdk -#### END ARG #### - -FROM ${JDK_IMAGE} - -RUN </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 31c212eec8..7e1a4ef695 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 54255b597b..8b4b39619b 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():