IP Library Granted Patent US 10,552,133
Granted Patent B2
US 10,552,133 · App. 15/492,940 · Granted Feb 4, 2020

Image deployment method and apparatus

Inventors: Lei Yang (Xi'an, CN); Jincheng Li (Xi'an, CN); Hang Wang (Xi'an, CN)
Assignee: Huawei Technologies Co., Ltd.
G06F8/60
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 10,552,133
App. No.
15/492,940
Granted
Feb 4, 2020
Kind
B2
Abstract

This application discloses an image deployment method, where the image deployment method is applied to a container system. Information about an image that has been deployed on each host is collected. After an image tag of a to-be-deployed image is obtained, a degree of overlapping between the image that has been deployed on each host and the to-be-deployed image is determined. A host with a higher overlapping degree needs to download a smaller amount of data when deploying the to-be-deployed image and deploys the to-be-deployed image at a higher speed. Finally, a management node selects, according to overlapping degrees of the hosts, a deployment host for deploying the to-be-deployed image.

Claims (55)

1. An image deployment method, comprising:

obtaining an image tag of a to-be-deployed image, wherein an image registry stores multiple images, each image of the multiple images represented by an image tag, wherein the multiple images comprise at least one image repository, each image repository comprising n images, and wherein there is a parent-child relationship between at least two images of the n images;

obtaining, from the image registry, an image tag of a parent image of the to-be-deployed image according to the image tag of the to-be-deployed image;

determining at least two to-be-selected hosts from hosts in a container system;

determining, for each of the at least two to-be-selected hosts, an image tag of an image that has been deployed on the to-be-selected host;

matching the image tag of the parent image of the to-be-deployed image with the image tag of the image that has been deployed on each to-be-selected host, to determine a parent image that is of the to-be-deployed image and that has been deployed on each to-be-selected host;

comparing the parent images of the to-be-deployed image that have been deployed on the to-be-selected hosts; and

selecting a deployment host for the to-be-deployed image according to a comparison result and a predetermined policy, wherein the predetermined policy is that a to-be-selected host with a largest quantity of deployed parent images of the to-be-deployed image is selected as the deployment host from the at least two to-be-selected hosts;

wherein the matching the image tag of the parent image of the to-be-deployed image with the image tag of the image that has been deployed on each to-be-selected host, to determine the parent image that is of the to-be-deployed image and that has been deployed on each to-be-selected host comprises:

determining a currently to-be-selected host from the at least two to-be-selected hosts, and sequentially performing the following steps until a parent image that is of the to-be-deployed image and that has been deployed on the currently to-be-selected host is determined, wherein the steps comprise:

step 1: matching the image tag of the to-be-deployed image with an image tag of an image that has been deployed on the currently to-be-selected host; and if the matching in the step 1 is successful, determine that the to-be-deployed image has been deployed on the currently to-be-selected host, or perform step 2 if the matching in the step 1 is unsuccessful;

step 2: matching an image tag of a top-layer parent image of the to-be-deployed image with the image tag of the image that has been deployed on the currently to-be-selected host; and if the matching in the step 2 is successful, determine that all parent images of the to-be-deployed image have been deployed on the currently to-be-selected host, or perform step 3 if the matching in the step 2 is unsuccessful; and

step 3: matching an image tag of a current image with the image tag of the image that has been deployed on the currently to-be-selected host, wherein the current image is a top-layer parent image of the parent image that is of the to-be-deployed image and on which matching has been performed in the previous step; and if the matching in the step 3 is successful, determine that all the parent images of the current image have been deployed on the currently to-be-selected host, or if the matching in the step 3 is unsuccessful, perform step 3 again until each parent image of the to-be-deployed image has been matched with the image tag of the image that has been deployed on the currently to-be-selected host.

2. The image deployment method according to claim 1 , further comprising:

when a trigger occasion is met, obtaining and storing, for each host in the container system, an image tag of an image that has been deployed on the host, wherein the trigger occasion is met in response to determining that: a preset period expires, or a container deployment instruction is received, or a collection instruction sent is received, wherein the collection instruction is used to instruct to collect and store the image tag of the images that have been deployed on the hosts; and

determining, for each to-be-selected host and according to the stored image tag of the images that have been deployed on the hosts, the image tag of the image that has been deployed on the to-be-selected host.

3. The image deployment method according to claim 1 ,

wherein before the determining the at least two to-be-selected hosts from the hosts in the container system, the method further comprises: obtaining resource utilization information of each host, wherein the resource utilization information comprises memory usage or central processing unit usage; and

wherein the determining the at least two to-be-selected hosts from the hosts in the container system comprises:

determining, according to the resource utilization information of each host, the at least two to-be-selected hosts that meet a resource utilization requirement of the to-be-deployed image.

4. A computing device set in a container system, comprising:

a memory storing a program; and

a processor configured to execute the program to cause the computer device to:

obtain an image tag of a to-be-deployed image, wherein an image registry stores multiple images, each image of the multiple images represented by an image tag, wherein the multiple images comprise at least one image repository, each image repository comprising n images, and wherein there is a parent-child relationship between at least two images of the n images;

obtain, from the image registry, an image tag of a parent image of the to-be-deployed image according to the image tag of the to-be-deployed image;

determine at least two to-be-selected hosts from hosts in the container system;

determine, for each of the at least two to-be-selected hosts, an image tag of an image that has been deployed on the to-be-selected host;

match the image tag of the parent image of the to-be-deployed image with the image tag of the image that has been deployed on each to-be-selected host, to determine a parent image that is of the to-be-deployed image and that has been deployed on each to-be-selected host;

compare the parent images of the to-be-deployed image that have been deployed on the to-be-selected hosts; and

select a deployment host for the to-be-deployed image according to a comparison result and a predetermined policy, wherein the predetermined policy is that a to-be-selected host with a largest quantity of deployed parent images of the to-be-deployed image is selected as the deployment host from the at least two to-be-selected hosts;

wherein the matching step comprises:

determining a currently to-be-selected host from the at least two to-be-selected hosts, and sequentially performing the following steps until a parent image that is of the to-be-deployed image and that has been deployed on the currently to-be-selected host is determined, wherein the steps comprise:

step 1: matching the image tag of the to-be-deployed image with an image tag of an image that has been deployed on the currently to-be-selected host and if the matching in the step 1 is successful, determine that the to-be-deployed image has been deployed on the currently to-be-selected host, or perform step 2 if the matching in the step 1 is unsuccessful;

step 2: matching an image tag of a top-layer parent image of the to-be-deployed image with the image tag of the image that has been deployed on the currently to-be-selected host and if the matching in the step 2 is successful, determine that all parent images of the to-be-deployed image have been deployed on the currently to-be-selected host, or perform step 3 if the matching in the step 2 is unsuccessful; and

step 3: matching an image tag of a current image with the image tag of the image that has been deployed on the currently to-be-selected host, wherein the current image is a top-layer parent image of the parent image that is of the to-be-deployed image and on which matching has been performed in the previous step; and if the matching in the step 3 is successful, determine that all the parent images of the current image have been deployed on the currently to-be-selected host, or if the matching in the step 3 is unsuccessful, perform step 3 again until each parent image of the to-be-deployed image has been matched with the image tag of the image that has been deployed on the currently to-be-selected host.

5. The computing device according to claim 4 , wherein the processor is further configured to execute the program to cause the computing device to:

when a trigger occasion is met, obtain, for each host in the container system, an image tag of an image that has been deployed on the host; wherein the trigger occasion is met in response to determining that: a preset period expires, or a container deployment instruction is received, or a collection instruction sent is received, wherein the collection instruction is used to instruct to collect and store the image tag of the images that have been deployed on the hosts;

store, for each host in the container system, the image tag of the image that has been deployed on the host into the memory; and

determine, for each to-be-selected host and according to the stored image tag of the images that have been deployed on the hosts, the image tag of the image that has been deployed on the to-be-selected host.

6. The computing device according to claim 4 , wherein the processor is further configured to execute the program to cause the computing device to:

obtain resource utilization information of each host, wherein the resource utilization information comprises memory usage or central processing unit usage; and

determine according to the resource utilization information of each host, the at least two to-be-selected hosts that meet a resource utilization requirement of the to-be-deployed image.

7. A non-transitory computer-readable storage medium having stored thereon program code, wherein a computing device executes the program code to perform a method of:

obtaining an image tag of a to-be-deployed image, wherein an image registry stores multiple images, each image of the multiple images represented by an image tag, wherein the multiple images comprise at least one image repository, each image repository comprising n images, and wherein there is a parent-child relationship between at least two images of the n images;

obtaining, from the image registry, an image tag of a parent image of the to-be-deployed image according to the image tag of the to-be-deployed image;

determining at least two to-be-selected hosts from hosts in a container system;

determining, for each of the at least two to-be-selected hosts, an image tag of an image that has been deployed on the to-be-selected host;

matching the image tag of the parent image of the to-be-deployed image with the image tag of the image that has been deployed on each to-be-selected host, to determine a parent image that is of the to-be-deployed image and that has been deployed on each to-be-selected host;

comparing the parent images of the to-be-deployed image that have been deployed on the to-be-selected hosts; and

selecting a deployment host for the to-be-deployed image according to a comparison result and a predetermined policy, wherein the predetermined policy is that a to-be-selected host with a largest quantity of deployed parent images of the to-be-deployed image is selected as the deployment host from the at least two to-be-selected hosts;

wherein the matching the image tag of the parent image of the to-be-deployed image with the image tag of the image that has been deployed on each to-be-selected host, to determine the parent image that is of the to-be-deployed image and that has been deployed on each to-be-selected host comprises:

determining a currently to-be-selected host from the at least two to-be-selected hosts, and sequentially performing the following steps until a parent image that is of the to-be-deployed image and that has been deployed on the currently to-be-selected host is determined, wherein the steps comprise:

step 1: matching the image tag of the to-be-deployed image with an image tag of an image that has been deployed on the currently to-be-selected host; and if the matching in the step 1 is successful, determine that the to-be-deployed image has been deployed on the currently to-be-selected host, or perform step 2 if the matching in the step 1 is unsuccessful;

step 2: matching an image tag of a top-layer parent image of the to-be-deployed image with the image tag of the image that has been deployed on the currently to-be-selected host; and if the matching in the step 2 is successful, determine that all parent images of the to-be-deployed image have been deployed on the currently to-be-selected host, or perform step 3 if the matching in the step 2 is unsuccessful; and

step 3: matching an image tag of a current image with the image tag of the image that has been deployed on the currently to-be-selected host, wherein the current image is a top-layer parent image of the parent image that is of the to-be-deployed image and on which matching has been performed in the previous step; and if the matching in the step 3 is successful, determine that all the parent images of the current image have been deployed on the currently to-be-selected host, or if the matching in the step 3 is unsuccessful, perform step 3 again until each parent image of the to-be-deployed image has been matched with the image tag of the image that has been deployed on the currently to-be-selected host.

Assignments (2)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Mar 1, 2022
From: HUAWEI TECHNOLOGIES CO., LTD.
To: HUAWEI CLOUD COMPUTING TECHNOLOGIES CO., LTD.
Reel/Frame 059267/0088 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded May 30, 2017
From: YANG, LEI; LI, JINCHENG; WANG, HANG
To: HUAWEI TECHNOLOGIES CO., LTD.
Reel/Frame 042531/0012 →
Continuity (2)
Continuation PCTCN2015000291 · Dec 31, 2015
Related Publication 20170220329A1 · Aug 3, 2017
Cited By (2)
US 12,386,605 US 12,430,114