All Products
Search
Document Center

Platform For AI:Before you begin

Last Updated:Jan 12, 2024

You can use the Deep Learning Containers (DLC) client to manage the data and jobs in DLC of Platform for AI (PAI). You can use the DLC client to automatically complete the command lines, submit training jobs, and manage jobs. Before you use the client, you need to download the client and authenticate your identity. This topic describes how to download the DLC client and perform identity authentication.

Usage notes

If a certificate error appears when you run the DLC client, run the sudo apt-get update && sudo apt-get install ca-certificates command.

Download the DLC client

Download the DLC client for your operating system:

You do not need to install the downloaded client file. You only need to run the chmod +x dlc command to grant the execute permission on the client file.

Auto-completion

  • Feature description

    The auto-completion feature of DLC works in the same way as that of the kubectl and Arena commands. Auto-completion automatically completes commands or arguments that are typed in the command line interface (CLI). You can perform auto-completion by typing a partial command or argument and then pressing the Tab key twice.

  • Syntax

    ./dlc completion <shelltype>
  • Parameter description

    <shelltype> specifies the type of command that you want to auto-complete. Valid values: bash, fish, powershell, and zsh.

  • Examples

    The following example shows how auto-completion works on a bash command.

    1. If you have not installed the bash-completion package, run the following command to install the package and then run the source command to enable the feature: Skip this step if you installed the bash-completion package.

      # Run the following command to install the bash-completion package in macOS: 
      brew install bash-completion && source /usr/local/etc/bash_completion
      # Run the following command to install the bash-completion package in Linux: 
      yum install bash-completion && source /etc/profile.d/bash_completion.sh
    2. Run the following command to enable the auto-completion feature. The automatic completion feature is dependent on the bash-completion package. If an error message appears when you execute auto-completion, it indicates that you have not installed the bash-completion package.

      source <(./dlc completion bash)
    3. Enter the ./dlc command and press the Tab key twice. Then, you can view the commands provided by the DLC client.

      ./dlc 

      The following commands are commands provided by the DLC client.

      completion  config      create      delete      get         help        logs        stop        submit
    Note

    For more information about how auto-completion works on other types of commands, you can run the dlc completion <zsh | fish | powershell> --help command.

Identity authentication

  • Feature description

    The first time you use the DLC client to manage data and jobs, you need to use the AccessKey pair of your Alibaba Cloud account to perform identity authentication. After you complete the authentication, authentication is no longer required when you use the DLC client.

  • Syntax

    ./dlc config --access_id <yourAccessKeyID> --access_key <yourAccessKeySecret> [--endpoint <yourEndpoint>] [--region <yourRegion>]
  • Parameter description

    Parameter

    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 resides. Example: pai-dlc.cn-shanghai.aliyuncs.com.

    STRING

    <yourRegion>

    Yes

    The endpoint of the region where the DLC service resides. For example, China (Shanghai) is cn-shanghai.

    STRING

  • Examples

    After you complete the identity authentication, the system saves the configuration to the .dlc/config file in the current directory by default. For example, you can run the following authentication command:

    ./dlc config --access_id <AccessKeyId>       \
               --access_key <AccessKeySecret>  \
               --endpoint 'pai-dlc.cn-shanghai.aliyuncs.com' \
               --region cn-shanghai

    The following result is returned:

    [OK] Configuration saved to: ~/.dlc/config

References

  • After you complete the identity authentication, you can refer to the list of supported commands to perform relevant operations. For more information, see Supported commands.

  • You can also submit DLC jobs in the PAI console. For more information, see Submit jobs by using the console.