Image deployment method, device, electronic device and storage medium

By pre-made heterogeneous images matching the information of different heterogeneous deployment architectures in the basic mirror warehouse and establishing mirror mapping tables, the problem of heterogeneous deployment architecture mismatch in container cloud cluster deployment is solved, reducing deployment cost and time, and improving deployment efficiency.

CN114490037BActive Publication Date: 2025-03-07SHENZHEN INTELLIFUSION TECHNOLOGIES CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202111629787.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-28
Publication Date
2025-03-07
Estimated Expiration
2041-12-28

AI Technical Summary

Technical Problem

During container cloud cluster deployment, mismatch in heterogeneous deployment architectures leads to an increase in time cost of discovering and handling problems during deployment, and requires writing a large number of adaptation scripts, increasing maintenance costs.

Method used

By pre-creating heterogeneous images matching different heterogeneous deployment architecture information in the basic mirror repository and establishing a mirror mapping table, matching and deploying appropriate images based on the target heterogeneous deployment architecture information, reducing the need to write adaptive scripts when deploying exceptions.

Benefits of technology

Reduces the time and labor cost of mirror deployment, improves the efficiency of mirror deployment, and reduces deployment exceptions caused by heterogeneous deployment architecture mismatch.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114490037B_ABST
    Figure CN114490037B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention relates to an image deployment method, device, electronic device and storage medium, the method comprising: obtaining a target image name and target heterogeneous deployment architecture information of an image to be deployed; obtaining multiple first images matching the target image name in a basic image repository based on the target image name, wherein the multiple first images correspond to multiple deployable heterogeneous deployment architecture information; establishing an image mapping table based on the multiple first images and the deployable heterogeneous deployment architecture information corresponding to each first image; obtaining the target first image in the image mapping table based on the target heterogeneous deployment architecture information, and deploying the target first image in the target heterogeneous deployment architecture. By using this method, single-architecture images can be reused, the complexity of remaking images when deployment problems occur can be reduced, the development and maintenance of images on the script side can be reduced, the development time and labor costs can be reduced, and the image deployment efficiency can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present invention relate to the field of image deployment, and in particular to an image deployment method, device, electronic device and storage medium. Background Art

[0002] At present, after adopting containerization as the basic deployment form, all data is packaged in the image, and deployment becomes very easy. You can directly load the image to start the container. For the target deployment cluster, the container cloud deployment mode can deploy the entire cluster in batches. However, in the actual container cloud cluster deployment process, there are usually target machines with different architectures in the cluster, which has the following problems with the requirements of traditional container cloud cluster deployment: different on-site target deployment cluster machines may have servers with multiple heterogeneous deployment architectures. For deployment images that do not meet the current on-site deployment architecture requirements, if support is required, a large number of adaptation scripts need to be written, which increases the cost of maintaining deployment scripts; for the uncertainty of the heterogeneous deployment architecture of the target deployment cluster machine, if the traditional container cloud deployment mode is adopted, the problem of heterogeneous deployment architecture mismatch can only be discovered in the later stage of the deployment process, and then the problem can be relocated and handled, which increases the time cost to a certain extent. How to solve the above problems has become a major challenge. Summary of the invention

[0003] In view of this, in order to solve the above technical problems or part of the technical problems, the embodiments of the present invention provide a mirror deployment method, device, electronic device and storage medium.

[0004] In a first aspect, an embodiment of the present invention provides an image deployment method, including:

[0005] Get the target image name and target heterogeneous deployment architecture information of the image to be deployed;

[0006] Based on the target image name, obtaining multiple first images matching the target image name in a basic image repository, wherein the multiple first images correspond to multiple deployable heterogeneous deployment architecture information;

[0007] Establishing an image mapping table based on the multiple first images and deployable heterogeneous deployment architecture information corresponding to each first image;

[0008] Based on the target heterogeneous deployment architecture information, a target first image is obtained in the image mapping table, and the target first image is deployed in the target heterogeneous deployment architecture.

[0009] In a possible implementation, the method further includes:

[0010] If the target heterogeneous deployment architecture of the image to be deployed includes multiple devices, obtaining host information of all devices;

[0011] Perform mirror affinity check on the host information of all the devices.

[0012] In a possible implementation, the method further includes:

[0013] If the host information of any device among all the devices does not match the image to be deployed, the deployment operation is terminated and the mismatching host information is recorded;

[0014] If the host information in all the devices matches the image to be deployed, the deployment operation is performed.

[0015] In a possible implementation, the method further includes:

[0016] Determining a patch file based on the unmatched host information;

[0017] The patch file is sent to a target heterogeneous deployment architecture, so that the target heterogeneous deployment architecture repairs the image deployment environment of the unmatched host based on the patch file.

[0018] In a possible implementation, the method further includes:

[0019] Get all the base images to be deployed;

[0020] For each base image, create a plurality of heterogeneous images corresponding to different heterogeneous deployment architecture information matching the base image, and obtain a plurality of heterogeneous images corresponding to each base image;

[0021] Based on multiple heterogeneous images corresponding to each of the base images, a base image warehouse is formed.

[0022] In a possible implementation, the method further includes:

[0023] Based on the image name, multiple images corresponding to each image name are grouped to obtain multiple groups of images, wherein each group of images includes a base image and corresponding multiple heterogeneous images.

[0024] In a second aspect, an embodiment of the present invention provides an image deployment device, including:

[0025] The acquisition module is used to obtain the target image name and target heterogeneous deployment architecture information of the image to be deployed;

[0026] The acquisition module is further used to acquire all matching multiple first images in the basic image repository based on the target image name, wherein the multiple first images correspond to multiple deployable heterogeneous deployment architecture information;

[0027] An establishing module, configured to establish an image mapping table based on the plurality of first images and deployable heterogeneous deployment architecture information corresponding to each first image;

[0028] A deployment module is used to obtain a target first image in the image mapping table based on the target heterogeneous deployment architecture information, and deploy the target first image in the target heterogeneous deployment architecture.

[0029] In a possible implementation, the device further includes a verification module, which is used to obtain host information of all devices if the target heterogeneous deployment architecture of the image to be deployed includes multiple devices; and perform image affinity verification on the host information of all devices.

[0030] In a third aspect, an embodiment of the present invention provides a server, comprising: a processor and a memory, wherein the processor is used to execute an image deployment program stored in the memory to implement the image deployment method described in the first aspect above.

[0031] In a fourth aspect, an embodiment of the present invention provides a storage medium, including: the storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the image deployment method described in the first aspect above.

[0032] The image deployment scheme provided by the embodiment of the present invention obtains the target image name and the target heterogeneous deployment architecture information of the image to be deployed; obtains multiple first images matching the target image name in the basic image warehouse based on the target image name, wherein the multiple first images correspond to multiple deployable heterogeneous deployment architecture information; establishes an image mapping table based on the multiple first images and the deployable heterogeneous deployment architecture information corresponding to each first image; obtains the target first image in the image mapping table based on the target heterogeneous deployment architecture information, and deploys the target first image in the target heterogeneous deployment architecture. Compared with the existing deployment method, the problem of heterogeneous deployment architecture information mismatch is not considered. Once information mismatch occurs, a large number of adaptation scripts need to be written, which increases labor and time costs and has low deployment efficiency. According to the present scheme, a basic image warehouse adapted to multiple heterogeneous deployment architecture information is established in advance, and deployable images are matched according to the target heterogeneous deployment architecture information. This can reduce the problem of writing a large number of adaptation scripts when deployment is abnormal, reduce the time and labor costs of image deployment, and improve image deployment efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] Figure 1A schematic diagram of a process flow of a mirror deployment method provided by an embodiment of the present invention;

[0034] Figure 2 A schematic diagram of a flow chart of a mirror affinity verification method provided by an embodiment of the present invention;

[0035] Figure 3 A schematic diagram of a process for creating a basic image repository provided by an embodiment of the present invention;

[0036] Figure 4 A flowchart of heterogeneous deployment of container cloud provided by an embodiment of the present invention;

[0037] Figure 5 A schematic diagram of the structure of a mirror deployment device provided by an embodiment of the present invention;

[0038] Figure 6 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0039] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0040] To facilitate understanding of the embodiments of the present invention, specific embodiments will be further explained below in conjunction with the accompanying drawings. The embodiments do not constitute a limitation on the embodiments of the present invention.

[0041] Figure 1 A schematic diagram of a process flow of a mirror deployment method provided by an embodiment of the present invention, such as Figure 1 As shown, the method specifically includes:

[0042] S11. Obtain the name of the target image to be deployed and the target heterogeneous deployment architecture information.

[0043] S12: Based on the target image name, obtain multiple first images matching the target image name in the basic image repository, wherein the multiple first images correspond to multiple deployable heterogeneous deployment architecture information.

[0044] The following is a unified description of S11-S12:

[0045] In an embodiment of the present invention, an image deployment instruction can be generated on the user side, which carries the name of the target image to be deployed and the target heterogeneous deployment architecture information of the target image to be deployed, and the name of the target image to be deployed is obtained, wherein the image name can be used as a unique identifier of the image.

[0046] Furthermore, according to the target image name, multiple first images matching the target image name are obtained in the basic image repository, and the basic image repository contains multiple heterogeneous images corresponding to different heterogeneous deployment architecture information for the same image to be deployed, that is, each heterogeneous image can correspond to a heterogeneous deployment architecture information, thereby achieving that the same image can be deployed in different heterogeneous deployment architectures.

[0047] Specifically, the basic image repository contains heterogeneous images corresponding to different heterogeneous deployment architecture information. The image list can be maintained in a text file. The text file can be a JSON array. Each image element contains: target heterogeneous image name, image list images and other information. This text file needs to be continuously maintained by operation and maintenance developers.

[0048] S13: Establish an image mapping table based on the multiple first images and the deployable heterogeneous deployment architecture information corresponding to each first image.

[0049] Create an image list of the target image to be deployed. The image list name can be set as the target image name. Index multiple first images that meet the conditions and the heterogeneous deployment architecture information corresponding to each first image in the image list, and record the full information of the first image, including but not limited to: image name, image ID, heterogeneous deployment architecture information matched by the image, image matching platform, etc.

[0050] Furthermore, the image list and the data layer information of the plurality of first images may be constructed into a target heterogeneous deployment image, wherein the image list may also be recorded in a json text file.

[0051] S14. Based on the target heterogeneous deployment architecture information, obtain the target first image in the image mapping table, and deploy the target first image in the target heterogeneous deployment architecture.

[0052] Based on the target heterogeneous deployment architecture information of the image to be deployed, the image mapping table is queried, and the target first image is obtained in the image mapping table. The target first image is an image that matches the target heterogeneous deployment architecture information, that is, the target first image can be normally deployed in the target heterogeneous deployment architecture, and then the obtained target first image is deployed in the target heterogeneous deployment architecture.

[0053] The image deployment method provided by the embodiment of the present invention obtains the target image name and the target heterogeneous deployment architecture information of the image to be deployed; obtains multiple first images matching the target image name in the basic image warehouse based on the target image name, wherein the multiple first images correspond to multiple deployable heterogeneous deployment architecture information; establishes an image mapping table based on the multiple first images and the deployable heterogeneous deployment architecture information corresponding to each first image; obtains the target first image in the image mapping table based on the target heterogeneous deployment architecture information, and deploys the target first image in the target heterogeneous deployment architecture. Compared with the existing deployment method, the problem of heterogeneous deployment architecture information mismatch is not considered. Once information mismatch occurs, a large number of adaptation scripts need to be written, which increases labor and time costs and has low deployment efficiency. According to the present solution, a basic image warehouse adapted to multiple heterogeneous deployment architecture information is established in advance, and deployable images are matched according to the target heterogeneous deployment architecture information. This can reduce the problem of writing a large number of adaptation scripts when deployment is abnormal, reduce the time and labor costs of image deployment, and improve image deployment efficiency.

[0054] Figure 2 A flowchart of a mirror affinity verification method provided by an embodiment of the present invention is shown as follows: Figure 2 As shown, the method specifically includes:

[0055] S21. If the target heterogeneous deployment architecture of the image to be deployed includes multiple devices, host information of all devices is obtained.

[0056] In the embodiment of the present invention, the image affinity check is used to detect whether all devices in the target heterogeneous deployment architecture match the environmental conditions required by the target image to be deployed before the image is officially deployed, and obtain the host information of all devices and store it in the Host file. The host information includes but is not limited to: IP, username, password, etc.

[0057] S22. If the host information of any device among all the devices does not match the image to be deployed, the deployment operation is terminated and the mismatching host information is recorded.

[0058] If there are architecture devices that do not match the conditions in the target cluster machine, the image deployment operation will be exited, and detailed error information can be stored in the log file and fed back to the developer user-side page for display and for review and maintenance.

[0059] S23. Determine a patch file based on the unmatched host information.

[0060] A patch file for repairing the error is determined based on the error information recorded in the log file, wherein the patch file includes but is not limited to affinity verification data, an image adapted to the target heterogeneous deployment architecture, and the like.

[0061] S24. Send the patch file to the target heterogeneous deployment architecture, so that the target heterogeneous deployment architecture repairs the image deployment environment of the mismatched host based on the patch file.

[0062] The patch file is sent to the target heterogeneous deployment architecture, and the target heterogeneous deployment architecture cluster repairs the image deployment environment of the mismatched hosts based on the patch file.

[0063] S25. If the host information in all devices matches the image to be deployed, the deployment operation is performed.

[0064] Correspondingly, if the host information of all devices in the target heterogeneous deployment architecture matches the conditions required by the image to be deployed, the image deployment operation is performed to complete the image deployment.

[0065] The image affinity verification method provided in the embodiment of the present invention can predict the availability of the image deployment package for the target heterogeneous deployment architecture cluster in advance by performing affinity verification before the formal deployment of the image, thereby avoiding the problem of failure during the deployment process due to lack of architecture support, or failure to run normally after the deployment is completed, thereby improving the image deployment efficiency and reducing time cost.

[0066] Figure 3 A flowchart of a method for creating a basic image repository provided by an embodiment of the present invention is shown in FIG. Figure 3 As shown, the method specifically includes:

[0067] S31. Obtain all base images to be deployed.

[0068] In the embodiment of the present invention, heterogeneous images matching different heterogeneous deployment architecture information are prepared in advance in the construction environment to obtain all the basic images to be deployed.

[0069] S32: For each base image, create a plurality of heterogeneous images corresponding to different heterogeneous deployment architecture information matching the base image, and obtain a plurality of heterogeneous images corresponding to each base image.

[0070] S33. Based on multiple heterogeneous images corresponding to each base image, a base image warehouse is formed.

[0071] The following is a unified description of S32~S33:

[0072] Based on the preset multiple heterogeneous deployment architecture information, for each base image, multiple heterogeneous images corresponding to different heterogeneous deployment architecture information matching the base image are produced to obtain multiple heterogeneous images corresponding to each base image, and a base image warehouse is formed based on the multiple heterogeneous images corresponding to each base image. Among them, the multiple heterogeneous deployment architecture information includes but is not limited to: ppc64le, aarch64, x86_64 and other architecture modes.

[0073] S34. Based on the image name, multiple images corresponding to each image name are grouped to obtain multiple groups of images, wherein each group of images includes a base image and corresponding multiple heterogeneous images.

[0074] Optionally, based on the image name, multiple heterogeneous images corresponding to each image name can be grouped into one group, so that there can be multiple groups of different images in the base image repository, where each group of images includes a base image and corresponding multiple heterogeneous images. Furthermore, a group of base images of the target image to be deployed can be quickly found according to the name of the target image to be deployed.

[0075] The basic image warehouse production method provided by the embodiment of the present invention pre-produces a plurality of basic images that match one image with different heterogeneous deployment architecture information, thereby realizing the reuse of single-architecture images, avoiding the problem of re-producing images when mismatched heterogeneous deployment architecture information is found during the image deployment process, reducing the complexity of re-producing images from scratch, and increasing the scalability of images.

[0076] The following is based on Figure 4 A flowchart of heterogeneous deployment of a container cloud provided by an embodiment of the present invention is used to illustrate the process of heterogeneously deploying a container cloud product using the present invention:

[0077] First, multiple basic images matching different heterogeneous deployment architecture information of container cloud products have been produced in the basic image warehouse. The multiple basic images can be stored in the same group, and the group name can be the name of the container cloud product. A group of basic images of the container cloud product can be queried according to the name, and the group of basic images and other files required for the heterogeneous deployment of the container cloud product are made into a container cloud heterogeneous deployment package, where other files may include heterogeneous controller scripts, heterogeneous binary files, etc.; then, the architecture information of the target deployment cluster device and the affinity of the architecture supported by the multiple basic images of the container cloud product are detected. If the architecture information of the target deployment cluster device can match the conditions required by the multiple basic images, the affinity check passes and the deployment operation is performed; if the architecture information of the target deployment cluster device does not match the device, the affinity check fails, and the error information is recorded in the log file and fed back to the operation and maintenance development to customize the patch package; finally, the device update after the patch repair is incorporated into the architecture of the target deployment cluster device again.

[0078] Figure 5 A schematic diagram of the structure of a mirror deployment device provided by an embodiment of the present invention specifically includes:

[0079] An acquisition module 501 is used to acquire the target image name and target heterogeneous deployment architecture information of the image to be deployed;

[0080] The acquisition module 501 is further used to acquire, based on the target image name, a plurality of first images matching the target image name in the basic image repository, wherein the plurality of first images correspond to a plurality of deployable heterogeneous deployment architecture information;

[0081] An establishing module 502 is used to establish an image mapping table based on the multiple first images and the deployable heterogeneous deployment architecture information corresponding to each first image;

[0082] The deployment module 503 is used to obtain a target first image in the image mapping table based on the target heterogeneous deployment architecture information, and deploy the target first image in the target heterogeneous deployment architecture.

[0083] The verification module 504 is used to obtain host information of all devices if the target heterogeneous deployment architecture of the image to be deployed includes multiple devices; and perform image affinity verification on the host information of all devices.

[0084] In a possible implementation, the acquisition module 501 is specifically configured to acquire all basic images to be deployed.

[0085] In one possible implementation, the establishment module 502 is specifically used to create, for each base image, heterogeneous images corresponding to multiple different heterogeneous deployment architecture information matching the base image, to obtain multiple heterogeneous images corresponding to each base image; based on the multiple heterogeneous images corresponding to each base image, a basic image warehouse is formed; based on the image name, the multiple images corresponding to each image name are grouped to obtain multiple groups of images, wherein each group of images includes a base image and corresponding multiple heterogeneous images.

[0086] In one possible implementation, the verification module 504 is specifically used to terminate the deployment operation and record the mismatching host information if the host information of any device among all the devices does not match the image to be deployed; if the host information of all the devices matches the image to be deployed, perform the deployment operation.

[0087] In one possible implementation, the verification module 504 is further used to determine a patch file based on the unmatched host information; and send the patch file to a target heterogeneous deployment architecture so that the target heterogeneous deployment architecture repairs the mirror deployment environment of the unmatched host based on the patch file.

[0088] The image deployment device provided in this embodiment can be as follows Figure 5 The image deployment device shown in can be executed as follows Figure 1-4 All steps of the image deployment method in the Figure 1-4 For more information, please refer to the technical effects of the image deployment method shown in the figure. Figure 1-4 For the sake of brevity, the relevant description is not repeated here.

[0089] Figure 6 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention, Figure 6 The electronic device 600 shown includes: at least one processor 601, a memory 602, at least one network interface 604 and other user interfaces 603. The various components in the electronic device 600 are coupled together via a bus system 605. It is understood that the bus system 605 is used to achieve connection and communication between these components. In addition to the data bus, the bus system 605 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, the bus system 605 is not shown in FIG. Figure 6 Various buses are labeled as bus system 605 .

[0090] The user interface 603 may include a display, a keyboard, or a pointing device (eg, a mouse, a trackball, a touch pad, or a touch screen).

[0091] It can be understood that the memory 602 in the embodiment of the present invention can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example but not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct RAM bus random access memory (DRRAM). The memory 602 described herein is intended to include, but is not limited to, these and any other suitable types of memory.

[0092] In some implementations, the memory 602 stores the following elements, executable units or data structures, or a subset thereof, or an extended set thereof: an operating system 6021 and an application 6022 .

[0093] The operating system 6021 includes various system programs, such as a framework layer, a core library layer, a driver layer, etc., which are used to implement various basic services and process hardware-based tasks. The application 6022 includes various application programs, such as a media player (Media Player), a browser (Browser), etc., which are used to implement various application services. The program for implementing the method of the embodiment of the present invention can be included in the application 6022.

[0094] In the embodiment of the present invention, by calling the program or instruction stored in the memory 602, specifically, the program or instruction stored in the application 6022, the processor 601 is used to execute the method steps provided by each method embodiment, for example, including:

[0095] Obtain a target image name and target heterogeneous deployment architecture information of an image to be deployed; obtain multiple first images matching the target image name in a basic image repository based on the target image name, wherein the multiple first images correspond to multiple deployable heterogeneous deployment architecture information; establish an image mapping table based on the multiple first images and the deployable heterogeneous deployment architecture information corresponding to each first image; obtain a target first image in the image mapping table based on the target heterogeneous deployment architecture information, and deploy the target first image in the target heterogeneous deployment architecture.

[0096] In a possible implementation, if the target heterogeneous deployment architecture of the image to be deployed includes multiple devices, host information of all devices is obtained; and image affinity verification is performed on the host information of all devices.

[0097] In a possible implementation, if the host information of any device among all the devices does not match the image to be deployed, the deployment operation is terminated and the mismatched host information is recorded; if the host information of all the devices matches the image to be deployed, the deployment operation is performed.

[0098] In a possible implementation, a patch file is determined based on the unmatched host information; and the patch file is sent to a target heterogeneous deployment architecture, so that the target heterogeneous deployment architecture repairs the mirror deployment environment of the unmatched host based on the patch file.

[0099] In one possible implementation, all base images to be deployed are obtained; for each base image, multiple heterogeneous images corresponding to different heterogeneous deployment architecture information matching the base image are produced to obtain multiple heterogeneous images corresponding to each base image; and a base image warehouse is formed based on the multiple heterogeneous images corresponding to each base image.

[0100] In a possible implementation, based on the image name, multiple images corresponding to each image name are grouped to obtain multiple groups of images, wherein each group of images includes a base image and corresponding multiple heterogeneous images.

[0101] The method disclosed in the above embodiment of the present invention can be applied to the processor 601, or implemented by the processor 601. The processor 601 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit in the processor 601 or the instruction in the form of software. The above processor 601 can be a general processor, a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field programmable gate array (Field Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present invention can be implemented or executed. The general processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiment of the present invention can be directly embodied as a hardware decoding processor to execute, or the hardware and software units in the decoding processor can be executed. The software unit can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 602, and the processor 601 reads the information in the memory 602 and completes the steps of the above method in combination with its hardware.

[0102] It is understood that the embodiments described herein may be implemented in hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing unit may be implemented in one or more application specific integrated circuits (ASIC), digital signal processors (DSP), digital signal processing devices (DSPDevice, DSPD), programmable logic devices (PLD), field programmable gate arrays (FPGA), general purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing the functions described in the present application, or a combination thereof.

[0103] For software implementation, the technology described herein can be implemented by a unit that performs the functions described herein. The software code can be stored in a memory and executed by a processor. The memory can be implemented in the processor or outside the processor.

[0104] The electronic device provided in this embodiment may be Figure 6 The electronic device shown in FIG. 1 may perform the following steps: Figure 1-4 All steps of the image deployment method in the Figure 1-4 For more details, please refer to Figure 1-4 For the sake of brevity, the relevant description is not repeated here.

[0105] The embodiment of the present invention also provides a storage medium (computer-readable storage medium). The storage medium here stores one or more programs. The storage medium may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a read-only memory, a flash memory, a hard disk or a solid-state drive; the memory may also include a combination of the above-mentioned types of memory.

[0106] When one or more programs in the storage medium can be executed by one or more processors, the mirror deployment method executed on the electronic device side can be implemented.

[0107] The processor is used to execute the image deployment program stored in the memory to implement the following steps of the image deployment method performed on the electronic device side:

[0108] Obtain a target image name and target heterogeneous deployment architecture information of the image to be deployed; obtain all matching multiple first images in the basic image repository based on the target image name, wherein the multiple first images correspond to multiple deployable heterogeneous deployment architecture information; establish an image mapping table based on the multiple first images and the deployable heterogeneous deployment architecture information corresponding to each first image; obtain the target first image in the image mapping table based on the target heterogeneous deployment architecture information, and deploy the target first image in the target heterogeneous deployment architecture.

[0109] In a possible implementation, if the target heterogeneous deployment architecture of the image to be deployed includes multiple devices, host information of all devices is obtained; and image affinity verification is performed on the host information of all devices.

[0110] In a possible implementation, if the host information of any device among all the devices does not match the image to be deployed, the deployment operation is terminated and the mismatched host information is recorded; if the host information of all the devices matches the image to be deployed, the deployment operation is performed.

[0111] In a possible implementation, a patch file is determined based on the unmatched host information; and the patch file is sent to a target heterogeneous deployment architecture, so that the target heterogeneous deployment architecture repairs the mirror deployment environment of the unmatched host based on the patch file.

[0112] In one possible implementation, all base images to be deployed are obtained; for each base image, multiple heterogeneous images corresponding to different heterogeneous deployment architecture information matching the base image are produced to obtain multiple heterogeneous images corresponding to each base image; and a base image warehouse is formed based on the multiple heterogeneous images corresponding to each base image.

[0113] In a possible implementation, based on the image name, multiple images corresponding to each image name are grouped to obtain multiple groups of images, wherein each group of images includes a base image and corresponding multiple heterogeneous images.

[0114] The professionals should further realize that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to the function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0115] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0116] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A mirror deployment method, characterized in that: include: Get the target image name and target heterogeneous deployment architecture information of the image to be deployed; Based on the target image name, obtaining multiple first images matching the target image name in a basic image repository, wherein the multiple first images correspond to multiple deployable heterogeneous deployment architecture information; Establishing an image mapping table based on the multiple first images and deployable heterogeneous deployment architecture information corresponding to each first image; Based on the target heterogeneous deployment architecture information, obtaining a target first image in the image mapping table, and deploying the target first image in the target heterogeneous deployment architecture; The method further comprises: If the target heterogeneous deployment architecture of the image to be deployed includes multiple devices, obtaining host information of all devices; Performing mirror affinity check on host information of all the devices; The mirror affinity check of the host information of all the devices includes: If the host information of any device among all the devices does not match the image to be deployed, the deployment operation is terminated and the mismatching host information is recorded; If the host information in all the devices matches the image to be deployed, the deployment operation is performed; After recording the unmatched host information, the method further includes: Determining a patch file based on the unmatched host information; The patch file is sent to a target heterogeneous deployment architecture, so that the target heterogeneous deployment architecture repairs the image deployment environment of the unmatched host based on the patch file.

2. The method according to claim 1, characterized in that The method further comprises: Get all the base images to be deployed; For each base image, create a plurality of heterogeneous images corresponding to different heterogeneous deployment architecture information matching the base image, and obtain a plurality of heterogeneous images corresponding to each base image; Based on multiple heterogeneous images corresponding to each of the base images, a base image warehouse is formed.

3. The method according to claim 2, characterized in that The method further comprises: Based on the image name, multiple images corresponding to each image name are grouped to obtain multiple groups of images, wherein each group of images includes a base image and corresponding multiple heterogeneous images.

4. A mirror deployment device, characterized in that: include: The acquisition module is used to obtain the target image name and target heterogeneous deployment architecture information of the image to be deployed; The acquisition module is further used to acquire all matching multiple first images in the basic image repository based on the target image name, wherein the multiple first images correspond to multiple deployable heterogeneous deployment architecture information; An establishing module, configured to establish an image mapping table based on the plurality of first images and deployable heterogeneous deployment architecture information corresponding to each first image; A deployment module, configured to obtain a target first image in the image mapping table based on the target heterogeneous deployment architecture information, and deploy the target first image in the target heterogeneous deployment architecture; It also includes a verification module, which is used to obtain host information of all devices if the target heterogeneous deployment architecture of the image to be deployed includes multiple devices; and perform image affinity verification on the host information of all devices; The verification module is specifically used to terminate the deployment operation and record the unmatched host information if the host information of any device among all the devices does not match the image to be deployed; if the host information of all the devices matches the image to be deployed, perform the deployment operation; The verification module is further used to determine a patch file based on the unmatched host information; and send the patch file to a target heterogeneous deployment architecture so that the target heterogeneous deployment architecture repairs the mirror deployment environment of the unmatched host based on the patch file.

5. An electronic device, characterized in that: include: A processor and a memory, wherein the processor is used to execute the image deployment program stored in the memory to implement the image deployment method according to any one of claims 1 to 3.

6. A storage medium, characterized in that: The storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the image deployment method described in any one of claims 1 to 3.

Citation Information

Patent Citations

  • Multi-architecture container cloud mirror image selection method, device and equipment and storage medium

    CN110673924A

  • Container service deployment method, device and equipment and readable storage medium

    CN111736956A

  • Method and device for releasing application in heterogeneous environment

    CN112231050A