diff --git a/src/apis/jina_cloud.py b/src/apis/jina_cloud.py index aabd60e..3efa3e6 100644 --- a/src/apis/jina_cloud.py +++ b/src/apis/jina_cloud.py @@ -185,7 +185,7 @@ def run_locally(executor_name, microservice_version_path): use_docker = True else: click.echo(''' -Docker daemon doesn\'t seem to be running. +Docker daemon doesn\'t seem to be running (possible reasons: incorrect docker installation, docker command isn\'t in system path, insufficient permissions, docker is running but unrespnsive). It might be important to run your microservice within a docker container. Your machine might not have all the dependencies installed. You have 3 options: diff --git a/src/utils/io.py b/src/utils/io.py index 9ae2693..95c275e 100644 --- a/src/utils/io.py +++ b/src/utils/io.py @@ -1,13 +1,9 @@ import os -import concurrent.futures -from typing import Generator +import subprocess import sys from contextlib import contextmanager -import docker -from docker import APIClient - def get_microservice_path(path, microservice_name, packages, num_approach, version): package_path = '_'.join(packages) @@ -44,14 +40,12 @@ def suppress_stdout(): def is_docker_running(): try: - from hubble import __windows__ - _client = docker.from_env() - # low-level client - _raw_client = APIClient( - base_url=docker.constants.DEFAULT_NPIPE - if __windows__ - else docker.constants.DEFAULT_UNIX_SOCKET - ) - except Exception: + if sys.platform.startswith('win'): + command = 'docker info' + else: + command = 'docker info 2> /dev/null' + + subprocess.check_output(command, shell=True) + return True + except subprocess.CalledProcessError: return False - return True \ No newline at end of file