chia7712 commented on code in PR #22886:
URL: https://github.com/apache/kafka/pull/22886#discussion_r3726043860


##########
docker/docker_build_test.py:
##########
@@ -75,11 +75,13 @@ def run_docker_tests(image, tag, kafka_url, image_type):
 
     args = parser.parse_args()
 
+    container_runtime = detect_container_runtime()
+
     if args.build_only or not (args.build_only or args.test_only):
         if args.kafka_url:
-            build_docker_image_runner(f"docker build -f $DOCKER_FILE -t 
{args.image}:{args.tag} --build-arg kafka_url={args.kafka_url} --build-arg 
build_date={date.today()} --no-cache --progress=plain $DOCKER_DIR", 
args.image_type)
+            build_docker_image_runner(f"{container_runtime} build -f 
$DOCKER_FILE -t {args.image}:{args.tag} --build-arg kafka_url={args.kafka_url} 
--build-arg build_date={date.today()} --no-cache $DOCKER_DIR", args.image_type)
         elif args.kafka_archive:
-            build_docker_image_runner(f"docker build -f $DOCKER_FILE -t 
{args.image}:{args.tag} --build-arg build_date={date.today()} --no-cache 
--progress=plain $DOCKER_DIR", args.image_type, args.kafka_archive)
-    
+            build_docker_image_runner(f"{container_runtime} build -f 
$DOCKER_FILE -t {args.image}:{args.tag} --build-arg kafka_url= --build-arg 
build_date={date.today()} --no-cache $DOCKER_DIR", args.image_type, 
args.kafka_archive)

Review Comment:
   Why do we need to add `kafka_url=`?



##########
docker/test/docker_sanity_test.py:
##########
@@ -25,12 +25,16 @@ class DockerSanityTest(unittest.TestCase):
     IMAGE="apache/kafka"
     FIXTURES_DIR="."
     MODE="jvm"
-    
+    CONTAINER_RUNTIME="docker"
+
+    def compose_command(self):
+        return [f"{self.CONTAINER_RUNTIME}-compose"]

Review Comment:
   ```
   ft1.1: Traceback (most recent call last):
     File "/home/chia7712/project/kafka/docker/test/docker_sanity_test.py", 
line 214, in setUp
       
self.start_compose(f"{self.FIXTURES_DIR}/{constants.COMBINED_MODE_COMPOSE}")
       
~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     File "/home/chia7712/project/kafka/docker/test/docker_sanity_test.py", 
line 49, in start_compose
       subprocess.run(self.compose_command() + ["-f", filename, "up", "-d"])
       ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     File "/usr/lib64/python3.14/subprocess.py", line 555, in run
       with Popen(*popenargs, **kwargs) as process:
            ~~~~~^^^^^^^^^^^^^^^^^^^^^^
     File "/usr/lib64/python3.14/subprocess.py", line 1039, in __init__
       self._execute_child(args, executable, preexec_fn, close_fds,
       ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                           pass_fds, cwd, env,
                           ^^^^^^^^^^^^^^^^^^^
       ...<5 lines>...
                           gid, gids, uid, umask,
                           ^^^^^^^^^^^^^^^^^^^^^^
                           start_new_session, process_group)
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     File "/usr/lib64/python3.14/subprocess.py", line 1990, in _execute_child
       raise child_exception_type(errno_num, err_msg, err_filename)
   FileNotFoundError: [Errno 2] No such file or directory: 'podman-compose'
   ```
   
   I meant this error stack is unfriendly to read



##########
docker/test/docker_sanity_test.py:
##########
@@ -25,12 +25,16 @@ class DockerSanityTest(unittest.TestCase):
     IMAGE="apache/kafka"
     FIXTURES_DIR="."
     MODE="jvm"
-    
+    CONTAINER_RUNTIME="docker"
+
+    def compose_command(self):
+        return [f"{self.CONTAINER_RUNTIME}-compose"]

Review Comment:
   Should we check if tool like `podman-compose` and `docker-compose` are 
installed?
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to