Ascend Docker Runtime

  • Ascend Docker Runtime must be installed when you need to use functions of containerization, full NPU scheduling, static vNPU scheduling, dynamic vNPU scheduling, resumable training, elastic training, recovery of inference card faults, or rescheduling upon inference card faults.
  • If you need only resource monitoring function, you do not need to install Ascend Docker Runtime. In this case, skip this section.

Prerequisites

Before the installation, ensure that the user ID of the runc file is 0.

Verifying the Installation Scenario

Currently, only the root user can install and upgrade Ascend Docker Runtime. Select an installation mode as required.

  1. Run the following command on the Kubernetes management node to query the node name:
    kubectl get node
    Command output:
    1
    2
    NAME       STATUS   ROLES           AGE   VERSION
    ubuntu     Ready    worker          23h   v1.17.3
    
  2. Check the container runtime of the current node. node-name indicates the node name.
    • If Kubernetes is not used, run the following command on any node:
      docker --version      # Docker
      containerd --version     # containerd
      • Docker version indicates Docker scenario.
      • containerd version indicates containerd scenario.
      • If both Docker and containerd versions are displayed, determine the container runtime to be used.

Installing Ascend Docker Runtime in the Docker Scenario

The installation procedure of Ascend Docker Runtime in the Kubernetes-Docker scenario is the same as that in the Docker scenario.

  1. After the installation package is downloaded, go to the path where the installation package (.run package) is stored on all compute nodes.
    cd <path to run package>
  2. Add the execute permission for the software package.
    chmod u+x Ascend-docker-runtime_{version}_linux-{arch}.run
  3. Check the consistency and integrity of the package.
    ./Ascend-docker-runtime_{version}_linux-{arch}.run --check
    Command output:
    1
    2
    3
    4
    [WARNING]: --check is meaningless for ascend-docker-runtime and will be discarded in the future
    Verifying archive integrity...  100%   SHA256 checksums are OK.
    ...
     All good.
    
  4. Install Ascend Docker Runtime.
    • Install Ascend Docker Runtime in the default path.
      ./Ascend-docker-runtime_{version}_linux-{arch}.run --install
    • Install Ascend Docker Runtime in the specified path. --install-path indicates the specified installation path.
      ./Ascend-docker-runtime_{version}_linux-{arch}.run --install --install-path=<path>
    • The specified installation path must be an absolute path.
    • If the Docker configuration file path is not the default /etc/docker/daemon.json, the --config-file-path parameter needs to be added to specify the configuration file path.

    The installation is successful if the following information is displayed:

    1
    2
    3
    4
    Uncompressing ascend-docker-runtime  100%
    [INFO]: installing ascend-docker-runtime
    ...
    [INFO] ascend-docker-runtime install success
    
  5. Make Ascend Docker Runtime take effect.
    systemctl daemon-reload && systemctl restart docker

    When Ascend Device Plugin is started, the system automatically checks whether Ascend Docker Runtime exists. Therefore, you need to start Ascend Docker Runtime and then Ascend Device Plugin. If Ascend Device Plugin is started before Ascend Docker Runtime, restart Ascend Device Plugin by referring to Ascend Device Plugin.

Installing Ascend Docker Runtime in the containerd Scenario

  1. After the installation package is downloaded, go to the path where the installation package (.run package) is stored.
    cd <path to run package>
  2. Add the execute permission for the software package.
    chmod u+x Ascend-docker-runtime_{version}_linux-{arch}.run
  3. Check the consistency and integrity of the package.
    ./Ascend-docker-runtime_{version}_linux-{arch}.run --check
    Command output:
    [WARNING]: --check is meaningless for ascend-docker-runtime and will be discarded in the future
    Verifying archive integrity...  100%   SHA256 checksums are OK.
    ...
     All good.
  4. Install Ascend Docker Runtime.
    • Install Ascend Docker Runtime in the default path.
      ./Ascend-docker-runtime_{version}_linux-{arch}.run --install --install-scene=containerd
    • Install Ascend Docker Runtime in the specified path. --install-path indicates the specified installation path.
      ./Ascend-docker-runtime_{version}_linux-{arch}.run --install --install-scene=containerd --install-path=<path>
      • The specified installation path must be an absolute path.
      • If the Containerd configuration file path is not the default /etc/containerd/config.toml, the --config-file-path parameter needs to be added to specify the configuration file path.
    The installation is successful if the following information is displayed:
    Uncompressing ascend-docker-runtime  100%
    [INFO]: installing ascend-docker-runtime
    ...
    [INFO] ascend-docker-runtime install success
  5. (Optional) If the installation fails, modify the containerd configuration file as follows.
    1. Modify the configuration file.
      • containerd without a default configuration file: Create and modify a configuration file.
        mkdir /etc/containerd
        containerd config default > /etc/containerd/config.toml
        vim /etc/containerd/config.toml
      • containerd with a configuration file: Open and modify the configuration file.
        vim /etc/containerd/config.toml
    2. Check the current cgroup version.
      stat -fc %T /sys/fs/cgroup/
      • tmpfs indicates cgroup v1.
      • cgroup2fs indicates cgroup v2.
    3. Modify the runtime_type field based on the cgroup version and modify the Ascend Docker Runtime installation path, as shown in the following information in bold.
      • cgroup v1

        For openEuler 24.03 OS, change the value of runtime_type in cgroup v1 to io.containerd.runc.v2.

            [plugins."io.containerd.grpc.v1.cri".containerd.runtimes] 
               [plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc]  
                 runtime_type = "io.containerd.runtime.v1.linux" 
                 runtime_engine = "" 
                 runtime_root = "" 
                 privileged_without_host_devices = false 
                 base_runtime_spec = "" 
                 [plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc.options] 
           [plugins."io.containerd.grpc.v1.cri".cni] 
             bin_dir = "/opt/cni/bin" 
             conf_dir = "/etc/cni/net.d" 
             max_conf_num = 1 
             conf_template = "" 
         [plugins."io.containerd.grpc.v1.cri".registry] 
             [plugins."io.containerd.grpc.v1.cri".registry.mirrors] 
               [plugins."io.containerd.grpc.v1.cri".registry.mirrors."docker.io"] 
                 endpoint = ["https://registry-1.docker.io"] 
         [plugins."io.containerd.grpc.v1.cri".image_decryption] 
             key_model = "" 
         
        ...
         [plugins."io.containerd.monitor.v1.cgroups"] 
           no_prometheus = false 
         [plugins."io.containerd.runtime.v1.linux"] 
           shim = "containerd-shim" 
           runtime = "/usr/local/Ascend/Ascend-Docker-Runtime/ascend-docker-runtime"   
           runtime_root = "" 
           no_shim = false 
           shim_debug = false 
         [plugins."io.containerd.runtime.v2.task"] 
           platforms = ["linux/amd64"] 
        ...
      • cgroup v2
                [plugins."io.containerd.grpc.v1.cri".containerd.default_runtime.options]
              [plugins."io.containerd.grpc.v1.cri".containerd.runtimes]
                [plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc]
                  base_runtime_spec = ""
                  cni_conf_dir = ""
                  cni_max_conf_num = 0
                  container_annotations = []
                  pod_annotations = []
                  privileged_without_host_devices = false
                  runtime_engine = ""
                  runtime_path = ""
                  runtime_root = ""
                  runtime_type = "io.containerd.runc.v2"
                  [plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc.options]
                    BinaryName = "/usr/local/Ascend/Ascend-Docker-Runtime/ascend-docker-runtime"
                    CriuImagePath = ""
                    CriuPath = ""
                    CriuWorkPath = ""
                    IoGid = 0
                    IoUid = 0
                    NoNewKeyring = false
                    NoPivotRoot = false
                    Root = ""
                    ShimCgroup = ""
                    SystemdCgroup = true
        ...
  6. Restart containerd.
    systemctl daemon-reload && systemctl restart containerd

Installing Ascend Docker Runtime in the Kubernetes-containerd Scenario

  1. After the installation package is downloaded, go to the path where the installation package (.run package) is stored.
    cd <path to run package>
  2. Add the execute permission for the software package.
    chmod u+x Ascend-docker-runtime_{version}_linux-{arch}.run
  3. Check the consistency and integrity of the package.
    ./Ascend-docker-runtime_{version}_linux-{arch}.run --check
    Command output:
    [WARNING]: --check is meaningless for ascend-docker-runtime and will be discarded in the future
    Verifying archive integrity...  100%   SHA256 checksums are OK.
    ...
     All good.
  4. Install Ascend Docker Runtime.
    • Install Ascend Docker Runtime in the default path.
      ./Ascend-docker-runtime_{version}_linux-{arch}.run --install --install-scene=containerd
    • Install Ascend Docker Runtime in the specified path. --install-path indicates the specified installation path.
      ./Ascend-docker-runtime_{version}_linux-{arch}.run --install --install-scene=containerd --install-path=<path>

      The specified installation path must be an absolute path.

    The installation is successful if the following information is displayed:
    Uncompressing ascend-docker-runtime  100%
    [INFO]: installing ascend-docker-runtime
    ...
    [INFO] ascend-docker-runtime install success
  5. (Optional) If the installation fails, modify the containerd configuration file as follows.
    1. Modify the configuration file.
      • containerd without a default configuration file: Create and modify a configuration file.
        mkdir /etc/containerd
        containerd config default > /etc/containerd/config.toml
        vim /etc/containerd/config.toml
      • containerd with a configuration file: Open and modify the configuration file.
        vim /etc/containerd/config.toml
    2. Check the current cgroup version.
      stat -fc %T /sys/fs/cgroup/
      • tmpfs indicates cgroup v1.
      • cgroup2fs indicates cgroup v2.
    3. Modify the runtime_type field based on the cgroup version and modify the Ascend Docker Runtime installation path, as shown in the following information in bold.
      • cgroup v1

        For openEuler 24.03 OS, change the value of runtime_type in cgroup v1 to io.containerd.runc.v2.

            [plugins."io.containerd.grpc.v1.cri".containerd.runtimes] 
               [plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc]  
                 runtime_type = "io.containerd.runtime.v1.linux" 
                 runtime_engine = "" 
                 runtime_root = "" 
                 privileged_without_host_devices = false 
                 base_runtime_spec = "" 
                 [plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc.options] 
           [plugins."io.containerd.grpc.v1.cri".cni] 
             bin_dir = "/opt/cni/bin" 
             conf_dir = "/etc/cni/net.d" 
             max_conf_num = 1 
             conf_template = "" 
         [plugins."io.containerd.grpc.v1.cri".registry] 
             [plugins."io.containerd.grpc.v1.cri".registry.mirrors] 
               [plugins."io.containerd.grpc.v1.cri".registry.mirrors."docker.io"] 
                 endpoint = ["https://registry-1.docker.io"] 
         [plugins."io.containerd.grpc.v1.cri".image_decryption] 
             key_model = "" 
         
        ...
         [plugins."io.containerd.monitor.v1.cgroups"] 
           no_prometheus = false 
         [plugins."io.containerd.runtime.v1.linux"] 
           shim = "containerd-shim" 
           runtime = "/usr/local/Ascend/Ascend-Docker-Runtime/ascend-docker-runtime"   
           runtime_root = "" 
           no_shim = false 
           shim_debug = false 
         [plugins."io.containerd.runtime.v2.task"] 
           platforms = ["linux/amd64"] 
        ...
      • cgroup v2
                [plugins."io.containerd.grpc.v1.cri".containerd.default_runtime.options]
              [plugins."io.containerd.grpc.v1.cri".containerd.runtimes]
                [plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc]
                  base_runtime_spec = ""
                  cni_conf_dir = ""
                  cni_max_conf_num = 0
                  container_annotations = []
                  pod_annotations = []
                  privileged_without_host_devices = false
                  runtime_engine = ""
                  runtime_path = ""
                  runtime_root = ""
                  runtime_type = "io.containerd.runc.v2"
                  [plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc.options]
                    BinaryName = "/usr/local/Ascend/Ascend-Docker-Runtime/ascend-docker-runtime"
                    CriuImagePath = ""
                    CriuPath = ""
                    CriuWorkPath = ""
                    IoGid = 0
                    IoUid = 0
                    NoNewKeyring = false
                    NoPivotRoot = false
                    Root = ""
                    ShimCgroup = ""
                    SystemdCgroup = true
        ...
  6. If you want to change the container runtime from Docker to containerd on a node, modify the kubeadm-flags.env configuration file of kubelet on the node. For details, see Kubernetes official document.
  7. If the Docker service exists, stop it.
    systemctl stop docker
  8. Restart containerd and kubelet.
    systemctl daemon-reload && systemctl restart containerd kubelet

Command Options of the Ascend Docker Runtime Installation Package

For details, see Table 1.

Table 1 Options supported by the installation package

Option

Description

--help | -h

Queries help information.

--info

Queries software package build information. This option will be deprecated in a later version.

--list

Queries the software package list. This option will be deprecated in a later version.

--check

Checks the consistency and integrity of packages. This option will be deprecated in a later version.

--quiet

Indicates silent installation, which skips interactive messages. It must be used together with install, uninstall, or upgrade. This option will be deprecated in a later version.

--tar arg1 [arg2 ...]

Runs the tar command on the software package. Use the parameters following tar as the command parameters. For example, the --tar xvf command indicates that the .run package will be decompressed to the current directory. This option will be deprecated in a later version.

--install

Installs the software package. You can specify the installation path by using --install-path=<path> or use the default installation path.

--install-path=<path>

Specifies the installation path.

  • The installation path must be an absolute path.
  • If the global configuration file ascend_docker_runtime_install.info exists in the environment, the specified installation path must be the same as that saved in the global configuration file.
  • If you want to change the installation path, uninstall the Ascend Docker Runtime package in the original path and ensure that the global configuration file ascend_docker_runtime_install.info has been deleted.
  • If Ascend Docker Runtime of a version earlier than 5.0.RC1 is installed using the ToolBox installation package, this file does not exist and does not need to be deleted.
  • If you do not specify the installation path, the software will be installed in the default path /usr/local/Ascend.
  • If this option is used to specify the installation directory, the running user must have the read and write permissions on the specified installation directory.

--install-scene=<scene>

Specifies the installation scenario of Ascend Docker Runtime. The default value is docker.

  • docker: installed in Docker (or Kubernetes-Docker).
  • containerd: installed in containerd (or Kubernetes-containerd).
  • isula: installed in the iSula container engine.

--uninstall

Uninstalls the software. If the installation path is specified during the installation, you also need to specify the installation path during the uninstallation. The option that specifies the installation path is --install-path=<path>.

--upgrade

Upgrades the software. If the installation path is specified during the installation, you also need to specify the installation path during the upgrade. The option that specifies the installation path is --install-path=<path>.

--config-file-path=<path>

Directory of the Docker or containerd configuration file. If this option is not specified, the following path is used by default:

  • Docker: /etc/docker/daemon.json
  • containerd: /etc/containerd/config.toml

--install-type=<type>

This option can be used only when Ascend Docker Runtime is installed or upgraded on the following products:
  • Atlas 200 AI accelerator module (RC)
  • Atlas 200I A2 accelerator module (RC)
  • Atlas 200I DK A2 developer kit
  • Atlas 200I SoC A1 core board
  • Atlas 500 AI edge station (model 3000)
  • Atlas 500 A2 edge station
This option is used to set the default mounted content of Ascend Docker Runtime, and must be used together with --install in the format of --install --install-type=<type>. The values of <type> can be:
  • A200
  • A200ISoC
  • A200IA2 (supporting Atlas 200I A2 accelerator module (RC) and Atlas 200I DK A2 developer kit)
  • A500
  • A500A2

--ce=<ce>

  • This option needs to be specified only when iSula is used to start the container. The value needs to be set to isula. It must be used together with --install or --uninstall.
  • It cannot be used together with --install-scene. You are advised to use --install-scene instead of --ce. --ce will be discarded in the near future.

--version

Queries the Ascend Docker Runtime version.