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.
- 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
- 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.
- If Kubernetes is integrated with the container runtime, run the following command on the management node:
kubectl describe node <node-name> | grep -i runtime
- Docker information indicates Kubernetes-Docker scenario.
- containerd information indicates Kubernetes-containerd scenarios.
- If Kubernetes is not used, run the following command on any node:
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.
- 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>
- Add the execute permission for the software package.
chmod u+x Ascend-docker-runtime_{version}_linux-{arch}.run - Check the consistency and integrity of the package.
./Ascend-docker-runtime_{version}_linux-{arch}.run --checkCommand 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.
- 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
- Install Ascend Docker Runtime in the default path.
- 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
- After the installation package is downloaded, go to the path where the installation package (.run package) is stored.
cd <path to run package>
- Add the execute permission for the software package.
chmod u+x Ascend-docker-runtime_{version}_linux-{arch}.run - Check the consistency and integrity of the package.
./Ascend-docker-runtime_{version}_linux-{arch}.run --checkCommand 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.
- 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
- Install Ascend Docker Runtime in the default path.
- (Optional) If the installation fails, modify the containerd configuration file as follows.
- 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
- containerd without a default configuration file: Create and modify a configuration file.
- Check the current cgroup version.
stat -fc %T /sys/fs/cgroup/
- tmpfs indicates cgroup v1.
- cgroup2fs indicates cgroup v2.
- 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 ...
- cgroup v1
- Modify the configuration file.
- Restart containerd.
systemctl daemon-reload && systemctl restart containerd
Installing Ascend Docker Runtime in the Kubernetes-containerd Scenario
- After the installation package is downloaded, go to the path where the installation package (.run package) is stored.
cd <path to run package>
- Add the execute permission for the software package.
chmod u+x Ascend-docker-runtime_{version}_linux-{arch}.run - Check the consistency and integrity of the package.
./Ascend-docker-runtime_{version}_linux-{arch}.run --checkCommand 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.
- 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
- Install Ascend Docker Runtime in the default path.
- (Optional) If the installation fails, modify the containerd configuration file as follows.
- 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
- containerd without a default configuration file: Create and modify a configuration file.
- Check the current cgroup version.
stat -fc %T /sys/fs/cgroup/
- tmpfs indicates cgroup v1.
- cgroup2fs indicates cgroup v2.
- 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 ...
- cgroup v1
- Modify the configuration file.
- 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.
- If the Docker service exists, stop it.
systemctl stop docker
- 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.
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.
|
--install-scene=<scene> |
Specifies the installation scenario of Ascend Docker Runtime. The default value is docker.
|
--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:
|
--install-type=<type> |
This option can be used only when Ascend Docker Runtime is installed or upgraded on the following products:
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:
|
--ce=<ce> |
|
--version |
Queries the Ascend Docker Runtime version. |