Ascend Docker Runtime
- Users who demand containerization support, full-NPU scheduling, static vNPU scheduling, dynamic vNPU scheduling, resumable training, elastic training, inference card fault recovery, or rescheduling upon inference card faults must install Ascend Docker Runtime.
- Users who only use resource monitoring do not need to install Ascend Docker Runtime and can skip this chapter directly.
- Before installation, ensure that the user ID of the
runcfile is 0. - Before installation, in the Containerd scenario, ensure that the user and user group of the
/etc/containerd/config.tomlfile areroot; in the Docker scenario or Isula scenario, ensure that the user and user group of the/etc/docker/daemon.jsonfile areroot. - Before installation, ensure that the
RPATHandRUNPATHof the so files configured in/etc/ld.so.preloaddo not contain the HDK driver directory with a relative path (you can check this using thereadelf -d xxx.socommand).
Currently, only the root user is supported for installing Ascend Docker Runtime. Please select the corresponding installation method based on the actual situation.
Run the following command on the K8s management node to query the node name.
kubectl get nodeExample output:
NAME STATUS ROLES AGE VERSION ubuntu Ready worker 23h v1.17.3Check the container runtime of the current node, where
node-nameis the node name.Non-K8s scenario: Run the following command on any node.
docker --version # Docker containerd --version # Containerd- If the output shows Docker version information, the current scenario is Docker scenario.
- If the output shows Containerd version information, the current scenario is Containerd scenario.
- If the output contains version information for both Docker and Containerd, determine which container runtime to use for job execution.
K8s integrated container runtime scenario: Run the following command on the management node.
kubectl describe node <node-name> | grep -i runtime- If the output contains Docker information, this indicates a K8s integrated Docker scenario.
- If the output contains Containerd information, this indicates a K8s integrated Containerd scenario.
The installation procedure of Ascend Docker Runtime in the K8s-Docker integrated scenario is the same as that in the Docker scenario.
After downloading the software package, go to the path where the software package (run package) is located on all compute nodes.
cd <path to run package>Run the following command to add executable permission to the software package.
chmod u+x Ascend-docker-runtime_{version}_linux-{arch}.runRun the following command to verify the consistency and integrity of the software package installation file.
./Ascend-docker-runtime_{version}_linux-{arch}.run --checkExample 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 using the following command.
To install to the default path, run the following command.
./Ascend-docker-runtime_{version}_linux-{arch}.run --installTo specify installation to a custom path, run the following command. The
--install-pathparameter specifies the installation path../Ascend-docker-runtime_{version}_linux-{arch}.run --install --install-path=<path>
- An absolute path must be used for specifying the installation path.
- If the Docker configuration file path is not the default
/etc/docker/daemon.json, add the--config-file-pathparameter to specify the configuration file path.
The following example output indicates a successful installation.
Uncompressing ascend-docker-runtime 100% [INFO]: installing ascend-docker-runtime ... [INFO] ascend-docker-runtime install successRun the following command to make Ascend Docker Runtime take effect.
systemctl daemon-reload && systemctl restart dockerAscend Device Plugin automatically checks whether Ascend Docker Runtime exists during startup. Therefore, you need to start Ascend Docker Runtime first and then start Ascend Device Plugin. If you start Ascend Device Plugin first and then start Ascend Docker Runtime, you need to restart Ascend Device Plugin by referring to Ascend Device Plugin.
After the software package is downloaded, go to the path where the software package (run package) is located.
cd <path to run package>Run the following command to add executable permission to the software package.
chmod u+x Ascend-docker-runtime_{version}_linux-{arch}.runRun the following command to verify the consistency and integrity of the software package installation file.
./Ascend-docker-runtime_{version}_linux-{arch}.run --checkExample 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 using the following command.
Install to the default path.
./Ascend-docker-runtime_{version}_linux-{arch}.run --install --install-scene=containerdTo install to a specified path, run the following command. The
--install-pathparameter specifies the installation path../Ascend-docker-runtime_{version}_linux-{arch}.run --install --install-scene=containerd --install-path=<path>- An absolute path must be used for specifying the installation path.
- If the Containerd configuration file path is not the default
/etc/containerd/config.toml, you need to add the--config-file-pathparameter to specify the configuration file path.
The following example output indicates a successful installation.
Uncompressing ascend-docker-runtime 100% [INFO]: installing ascend-docker-runtime ... [INFO] ascend-docker-runtime install success(Optional) If the installation fails, refer to the following steps to modify the Containerd configuration file.
Open the configuration file.
Scenario where Containerd has no default configuration file: Run the following commands in sequence to create and modify the configuration file.
mkdir /etc/containerd containerd config default > /etc/containerd/config.toml vim /etc/containerd/config.tomlScenario with an existing Containerd configuration file: Open and modify the configuration file.
vim /etc/containerd/config.toml
Add
ascend runtimeand set it as the default runtime. An example is shown below.Locate the following runc configuration in the configuration file (note that
io.containerd.cri.v1.runtimemay vary across different Containerd versions; use the actual value):[plugins.'io.containerd.cri.v1.runtime'.containerd.runtimes.runc] runtime_type = 'io.containerd.runc.v2' runtime_path = '' pod_annotations = [] container_annotations = [] privileged_without_host_devices = false privileged_without_host_devices_all_devices_allowed = false cgroup_writable = false base_runtime_spec = '' cni_conf_dir = '' cni_max_conf_num = 0 snapshotter = '' sandboxer = 'podsandbox' io_type = '' [plugins.'io.containerd.cri.v1.runtime'.containerd.runtimes.runc.options] BinaryName = '' CriuImagePath = '' CriuWorkPath = '' IoGid = 0 IoUid = 0 NoNewKeyring = false Root = '' ShimCgroup = '' SystemdCgroup = true ...Copy the above configuration content, change
runctoascendand set the value ofBinaryNameto the installation path of the ascend-docker-runtime executable file. Refer to the following (whereio.containerd.cri.v1.runtimemay vary across different Containerd versions; use the actual value):[plugins.'io.containerd.cri.v1.runtime'.containerd.runtimes.ascend] runtime_type = 'io.containerd.runc.v2' runtime_path = '' pod_annotations = [] container_annotations = [] privileged_without_host_devices = false privileged_without_host_devices_all_devices_allowed = false cgroup_writable = false base_runtime_spec = '' cni_conf_dir = '' cni_max_conf_num = 0 snapshotter = '' sandboxer = 'podsandbox' io_type = '' [plugins.'io.containerd.cri.v1.runtime'.containerd.runtimes.ascend.options] BinaryName = '/usr/local/Ascend/Ascend-Docker-Runtime/ascend-docker-runtime' CriuImagePath = '' CriuWorkPath = '' IoGid = 0 IoUid = 0 NoNewKeyring = false Root = '' ShimCgroup = '' SystemdCgroup = true ...Locate the following configuration item and change the value of
default_runtime_nametoascend(whereio.containerd.cri.v1.runtimemay vary across different Containerd versions; use the actual value):Before modification:
[plugins.'io.containerd.cri.v1.runtime'.containerd] default_runtime_name = 'runc' ignore_blockio_not_enabled_errors = false ignore_rdt_not_enabled_errors = false ...After modification:
[plugins.'io.containerd.cri.v1.runtime'.containerd] default_runtime_name = 'ascend' ignore_blockio_not_enabled_errors = false ignore_rdt_not_enabled_errors = false ...
Run the following command to restart Containerd.
systemctl daemon-reload && systemctl restart containerd
After the software package is downloaded, first go to the path where the installation package (run package) is located.
cd <path to run package>Run the following command to add executable permission to the software package.
chmod u+x Ascend-docker-runtime_{version}_linux-{arch}.runRun the following command to verify the consistency and integrity of the software package installation file.
./Ascend-docker-runtime_{version}_linux-{arch}.run --checkExample 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.You can install Ascend Docker Runtime using the following commands.
Install to the default path.
./Ascend-docker-runtime_{version}_linux-{arch}.run --install --install-scene=containerdTo install to a specified path, run the following command. The
--install-pathparameter specifies the installation path../Ascend-docker-runtime_{version}_linux-{arch}.run --install --install-scene=containerd --install-path=<path>You must use an absolute path when specifying the installation path.
The following example output indicates a successful installation.
Uncompressing ascend-docker-runtime 100% [INFO]: installing ascend-docker-runtime ... [INFO] ascend-docker-runtime install success(Optional) If the installation fails, refer to Step 5 in Installing Ascend Docker Runtime in the Containerd Scenario.
If you need to change the container runtime on the node from Docker to Containerd, you must modify the kubelet configuration file
kubeadm-flags.envon the node. For details, see the K8s official documentation.If a Docker service exists, run the following command to stop the corresponding service.
systemctl stop dockerRun the command to restart Containerd and kubelet. The following is an example output.
systemctl daemon-reload && systemctl restart containerd kubelet
Table 1 lists parameters supported by the Ascend Docker Runtime installation commands.
Table 1 Parameters