Optimize image reconstruction for container repositories

By receiving the characteristic information of the container warehouse, selecting images and generating cost functions, optimizing the images in the container warehouse solves the problems of image redundancy and high cost in the existing technology, and achieves efficient storage and network savings.

CN112181584BActive Publication Date: 2024-09-10INTERNATIONAL BUSINESS MACHINE CORPORATION
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010583832.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2019-07-02
Filing Date
2020-06-23
Publication Date
2024-09-10
Estimated Expiration
2040-06-23

AI Technical Summary

Technical Problem

Existing technologies are difficult to effectively reduce the redundancy, storage costs, and network costs of images in container warehouses. Conventional methods increase memory, CPU, and I/O overhead, and cannot effectively reduce traffic between the network and storage.

Method used

By receiving the characteristic information of the container warehouse, select at least two container images, generate a cost function based on the characteristic information, and reduce redundancy in the container warehouse through an optimization mechanism, create a new layer to reduce redundancy, and use the image parser to generate a matrix. Resolve overlaps between images and files, estimate redundancy and generate cost functions to minimize storage, network and operational costs.

Benefits of technology

Achieve storage savings of at least factor 2, improve reusability between images, and reduce network traffic, reducing storage and network costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112181584B_ABST
    Figure CN112181584B_ABST
Patent Text Reader

Abstract

The present application relates to optimizing image reconstruction for a container repository. A computer-implemented method includes receiving characteristic information of a container repository. The container repository includes a plurality of container images. The method includes selecting at least two container images in the container repository, and selecting parameters for optimization based on the characteristic information. The method also includes generating a cost function based on the parameters for optimization, and optimizing at least two container images in the container repository based on the cost function. A computer-implemented method includes receiving a composition of each of at least two layers in a container image. The composition of each of the at least two layers includes at least one file. The method includes mapping overlaps between compositions in the at least two layers, and estimating redundancy in the container image based on the overlaps. The method also includes calculating a new layer that reduces redundancy in the container image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to container images, and more particularly, to optimizing image reconstruction for container registries in cloud storage systems and networks. Summary of the invention

[0002] According to one embodiment, a computer-implemented method includes receiving characteristic information of a container repository. The container repository includes a plurality of container images. The method includes selecting at least two container images in the container repository, and selecting parameters for optimization based on the characteristic information. The method also includes generating a cost function based on the parameters for optimization, and optimizing the at least two container images in the container repository based on the cost function.

[0003] According to one embodiment, a computer-implemented method includes receiving a composition of each of at least two layers in a container image. The composition of each of the at least two layers includes at least one file. The method includes mapping overlaps between the compositions in the at least two layers and estimating redundancy in the container image based on the overlaps. The method also includes calculating a new layer that reduces redundancy in the container image.

[0004] According to one embodiment, a computer program product for reducing redundancy includes a computer-readable storage medium having program instructions embodied therein. The program instructions are executable by a computer to cause the computer to receive characteristic information of a container repository by the computer. The container repository includes a plurality of container images. The program instructions cause the computer to select at least two container images in the container repository by the computer, and to select parameters for optimization by the computer based on the characteristic information. The program instructions also cause the computer to generate a cost function by the computer based on the parameters for optimization, and to optimize at least two container images in the container repository by the computer based on the cost function.

[0005] Other aspects and embodiments of the invention will become apparent from the following detailed description, which, when taken in conjunction with the accompanying drawings, illustrates, by way of example, the principles of the invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0006] Figure 1 A cloud computing environment according to one embodiment of the present invention is shown.

[0007] Figure 2 An abstract model layer according to one embodiment of the present invention is shown.

[0008] Figure 3 is a high-level architecture according to one embodiment of the present invention.

[0009] Figure 4 is a flow chart of a method according to one embodiment of the present invention.

[0010] Figure 5 is a flow chart of a method according to one embodiment of the present invention.

[0011] Figure 6 is a schematic diagram illustrating optimization according to one embodiment of the present invention.

[0012] Figure 7 is a schematic diagram illustrating optimization according to one embodiment of the present invention. DETAILED DESCRIPTION

[0013] The following description is intended to illustrate the general principles of the invention, but is not intended to limit the inventive concepts claimed herein. In addition, the specific features described herein may be used in combination with other described features in all possible combinations and permutations.

[0014] Unless expressly defined otherwise herein, all terms are to be given their broadest possible interpretations, including the meanings implied in the specification and as understood by those skilled in the art and / or defined in dictionaries, treatises, and the like.

[0015] It must also be noted that, as used in the specification and the appended claims, the singular forms "a", "an", and "the" include plural referents unless otherwise indicated. It will also be understood that the terms "comprises" and / or "comprising", when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and / or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.

[0016] The following description discloses several embodiments for optimizing image reconstruction for container repositories in cloud storage systems and networks.

[0017] In one general embodiment, a computer-implemented method includes receiving characteristic information of a container repository. The container repository includes a plurality of container images. The method includes selecting at least two container images in the container repository, and selecting parameters for optimization based on the characteristic information. The method also includes generating a cost function based on the parameters for optimization, and optimizing the at least two container images in the container repository based on the cost function.

[0018] In another general embodiment, a computer-implemented method includes receiving a composition of each of at least two layers in a container image. The composition of each of the at least two layers includes at least one file. The method includes mapping overlaps between the compositions in the at least two layers and estimating redundancy in the container image based on the overlaps. The method also includes calculating a new layer that reduces redundancy in the container image.

[0019] In another general embodiment, a computer program product for reducing redundancy includes a computer-readable storage medium having program instructions embodied therein. The program instructions are executable by a computer to cause the computer to receive characteristic information of a container repository by the computer. The container repository includes a plurality of container images. The program instructions cause the computer to select at least two container images in the container repository by the computer, and to select parameters for optimization by the computer based on the characteristic information. The program instructions also cause the computer to generate a cost function by the computer based on the parameters for optimization, and to optimize at least two container images in the container repository by the computer based on the cost function.

[0020] It should be understood that although the present disclosure includes detailed descriptions about cloud computing, the implementation of the teachings set forth herein is not limited to cloud computing environments. Instead, embodiments of the present invention can be implemented in conjunction with any other type of computing environment now known or later developed.

[0021] Cloud computing is a service delivery model for convenient, on-demand network access to a shared pool of configurable computing resources. Configurable computing resources are resources that can be quickly deployed and released with minimal management cost or interaction with the service provider, such as networks, network bandwidth, servers, processing, memory, storage, applications, virtual machines, and services. This cloud model can include at least five characteristics, at least three service models, and at least four deployment models.

[0022] Features include:

[0023] On-demand self-service: Cloud consumers can unilaterally and automatically deploy computing capabilities such as server time and network storage on demand without human interaction with the service provider.

[0024] Broad network access: Computing power can be accessed over the network through standard mechanisms that facilitate the use of the cloud through different types of thin-client or thick-client platforms (e.g., mobile phones, laptops, personal digital assistants (PDAs)).

[0025] Resource pool: The computing resources of the provider are grouped into resource pools and serve multiple consumers through a multi-tenant model, where different physical and virtual resources are dynamically allocated and reallocated on demand. Generally, consumers cannot control or even know the exact location of the provided resources, but can specify the location (such as country, state or data center) at a higher level of abstraction, so it is location-independent.

[0026] Rapid elasticity: The ability to quickly and elastically (sometimes automatically) deploy computing power to scale up quickly, and quickly release it to scale down quickly. To consumers, the computing power available for deployment often appears to be unlimited, and any amount of computing power can be accessed at any time.

[0027] Measurable services: Cloud systems automatically control and optimize resource usage by leveraging metering capabilities at a level of abstraction appropriate to the type of service (e.g., storage, processing, bandwidth, and active user accounts). Resource usage can be monitored, controlled, and reported, providing transparency to both service providers and consumers.

[0028] The service model is as follows:

[0029] Software as a Service (SaaS): The capability provided to consumers is to use the provider's applications running on a cloud infrastructure. Applications can be accessed from a variety of client devices through a thin client interface such as a web browser (e.g., web-based email). Aside from limited user-specific application configuration settings, consumers neither manage nor control the underlying cloud infrastructure including networks, servers, operating systems, storage, or even individual application capabilities.

[0030] Platform as a Service (PaaS): The capability provided to consumers is to deploy applications created or acquired by consumers on the cloud infrastructure, which are created using programming languages ​​and tools supported by the provider. Consumers neither manage nor control the underlying cloud infrastructure including networks, servers, operating systems or storage, but have control over the applications they deploy and may also have control over the configuration of the application hosting environment.

[0031] Infrastructure as a Service (IaaS): The capabilities provided to consumers are processing, storage, network, and other basic computing resources on which consumers can deploy and run arbitrary software including operating systems and applications. Consumers neither manage nor control the underlying cloud infrastructure, but have control over the operating system, storage, and applications they deploy, and may have limited control over selected network components (such as host firewalls).

[0032] The deployment model is as follows:

[0033] Private Cloud: Cloud infrastructure is run solely for an organization. The cloud infrastructure can be managed by the organization or a third party and can exist inside or outside the organization.

[0034] Community Cloud: A cloud infrastructure is shared by several organizations and supports a specific community with common interests (e.g., mission, security requirements, policies, and compliance considerations). A community cloud can be managed by multiple organizations within the community or by a third party and can exist inside or outside the community.

[0035] Public cloud: Cloud infrastructure is provided to the public or to large industry groups and is owned by an organization that sells cloud services.

[0036] Hybrid cloud: A cloud infrastructure consisting of two or more clouds (private, community or public) in a deployment model that remain distinct entities but are bound together by standardized or proprietary technologies (such as cloud burst sharing for load balancing between clouds) that enable data and application portability.

[0037] The cloud computing environment is service-oriented, with characteristics centered on statelessness, low coupling, modularity, and semantic interoperability. The core of cloud computing is the infrastructure that includes a network of interconnected nodes.

[0038] Reference now Figure 1 , in which an exemplary cloud computing environment 50 is shown. As shown, the cloud computing environment 50 includes one or more cloud computing nodes 10 with which a local computing device used by a cloud computing consumer can communicate, and the local computing device can be, for example, a personal digital assistant (PDA) or a mobile phone 54A, a desktop computer 54B, a laptop computer 54C and / or an automobile computer system 54N. The cloud computing nodes 10 can communicate with each other. The cloud computing nodes 10 can be physically or virtually grouped in one or more networks including but not limited to private clouds, community clouds, public clouds or hybrid clouds, or a combination thereof as described above (not shown in the figure). In this way, cloud consumers can request infrastructure as a service (IaaS), platform as a service (PaaS) and / or software as a service (SaaS) provided by the cloud computing environment 50 without having to maintain resources on local computing devices. It should be understood that Figure 1 The various types of computing devices 54A-N shown are merely illustrative, and the cloud computing node 10 and the cloud computing environment 50 may communicate with any type of computing device on any type of network and / or network-addressable connection (eg, using a web browser).

[0039] Reference now Figure 2 , which shows a cloud computing environment 50 ( Figure 1 ) provides a set of functional abstraction layers. First of all, it should be understood that Figure 2 The components, layers, and functions shown are only exemplary and the embodiments of the present invention are not limited thereto. Figure 2 As shown, the following layers and corresponding functions are provided:

[0040] The hardware and software layer 60 includes hardware and software components. Examples of hardware components include: host 61; server 62 based on RISC (Reduced Instruction Set Computer) architecture; server 63; blade server 64; storage device 65; network and network components 66. Examples of software components include: network application server software 67 and database software 68.

[0041] The virtualization layer 70 provides an abstraction layer that can provide examples of the following virtual entities: virtual servers 71 , virtual storage 72 , virtual networks 73 (including virtual private networks), virtual applications and operating systems 74 , and virtual clients 75 .

[0042] In one example, the management layer 80 may provide the following functions: Resource provisioning function 81: providing dynamic acquisition of computing resources and other resources for performing tasks in a cloud computing environment; Metering and pricing function 82: tracking the cost of resource usage within the cloud computing environment and providing bills and invoices for this purpose. In one example, the resource may include an application software license. Security function: providing identity authentication for cloud consumers and tasks, and providing protection for data and other resources. User portal function 83: providing access to the cloud computing environment for consumers and system administrators. Service level management function 84: providing allocation and management of cloud computing resources to meet the required service levels. Service level agreement (SLA) planning and fulfillment function 85: providing pre-arrangement and provision for future demand for cloud computing resources predicted according to the SLA.

[0043] The workload layer 90 provides examples of functions that may be implemented in a cloud computing environment. In this layer, examples of workloads or functions that may be provided include: mapping and navigation 91; software development and lifecycle management 92; virtual classroom teaching provision 93; data analysis processing 94; transaction processing 95; and image reconstruction optimized for container repositories.

[0044] A container is a lightweight, independent, executable software package that can be portable, independent of the operating system (OS) and / or kernel environment. A container can be an abstraction at the application layer that encapsulates code and / or dependencies together. Multiple containers can run on the same machine, where the containers share the OS. Each container can run isolated processes in user space.

[0045] A container image is a static file that includes executable code for running isolated processes on an information technology (IT) infrastructure. Container images can be stored in an online store (e.g., a container repository). Each container image is a combination of a manifest (e.g., metadata including information about container image layers, size, summary, operating system (OS), architecture, runtime requirements, etc.) and layers (e.g., a compressed tar file). A container image contains an application and required runtime dependencies. Container images can be easily versioned, stored, and shared via a centralized container repository service. Container repositories store and serve millions of container images, allowing developers to "push" and "pull" images and make changes to them.

[0046] Container images are constructed in layers, where each layer contains a portion of the image content (e.g., a set of files). Files in a container image cannot be removed from an existing image. Only new files can be added (e.g., at the expense of increasing the image size and / or number of layers). Layers can be merged to form a container root file system. Layers are read-only. The same layer can be shared between container images and containers, and is stored only once as a layer. In practice, the ability to share layers in container images is limited because layers are rarely exactly the same.

[0047] The availability of files in a layer is limited. For example, layer 1 contains file X, file 1, file 2, ... through file 99. Layer 2 contains file 1, file 2, ... through file 99 and file Y. Although 99% of the files in layer 1 and layer 2 are identical, because deduplication is conventionally at the layer level, each complete set of files must be stored. Assuming the files are the same size, the space requirements are doubled (e.g., end-to-end). The network traffic during push / pull operations is also doubled (e.g., end-to-end). Since the differences in the files in each layer are relatively small, the number of duplicate files and the total redundant capacity are very significant in the container repository.

[0048] In a conventional approach, a content-addressable storage scheme can be used to identify duplicate layers between the same images and only store one copy of each layer. The content-addressable storage scheme can reduce storage usage on the repository and end hosts. The content-addressable storage scheme can be applied to locally stored images. In practice, the layers are rarely the same, and the storage savings of the content-addressable storage scheme are very limited. For example, among the 10,000 most common DockerHub images, containing 104,667 layers, only 36% of the layers are the same, and the use of conventional content-addressable storage schemes only improves the storage reduction by a factor of 1.48.

[0049] Another common approach to reducing warehouse storage requirements is to use storage that can perform data deduplication. This type of storage does not reduce network traffic or client storage footprint.

[0050] Similarly, some possible approaches include placing each file in its own layer. Each layer is content addressable and does not store duplicate files. Not having duplicate files reduces redundancy. However, client-side unification techniques can encounter performance overhead because placing each file in its own layer significantly increases the number of layers to be merged. Placing all files of each image in the same layer instead can significantly increase storage redundancy, resulting in unnecessary files being downloaded. One of ordinary skill in the art will appreciate that placing all files in the same layer can significantly increase network / client storage redundancy beyond practical application.

[0051] None of the conventional approaches described above address all network, storage, and tier considerations to effectively reduce network traffic between the repository and the customer. Additionally, customers often continue to store images in their original, non-deduplicated form, which requires excessive storage space. Conventional deduplication processes add significant memory, CPU, and I / O overhead. For example, in a tier pull, a known deduplication-capable repository will need to decompress the tier, compute hashes for all files, and update the hash indexes in memory and on disk. In a tier pull, the tier needs to be reassembled from its segments, which triggers I / O for each file. These operations all require increased repository infrastructure costs and push / pull times.

[0052] Various embodiments of the present invention reorganize and optimize the layers to reduce redundancy, storage costs, and network costs. Many layers differ from other layers by only a relatively small number of files. At least some embodiments disclosed herein include separating "almost identical" layers into shared and unique content to create new layers that can be easily reused. By exploiting the overlap in these almost identical layers, various embodiments of the present invention provide storage savings of at least a factor of 2, improve reusability between images, and reduce network traffic.

[0053] Figure 3 According to various embodiments, Figure 4 and 5 In various embodiments, architecture 300 may be used in accordance with the present invention. Figure 1-2 Of course, as will be appreciated by those skilled in the art upon reading this description, architecture 300 may include more than Figure 3 More or fewer elements may be included than those specifically described herein.

[0054] Each step of method 400 (described in further detail below) may be performed by any suitable component of architecture 300. A processor (e.g., a processing circuit, chip, and / or module) implemented in hardware and / or software and preferably having at least one hardware component may be used in any device to perform one or more steps of method 400 in architecture 300. Exemplary processors include, but are not limited to, a central processing unit (CPU), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA), etc., combinations thereof, or any other suitable computing device known in the art.

[0055] Each step of method 500 (described in further detail below) may be performed by any suitable component of architecture 300. A processor (e.g., a processing circuit, chip, and / or module) implemented in hardware and / or software and preferably having at least one hardware component may be used in any device to perform one or more steps of method 500 in architecture 300. Exemplary processors include, but are not limited to, a central processing unit (CPU), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA), etc., combinations thereof, or any other suitable computing device known in the art.

[0056] Architecture 300 includes a warehouse 302. Warehouse 302 may be a third-party warehouse for container images. Container images may be pushed to or pulled from warehouse 302. Warehouse 302 may be a public container warehouse, a private container warehouse, or any container warehouse known in the art.

[0057] Architecture 300 includes manager 304. Manager 304 manages the warehouse in any manner known in the art.

[0058] The architecture 300 includes an optimizer 306 for running optimization operations on warehouse data and any associated metadata. In a preferred method, the optimizer 306 receives a request for warehouse optimization and / or analysis from the manager 304. The optimizer 306 may perform any of the various operations described below with reference to the methods 400 and 500. In one embodiment, the optimizer 306 generates an output of the request to the manager 304.

[0059] The optimizer 306 includes components for performing various operations that will be described in detail below with reference to the methods 400 and 500. The optimizer 306 includes an image parser 308. In one embodiment, the image parser 308 can parse the container images in the container repository by generating a matrix from the container image collection. The image parser 308 can generate a binary matrix including the container image and the file as the dimensions of the matrix. In a preferred embodiment, the image parser 308 generates a mapping of which container images contain which files. In one embodiment, the image parser 308 generates a mapping of overlaps between container images, layers in container images, files in container images, and the like.

[0060] In a preferred embodiment, the image parser 308 generates a matrix M from a set of container images. ik For example, M if and only if image i requires file k. ik =1. The image parser 308 can run in parallel, using H(name+content) to create a sorted hash vector f for each image. i The single vector can be merge sorted to form a single vector F that contains all the sorted file hashes. In one approach, merge sort can be a single threaded task. The vector f can be sorted based on F. i Expand and convert into binary vector b i . Merge binary vector b i To generate the matrix M ik .

[0061] The optimizer 306 includes an image subset selector 310 for determining which portion of the warehouse 302 to optimize. The image subset selector 310 can limit the number of images optimized at one time. In various embodiments, optimizing the entire warehouse 302 may not be efficient. In a preferred embodiment, the image subset selector 310 accounts for the local optimization parameters of the client. The image subset selector 310 selects the image subset to be rebuilt based on one or more factors. One factor includes the frequency of image pulls (for example, in one method, the image subset selector 310 selects the top 5% of images). Optimizing images that are pulled relatively infrequently is inefficient for the use of resources. The threshold frequency for selecting images to be optimized can be set by a user, a manufacturer, a content provider, a service provider, etc. The threshold frequency can be determined in any manner known in the art. In one method, the threshold frequency can be found in a lookup table.

[0062] Another factor includes image clustering. In one embodiment of the present disclosure, images that are relatively frequently pulled together by customers can be clustered and optimized to increase savings for different customers. The relative frequency can be set and / or determined in any of the above ways.

[0063] Images marked as "official", pre-selected images, images pre-marked as "high quality" (e.g., or any equivalent thereof), etc. may be considered to be relatively higher quality than other images in the container registry. In the case where these images are manually pre-optimized at the local level, images marked as "official", pre-selected images, images pre-marked as "high quality" (e.g., or any equivalent thereof) may not be optimized. The image subset selector 310 may select a subset of images to be rebuilt based on any combination of these factors.

[0064] The optimizer 306 includes a redundancy estimator and parameter selector 312. The redundancy estimator and parameter selector 312 can estimate the amount of redundancy in the warehouse 302 by examining the output generated by the image parser 308. In one embodiment, the redundancy estimator and parameter selector 312 calculates the savings to the warehouse 302 by counting the reoccurrences of files in the output generated by the image parser 308. In various embodiments described herein, redundancy refers to the redundancy of files within a layer and / or within a container warehouse. For example, if several images contain the same files and these files are stored multiple times in the container warehouse, this is considered to have high redundancy.

[0065] In a preferred embodiment, the redundancy estimator and parameter selector 312 may determine parameters for an optimization mechanism 316, which will be described in detail below. Parameters to be optimized may include storage cost, network cost, operation cost, the number of image-to-layer edges, the number of files, the number of layer-to-file edges, the number of image-layer-file paths, the number of layers in an image, and the like.

[0066] In one embodiment, the redundancy estimator and parameter selector 312 assigns a variable to each parameter, which will be discussed in detail below. For example, α can represent the number of layers per image, β can represent storage redundancy, γ can represent network and / or customer storage redundancy, etc. In a preferred approach, the redundancy estimator and parameter selector 312 tracks and / or stores historical data for each parameter in any manner known in the art. In one approach, the historical data for each parameter is stored in a table. The redundancy estimator and parameter selector 312 can update the savings calculation periodically, continuously, manually, in response to changes in one or more parameters, etc.

[0067] The optimizer 306 includes an optimization trigger 314. The optimization trigger 314 triggers the optimization mechanism 316, the optimization applier 318, any operation of the method 400 and / or the method 500 described in detail below, etc. The optimization trigger 314 triggers optimization on demand, in response to an increase in storage usage above a predetermined threshold, in response to an increase in duplicate files above a predetermined threshold, in response to an increase in the number of layers per image above a predetermined threshold, etc. Any predetermined threshold can be defined by a user, an administrator 304, a warehouse 302, a service provider, a content provider, etc. The predetermined values ​​disclosed herein can be found in a lookup table. The demand can be received from a user, an administrator 304, a warehouse 302, a service provider, a content provider, etc.

[0068] In one approach, the optimization trigger 314 can determine that a threshold is exceeded by scanning the warehouse files. In a preferred approach, the scan can be performed incrementally to update the statistics of the parameters and / or estimate redundancy.

[0069] Optimizer 306 includes optimization mechanism 316. In a preferred embodiment, optimization mechanism 316 uses the output of the matrix including images and files generated by image parser 308. Optimization mechanism 316 can use any output generated by redundancy estimator and parameter selector 312, including the set of images to be optimized and / or any parameters selected for optimization (e.g., with any associated variables). In a preferred embodiment, optimization mechanism 316 is triggered by optimization trigger 314.

[0070] In a preferred embodiment, the optimization mechanism 316 includes at least some of the embodiments described below.

[0071] The image set can be represented by I, the layer set can be represented by J, and the file set can be represented by K. E is a set of (i, k) (i∈I∈K), where image i includes file k. In each method, E is the input. k Indicates the size of file k, represented by f i represents the frequency of image i (eg, using). In a preferred method, the optimization mechanism 316 outputs a Boolean decision symbol x j,i ,y k,j and z i,j,k , where x is a pointer to layer j if and only if image i contains layer j (e.g., as a pointer). j,i = 1 if and only if layer j contains file k (e.g., as a copy), y k,j = 1, if and only if image i contains layer j and layer j contains file k, z i,j,k =1.

[0072] A cost function may be defined to minimize a weighted combination of costs associated with the parameters defined above. The cost function may be based on one or more factors, including operating costs, storage costs, and / or network costs. In a preferred embodiment, the cost function includes at least storage, network, and operating costs defined by the following formula:

[0073] Cost = α*operations + β*storage + γ*network

[0074] The operation cost counts the number of mirror-to-layer edges and is expressed as the mirror frequency f i Weighted. The operating cost can be defined as follows:

[0075] Operation = ∑ i f i ∑ j x j,i .

[0076] The storage cost counts the number of files and / or layer-to-file edges and is expressed in terms of file size g k Weighted. Storage cost can be defined as follows:

[0077] Storage = ∑ k g k ∑ j y k,j .

[0078] The network cost counts the number of image-layer-file paths and is expressed as the image frequency g k Weighted. The network cost can be defined as follows:

[0079] Network = ∑ i f i ∑ j ∑ k g k z i,j,k

[0080] The optimization mechanism 316 minimizes the cost function according to various constraints.

[0081] In one embodiment, a cost function is generated to satisfy the file requirements of the image. The cost function can be generated such that ∑ j∈J z i,j,k ≥1, where ((i,k)∈E).

[0082] In one embodiment, the cost function is generated so that the image does not contain any layers that are not used by the image. The cost function can be generated so that Specifically, for each i and j, if for all k, Let (i,k)∈E, then

[0083] In one embodiment, a cost function is generated so that the image does not contain any files that are not used by the image. A cost file may be generated so that y k,j +x j,i ≤1, where

[0084] In another embodiment, the cost function is constrained so that the order of the files as they appear in the layer stack in the resulting image is constrained by the original order of the files.

[0085] In an alternative embodiment, the optimization mechanism 316 uses a greedy algorithm based on the cost function described above. In one approach, the greedy algorithm starts with an empty set of layers and constructs layers based on the requirements in E. In a preferred approach, the algorithm does not use layers in the existing repository structure. The algorithm considers all files in a random order and, for each file, considers all images that require the file.

[0086] In one approach, for each image, the algorithm either creates a new file or maintains the original file. The algorithm considers the cost of each possible action based on the state of the solution up to that point. In one approach, there are five possible cases, including: Case 1: Add image-layer connection, Case 2: Add layer-file connection, Case 3: Do nothing, Case 4: Add image-layer and layer-file connection, Case 5: Add new layer and image-layer and layer-file connection.

[0087] For case 1, the algorithm considers using an existing layer l created in the previous step that includes the current file but is not yet referenced by the mirror. Case 1 can add a new edge from the mirror to l. In case 1, the operation cost increases by 1 in response to adding a mirror-to-layer edge, the storage cost remains unchanged, and the network cost depends on the files already included in l. If mirror i is connected to layer l, mirror i serves additional files. If the additional files are used by mirror i, the additional files are not counted. Otherwise, too many files are created unnecessarily.

[0088] In a preferred embodiment, the algorithm takes the action with the lowest cost.

[0089] In one approach, the algorithm can be extended to skip edges that create incorrect reorderings.

[0090] In a preferred embodiment, the optimization mechanism 316 outputs a new structure to be implemented by the optimization applicator 318 described in detail below.

[0091] The optimizer 306 includes an optimization applicator 318. The optimization applicator 318 receives the new structure generated by the optimization mechanism 316 and creates a new layer. The optimization applicator 318 can generate a manifest for each image.

[0092] In some embodiments, the image can be pushed before the optimized structure can be fully applied by the optimization applicator 318. In one approach, a copy of the layers referenced by the image can be maintained so that the corresponding pushed image can be unaffected by the optimization. In another approach, the image can be updated locally with the structure updated according to the client request. The request can be explicit or due to a push to an existing image. Images pulled before optimization and pushed with additional layers after optimization use new (read-only) layers to avoid the warehouse slowly storing previous layers. In the case where the image is pulled before optimization and pushed with additional layers after optimization, the client can pull the updated layers for the image (e.g., excluding the new layers) and then append the new layers. In some embodiments, the pulling and appending in this case can occur automatically at the time of pushing.

[0093] Reference now Figure 4 , a flow chart of a method 400 according to an embodiment is shown. In various embodiments, the method 400 may be performed according to the present invention. Figure 1-3 Of course, as will be understood by those skilled in the art upon reading this specification, method 400 may include more Figure 4 More or fewer operations may be performed as specifically described in .

[0094] Each step of method 400 may be performed by any suitable component of an operating environment. For example, in various embodiments, method 400 may be performed in part or in whole by a computer or some other device having one or more processors therein. A processor (e.g., a processing circuit, chip, and / or module implemented in hardware and / or software and preferably having at least one hardware component) may be utilized in any device to perform one or more steps of method 400. Illustrative processors include, but are not limited to, a central processing unit (CPU), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA), etc., combinations thereof, or any other suitable computing device known in the art.

[0095] like Figure 4 As shown, method 400 includes operation 402. Operation 402 includes receiving characteristic information of a container repository. The container repository preferably includes multiple container images. In a preferred embodiment, the characteristic information includes multiple container images in the container repository and layers and files in each container image in the container repository. As understood by a person of ordinary skill in the art, each container image may include layers, and each layer may include files.

[0096] The feature information may be collected in any manner known in the art. In one method, the container image may be parsed to determine the feature information of each container image. In one embodiment, the image parser may parse the container images in the container repository by generating a matrix for the container image set. The image parser may generate a binary matrix including the container image and the file as the dimensions of the matrix. In a preferred embodiment, the image parser generates a mapping of which container images include which files. In one embodiment, the image parser generates a mapping of overlaps between container images, layers in container images, files in container images, and the like. In one example, layer 1 contains file X, file 1, file 2, ... until file 99. Layer 2 contains file 1, file 2, ... until file 99, file Y. The mapping may show that layer 1 and layer 2 are in the same container image, and files 1-99 overlap between layer 1 and layer 2.

[0097] In a preferred embodiment, the image resolver generates a matrix M from a collection of container images. ik For example, M if and only if image i requires file k. ik Equal to 1. The image resolvers can run in parallel, using H(name+content) to create a sorted hash vector f for each image i The single vector can be merge sorted to form a single vector F that contains all the sorted file hashes. In one approach, merge sort can be a single threaded task. The vector f can be sorted based on F. i Expand and convert into binary vector b i . Merge binary vector b i To generate the matrix M ik .

[0098] In another embodiment, the characteristic information may refer to client configuration, resource requirements, historical resource requirements, usage requirements, etc. In a preferred embodiment, client local optimization parameters may be considered for various embodiments disclosed herein. Client characteristic information may be collected and / or stored in any manner known in the art.

[0099] Operation 404 selects at least two container images in a container repository. The repository images may be pushed / pulled from the container repository. The container repository may be a third-party repository for container images. The container repository may be a public container repository, a private container repository, or any container repository known in the art.

[0100] In various embodiments, the at least two container images selected may be container images that are accessed relatively frequently compared to other container images in the container repository. Optimizing the entire repository (e.g., every container image in the container repository) may not be efficient. In one example, the relatively frequently accessed container images may include the top 5% of pulled images in frequency. Optimizing container images that are pulled relatively infrequently may not be efficient in the use of resources.

[0101] In another embodiment, the container image may be selected based on image clustering. In one embodiment of the present disclosure, images that are relatively frequently pulled together by customers may be clustered and optimized to increase savings for different customers.

[0102] In another embodiment, selecting at least two container images includes not selecting a container image that is relatively higher quality than other container images in the container repository. Images marked as "official", pre-selected images, images pre-marked as "high quality" (e.g., or any equivalent thereof), etc. can be considered to be relatively higher quality than other images in the container repository. In the case where these images are manually pre-optimized at the local level, images marked as "official", pre-selected images, images pre-marked as "high quality" (e.g., or any equivalent thereof) may not be optimized.

[0103] In some methods, at least two container images may be selected in response to a request from an administrator, a user, a container repository, a service provider, a content provider, etc. For example, an administrator may specifically request a set of container images to be optimized for a project.

[0104] Operation 406 includes selecting parameters for optimization based on the feature information. In the various embodiments disclosed herein, optimization refers to reducing the redundancy of files in a container image, a container image set, and / or a container repository. A container image may include multiple layers. Each layer may have multiple files. Files may be repeated in multiple layers of a container image and / or multiple container images in a container repository. As a person of ordinary skill in the art will understand after reading this disclosure, duplicate files in a container image, a container image set, and / or a container repository may generate redundancy. For example, if several images include the same file and the file is stored multiple times in a container repository, the repository is considered to have high redundancy.

[0105] Parameters used for optimization based on feature information may include the number of file reoccurrences, storage cost, network cost, operation cost, the number of mirror-to-layer edges, the number of files, the number of layer-to-file edges, the number of mirror-layer-file paths, the number of layers in the mirror, and the like.

[0106] In one embodiment, method 400 assigns a variable to each parameter discussed in detail below. For example, α may represent the number of layers per image, β may represent storage redundancy, γ may represent network and / or customer storage redundancy, etc. In a preferred method, method 400 tracks and / or stores historical data for each parameter in any manner known in the art. In one method, historical data for each parameter is stored in a table. Method 400 may update the savings calculation periodically, continuously, manually, in response to changes in one or more parameters, etc.

[0107] In various methods, parameters for optimization may include triggers for optimization. Optimization triggers may trigger optimization on demand, in response to storage usage increasing above a predetermined threshold, in response to duplicate files increasing above a predetermined threshold, in response to the number of layers per image increasing above a predetermined threshold, etc. Any predetermined threshold may be defined by a user, administrator, container repository, service provider, content provider, etc. The predetermined values ​​disclosed herein may be found in a lookup table. Demand may be received from a user, administrator, container repository, service provider, content provider, etc.

[0108] Operation 408 includes generating a cost function based on the parameters for optimization. In a preferred embodiment, the cost function uses the output of the matrix generated by the image parser including container images and files. The cost function can be generated using any output including the set of container images to be optimized and / or any parameters selected for optimization (e.g., with any associated variables).

[0109] In a preferred embodiment, the cost function includes at least some of the embodiments described below.

[0110] The image set can be represented by I, the layer set can be represented by J, and the file set can be represented by K. E is a set of (i, k) (i∈I∈K), where image i includes file k. k Indicates the size of file k, represented by f i represents the frequency of image i (eg, using). In a preferred method, the cost function outputs a Boolean decision symbol x j,i ,y k,j and z i,j,k , where x is a pointer to layer j if and only if image i contains layer j (e.g., as a pointer). j,i = 1 if and only if layer j contains file k (e.g., as a copy), y k,j = 1, if and only if image i contains layer j and layer j contains file k, z i,j,k =1.

[0111] A cost function may be defined to minimize a weighted combination of costs associated with the parameters defined above. In a preferred embodiment, the cost function includes at least storage, network, and operation costs defined by the following formula:

[0112] Cost = α*operations + β*storage + γ*network

[0113] The operation cost counts the number of mirror-to-layer edges and is expressed as the mirror frequency f i Weighted. The operating cost can be defined as follows:

[0114] Operation = ∑ i f i ∑ j x j,i .

[0115] The storage cost counts the number of files and / or layer-to-file edges and is expressed in terms of file size g k Weighted. Storage cost can be defined as follows:

[0116] Storage = ∑ k g k ∑ j y k,j .

[0117] The network cost counts the number of image-layer-file paths and is expressed as the image frequency g k Weighted. The network cost can be defined as follows:

[0118] Network = ∑ i f i ∑ j ∑ k g k z i,j,k .

[0119] In one embodiment, a cost function is generated to satisfy the file requirements of the image. The cost function can be generated such that ∑ j∈J z i,j,k ≥1, where ((i,k)∈E).

[0120] In one embodiment, the cost function is generated so that the image does not contain any layers that are not used by the image. The cost function can be generated so that Specifically, for each i and j, if for all k, Let (i,k)∈E, then

[0121] In one embodiment, a cost function is generated so that the image does not contain any files that are not used by the image. A cost file may be generated so that y k,j +x j,i ≤1, where

[0122] In another embodiment, the cost function is constrained so that the order of the files as they appear in the layer stack in the resulting image is constrained by the original order of the files.

[0123] In a preferred embodiment, the cost function is based on any combination of the factors described above. According to one embodiment, the cost function may be based on factors selected from operating costs, storage costs, and network costs.

[0124] In an alternative embodiment, the optimization is performed using a greedy algorithm based on the cost function described above. In one approach, the greedy algorithm starts with an empty set of layers and constructs layers based on the requirements in E. In a preferred approach, the algorithm does not use layers in the existing repository structure. The algorithm considers all files in a random order and, for each file, considers all images that require the file.

[0125] In one approach, for each image, the algorithm either creates a new file or maintains the original file. The algorithm considers the cost of each possible action based on the state of the solution up to that point. In one approach, there are five possible cases, including: Case 1: Add image-layer connection, Case 2: Add layer-file connection, Case 3: Do nothing, Case 4: Add image-layer and layer-file connection, Case 5: Add new layer and image-layer and layer-file connection.

[0126] For case 1, the algorithm considers using an existing layer l created in the previous step that includes the current file but is not yet referenced by the mirror. Case 1 can add a new edge from the mirror to l. In case 1, the operation cost increases by 1 in response to adding a mirror-to-layer edge, the storage cost remains unchanged, and the network cost depends on the files already included in l. If mirror i is connected to layer l, mirror i serves additional files. If the additional files are used by mirror i, the additional files are not counted. Otherwise, too many files are created unnecessarily.

[0127] In a preferred embodiment, the algorithm takes the action with the lowest cost.

[0128] In one approach, the algorithm can be extended to skip edges that create incorrect reorderings.

[0129] In a preferred embodiment, the cost function outputs a new structure to optimize at least two container images in the container repository based on the cost function.

[0130] Operation 410 includes optimizing at least two container images in the container repository based on a cost function. In a preferred method, optimizing at least two container images in the container repository based on a cost function reduces redundancy of files in each container image, container image set, and / or container repository.

[0131] In a preferred embodiment, optimizing the container images in the container repository includes computing new layers that reduce redundancy in the container images.

[0132] In one example of method 400, the characteristic information of the container repository in operation 402 is used to generate an image-to-file requirement matrix for the container repository. Operation 404 can select a subset of images in the matrix based on a request from an administrator and / or based on the administrator's preferences. Parameters α, β, and γ are selected, and the image subset is optimized. The optimization can replace the original layer and reconstruct the warehouse so that the redundancy of the file is reduced. In response to the optimization, the optimized input / output can be stored for future optimization. The optimized input / output can be stored in any manner known in the art. In a preferred method, the optimized input / output can be stored in a table.

[0133] In another example of method 400, the administrator may generate a set C of configuration values, C = {{max1, α1, β1)}, ... (max n ,α n ,β n )}, for example, C = {(10, 1, 0.1), (1000, 1, 0.1)}. The warehouse can be restricted according to the examples described above. For each configuration, method 400 generates a magnitude of capacity savings (e.g., C1 = 10%, C2 = 50%, etc.) and an estimated cost (e.g., in terms of resource usage) of applying the new structure to the warehouse (I / O) (e.g., C1 = 50TB, C2 = 60TB, etc.). In response to the optimization, the optimized input / output can be stored for future optimization. The optimized input / output can be stored in any manner known in the art. In a preferred method, the optimized input / output can be stored in a table.

[0134] In another example of method 400, in a first case, the warehouse can be reconstructed as set in the first example described above. Future configurations can be recommended based on system resources, the type of image in the container image, historical data, etc. Storage-constrained systems benefit from a greater reduction in storage capacity (e.g., an increased maximum value). In a second case, the warehouse can be reconstructed according to the second example described above. Each time the warehouse is reconstructed, the configuration value can be reduced. The configuration value can be selected based on previous reconstructions for the same or substantially the same system and / or systems with substantially the same resources. In both cases, the optimized input / output can be stored for future optimization. The optimized input / output can be stored in any manner known in the art. In a preferred method, the optimized input / output can be stored in a table.

[0135] In some embodiments, some container images may be pushed in between optimizing container images. In one approach, copies of layers referenced by container images may be maintained so that corresponding pushed container images are not affected by the optimization. In another approach, images may be updated locally with updated structures on client request. The request may be explicit or due to a push to an existing image. Images pulled before optimization and pushed in with additional layers after optimization use new (read-only) layers to avoid the repository slowly storing previous layers. In the case where an image is pulled before optimization and pushed in with additional layers after optimization, the client may pull updated layers for the image (e.g., excluding new layers) and then append the new layers. In some embodiments, the pulling and appending in this case may occur automatically upon push.

[0136] Reference now Figure 5 , shows a flow chart of a method 500 according to an embodiment. In various embodiments, the method may be performed according to the present invention. Figure 1-4 and Figure 6-7 Method 500 is performed in any environment depicted in the description. Of course, as will be appreciated by those skilled in the art upon reading this description, Figure 5 More or fewer elements than those specifically described in detail may be included in method 500 .

[0137] Each step of method 500 may be performed by any suitable component of an operating environment. For example, in various embodiments, method 500 may be performed in part or in whole by a computer or some other device having one or more processors therein. A processor (e.g., a processing circuit, a chip, and / or a module) implemented in hardware and / or software and preferably having at least one hardware component may be used in any device to perform one or more steps of method 500. Exemplary processors include, but are not limited to, a central processing unit (CPU), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA), etc., combinations thereof, or any other suitable computing device known in the art.

[0138] like Figure 5 As shown, method 500 includes operation 502. Operation 502 includes receiving a configuration of each of at least two layers in a container image. In a preferred embodiment, the configuration of each of the at least two layers includes at least one file.

[0139] The composition of each of the at least two layers in the container image can be determined according to any method known in the art. In one method, the container image can be parsed to determine the composition of the container image. In one embodiment, the image parser can parse the container image into layers and files.

[0140] Operation 504 includes mapping the overlap between the composition of the at least two layers. The image parser can generate a mapping of which layers include which files. In one embodiment, the image parser generates a mapping of the overlap between the layers in the container image and / or the files in the layers. In one example, layer 1 contains file X, file 1, file 2, ... until file 99. Layer 2 contains file 1, file 2, ... until file 99 and file Y. The mapping can show that layer 1 and layer 2 are in the same container image, and files 1-99 overlap between layer 1 and layer 2. As understood by a person of ordinary skill in the art after reading this disclosure, overlap can refer to any redundancy in data, files, layers, images, warehouses, etc.

[0141] Operation 506 includes estimating redundancy in the container image based on overlap. In various embodiments described herein, redundancy refers to redundancy of files within a layer and / or within a container image. For example, if several layers within an image include the same files and these files are stored multiple times within the container image, the container image is considered to have high redundancy. In a preferred embodiment, redundancy can be estimated based on overlap in the composition of each of at least two layers in the container image. In one embodiment, redundancy can be estimated based on the number of times a file reappears. Redundancy can be estimated in any manner known in the art.

[0142] Operation 508 includes calculating a new layer that reduces redundancy in the container image. In a preferred embodiment, calculating a new layer that reduces redundancy in the container image includes generating a cost function according to the embodiments described above. In some methods, the calculated new layer replaces at least two original layers in the container image.

[0143] In one embodiment, as described in detail above, a new layer is computed for a container image that is accessed relatively frequently compared to other container images in a container repository having the container image.

[0144] In another embodiment, as described in detail above, new layers are not computed for container images having relatively higher quality.

[0145] Figure 6 is a schematic diagram of exemplary optimization according to various embodiments. In various embodiments, according to the present invention, Figure 1-5 and Figure 7 Optimization 600 can be implemented in any environment depicted in FIG. Of course, as will be appreciated by those skilled in the art upon reading this description, Figure 6 More or fewer elements than those specifically described in may be included in optimization 600.

[0146] In a preferred embodiment, optimization 600 may be performed according to method 400 described in detail above. As shown, a container repository including image 1 and image 2 has high redundancy, wherein files 1-99 are stored in both image 1 and image 2. Image 2 has high redundancy because image 2 includes layer 1 and layer 2 and files 1-99 are stored in both layer 1 and layer 2. According to the various embodiments described above, layer X, layer A, and layer Y are calculated new layers that replace layer 1 and layer 2. The container repository and the container image are optimized when the file is not stored more than once in the container repository and the container image.

[0147] Figure 7 is a schematic diagram of exemplary optimization according to various embodiments. In various embodiments, according to the present invention, Figure 1-6 Optimization 700 can be implemented in any environment depicted in FIG. Of course, as will be appreciated by those skilled in the art upon reading this description, Figure 7 More or fewer elements than those specifically described in may be included in optimization 700.

[0148] In a preferred embodiment, optimization 700 may be performed according to method 500 as described in detail above. When files 1-99 are stored in both image 1 and image 2, the container image has high redundancy. According to the various embodiments described above, layer X, layer A, and layer Y are new layers calculated, replacing layer 1 and layer 2. The container image is optimized when no file is stored more than once within the container image.

[0149] The present invention may be a system, method and / or computer program product at any possible level of technical detail integration. The computer program product may include a computer-readable storage medium having computer-readable program instructions thereon, the computer-readable program instructions being used to cause a processor to perform various aspects of the present invention.

[0150] A computer-readable storage medium may be a tangible device that can hold and store instructions used by an instruction execution device. A computer-readable storage medium may be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples of computer-readable storage media (a non-exhaustive list) include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, such as a punch card or a raised structure in a groove on which instructions are stored, and any suitable combination of the foregoing. As used herein, a computer-readable storage medium is not to be interpreted as a transient signal per se, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (e.g., a light pulse through a fiber optic cable), or an electrical signal transmitted through a wire.

[0151] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.

[0152] The computer program instructions for performing the operation of the present invention may be assembler instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, integrated circuit configuration data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages, such as Smalltalk, C++, etc., and procedural programming languages, such as "C" language or similar programming languages. Computer-readable program instructions may be executed entirely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), may be personalized by utilizing the state information of the computer-readable program instructions, and the electronic circuit may execute the computer-readable program instructions, thereby realizing various aspects of the present invention.

[0153] Various aspects of the present invention are described herein with reference to the flow charts and / or block diagrams of the methods, devices (systems) and computer program products according to embodiments of the present invention. It should be understood that each box of the flow chart and / or block diagram and the combination of each box in the flow chart and / or block diagram can be implemented by computer-readable program instructions.

[0154] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processor of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0155] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0156] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to multiple embodiments of the present invention. In this regard, each square box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of the module, program segment or instruction includes one or more executable instructions for realizing the specified logical function. In some alternative implementations, the function marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square boxes can actually be executed substantially in parallel, and they can sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or action, or can be implemented with a combination of special hardware and computer instructions.

[0157] In addition, the system according to various embodiments may include a processor and logic integrated with the processor and / or integrable by the processor, the logic being configured to perform one or more of the process steps described herein. By integrated therewith, it is meant that the processor has logic embedded therewith as hardware logic, such as an application specific integrated circuit (ASIC), FPGA, etc. By executable by the processor, it is meant that the logic is hardware logic; software logic, such as a part of firmware, an operating system, a part of an application; etc., or some combination of hardware and software logic, which is accessible by the processor and configured to cause the processor to perform a certain function when executed by the processor. The software logic may be stored on local and / or remote memory of any memory type, as is known in the art. Any processor known in the art, such as a software processor module and / or a hardware processor, such as an ASIC, FPGA, a central processing unit (CPU), an integrated circuit (IC), a graphics processing unit (GPU), etc., may be used.

[0158] It is clear that the various features of the foregoing systems and / or methods may be combined in any manner, resulting in multiple combinations from the description presented above.

[0159] It should also be appreciated that embodiments of the present invention may be provided as a service deployed on behalf of a client to provide services on demand.

[0160] The embodiments of the present invention have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The terms used herein are selected to best explain the principles of the embodiments, practical applications, or technical improvements to the technology in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.

Claims

1. A computer-implemented method comprising: receiving characteristic information of a container repository, wherein the container repository includes a plurality of container images, wherein the characteristic information includes layers and files of each of the plurality of container images, wherein an image parser generates a mapping of overlapping files in the layers in the container images; Select at least two container images in the container repository; Based on the feature information, selecting parameters for optimization; generating a cost function based on the parameters for optimization, each of the parameters for optimization being a variable of the cost function, wherein the cost function is based at least in part on a mapping generated by the image resolver, wherein the cost function is generated such that at least one of the selected container images does not include any layers that are not used by the at least one of the selected container images; and The selected container image in the container repository is optimized based on operation cost, storage cost, and network cost as variables of the cost function.

2. The computer-implemented method of claim 1, wherein: Selecting the at least two container images includes selecting a container image that is relatively more frequently accessed than other container images in the container repository.

3. The computer-implemented method of claim 1, wherein: Selecting the at least two container images includes not selecting a container image of relatively higher quality than other container images in the container repository.

4. The computer-implemented method of claim 1, wherein: Selecting the at least two container images is based on an administrator request.

5. The computer-implemented method of claim 1, wherein: The cost function is a weighted combination of the variables of the cost function.

6. The computer-implemented method of claim 1, wherein: Optimizing the container image in the container repository includes: Compute new layers that reduce redundancy in container images.

7. The computer-implemented method of claim 6, wherein: The redundancy in the container image refers to the redundancy of files in the container image.

8. A computer-implemented method comprising: Receiving a configuration of each of at least two layers in a first container image, wherein the configuration of each of the at least two layers includes at least one file; Mapping overlapping files in layers in the first container image and the second container image; Based on the overlap, estimating redundancy in the first container image; Selecting parameters for optimization of the first container image and the second container image; generating a cost function based on the parameters for optimization, wherein each of the parameters for optimization is a variable of the cost function, wherein the cost function is based at least in part on the mapping; and The first container image is optimized based on operation cost, storage cost, and network cost as variables of the cost function, wherein the optimization includes calculating a new layer that reduces the redundancy in the first container image, wherein the cost function is generated so that the first container image does not include any layer that is not used by the first container image.

9. The computer-implemented method of claim 8, wherein: A new layer is calculated for a container image that is accessed relatively more frequently than other container images in the container repository having the first container image.

10. The computer-implemented method of claim 8, wherein: New layers are not calculated for container images with relatively higher quality.

11. The computer-implemented method of claim 8, wherein: The calculated new layer replaces the original at least two layers in the first container image.

12. The computer-implemented method of claim 8, wherein: The cost function is a weighted combination of the variables of the cost function.

13. A computer program product for reducing redundancy, the computer program product comprising a computer-readable storage medium having program instructions embodied therein, the program instructions being executable by a computer to cause the computer to perform the method of any one of claims 1-12.

14. A computer system for reducing redundancy, the computer system comprising: Memory; as well as At least one processor is in communication with the memory, wherein the computer system is configured to perform the method of any one of claims 1-12.

15. An apparatus for reducing redundancy, the apparatus comprising modules configured to implement the steps in the method according to any one of claims 1-12.