You can use the command-line interface (CLI) to submit Deep Learning Containers (DLC) resource group jobs. This topic describes how to download the DLC client, authenticate user credentials, and create and submit a job.
Prerequisites
When you use the DLC for the first time, you must first assign a service-linked role to DLC so that DLC can access the required resources. For more information, see Grant the permissions that are required to use DLC.
The AccessKey pair of your Alibaba Cloud account is obtained. For more information, see Obtain an AccessKey pair.
Download the DLC client and perform identify authentication
Download the DLC client for your operating system and authenticate your credentials. For more information, see Before you begin.
Create and submit a job
Log on to the Machine Learning Platform for AI (PAI) console.
View the workspace ID on the Workspaces page based on the instructions shown in the following figure.
Create a parameter file named
./tfjob.params
and copy the following content into the file. Replace the parameters as required. For more information about how to use CLIs in the DLC client, see Supported commands.name=test_cli_tfjob_001 workers=1 worker_cpu=4 worker_gpu=0 worker_memory=4Gi worker_shared_memory=4Gi worker_image=registry-vpc.cn-beijing.aliyuncs.com/pai-dlc/tensorflow-training:1.12.2PAI-cpu-py27-ubuntu16.04 command=echo good && sleep 120 resource_id=<the resource group ID> # If you use the public resource group, this parameter can be left empty. workspace_id=<the workspace ID>
Use the following code to specify the parameter_file parameter to create and submit a DLC job. The job can be submitted to a specific workspace.
dlc submit tfjob --job_file ./tfjob.params
Run the following command to view the job that you submitted:
dlc get job <jobID>