Starting and Uninstalling a Cloud Phone
This section describes how to operate a cloud phone instance.
- You can use the kbox_config.cfg file to flexibly configure the resources used by cloud phones to achieve optimal performance.
- The kbox_config.cfg file contains configuration items such as KBOX_GPU_MAP, KBOX_MOUNT_MAP, and KBOX_CPUSET_MAP. You can change the value of the corresponding channel in the maps to select the GPU, CPU, and data volume storage path used by a container.
- The kbox_config.cfg file exists in the startup path. The container uses the configuration in this file. Therefore, ensure that the configuration in the kbox_config.cfg file is correct. If the configuration file does not exist in the startup path, the cloud phone cannot be started.
- Decompress Kbox-AOSP11.zip and upload the deploy_scripts directory in the Kbox-AOSP11 folder to the ~/dependency directory on the server.
- (Optional) To enable hardware decoding, set ENABLE_HARD_DECODE to 1 in the kbox_config.cfg file in the deploy_scripts directory and perform the following steps to configure NETINT card nodes:
- Run the following command to view the nodes of the NETINT card chips.
1nvme listThe following is an example of the command output. The information in bold indicates the NVMe nodes of the chips of the NETINT Quadra encoding card. One encoding card has two chips.
1 2 3 4
Node SN Model Namespace Usage Format FW Rev ------------- -------------------- ---------------- --------- ------------------------ ---------------- -------- /dev/nvme0n1 Q2A325A11DC082-0454A QuadraT2A 1 8.59 TB / 8.59 TB 4 KiB + 0 B 4606nrc2 /dev/nvme1n1 Q2A325A11DC082-0454B QuadraT2A 1 8.59 TB / 8.59 TB 4 KiB + 0 B 4606nrc2
- Check the mapping between NVMe nodes and PCIe bus numbers.{index} indicates the NVMe node number returned in 2.a. For example, in /dev/nvme0n1, the value of {index} is 0.
1find /sys/devices/ -name nvme{index}
In the following command output, 0000:05:00.0 indicates the bus number of the device.
1 2
/sys/devices/pci0000:00/0000:00:0e.0/0000:05:00.0/nvme/nvme0 /sys/devices/virtual/nvme-subsystem/nvme-subsys0/nvme0
- Check the mapping between the node and NUMA based on the bus number.{busID} indicates the bus number obtained in the previous step. For example, in the command output for nvme0, {busID} is 0000:05:00.0.
1lspci -vvvs {busID} | grep NUMA
The command output is as follows:
1NUMA node: 0
- Change the value of NETINT in the kbox_config.cfg file based on the NUMA information corresponding to the NVMe node of the encoding card.
For servers powered by Kunpeng 920 7265F or 7260 processors: Write NVMe nodes belonging to NUMA 0 and NUMA 1 in the NETINT0 field, and NVMe nodes belonging to NUMA 2 and NUMA 3 in the NETINT1 field.
Two nodes need to be added for each device in a field. For example, for NVMe device 2, you need to add nodes /dev/nvme2 and /dev/nvme2n1.
# Nodes of NETINT encoding card devices NETINT0="/dev/nvme0,/dev/nvme0n1,/dev/nvme1,/dev/nvme1n1" NETINT1="/dev/nvme2,/dev/nvme2n1,/dev/nvme3,/dev/nvme3n1"
- If the value of NETINT is empty when the container is started for the first time, do not set ENABLE_HARD_DECODE to 1. Do not set ENABLE_HARD_DECODE to 1 also when the container is restarted. Otherwise, a black screen will occur for a short period of time when you play a video.
- If software decoding is used (by setting ENABLE_HARD_DECODE to 0) during startup, you can switch to hardware decoding (by setting ENABLE_HARD_DECODE to 1) during a restart, with the prerequisite that you have configured NETINT in the previous startup.
- For the environment where one Quadra T2A encoding card is installed, configure the device node information based on the site requirements. The following configuration is for reference.
# Nodes of NETINT encoding card devices NETINT0="/dev/nvme0,/dev/nvme0n1,/dev/nvme1,/dev/nvme1n1" NETINT1="/dev/nvme0,/dev/nvme0n1,/dev/nvme1,/dev/nvme1n1"
- Run the following command to view the nodes of the NETINT card chips.
- Run the android11_kbox.sh script to start containers.
1 2 3
cd ~/dependency/deploy_scripts chmod +x android11_kbox.sh ./android11_kbox.sh start {image_name:tag} ${index1} ${index2}
Table 1 lists the default configurations of a Kbox basic cloud phone.
Table 1 Default configurations Configuration Item
Kbox Basic Cloud Phone
Scenario
Mobile office/hosting
vCPU
2
CPU core binding policy
2 containers, 2 cores
Memory
6 GB
System storage
16 GB
Resolution
720 x 1280
The following are examples of using the startup script:
- Start instance 1.
1./android11_kbox.sh start kbox:latest 1
- Start instances 1 to 5.
1./android11_kbox.sh start kbox:latest 1 5
- Start instance 1.
- Run the following command to check whether the Kbox container is started successfully. ${index} indicates the ID of the instance.
1docker exec -it kbox_${index} getprop | grep boot_completed
In the output, if the value of sys.boot_completed is 1, the startup is successful.
- Stop and delete Kbox containers.
In the Kbox solution, data volumes are mounted by default. The default docker stop and docker rm commands cannot completely clear container data. Run the following script to completely clear files on the host.
Run the android11_kbox.sh script to stop and delete a running Kbox container.
- Stop and delete the container whose ID is ${index}.
1./android11_kbox.sh delete ${index}
- Stop and delete all the containers numbered from ${index1} to ${index2}.
1./android11_kbox.sh delete ${index1} ${index2}
- Stop and delete the container whose ID is ${index}.
- Restart Kbox containers.
In the Kbox solution, data volumes are mounted by default. The default docker restart command cannot restart a container. Instead, run the following script to restart a container.
Run the android11_kbox.sh script to restart Kbox containers.
- Restart the container numbered ${index}.
1./android11_kbox.sh restart ${index}
- Restart all the containers numbered from ${index1} to ${index2}.
1./android11_kbox.sh restart ${index1} ${index2}
- Restart the container numbered ${index}.