[go: up one dir, main page]

CN117389690B - Mirror image package construction method, device, equipment and storage medium - Google Patents

Mirror image package construction method, device, equipment and storage medium Download PDF

Info

Publication number
CN117389690B
CN117389690B CN202311675364.5A CN202311675364A CN117389690B CN 117389690 B CN117389690 B CN 117389690B CN 202311675364 A CN202311675364 A CN 202311675364A CN 117389690 B CN117389690 B CN 117389690B
Authority
CN
China
Prior art keywords
image
target
architecture
mirror
candidate
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202311675364.5A
Other languages
Chinese (zh)
Other versions
CN117389690A (en
Inventor
黄衍峰
李学峰
幸大树
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhongdian Cloud Computing Technology Co ltd
Original Assignee
Zhongdian Cloud Computing Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhongdian Cloud Computing Technology Co ltd filed Critical Zhongdian Cloud Computing Technology Co ltd
Priority to CN202311675364.5A priority Critical patent/CN117389690B/en
Publication of CN117389690A publication Critical patent/CN117389690A/en
Application granted granted Critical
Publication of CN117389690B publication Critical patent/CN117389690B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45562Creating, deleting, cloning virtual machine instances

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the disclosure relates to a method, a device, equipment and a storage medium for constructing a mirror image package, wherein the method comprises the following steps: acquiring a plurality of candidate images, dependency relationship information corresponding to the plurality of candidate images and a target architecture; dividing a plurality of candidate images into a target reserved image and a target deleted image based on the target architecture and the dependency information; and constructing a mirror image package based on the target reserved mirror image. According to the embodiment of the disclosure, the mirror image package has smaller volume and higher resource utilization rate.

Description

Mirror image package construction method, device, equipment and storage medium
Technical Field
The embodiment of the disclosure relates to the technical field of computers, in particular to a method, a device, equipment and a storage medium for constructing a mirror image package.
Background
Currently, with the development of computer technology, communities are gradually focusing on multi-architecture support to ensure that clusters can run seamlessly across different architectures. For example, for Kubernetes (i.e., K8 s), which has become an industry standard platform for cloud-native application deployment and management, kubernetes clusters can run seamlessly across different architectures when communities are able to implement multi-architecture support.
In a multi-architecture offline environment, when using multiple different architecture container images, a user needs to synchronize the multiple different architecture container images in the fabric image package into the multi-architecture offline environment. However, the current mirror image package has the problems of large volume and low resource utilization rate.
Disclosure of Invention
In order to solve the above technical problems or at least partially solve the above technical problems, embodiments of the present disclosure provide a method, an apparatus, a device, and a storage medium for constructing a mirror package.
A first aspect of an embodiment of the present disclosure provides a method for constructing a mirror packet, where the method includes:
acquiring a plurality of candidate images, dependency relationship information corresponding to the plurality of candidate images and a target architecture;
dividing a plurality of candidate images into a target reserved image and a target deleted image based on target architecture and dependency information, wherein the target reserved image at least comprises a first target reserved image, the first target reserved image is a candidate image of which an applied architecture belongs to the target architecture, and the target deleted image is a candidate image of which the applied architecture does not belong to the target architecture and does not have a dependency relationship with the first target reserved image;
And constructing a mirror image package based on the target reserved mirror image.
A second aspect of an embodiment of the present disclosure provides an apparatus for constructing a mirror image package, including:
the acquisition module is used for acquiring a plurality of candidate images, dependency relationship information corresponding to the candidate images and a target architecture;
the dividing module is used for dividing a plurality of candidate images into a target reserved image and a target deleted image based on target architecture and dependency information, wherein the target reserved image at least comprises a first target reserved image, the first target reserved image is a candidate image of which the applicable architecture belongs to the target architecture, and the target deleted image is a candidate image of which the applicable architecture does not belong to the target architecture and does not have a dependency relationship with the first target reserved image;
and the construction module is used for constructing the mirror image package based on the target reserved mirror image.
A third aspect of the disclosed embodiments provides an electronic device, the server comprising: a processor and a memory, wherein the memory has stored therein a computer program which, when executed by the processor, performs the method of the first aspect described above.
A fourth aspect of the disclosed embodiments provides a computer readable storage medium having stored therein a computer program which, when executed by a processor, can implement the method of the first aspect described above.
Compared with the prior art, the technical scheme provided by the embodiment of the disclosure has the following advantages:
according to the embodiment of the disclosure, a plurality of candidate images, dependency relationship information corresponding to the candidate images and a target architecture can be obtained; dividing a plurality of candidate images into a target reserved image and a target deleted image based on target architecture and dependency information, wherein the target reserved image at least comprises a first target reserved image, the first target reserved image is a candidate image of which an applied architecture belongs to the target architecture, and the target deleted image is a candidate image of which the applied architecture does not belong to the target architecture and does not have a dependency relationship with the first target reserved image; and constructing a mirror image package based on the target reserved mirror image. Therefore, by adopting the technical scheme, the mirror image package comprises the first target reserved mirror image applicable to the target architecture, and does not comprise the target deleted mirror image which is not applicable to the target architecture and does not have a dependency relationship with the first target reserved mirror image, so that the mirror image package has smaller volume and higher resource utilization rate, and the problems of larger mirror image package volume and lower resource utilization rate are solved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description, serve to explain the principles of the disclosure.
In order to more clearly illustrate the embodiments of the present disclosure or the solutions in the prior art, the drawings that are required for the description of the embodiments or the prior art will be briefly described below, and it will be obvious to those skilled in the art that other drawings can be obtained from these drawings without inventive effort.
FIG. 1 is a flowchart of a method for constructing a mirror package provided by an embodiment of the present disclosure;
FIG. 2 is a schematic diagram of a multi-architecture mirrored list provided by an embodiment of the present disclosure;
FIG. 3 is a flow chart of a process for constructing a mirror package provided by an embodiment of the present disclosure;
FIG. 4 is a schematic structural diagram of a device for constructing a mirror image package according to an embodiment of the present disclosure;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure.
Detailed Description
In order that the above objects, features and advantages of the present disclosure may be more clearly understood, a further description of aspects of the present disclosure will be provided below. It should be noted that, without conflict, the embodiments of the present disclosure and features in the embodiments may be combined with each other.
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present disclosure, but the present disclosure may be practiced otherwise than as described herein; it will be apparent that the embodiments in the specification are only some, but not all, embodiments of the disclosure.
The applicant has found through research on the related art that the related art does not consider the actual architecture requirements of the user's multi-architecture offline environment when constructing the image package, but packages images of all possible architectures in the image package. Because flexible architecture selection cannot be performed according to the actual architecture requirements of the user's multi-architecture offline environment, the number of images included in the image package is large and the images which are not actually needed by the user in the multi-architecture offline environment are included, so that the volume of the image package is overlarge and the resource utilization rate is not high. In view of the fact that the method for constructing the mirror image package in the related art lacks flexibility and high efficiency under the condition of facing different architecture requirements, the embodiment of the disclosure provides a method, a device, a medium and equipment for constructing the mirror image package, so that flexible custom combination and expansion of the mirror image package are realized, and the actual architecture requirements of a multi-architecture offline environment are better met. The method of constructing the mirror package will be described in detail with reference to fig. 1 to 3.
Fig. 1 is a flowchart of a method for constructing a mirror package according to an embodiment of the present disclosure, which may be performed by an electronic device. The electronic device may be understood as a device such as a mobile phone, tablet, notebook, desktop, smart television, etc., by way of example. By the method for constructing the mirror package, the mirror package can be constructed for a cluster (such as Kubernetes and the like). As shown in fig. 1, the method provided in this embodiment includes the following steps:
S110, acquiring a plurality of candidate images, dependency relationship information corresponding to the plurality of candidate images and a target architecture.
Specifically, the candidate image is an image applicable to a candidate architecture, where a specific type of the candidate architecture can be set by a person skilled in the art according to the actual situation of the architecture that may be used by the user, for example, any architecture in the market may be used as the candidate architecture, for example, but not limited to, X86, ARM, RISC-V, MIPS, etc. in the market may be used as the candidate architecture.
The candidate mirror may include a mirror configuration, a mirror layer, and the like, but is not limited thereto.
Various embodiments of "obtaining multiple candidate images" are described below with respect to a typical example, but are not meant to limit the present disclosure.
In some embodiments, obtaining a plurality of candidate images includes: obtaining a pulling address and a hash value corresponding to the multi-architecture mirror list; based on the pull address and the hash value, a corresponding multi-architecture mirror list is obtained; based on the multi-architecture mirror list, a plurality of candidate mirrors are obtained.
Specifically, the pull address is the memory address that stores the multi-architecture mirrored list.
In particular, the hash value of the multi-architecture mirror list may include, but is not limited to, sha256 value, and the like.
Specifically, the hash value of at least one candidate image is included in the multi-architecture image list, and the hash value of the candidate image may include, but is not limited to, sha256 values.
In particular, multiple candidate images may be synchronized to a local image repository.
Illustratively, FIG. 2 is a schematic diagram of a multi-architecture mirrored list provided by an embodiment of the present disclosure. Referring to fig. 2, if the multi-architecture mirror list is obtained based on the pull address and the hash value corresponding to the multi-architecture mirror list shown in fig. 2, the first candidate mirror may be obtained based on the hash value of the first candidate mirror, and the second candidate mirror may be obtained based on the hash value of the second candidate mirror.
Of course, the plurality of candidate images may also be obtained by receiving images transmitted from other electronic devices, or by reading images stored in the storage device.
Specifically, the dependency relationship information is used to record the dependency relationship between different candidate images, for example, the plurality of candidate images includes a first candidate image, a second candidate image, a third candidate image, a fourth candidate image, and a fifth candidate image, and if the first candidate image and the second candidate image have the dependency relationship, and the third candidate image and the fifth candidate image have the dependency relationship, the dependency relationship needs to be recorded in the dependency relationship information. It should be noted that having a dependency relationship between two candidate images means that the two candidate images have the same image layer.
There are various specific ways of determining the dependency information, and a typical example will be described below, but this is not a limitation of the present application.
In some embodiments, the determination of the dependency information includes: for a plurality of candidate images, if at least one identical image layer exists between the two candidate images, determining that the two candidate images have a dependency relationship.
For example, a plurality of candidate images are paired to obtain a plurality of image pairs, then, for each image pair in the plurality of candidate images, two candidate images in the image pair are compared, and if at least one identical image layer exists, it is determined that the two candidate images in the image pair have a dependency relationship.
It can be understood that whether the two candidate images have the dependency relationship is determined by detecting whether the two candidate images have at least one identical image layer or not, so that the construction mode of the dependency relationship information is simple and easy to realize, and the realization difficulty of constructing the dependency relationship information is reduced.
Of course, the trained dependency information construction model (for example, a neural network model) may also be used to construct dependency information corresponding to a plurality of candidate models, for example, a plurality of candidate images are input into the trained dependency information construction model, so as to obtain dependency information output by the dependency information construction model.
Specifically, the target architecture may be determined by the actual architecture requirements of the multi-architecture offline environment to which the mirror package is to be deployed. For example, the actual architecture requirements of a multi-architecture offline environment include X86 and ARM, and the target architecture includes X86 and ARM.
Various embodiments of the "acquisition target architecture" are described below with respect to typical examples, but do not constitute limitations of the present disclosure.
In some embodiments, obtaining the target architecture includes: displaying candidate architecture identifiers corresponding to the candidate architectures; and responding to the selection operation of the target architecture identification in the candidate architecture identifications, and taking the candidate architecture corresponding to the target architecture identification as the target architecture.
In particular, the candidate architecture identification is used to identify candidate architectures. The specific presentation form of the candidate architecture identification may include, for example, but is not limited to, a tag, a card, text, and the like.
Specifically, the selecting operation is an operation of selecting a target architecture identification from the candidate architecture identifications. The selection operation may include, for example, but not limited to, a triggering operation on the candidate architecture identification via a mouse, touch screen, or the like.
It can be understood that the target architecture is obtained through selection operation, so that the target architecture corresponding to the mirror image package can be flexibly selected according to the actual architecture requirement of the multi-architecture offline environment, and the mirror image package can be flexibly customized.
In other embodiments, obtaining the target architecture includes: the architecture of the current device is identified and the architecture of the current device is taken as a target architecture.
Specifically, the current device is an electronic device that performs the method of constructing the image package. Those skilled in the art may recognize the architecture of the current device using any possible existing recognition method, and this disclosure is not limited in this regard.
It can be understood that by setting the architecture of the current device as the target architecture, the target architecture can be obtained quickly and efficiently under the condition of unmanned aerial vehicle interaction, which is beneficial to reducing the operation threshold for obtaining the target architecture.
S120, dividing a plurality of candidate images into a target reserved image and a target deleted image based on target architecture and dependency information, wherein the target reserved image at least comprises a first target reserved image, the first target reserved image is a candidate image of which an applied architecture belongs to a target architecture, and the target deleted image is a candidate image of which the applied architecture does not belong to the target architecture and does not have a dependency relationship with the first target reserved image.
Specifically, the target retained image is subsequently used to generate an image package. The target reserved image at least comprises a first target reserved image, and the framework applicable to the first target reserved image belongs to a target framework, so that the first target reserved image is an actually required image.
Specifically, the target deletion image is not used in the subsequent generation of the multi-architecture image, in other words, the finally generated image package does not include the target deletion image. Because the architecture to which the target deleted image is applicable does not belong to the target architecture and does not have a dependency relationship with the target reserved image, the target deleted image is not an actually required image, and the existence or non-existence of the target deleted image has no influence on the normal operation of the target reserved image.
Various specific embodiments of S120 are described below with respect to typical examples, but do not constitute limitations of the present disclosure.
In some embodiments, S120 may include: s121, dividing a plurality of candidate images into a first target reserved image and a redundant image based on a target architecture, wherein the redundant image is a candidate image of which the applicable architecture does not belong to the target architecture; s122, if the redundant mirror image is determined to have a dependency relationship with the first target reserved mirror image based on the architecture information, determining that the redundant mirror image is the second target reserved mirror image, otherwise, determining that the redundant mirror image is the target deleted mirror image.
Specifically, the redundant image is a candidate image for which the applicable architecture does not belong to the target architecture.
For each redundant mirror, if the redundant mirror and each first target reserved mirror are determined to have no dependency relationship based on the dependency relationship information, the redundant mirror is determined to be the target deleted mirror, and if the redundant mirror and at least one first target reserved mirror are determined to have the dependency relationship based on the dependency relationship information, the redundant mirror is determined to be the second target reserved mirror.
Alternatively, S121 may include: extracting architecture information from the candidate images for each candidate image, wherein the architecture information is used for characterizing an architecture to which the candidate image is applicable; if the framework suitable for the candidate mirror image is determined to belong to the target framework based on the framework information, the candidate mirror image is determined to be the first target reserved mirror image, otherwise, the candidate mirror image is determined to be the redundant mirror image.
Specifically, the candidate mirror image includes configuration information, metadata can be extracted from the configuration information, and the mirror image name, version, label, operating system, architecture information and the like of the candidate mirror image can be obtained by analyzing the metadata.
Specifically, the second target-reservation image is a candidate image that does not belong to the target architecture and has a dependency relationship with the first target-reservation image.
In some cases, only the first target retention image and the target deletion image are included in the plurality of candidate images, at this time, determining each redundant image as the target deletion image based on the dependency information may be implemented through S122.
In other cases, the plurality of candidate images includes a first target retention image, a second target retention image, and a target deletion image. At this time, it may be achieved through S122 that the redundant mirror is divided into the second target reserve mirror and the target delete mirror based on the dependency information.
It can be understood that the first target retention image and the redundant image are identified based on the target architecture, and then the target deletion image is identified based on the dependency information (or the second target retention image and the target deletion image are identified based on the dependency information), so that the method for dividing the target retention image and the target deletion image from the multiple candidate images is simple and easy to implement, and is beneficial to reducing the implementation difficulty of dividing the target retention image and the target deletion image.
Of course, the classification model (e.g., neural network model) can be trained to divide the multiple candidate images into the target retention image and the target deletion image based on the target architecture and the dependency information, for example, the multiple candidate images, the target architecture and the dependency information are input into the classification model to obtain the classification result output by the classification model, wherein the classification result is used for identifying the target retention image and the target deletion image.
It can be further understood that by setting the target deletion image as a candidate image which does not belong to the target architecture and does not have a dependency relationship with the first target reservation image, the target deletion image does not influence the actual architecture requirement of the multi-architecture offline environment or the normal operation of the first target reservation image when the target deletion image does not exist in the image package, so that the first target reservation image in the image package can normally operate, the volume of the image package is smaller, the occupied storage space is less, and the resource utilization rate is higher.
S130, constructing a mirror image package based on the target reserved mirror image.
Specifically, the image package includes at least one target-reservation image.
Various embodiments of S130 are described below with respect to a typical example.
In some embodiments, S130 may include: and packaging the target reserved mirror image to obtain a mirror image package.
In other embodiments, S130 may include: deleting a mirror image layer in the target deleted mirror image; and packaging the multi-architecture mirror image list, the target reserved mirror image and the target deleted mirror image after deleting the mirror image layer to obtain a mirror image package.
Specifically, the hash value of the target delete image is still maintained in the multi-architecture image list.
It can be understood that by setting the hash value of the target deleted image and the data of the target deleted image except the image layer in the image packet, when other architectures are expanded in the offline environment, an image packet is constructed as an expansion packet according to the expanded architecture, so that quick expansion can be realized.
According to the embodiment of the disclosure, the image package comprises the first target reserved image applicable to the target architecture, and does not comprise the target deleted image which is not applicable to the target architecture and does not have a dependency relationship with the first target reserved image, so that the image package has smaller volume, higher resource utilization rate and the problems of larger image package and lower resource utilization rate are solved.
The following describes a method for constructing a mirror package according to an embodiment of the present disclosure based on a specific example.
Step one: multi-architecture mirror synchronization (i.e., obtaining multiple candidate mirrors). Specifically, an online mirror list is obtained, wherein the online mirror list comprises a pull address and a sha256 value of a multi-architecture mirror list, and a corresponding multi-architecture mirror list is obtained based on the pull address and the sha256 value, so that a plurality of candidate mirrors are synchronized to a local mirror warehouse based on the sha256 value of the candidate mirrors in the multi-architecture mirror list. For example, fig. 3 is a flowchart of a process for constructing an image packet according to an embodiment of the present disclosure, and as shown in fig. 3, an ARM architecture image and an X86 architecture image may be synchronized to a local image repository through step one.
Step two: redundant mirrors are automatically identified. Specifically, metadata of the candidate images is extracted for each candidate image, wherein the metadata includes image names, versions, tags, operating systems, architecture information, and the like, and architecture requirements of the offline environment are acquired to acquire a target architecture. Furthermore, for each candidate image, comparing the architecture information in the metadata of the candidate image with the target architecture, if the architecture information of the candidate image accords with the target architecture, determining the candidate image as a first target reserved image (belonging to the target reserved image), wherein the first target reserved image is reserved later, otherwise, if the architecture information of the candidate image does not accord with the target architecture, marking the candidate image as a redundant image.
Step three: the target in the redundant mirror deletes the mirror delete. Specifically, the electronic device may pre-construct dependency relationship information to record the dependency relationship between the candidate images, where the dependency relationship information helps to identify which candidate images are dependent on other candidate images, so as to determine which redundant images are target deletion images, so that the redundant images can be safely deleted without affecting the normal functions of the images (i.e. target retention images). And identifying target deleted images from the redundant images based on the dependency information, and deleting image layers of the target deleted images from the local image warehouse. For example, as shown in fig. 3, if the target architecture is X86, the redundant ARM architecture image is deleted (i.e., the target delete image); if the target architecture is ARM, the redundant X86 architecture image is deleted (i.e., the target delete image).
Step four, reconstructing mirror image packets: reconstructing the image package based on the remaining target retention images and the multi-architecture image list in the local image repository. For example, as shown in fig. 3, the remaining content in the local mirror repository is packaged to obtain a mirror package.
In summary, the method for constructing the mirror package provided by the embodiment of the disclosure has the following advantages: 1. flexibility and customization enhancement: the method has the advantages that the strategy of constructing and customizing combination according to the architecture requirements of the multi-architecture offline environment is introduced, so that the mirror image package can be customized and selected according to the actual architecture requirements of the multi-architecture offline environment, unnecessary redundancy is avoided, flexibility of constructing and managing the mirror image package is improved, resources are utilized more efficiently, and users can freely combine the mirror images of different architectures according to the actual architecture requirements of the offline environment to obtain the mirror image package meeting the actual architecture requirements, so that complex and changeable deployment scenes are met. 2. Saving storage space: by deleting redundant target deleted images in the local image warehouse, only the needed target reserved images are reserved, the volume of the image package is effectively reduced, the storage space is saved, unnecessary resource occupation is reduced, and the utilization efficiency and performance of the image package are improved. 3. Intelligent and automation level increases: based on the dependency information and the target architecture, intelligent division of a plurality of candidate images and deletion of redundant target deleted images can be realized, and the intelligent and automatic level of image management can be improved. 4. Fast extension support: when the cluster needs to be expanded to a new architecture, the corresponding mirror image package of the new architecture can be quickly constructed to serve as an expansion package according to the embodiment of the disclosure, so that the mirror image package can be flexibly expanded when needed, and the expansion process of the cluster is simplified. 4. The applicability is wide: the method is suitable for different types of cloud native multi-architecture environments, and supports flexible deployment of various hardware and architectures. The method for constructing the mirror image package provided by the embodiment of the disclosure can be applied to two scenes, namely, aiming at a multi-architecture cluster to be deployed, a user can select the mirror image package of a corresponding architecture according to the actual architecture requirement of the multi-architecture cluster. Secondly, when the cluster needs to introduce a new architecture to expand functions, a mirror image packet corresponding to the new architecture can be constructed and used as an expansion packet for the cluster.
Fig. 4 is a schematic structural diagram of a device for constructing a mirror image package according to an embodiment of the present disclosure, where the device for constructing a mirror image package may be understood as the electronic device or a part of functional modules in the electronic device. As shown in fig. 4, the image packet constructing apparatus 300 includes:
an obtaining module 310, configured to obtain a plurality of candidate images, dependency relationship information corresponding to the plurality of candidate images, and a target architecture;
the dividing module 320 is configured to divide the plurality of candidate images into a target retention image and a target deletion image based on the target architecture and the dependency information, where the target retention image includes at least a first target retention image, the first target retention image is a candidate image that the applicable architecture belongs to, and the target deletion image is a candidate image that the applicable architecture does not belong to and has no dependency relationship with the target architecture;
a construction module 330 is configured to construct a mirror package based on the target retained mirror.
In another embodiment of the present disclosure, the obtaining module 310 includes a first obtaining sub-module for obtaining a plurality of candidate images, where the first obtaining sub-module is specifically configured to obtain a pull address and a hash value corresponding to the multi-architecture image list; based on the pull address and the hash value, a corresponding multi-architecture mirror list is obtained; and acquiring the plurality of candidate images based on the multi-architecture image list.
In yet another embodiment of the present disclosure, the obtaining module 310 includes a second obtaining sub-module for obtaining a target architecture, where the second obtaining sub-module is specifically configured to display a candidate architecture identifier corresponding to a candidate architecture; responding to a selection operation aiming at a target architecture identifier in the candidate architecture identifiers, and taking a candidate architecture corresponding to the target architecture identifier as the target architecture; or alternatively; and identifying the architecture of the current equipment, and taking the architecture of the current equipment as the target architecture.
In yet another embodiment of the present disclosure, the target-reservation image further includes a second target-reservation image, wherein the second target-reservation image is a candidate image for which the applicable architecture does not belong to the target architecture and has a dependency relationship with the first target-reservation image;
accordingly, the partitioning module 320 includes:
the first dividing sub-module is used for dividing the plurality of candidate images into the first target reserved image and a redundant image based on the target architecture, wherein the redundant image is a candidate image of which the applicable architecture does not belong to the target architecture;
and the second dividing sub-module is used for dividing the redundant mirror image into the second target reserved mirror image and the target deleted mirror image based on the dependency relationship information.
In yet another embodiment of the present disclosure, the first partitioning submodule is specifically configured to extract, for each candidate image, architecture information from the candidate image, where the architecture information is used to characterize an architecture to which the candidate image is applicable; and if the framework suitable for the candidate mirror image is determined to belong to the target framework based on the framework information, determining that the candidate mirror image is the first target reserved mirror image, otherwise, determining that the candidate mirror image is the redundant mirror image.
In yet another embodiment of the present disclosure, the construction module 330 is specifically configured to delete a mirror layer in the target delete mirror; and packaging the multi-architecture mirror image list, the target reserved mirror image and the target deleted mirror image after deleting the mirror image layer to obtain the mirror image package.
In still another embodiment of the present disclosure, the apparatus further includes a construction module 330 configured to construct dependency information, where the dependency information is specifically configured to determine, for the plurality of candidate images, that two candidate images have a dependency relationship if there is at least one identical image layer between the two candidate images.
The device provided in this embodiment can execute the method of any one of the above embodiments, and the execution mode and the beneficial effects thereof are similar, and are not described herein again.
The embodiment of the disclosure also provides an electronic device, which comprises: a memory in which a computer program is stored; a processor for executing the computer program, which when executed by the processor can implement the method of any of the above embodiments.
Fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure. Referring now in particular to fig. 5, a schematic diagram of an electronic device 400 suitable for use in implementing embodiments of the present disclosure is shown. The electronic device 400 in the embodiments of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and the like, and stationary terminals such as digital TVs, desktop computers, and the like. The electronic device shown in fig. 5 is merely an example and should not be construed to limit the functionality and scope of use of the disclosed embodiments.
As shown in fig. 5, the electronic device 400 may include a processing means (e.g., a central processing unit, a graphics processor, etc.) 401, which may perform various suitable actions and processes according to a program stored in a Read Only Memory (ROM) 402 or a program loaded from a storage means 408 into a Random Access Memory (RAM) 403. In the RAM 403, various programs and data necessary for the operation of the electronic device 400 are also stored. The processing device 401, the ROM 402, and the RAM 403 are connected to each other by a bus 404. An input/output (I/O) interface 405 is also connected to bus 404.
In general, the following devices may be connected to the I/O interface 405: input devices 406 including, for example, a touch screen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; an output device 407 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 408 including, for example, magnetic tape, hard disk, etc.; and a communication device 409. The communication means 409 may allow the electronic device 400 to communicate with other devices wirelessly or by wire to exchange data. While fig. 5 shows an electronic device 400 having various means, it is to be understood that not all of the illustrated means are required to be implemented or provided. More or fewer devices may be implemented or provided instead.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a non-transitory computer readable medium, the computer program comprising program code for performing the method shown in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via communications device 409, or from storage 408, or from ROM 402. The above-described functions defined in the methods of the embodiments of the present disclosure are performed when the computer program is executed by the processing device 401.
It should be noted that the computer readable medium described in the present disclosure may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this disclosure, a computer-readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present disclosure, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, fiber optic cables, RF (radio frequency), and the like, or any suitable combination of the foregoing.
In some implementations, the clients, servers may communicate using any currently known or future developed network protocol, such as HTTP (HyperText Transfer Protocol ), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the internet (e.g., the internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed networks.
The computer readable medium may be contained in the electronic device; or may exist alone without being incorporated into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to:
acquiring a plurality of candidate images, dependency relationship information corresponding to the plurality of candidate images and a target architecture;
dividing a plurality of candidate images into a target reserved image and a target deleted image based on target architecture and dependency information, wherein the target reserved image at least comprises a first target reserved image, the first target reserved image is a candidate image of which an applied architecture belongs to the target architecture, and the target deleted image is a candidate image of which the applied architecture does not belong to the target architecture and does not have a dependency relationship with the first target reserved image;
And constructing a mirror image package based on the target reserved mirror image.
Computer program code for carrying out operations of the present disclosure may be written in one or more programming languages, including, but not limited to, an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units involved in the embodiments of the present disclosure may be implemented by means of software, or may be implemented by means of hardware. Wherein the names of the units do not constitute a limitation of the units themselves in some cases.
The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: a Field Programmable Gate Array (FPGA), an Application Specific Integrated Circuit (ASIC), an Application Specific Standard Product (ASSP), a system on a chip (SOC), a Complex Programmable Logic Device (CPLD), and the like.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The embodiments of the present disclosure further provide a computer readable storage medium, where a computer program is stored, where the computer program, when executed by a processor, may implement a method according to any one of the foregoing embodiments, and the implementation manner and beneficial effects of the method are similar, and are not described herein again.
It should be noted that in this document, relational terms such as "first" and "second" and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The foregoing is merely a specific embodiment of the disclosure to enable one skilled in the art to understand or practice the disclosure. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the disclosure. Thus, the present disclosure is not intended to be limited to the embodiments shown and described herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (8)

1. A method of constructing a mirrored package, comprising:
acquiring a plurality of candidate images, dependency relationship information corresponding to the plurality of candidate images and a target architecture;
dividing the plurality of candidate images into a target reserved image and a target deleted image based on the target architecture and the dependency information, wherein the target reserved image at least comprises a first target reserved image, the first target reserved image is a candidate image of which the applicable architecture belongs to the target architecture, and the target deleted image is a candidate image of which the applicable architecture does not belong to the target architecture and does not have a dependency relationship with the first target reserved image;
Constructing a mirror image package based on the target reserved mirror image;
the target reservation image further comprises a second target reservation image, wherein the second target reservation image is a candidate image which does not belong to the target architecture and has a dependency relationship with the first target reservation image;
accordingly, the dividing the plurality of candidate images into a target reserved image and a target deleted image based on the target architecture and the dependency information includes:
dividing the plurality of candidate images into the first target reserved image and a redundant image based on the target architecture, wherein the redundant image is a candidate image of which the applicable architecture does not belong to the target architecture;
dividing the redundant mirror image into the second target reserved mirror image and the target deleted mirror image based on the dependency information;
the constructing a mirror package based on the target reserved mirror includes:
deleting the mirror image layer in the target deleted mirror image;
and packaging the multi-architecture mirror image list, the target reserved mirror image and the target deleted mirror image after deleting the mirror image layer to obtain the mirror image package.
2. The method of claim 1, wherein the obtaining a plurality of candidate images comprises:
obtaining a pulling address and a hash value corresponding to the multi-architecture mirror list;
based on the pull address and the hash value, a corresponding multi-architecture mirror list is obtained;
and acquiring the plurality of candidate images based on the multi-architecture image list.
3. The method of claim 1, wherein acquiring the target architecture comprises:
displaying candidate architecture identifiers corresponding to the candidate architectures;
responding to a selection operation aiming at a target architecture identifier in the candidate architecture identifiers, and taking a candidate architecture corresponding to the target architecture identifier as the target architecture;
or alternatively;
and identifying the architecture of the current equipment, and taking the architecture of the current equipment as the target architecture.
4. The method of claim 1, wherein dividing the plurality of candidate images into the first target retention image and a redundant image based on the target architecture comprises:
extracting architecture information from each candidate image, wherein the architecture information is used for representing an architecture applicable to the candidate image;
And if the framework suitable for the candidate mirror image is determined to belong to the target framework based on the framework information, determining that the candidate mirror image is the first target reserved mirror image, otherwise, determining that the candidate mirror image is the redundant mirror image.
5. The method according to any one of claims 1-4, wherein the determining of the dependency information comprises:
and for the plurality of candidate images, if at least one identical image layer exists between two candidate images, determining that the two candidate images have a dependency relationship.
6. A mirrored packet construction apparatus, comprising:
the acquisition module is used for acquiring a plurality of candidate images, dependency relationship information corresponding to the candidate images and a target architecture;
the dividing module is used for dividing the plurality of candidate images into a target reserved image and a target deleted image based on the target architecture and the dependency information, wherein the target reserved image at least comprises a first target reserved image, the first target reserved image is a candidate image of which the applied architecture belongs to the target architecture, and the target deleted image is a candidate image of which the applied architecture does not belong to the target architecture and does not have a dependency relationship with the first target reserved image;
The construction module is used for constructing a mirror image package based on the target reserved mirror image; the construction module is specifically configured to delete a mirror layer in the target deleted mirror; packaging the multi-architecture mirror list, the target reserved mirror and the target deleted mirror after deleting the mirror layer to obtain the mirror package;
the target reservation image further comprises a second target reservation image, wherein the second target reservation image is a candidate image which does not belong to the target architecture and has a dependency relationship with the first target reservation image;
accordingly, the dividing module includes:
the first dividing sub-module is used for dividing the plurality of candidate images into the first target reserved image and a redundant image based on the target architecture, wherein the redundant image is a candidate image of which the applicable architecture does not belong to the target architecture;
and the second dividing sub-module is used for dividing the redundant mirror image into the second target reserved mirror image and the target deleted mirror image based on the dependency relationship information.
7. An electronic device, comprising:
a processor and a memory, wherein the memory has stored therein a computer program which, when executed by the processor, performs the method of any of claims 1-5.
8. A computer readable storage medium, characterized in that the storage medium has stored therein a computer program which, when executed by a processor, implements the method according to any of claims 1-5.
CN202311675364.5A 2023-12-08 2023-12-08 Mirror image package construction method, device, equipment and storage medium Active CN117389690B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311675364.5A CN117389690B (en) 2023-12-08 2023-12-08 Mirror image package construction method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311675364.5A CN117389690B (en) 2023-12-08 2023-12-08 Mirror image package construction method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN117389690A CN117389690A (en) 2024-01-12
CN117389690B true CN117389690B (en) 2024-03-15

Family

ID=89437657

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311675364.5A Active CN117389690B (en) 2023-12-08 2023-12-08 Mirror image package construction method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117389690B (en)

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107491329A (en) * 2017-08-04 2017-12-19 上海携程商务有限公司 Docker mirror images construction method, equipment, storage medium and electronic installation
CN107809467A (en) * 2017-10-10 2018-03-16 暨南大学 Container mirror image data deletes method under a kind of cloud environment
CN111666129A (en) * 2020-06-03 2020-09-15 科东(广州)软件科技有限公司 Container mirror image processing method, electronic device, storage medium and system
CN112231050A (en) * 2020-09-28 2021-01-15 苏州浪潮智能科技有限公司 A method and device for application publishing in heterogeneous environment
WO2021051933A1 (en) * 2019-09-20 2021-03-25 平安科技(深圳)有限公司 Container cloud platform-based available area construction method and apparatus, device and storage medium
CN113360160A (en) * 2020-03-05 2021-09-07 北京沃东天骏信息技术有限公司 Method and device for deploying application, electronic equipment and storage medium
CN113495870A (en) * 2020-04-01 2021-10-12 北京沃东天骏信息技术有限公司 Mirror image construction method and device, electronic equipment and storage medium
CN114756374A (en) * 2022-04-30 2022-07-15 苏州浪潮智能科技有限公司 A method, apparatus, device and medium for scheduling heterogeneous CPUs
CN115794257A (en) * 2022-12-01 2023-03-14 北京首都在线科技股份有限公司 System starting method and device, electronic equipment and storage medium
CN116009897A (en) * 2022-12-28 2023-04-25 广东亿迅科技有限公司 Integration and deployment method, system, equipment and storage medium of multi-architecture harbor-operator
CN116166379A (en) * 2023-02-16 2023-05-26 南京烽火星空通信发展有限公司 Mirror image cutting and multi-architecture mirror image construction method based on cloud platform
CN116954831A (en) * 2023-09-20 2023-10-27 中国电子科技集团公司第十五研究所 Method and system for generating container image packages based on assembly files

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120144389A1 (en) * 2010-12-07 2012-06-07 International Business Machines Corporation Optimizing virtual image deployment for hardware architecture and resources
US9411695B2 (en) * 2013-12-04 2016-08-09 Lenovo Enterprise Solutions (Singapore) Pte. Ltd. Provisioning memory in a memory system for mirroring
US10387750B2 (en) * 2017-08-08 2019-08-20 Red Hat, Inc. Supporting manifest list for multi-platform application container images
US20190347127A1 (en) * 2018-05-09 2019-11-14 Red Hat, Inc. Service provisioning and orchestration for virtual machine to container migration
CN111722906B (en) * 2019-03-22 2025-04-04 华为技术有限公司 Method and device for deploying virtual machines and containers
US11366683B2 (en) * 2020-01-03 2022-06-21 International Business Machines Corporation Images deployment system across multiple architectures
CN112463170B (en) * 2020-10-29 2022-08-23 苏州浪潮智能科技有限公司 Method, device and equipment for making mirror image on cloud platform and storage medium
US20230125342A1 (en) * 2021-10-27 2023-04-27 Micro Focus Llc Cross-platform application containerized execution

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107491329A (en) * 2017-08-04 2017-12-19 上海携程商务有限公司 Docker mirror images construction method, equipment, storage medium and electronic installation
CN107809467A (en) * 2017-10-10 2018-03-16 暨南大学 Container mirror image data deletes method under a kind of cloud environment
WO2021051933A1 (en) * 2019-09-20 2021-03-25 平安科技(深圳)有限公司 Container cloud platform-based available area construction method and apparatus, device and storage medium
CN113360160A (en) * 2020-03-05 2021-09-07 北京沃东天骏信息技术有限公司 Method and device for deploying application, electronic equipment and storage medium
CN113495870A (en) * 2020-04-01 2021-10-12 北京沃东天骏信息技术有限公司 Mirror image construction method and device, electronic equipment and storage medium
CN111666129A (en) * 2020-06-03 2020-09-15 科东(广州)软件科技有限公司 Container mirror image processing method, electronic device, storage medium and system
CN112231050A (en) * 2020-09-28 2021-01-15 苏州浪潮智能科技有限公司 A method and device for application publishing in heterogeneous environment
CN114756374A (en) * 2022-04-30 2022-07-15 苏州浪潮智能科技有限公司 A method, apparatus, device and medium for scheduling heterogeneous CPUs
CN115794257A (en) * 2022-12-01 2023-03-14 北京首都在线科技股份有限公司 System starting method and device, electronic equipment and storage medium
CN116009897A (en) * 2022-12-28 2023-04-25 广东亿迅科技有限公司 Integration and deployment method, system, equipment and storage medium of multi-architecture harbor-operator
CN116166379A (en) * 2023-02-16 2023-05-26 南京烽火星空通信发展有限公司 Mirror image cutting and multi-architecture mirror image construction method based on cloud platform
CN116954831A (en) * 2023-09-20 2023-10-27 中国电子科技集团公司第十五研究所 Method and system for generating container image packages based on assembly files

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
一种概率模型的Docker镜像删减策略;周毅;邓玉辉;;小型微型计算机系统;20180915(09);全文 *
基于开源PaaS技术的互联网业务平台自动部署方案;何震苇;严丽云;李慧云;张凌;陆钢;;电信科学;20151020(10);全文 *
面向Dockerfile的容器镜像构建工具;耿朋;陈伟;魏峻;;计算机系统应用;20161115(11);全文 *

Also Published As

Publication number Publication date
CN117389690A (en) 2024-01-12

Similar Documents

Publication Publication Date Title
CN110275723A (en) Obtain method, apparatus, electronic equipment and the readable medium of resource
CN113157153A (en) Content sharing method and device, electronic equipment and computer readable storage medium
CN112965761B (en) Data processing method, system, electronic equipment and storage medium
CN107526623B (en) Data processing method and device
CN106708443A (en) Data reading and writing method and device
CN111198777A (en) Data processing method, device, terminal and storage medium
CN111857720B (en) User interface state information generation method and device, electronic equipment and medium
CN118245285A (en) Intelligent disaster recovery management and control platform and method for data backup of data center
CN111258800A (en) Page processing method and device and electronic equipment
CN117349035B (en) Workload scheduling method, device, equipment and storage medium
CN117369952B (en) Cluster processing method, device, equipment and storage medium
CN111191225B (en) Method, device, medium and electronic equipment for switching isolated objects
CN113656128A (en) Page generation method and device and electronic equipment
CN110888773B (en) Method, device, medium and electronic equipment for acquiring thread identification
CN117389690B (en) Mirror image package construction method, device, equipment and storage medium
CN111797353A (en) Information pushing method and device and electronic equipment
CN117633382A (en) Page loading method and device, electronic equipment and computer readable medium
CN112311842A (en) Method and apparatus for information interaction
CN111787043A (en) Data request method and device
CN110865810A (en) Resource multiplexing method and device, electronic equipment and computer readable storage medium
CN112307723B (en) Method and device for generating code document and electronic equipment
CN111241368B (en) Data processing method, device, medium and equipment
CN111596987B (en) Page display method and device and electronic equipment
CN113220371A (en) SDK access method, device, medium and electronic equipment
CN116820354B (en) Data storage method, data storage device and data storage system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant