You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by mx...@apache.org on 2018/11/30 11:15:53 UTC

[beam] 03/07: [BEAM-5978] Correctly pick the docker executable

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

mxm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/beam.git

commit 65136cff720ce6949a9b41fb94908cbaa2dbe13d
Author: Ankur Goenka <an...@gmail.com>
AuthorDate: Thu Nov 29 19:13:32 2018 -0800

    [BEAM-5978] Correctly pick the docker executable
---
 sdks/python/apache_beam/runners/portability/job_server.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/sdks/python/apache_beam/runners/portability/job_server.py b/sdks/python/apache_beam/runners/portability/job_server.py
index b5e7f76..8498deb 100644
--- a/sdks/python/apache_beam/runners/portability/job_server.py
+++ b/sdks/python/apache_beam/runners/portability/job_server.py
@@ -25,6 +25,7 @@ import socket
 import sys
 import time
 from subprocess import Popen
+from subprocess import check_output
 from threading import Lock
 
 
@@ -50,10 +51,11 @@ class DockerizedJobServer(object):
     # TODO This is hardcoded to Flink at the moment but should be changed
     job_server_image_name = os.environ['USER'] + \
         "-docker-apache.bintray.io/beam/flink-job-server:latest"
+    docker_path = check_output(['which', 'docker']).strip()
     cmd = ["docker", "run",
            # We mount the docker binary and socket to be able to spin up
            # "sibling" containers for the SDK harness.
-           "-v", "/usr/local/bin/docker:/bin/docker",
+           "-v", ':'.join([docker_path, "/bin/docker"]),
            "-v", "/var/run/docker.sock:/var/run/docker.sock"]
     self.job_port = DockerizedJobServer._pick_port(self.job_port)
     # artifact_port 0 suggest to pick a dynamic port.