You can use the client to manage jobs in DLC. The client provides features such as command line auto-completion, training job submission, and job management. Before you begin, you must download the client and perform identity authentication. This topic describes how to download the client and perform identity authentication.
Notes on using the client
If a certificate-related error occurs during runtime, you can run sudo apt-get update && sudo apt-get install ca-certificates.
Download the client
You can download the client for your operating system from the following links:
The downloaded client does not require installation. You can run the chmod +x dlc command to grant executable permissions to the file. You can then invoke the client commands from the command line.
Auto-completion (completion)
-
Feature
The auto-completion feature works in the same way as the auto-completion features of the community Kubectl and Arena command-line tools. You can press the Tab key twice in the command line to use the auto-completion feature of the DLC client. This feature provides suggestions for incomplete commands.
-
Format
./dlc completion <shelltype> -
Parameters
<shelltype> specifies the shell type for which you want to generate the auto-completion script. Supported types include bash, fish, powershell, and zsh.
-
Example
The following example shows how to use auto-completion in bash:
-
If the bash-completion package is not installed, you can run the following command to install it. Then, you can run the
sourcecommand to apply the changes. If the package is already installed, you can skip this step.# For macOS, run the following command. brew install bash-completion && source /usr/local/etc/bash_completion # For Linux, run the following command. yum install bash-completion && source /etc/profile.d/bash_completion.sh -
You can run the following command to enable auto-completion. The auto-completion feature depends on the bash-completion package. If an error occurs, it indicates that the bash-completion package is not installed in your environment.
source <(./dlc completion bash) -
Enter
./dlcand press the Tab key twice to view the commands that are provided by the DLC client../dlcThe system returns the following commands that are provided by the DLC client.
completion config create delete get help logs stop submit
NoteFor other shell types, you can run the
dlc completion <zsh | fish | powershell> --helpcommand for detailed usage instructions. -
User authentication (config)
-
Feature
The first time you use the DLC client to manage data and jobs, you must perform identity authentication using the AccessKey ID and AccessKey secret of your Alibaba Cloud account. After the initial authentication, you do not need to perform authentication again.
-
Format
./dlc config --protocol https --access_id <yourAccessKeyID> --access_key <yourAccessKeySecret> [--endpoint <yourEndpoint>] [--region <yourRegion>] -
Parameters
Parameters to replace
Required
Description
Type
<yourAccessKeyId>
Yes
The AccessKey ID of your Alibaba Cloud account.
STRING
<yourAccessKeySecret>
Yes
The AccessKey secret of your Alibaba Cloud account.
STRING
<yourEndpoint>
Yes
The endpoint of the region where the DLC service is located. Example: pai-dlc.cn-shanghai.aliyuncs.com.
STRING
<yourRegion>
Yes
The region where the DLC service is located. For example, the region ID for China (Shanghai) is cn-shanghai.
STRING
-
Example
After you perform identity authentication, the configuration is saved to the .dlc/config file in the current directory by default. For example, you can run a command similar to the following:
./dlc config --protocol https \ --access_id <AccessKeyId> \ --access_key <AccessKeySecret> \ --endpoint 'pai-dlc.cn-shanghai.aliyuncs.com' \ --region cn-shanghaiA message similar to the following one is returned:
[OK] Configuration saved to: ~/.dlc/config
References
-
After you authenticate the client, you can perform operations using the supported commands. For more information, see Command list.
-
You can also submit DLC jobs in the console. For more information, see Create tasks in the console.