diff --git a/docs/designs/client_tool.md b/docs/designs/client_tool.md index 6d2bc0d25..d708cdd2b 100644 --- a/docs/designs/client_tool.md +++ b/docs/designs/client_tool.md @@ -58,12 +58,7 @@ this command-line client tool. 1. Build the Docker image for an ElasticDL job. ```bash - elasticdl zoo build - --image=a_docker_registry/bright/elasticdl-wnd:1.0 - [--docker_base_url=docke_base_url] - [--docker_tlscert=docker_tlscert] - [--docker_tlskey=docker_tlskey] - . + elasticdl zoo build --image=a_docker_registry/bright/elasticdl-wnd:1.0 . ``` 1. Push the Docker image to a remote registry. @@ -79,7 +74,7 @@ this command-line client tool. ```bash elasticdl train \ - --image=a_docker_registry/bright/elasticdl-wnd:1.0 \ + --image_name=a_docker_registry/bright/elasticdl-wnd:1.0 \ --model_zoo=model_zoo --model_def=a_directory.wide_and_deep.custom_model \ --training_data=/data/mnist/train \ diff --git a/elasticdl_client/api.py b/elasticdl_client/api.py index 908375359..59f1bc83b 100644 --- a/elasticdl_client/api.py +++ b/elasticdl_client/api.py @@ -75,12 +75,8 @@ def build_zoo(args): logger.info("Build the image for the model zoo.") # Call docker api to build the image # Validate the image name schema - client = _get_docker_client( - docker_base_url=args.docker_base_url, - docker_tlscert=args.docker_tlscert, - docker_tlskey=args.docker_tlskey, - ) - for line in client.build( + client = docker.DockerClient.from_env() + for line in client.api.build( dockerfile="./Dockerfile", path=args.path, rm=True, @@ -93,13 +89,8 @@ def build_zoo(args): def push_zoo(args): logger.info("Push the image for the model zoo.") # Call docker api to push the image to remote registry - client = _get_docker_client( - docker_base_url=args.docker_base_url, - docker_tlscert=args.docker_tlscert, - docker_tlskey=args.docker_tlskey, - ) - - for line in client.push(args.image, stream=True, decode=True): + client = docker.DockerClient.from_env() + for line in client.api.push(args.image, stream=True, decode=True): _print_docker_progress(line) diff --git a/elasticdl_client/common/args.py b/elasticdl_client/common/args.py index 1c6486733..d83d119a8 100644 --- a/elasticdl_client/common/args.py +++ b/elasticdl_client/common/args.py @@ -49,7 +49,6 @@ def add_zoo_build_arguments(parser): help="The name of the docker image we are building for" "this model zoo.", ) - add_docker_arguments(parser) def add_zoo_push_arguments(parser): @@ -58,28 +57,6 @@ def add_zoo_push_arguments(parser): type=str, help="The name of the docker image for this model zoo.", ) - add_docker_arguments(parser) - - -def add_docker_arguments(parser): - parser.add_argument( - "--docker_base_url", - type=str, - help="URL to the Docker server", - default="unix://var/run/docker.sock", - ) - parser.add_argument( - "--docker_tlscert", - type=str, - help="Path to Docker client cert", - default="", - ) - parser.add_argument( - "--docker_tlskey", - type=str, - help="Path to Docker client key", - default="", - ) def add_train_params(parser):