CN116700902A - Container acceleration deployment method and device for asynchronous parallel extraction of mirror image layer - Google Patents

Container acceleration deployment method and device for asynchronous parallel extraction of mirror image layer Download PDF

Info

Publication number
CN116700902A
CN116700902A CN202310748301.1A CN202310748301A CN116700902A CN 116700902 A CN116700902 A CN 116700902A CN 202310748301 A CN202310748301 A CN 202310748301A CN 116700902 A CN116700902 A CN 116700902A
Authority
CN
China
Prior art keywords
layer
mirror
image
mirror image
file
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.)
Granted
Application number
CN202310748301.1A
Other languages
Chinese (zh)
Other versions
CN116700902B (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.)
Tianjin University
Original Assignee
Tianjin University
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 Tianjin University filed Critical Tianjin University
Priority to CN202310748301.1A priority Critical patent/CN116700902B/en
Publication of CN116700902A publication Critical patent/CN116700902A/en
Application granted granted Critical
Publication of CN116700902B publication Critical patent/CN116700902B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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; CALCULATING OR 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
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

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 application discloses a container accelerating deployment method and device for asynchronous parallel extraction of a mirror layer, comprising the following steps: s1, confirming a dock installation path after receiving an instruction; s2, copying a json configuration file of the mirror image to be deployed; s3, adding a mirror image name, a mirror image version and a mirror image ID to repositives based on the manifest of the mirror image to be deployed; s4, confirming the total mirror image layer number and initializing the mirror image layer number; s5, generating DiffID, chainID and CacheID of the first mirror image layer; s6, multiplexing and judging the DiffID of the first layer, if yes, executing S8, otherwise, storing the ID of the mirror image layer, and executing S7; s7, recording the mirror image layer dependency relationship; s8, judging that L is less than L, if yes, executing l=l+1, returning to S5, otherwise, downloading the mirror image layer content to be built in parallel. The application accelerates the deployment speed of the container.

Description

Container acceleration deployment method and device for asynchronous parallel extraction of mirror image layer
Technical Field
The application belongs to the technical field of containerized services, and particularly relates to a container acceleration deployment method and device for asynchronous parallel extraction of a mirror layer.
Background
In a containerized deployment environment, accelerating the deployment and startup process of a container is important to improve the response speed and overall performance of an application. Conventional container deployment methods typically require that the complete image file be downloaded to the local host and then image extracted. The current mirror image extraction scheme is limited by the ChainID calculation method of the mirror image layer, resulting in the following two main problems: 1. serial extraction limit: the current calculation method requires recursively calculating the ChainID layer by layer, namely the ChainID of each layer is obtained by jointly calculating the DiffID of the current layer and the ChianID of the father layer, so that the images are required to be extracted layer by layer in sequence when the images are extracted, parallel processing cannot be realized, the efficiency of container deployment is limited, and the next operation can be carried out only by waiting for the completion of the extraction of each image layer; 2. the mirror layer multiplexing rate is low: because of the nature of the ChainID calculation method, even though the two mirror layers are consistent in terms of file content, their chainids will be different due to the inconsistencies of the upper mirror layers, meaning that these mirror layers cannot be multiplexed, even though their content is actually the same.
The mirror deployment driver realizes the extraction of mirror image content of the local file system from the mirror image, however, the current driver has the limitations that, for example, a mirror image layer must be extracted according to the sequence of a mirror image structure, the content cannot be effectively reused, and the like, so that resources are wasted, the extraction process faces longer time consumption, and the extraction efficiency is seriously hindered. Therefore, the current limitation needs to be overcome, and parallel extraction is realized, namely, the extraction of the mirror image layer can be performed simultaneously, so that the deployment process is accelerated, and the extraction efficiency is improved. In addition, mirror layers having the same content should be multiplexed.
Disclosure of Invention
Aiming at the problems, the application provides a container acceleration deployment method and device for asynchronous parallel extraction of a mirror layer. In order to solve the technical problems, the technical scheme adopted by the application is as follows:
a container accelerating deployment method for asynchronous parallel extraction of a mirror layer comprises the following steps:
s1, when a server node receives a deployment containerized service instruction, confirming an installation path of a docker;
s2, copying the json configuration file of the mirror image to be deployed to the installation path of the docker obtained in the step S1;
s3, adding corresponding mirror image information into a repositives file based on a manifest file of a mirror image to be deployed, wherein the mirror image information comprises a mirror image name, a mirror image version and a mirror image ID;
s4, confirming the total image layer number L of the image based on the manifest file of the image to be deployed, and initializing the image layer number l=1;
s5, generating corresponding DiffiD, chainID and CacheID for a first layer mirror image layer of the mirror image to be deployed based on the manifest file;
s6, multiplexing judgment is carried out on the DiffID of the first mirror image layer, if the DiffID exists on the server node, the step S8 is executed, otherwise, the DiffID, chainID and CachelD of the first mirror image layer are stored, and the step S7 is executed;
s7, establishing data information for recording the mirror image layer dependency relationship under an overlay2 file system under a dock installation path;
s8, judging that L is less than L, if yes, executing l=l+1, returning to the step S5, otherwise, downloading the mirror layer contents in the mirror layer folder to be built in parallel.
In step S5, when the first mirror layer is the base mirror layer, the ChainID of the base mirror layer is equal to the DiffID of the first mirror layer, and when the first mirror layer is not the base mirror layer, the ChainID of the mirror layer is obtained by SHA256 hash values of the ChainID, the space of the parent layer of the mirror layer and the DiffID of the mirror layer; the CacheID is obtained from the SHA256 hash value of both the floating point seconds and the DiffID of the mirror layer.
In step S6, the method for storing DiffID, chainID and CacheID of the first mirror layer includes:
a, judging whether the first mirror image layer is a basic mirror image layer, if so, executing the step b, otherwise, executing the step c;
b, under the installation directory of the container, establishing a metadata folder with the ChainID of the first mirror layer as the name, and under the metadata folder, establishing a cache-id file for storing the CacheID of the mirror layer, a diff file for storing the DiffID of the mirror layer and a size file for storing the byte number of the mirror layer;
c. and establishing a metadata folder with the ChainID of the first layer mirror layer as a name under the installation directory of the container, and establishing a cache-id file for storing the CacheID of the mirror layer, a diff file for storing the DiffID of the mirror layer, a size file for storing the byte number of the mirror layer and a parent file for storing the parent layer of the mirror layer under the metadata folder.
The step S7 includes the steps of:
(1) creating a dependency folder under the overlay2 file system with the CacheID of the mirror layer of the first layer as the name;
(2) creating an empty folder with a file name diff and an empty file with a file name committed under the CacheID dependency folder;
(3) creating a soft link for the first mirror layer under the overlay2 file system for pointing to the empty folder with the file name diff created in step (2);
(4) and respectively creating link files for recording soft links of the first layer mirror layer and lower files for recording the relation between the first layer mirror layer and other mirror layers under the CacheID dependency relation folder.
A container acceleration deployment apparatus for mirror layer asynchronous parallel extraction, comprising:
and a confirmation module: the method comprises the steps of receiving a containerized service instruction and confirming a dock installation path;
json profile copy module: copying the json configuration file of the mirror image to be deployed to the position under the dock installation path acquired by the confirmation module;
the mirror image information adding module: the method comprises the steps that image information of a corresponding image layer is added to a repositiories file based on a manifest file of an image to be deployed, wherein the image information comprises an image name, an image version and an image ID;
an identification ID generation module: generating a corresponding DiffID, chainID and CacheID for each image layer of the images to be deployed based on the manifest file;
mirror image layer judging module: the method comprises the steps that multiplexing judgment is carried out on each mirror image layer to be built based on the DiffID generated by an identification ID generation module, if the DiffID does not exist on a server node, diffID, chainID and CacheID of the mirror image layer are stored, otherwise, the identification ID generation module is started to process the next mirror image layer until all the mirror image layers are processed and judged to be finished;
and the dependency relation storage module is used for: the method comprises the steps of establishing data information for recording the dependency relationship between mirror image layers under an overlay2 file system under a dock installation path;
and (3) a downloading module: and downloading the mirror image layer contents in the corresponding mirror image layer folder in parallel based on the judgment result of the mirror image layer judgment module.
The application has the beneficial effects that:
(1) By using the layered structure of the container mirror image, a plurality of mirror image layers can be extracted simultaneously when the container is deployed through asynchronous parallel extraction, so that the time consumption of the traditional serial mirror image extraction layer is reduced, and the deployment speed of the container is optimized;
(2) By changing the content identification into the DiffID, the identical content mirror image layer inconsistent with the parent layer can be reused, so that the resource utilization efficiency is further improved;
(3) In the mirror image extraction process, unordered loading of each mirror image layer is allowed, so that the mirror image extraction is started earlier, and the mirror image extraction speed is increased.
Drawings
In order to more clearly illustrate the embodiments of the application or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic view of the effect of the present application.
Fig. 2 is a diagram showing an example of a mirror structure in the prior art.
FIG. 3 is a flow chart of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without any inventive effort, are intended to be within the scope of the application.
The following first describes the terms of the prior art used in the present application:
image Extraction (Image Extraction): image extraction refers to the process of obtaining a desired component, file, or configuration from a container image. In the containerization technique, the container image is a stand-alone, portable software package that contains all the components of the application and its associated dependencies. The container image may be viewed as a virtual file system that is made up of multiple layers. Each layer contains the changing content of one or more files or directories. The goal of image extraction is to extract specific components or files in the container image for further analysis, modification, or use. The process of image extraction relies on underlying container image techniques and tools. Specific methods of extracting container images may execute the associated commands by using a corresponding image tool, such as a Docker CLI (Command-Line Interface) or OCI tool. In summary, image extraction refers to the process of extracting a desired component, file, or configuration from a container image to meet different development, testing, deployment, or security requirements. This process relies on underlying container mirroring techniques and tools and has wide application value.
The following is python:3.9.3 mirror image is taken as an example, and a file structure diagram of the next mirror image is briefly introduced, as shown in fig. 2, including:
i, manifest. Json file: files for describing the metadata and configuration information of the Docker image are in the top-level directory;
ii, repositives file: the method comprises the steps of recording the name, the label and the corresponding hash value file of a Docker image, wherein each image has a corresponding entry in a repositives. Json file;
iii,05034335a2e3f4af8c426d8ebd8344b42083af222e05f62203d78e 21bbe 715.Json file: including configuration files related to container operation, such as default environment variables of the container, start commands, network configuration of the container, etc.;
iv, mirror layer folder: besides the three files, the file system also comprises a plurality of mirror image layer folders, wherein each folder comprises mirror image layer contents and mirror image configuration corresponding to the mirror image layer.
DiffID: diffID refers to a unique identifier for each layer (layer) in the container image, which is generated by hashing the contents of each layer. Hash computation uses a specific algorithm (e.g., SHA 256) to process files and directories in layers to produce a fixed length hash value, so the DiffID of each layer is also a unique identifier associated with its content. The role of DiffID is to provide a lightweight way of identifying content changes for each layer in the container image. Thus, when comparing, verifying, distributing or storing container images, the difference between two images or layers can be quickly determined by DiffID.
chainID: in the container mirror, each layer has a unique ChainID for identifying the identity of that layer. The ChainID is generated by the Docker engine, which is calculated based on the content of each layer. For the base image layer, the ChainID is a hash value generated by the file system contents of the layer that identifies the contents of the layer, including file and directory structures. For a non-base mirrored layer, the ChainID is a hash value generated by the ChainID of the previous layer and the file system contents of that layer. By calculating the ChainID for each layer, the container engine can effectively compare the different layers of the image and determine if the image already exists to avoid storing the same layers repeatedly. This chained architecture also makes the construction and distribution of container images more efficient, as only the modified layers need to be transferred instead of the entire image.
A container acceleration deployment method for asynchronous parallel extraction of a mirror layer is shown in fig. 3, and comprises the following steps:
s1, when a server node receives a deployment containerized service instruction, confirming an installation path of a docker;
the installation path of the Docker comprises key files and directories required by the operation of the Docker, and the default installation path is/var/lib/Docker/, and the path can be modified by a user after the Docker is installed. The installation path generally comprises a plurality of folders, the contents in the image folder and the overlay2 folder are mainly edited and modified, the image file system is a default position for storing image related data and is used for storing names, labels and other related information of the images, and the overlay2 file system is a default position of a storage container file system and is a part of a storage drive.
S2, copying the json configuration file of the mirror image to be deployed to the installation path of the docker obtained in the step S1 so as to support the management and operation of the container;
mirroring is a static representation of a container in a Docker. The mirror image contains the code and the running dependency of the container running, is a multi-layer structure, and each layer is read-only. When the deployment of the container is started, in this embodiment, the 05034335a2e3f4af8c426d8ebd8344b42083af222e05f62203d78ec2lbbee71 5.json file in fig. 2 is first copied into the folder under the path of/var/lib/dock/image/overlay 2/imagedb/content/sha 256.
S3, adding corresponding mirror image information into a repositives file based on a manifest file of a mirror image to be deployed, wherein the mirror image information comprises a mirror image name, a mirror image version and a mirror image ID;
the purpose of this step is to modify the/var/lib/dock/image/overlay 2/repositives. Json file so that the corresponding mirror can be accurately identified and used during the later container deployment and management process. Such as: the file contents of repositives without any mirror deployment are: { "repositives": { }, and after deploying a container service (python: 3.9.3 for example), the contents of the repositives file are: { "repositives": { "python": { "python: 3.9.3': "sha 256:05034335a2e3f4af8c426d8ebd8344b42083af222e05f62203d78ec21bbee 715' }). Wherein python is the mirror name, and can be obtained from the "RepoTags" field of the manifest. Json file of the mirror to be deployed; "3.9.3" is a mirror version, which is obtained in the same way as the mirror name; "05034335a2e3f4af8c426d8ebd8344b42083af222e05f62203d78ec21bbee71 5" is an image ID, which can be obtained from the "Config" field of the manifest.
S4, confirming the total image layer number L of the images to be deployed based on the manifest file, and initializing the image layer number l=1;
s5, generating corresponding DiffID, chainID and CacheID for a first layer mirror image layer of the mirror image to be deployed based on the manifest file;
specifically, diffID: the DiffID and image layer sequence of each image layer can be obtained from the "Layers" field of the manifest. Json file in the image to be deployed. chainID: if the mirror layer does not have any father layer, namely the mirror layer is the basic mirror layer, the ChainID is equal to the DiffID, otherwise, the ChainID is obtained through the SHA256 hash value of the string formed by the ChainID of the father layer, the space and the DiffID of the own layer. CachelD: this value is used only for retrieval and has no special meaning, so the present application uses SHA256 hash values of strings spelled by both floating point seconds from 1970 s to the current time and diffids of the present layer as cacheids. These three identifiers, as unique identifications of the mirror layer, can be used to identify and retrieve the mirror layer to support management and construction of the container.
Although the present application still retains the calculation of the ChainID, diffID is used as an identification of layer content when determining whether different mirror layers are consistent, unlike the prior art which uses ChainID as a content identification. Because DiffID only considers the file content of the present layer, even when the parent layer is inconsistent, if the two mirror layers are consistent, mirror layer reuse judgment can be performed.
S6, multiplexing judgment is carried out on the DiffID of the first mirror layer, if the DiffID exists on the server node, the step S8 is executed, otherwise, diffID, chainID and CacheID of the first mirror layer are stored, and the step S7 is executed;
specifically, the method for performing multiplexing judgment on the DiffID of the mirror layer of the first layer is as follows: and comparing the DiffID of the mirror layer to be deployed with all the loaded mirror layers on the server node one by one, if the DiffID is completely the same, the mirror layer to be deployed does not carry out links such as metadata file writing, mirror layer content writing and the like, the deployed mirror layer files with the same DiffID are directly used, and if the DiffID is not present, the metadata files and the mirror layer content of the mirror layer are required to be written. As shown in fig. 1, in this way, on the one hand, container deployment speed can be increased, and on the other hand, redundant mirror transfers and storage can be reduced.
The method for storing DiffID, chainID and CacheID of the first mirror layer comprises the following steps: first, a metadata folder for storing mirror layer metadata is created for the first layer mirror layer under the/var/lib/dock/image/overlay 2/layerdb/sha 256/path, the metadata folder is named as the chaind of the mirror layer, and then its subfiles are created under the metadata folder. If the first mirror layer is the base mirror layer, i.e. l=1, the number of subfiles is three, which are respectively: the file name is a cache-id file, and is used for storing the cache ID of the mirror layer; a file with a file name diff for storing a DiffID of the mirror layer; the file with the file name of size is used for storing the byte number of the mirror layer, and can be obtained based on the mirror folder measurement. If the mirror layer is not the base mirror layer, the number of the sub files is four, and compared with the case of the base mirror layer, a file with a file name of parent is added for storing the DiffID of the parent layer mirror layer. These metadata are critical to the management, operation and hierarchy of the container.
S7, establishing data information for recording the mirror image layer dependency relationship under an overlay2 file system under a dock installation path;
the default location of the/var/lib/Docker/overlay 2/Docker storage container file system specifically includes the following steps:
(1) firstly, creating a dependency relation folder with a CacheID of a first mirror layer as a name under a/var/lib/dock/overlay 2/path;
(2) creating an empty folder with a file name of diff and an empty file with a file name of committed under the CacheID dependency folder created in the step (1);
(3) creating a soft link for the first mirror layer under the/var/lib/dock/overlay 2/1/path, wherein the name of the soft link is a random character string used for pointing to an empty file folder with a file name diff of the mirror layer created in the step (2);
(4) respectively creating link files for recording soft link names of the mirror image layers and 1ower files for recording the relationships between the mirror image layers and other mirror image layers under the dependency relation folders with the names of CacheID created in the step (1);
the file name is the name of the soft link of the mirror layer created in the step (3) for the content in the link file. The file name is that the content in the lower file is a chained structure, and the chained structure is used for storing the father layer of the mirror layer, all layers between the father layer of the mirror layer and the basic mirror layer of the mirror where the mirror layer is located, and the soft link name of the basic mirror layer. Specifically, the chain structure may be in the form of: 1/soft link name corresponding to parent layer: soft link name corresponding to parent layer of/parent layer: soft link names corresponding to parent layers of the/parent layers. And the soft link name corresponding to the l/base mirror layer.
The above completes the writing of the mirror metadata file, which includes the manifest and repositives files, and the metadata file size is usually only a few KB, and the downloading delay is negligible compared with the mirror file information. Furthermore, as can be seen from the above, this process does not involve file transfer with high data volume and is therefore relatively time-consuming, negligible in most scenarios. And the unordered and parallel downloading guarantee is provided for the content writing (larger data quantity) part of the mirror image layer.
S8, judging that L is less than L, if yes, executing l=l+1, and returning to the step S5, otherwise, downloading mirror layer contents in the corresponding mirror layer folder in parallel based on the newly stored mirror layer in the step S6;
and carrying out image layer content downloading on the corresponding image layer based on multiplexing judgment results of all image layers of the images to be deployed, wherein the image layer does not need to be downloaded again when the image layer exists on the node, thereby reducing file transmission and reducing deployment time consumption. In the downloading process, the image layer with large data volume is downloaded to the/var/lib/dock/overlay 2/CacheID/diff/folder of the image layer in parallel.
The embodiment is realized based on the Overlay2 of the Docker, but different from the original Overlay2 driver, the mirror metadata file writing with small data volume and the mirror layer content writing with large data volume are decoupled, and before the mirror layer content writing, the corresponding configuration file is built in the Docker path through the mirror metadata file with extremely small data volume, so that the mirror image is loaded in any sequence during the mirror layer content writing. In order to maintain compatibility, the configuration file to be finally established is consistent with the original scheme, and only the image extraction process is optimized to realize accelerated deployment.
The embodiment also provides a container accelerating deployment device for asynchronous parallel extraction of a mirror layer, which comprises:
and a confirmation module: the method comprises the steps of receiving a containerized service instruction and confirming a dock installation path;
json profile copy module: copying the json configuration file of the mirror image to be deployed to the position under the dock installation path acquired by the confirmation module;
the mirror image information adding module: the method comprises the steps that image information of a corresponding image layer is added to a repositiories file based on a manifest file of an image to be deployed, wherein the image information comprises an image name, an image version and an image ID;
an identification ID generation module: generating a corresponding DiffID, chainID and CacheID for each image layer of the images to be deployed based on the manifest file;
mirror image layer judging module: the method comprises the steps that multiplexing judgment is carried out on each mirror image layer to be built based on the DiffID generated by an identification ID generation module, if the DiffID does not exist on a server node, diffID, chainID and CacheID of the mirror image layer are stored, otherwise, the identification ID generation module is started to process the next mirror image layer until all the mirror image layers are processed and judged to be finished;
and the dependency relation storage module is used for: the method comprises the steps of establishing data information for recording the dependency relationship between mirror image layers under an overlay2 file system under a dock installation path;
and (3) a downloading module: and the judgment result of the base mirror layer judgment module carries out parallel downloading on the mirror layer content in the corresponding mirror layer folder.
The embodiment of the application also provides electronic equipment, which comprises a processor and a memory, wherein the memory stores a computer program, and when the computer program is executed by the processor, the container acceleration deployment method for the asynchronous parallel extraction of the mirror layer is realized.
The embodiment of the application also provides a computer readable storage medium which stores a computer program, wherein the computer program realizes the container acceleration deployment method of the asynchronous parallel extraction of the mirror layer when being executed by a processor. Specifically, the storage medium may be a general-purpose storage medium, such as a mobile disk, a hard disk, or the like, and when a computer program on the storage medium is executed, an embodiment of a container acceleration deployment method capable of executing the above-described asynchronous parallel extraction of the mirror layer is provided.
The foregoing description of the preferred embodiments of the application is not intended to be limiting, but rather is intended to cover all modifications, equivalents, alternatives, and improvements that fall within the spirit and scope of the application.

Claims (5)

1. The container accelerating deployment method for asynchronous parallel extraction of the mirror layer is characterized by comprising the following steps of:
s1, when a server node receives a deployment containerized service instruction, confirming an installation path of a docker;
s2, copying the json configuration file of the mirror image to be deployed to the installation path of the docker obtained in the step S1;
s3, adding corresponding mirror image information into a repositives file based on a manifest file of a mirror image to be deployed, wherein the mirror image information comprises a mirror image name, a mirror image version and a mirror image ID;
s4, confirming the total image layer number L of the image based on the manifest file of the image to be deployed, and initializing the image layer number l=1;
s5, generating corresponding DiffID, chainID and CacheID for a first layer mirror image layer of the mirror image to be deployed based on the manifest file;
s6, multiplexing judgment is carried out on the DiffID of the first mirror image layer, if the DiffID exists on the server node, the step S8 is executed, otherwise, the DiffID, chainID and CachelD of the first mirror image layer are stored, and the step S7 is executed;
s7, establishing data information for recording the mirror image layer dependency relationship under an overlay2 file system under a dock installation path;
s8, judging that L is less than L, if yes, executing l=l+1, returning to the step S5, otherwise, downloading the mirror layer contents in the mirror layer folder to be built in parallel.
2. The method for accelerating the deployment of containers by asynchronous parallel extraction of mirror layers according to claim l, wherein in step S5, when the first mirror layer is a base mirror layer, the ChainID of the base mirror layer is equal to the DiffID thereof, and when the first mirror layer is not the base mirror layer, the ChainID of the mirror layer is obtained by SHA256 hash values of the ChainID, space and DiffID of the parent layer of the mirror layer; the CacheID is obtained from the SHA256 hash value of both the floating point seconds and the DiffID of the mirror layer.
3. The method for accelerated deployment of containers for asynchronous parallel extraction of mirror layers according to claim 1, wherein in step S6, the method for storing DiffID, chainID and CacheID of the first mirror layer comprises:
a, judging whether the first mirror image layer is a basic mirror image layer, if so, executing the step b, otherwise, executing the step c;
b, under the installation directory of the container, establishing a metadata folder with the ChainID of the first mirror layer as the name, and under the metadata folder, establishing a cache-id file for storing the CacheID of the mirror layer, a diff file for storing the DiffID of the mirror layer and a size file for storing the byte number of the mirror layer;
c. under the installation directory of the container, a metadata folder with the ChainID of the first layer mirror layer as the name is established, and a cache-id file for storing the CacheID of the mirror layer, a diff file for storing the DiffID of the mirror layer, a size file for storing the byte number of the mirror layer and a parent file for storing the DiffID of the parent layer of the mirror layer are established under the metadata folder.
4. The method for accelerated deployment of containers for asynchronous parallel extraction of mirror layers according to claim 1, wherein said step S7 comprises the steps of:
(1) creating a dependency folder under the overlay2 file system with the CacheID of the mirror layer of the first layer as the name;
(2) creating an empty folder with a file name diff and an empty file with a file name committed under the CacheID dependency folder;
(3) creating a soft link for the first mirror layer under the overlay2 file system for pointing to the empty folder with the file name diff created in step (2);
(4) and respectively creating link files for recording soft links of the first layer mirror layer and lower files for recording the relation between the first layer mirror layer and other mirror layers under the CacheID dependency relation folder.
5. A container acceleration deployment apparatus for asynchronous parallel extraction of mirror layers, comprising:
and a confirmation module: the method comprises the steps of receiving a containerized service instruction and confirming a dock installation path;
json profile copy module: copying the json configuration file of the mirror image to be deployed to the position under the dock installation path acquired by the confirmation module;
the mirror image information adding module: the method comprises the steps that image information of a corresponding image layer is added to a repositiories file based on a manifest file of an image to be deployed, wherein the image information comprises an image name, an image version and an image ID;
an identification ID generation module: generating a corresponding DiffID, chainID and CacheID for each image layer of the images to be deployed based on the manifest file;
mirror image layer judging module: the method comprises the steps that multiplexing judgment is carried out on each mirror image layer to be built based on the DiffID generated by an identification ID generation module, if the DiffID does not exist on a server node, diffID, chainID and CacheID of the mirror image layer are stored, otherwise, the identification ID generation module is started to process the next mirror image layer until all the mirror image layers are processed and judged to be finished;
and the dependency relation storage module is used for: the method comprises the steps of establishing data information for recording the dependency relationship between mirror image layers under an overlay2 file system under a dock installation path;
and (3) a downloading module: and downloading the mirror image layer contents in the corresponding mirror image layer folder in parallel based on the judgment result of the mirror image layer judgment module.
CN202310748301.1A 2023-06-25 2023-06-25 Container acceleration deployment method and device for asynchronous parallel extraction of mirror image layer Active CN116700902B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310748301.1A CN116700902B (en) 2023-06-25 2023-06-25 Container acceleration deployment method and device for asynchronous parallel extraction of mirror image layer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310748301.1A CN116700902B (en) 2023-06-25 2023-06-25 Container acceleration deployment method and device for asynchronous parallel extraction of mirror image layer

Publications (2)

Publication Number Publication Date
CN116700902A true CN116700902A (en) 2023-09-05
CN116700902B CN116700902B (en) 2024-03-12

Family

ID=87839018

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310748301.1A Active CN116700902B (en) 2023-06-25 2023-06-25 Container acceleration deployment method and device for asynchronous parallel extraction of mirror image layer

Country Status (1)

Country Link
CN (1) CN116700902B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102932415A (en) * 2012-09-26 2013-02-13 东软集团股份有限公司 Method and device for storing mirror image document
CN107431720A (en) * 2015-12-31 2017-12-01 华为技术有限公司 Mirror image dispositions method and device
CN107729020A (en) * 2017-10-11 2018-02-23 北京航空航天大学 A kind of method for realizing extensive container rapid deployment
CN109358857A (en) * 2018-08-22 2019-02-19 华为技术有限公司 Mirror image building, mirrored storage, mirror image distribution method and device
CN112527463A (en) * 2020-12-17 2021-03-19 重庆邮电大学 Container mirror image downloading acceleration method based on object storage
WO2022127420A1 (en) * 2020-12-18 2022-06-23 中兴通讯股份有限公司 Service choreography and deployment method and system, network device, and storage medium
US20230022646A1 (en) * 2020-02-21 2023-01-26 Telefonaktiebolaget Lm Ericsson (Publ) Method for updating applications in cloud environments

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102932415A (en) * 2012-09-26 2013-02-13 东软集团股份有限公司 Method and device for storing mirror image document
CN107431720A (en) * 2015-12-31 2017-12-01 华为技术有限公司 Mirror image dispositions method and device
CN107729020A (en) * 2017-10-11 2018-02-23 北京航空航天大学 A kind of method for realizing extensive container rapid deployment
CN109358857A (en) * 2018-08-22 2019-02-19 华为技术有限公司 Mirror image building, mirrored storage, mirror image distribution method and device
US20230022646A1 (en) * 2020-02-21 2023-01-26 Telefonaktiebolaget Lm Ericsson (Publ) Method for updating applications in cloud environments
CN112527463A (en) * 2020-12-17 2021-03-19 重庆邮电大学 Container mirror image downloading acceleration method based on object storage
WO2022127420A1 (en) * 2020-12-18 2022-06-23 中兴通讯股份有限公司 Service choreography and deployment method and system, network device, and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
PAOLO BELLAVISTA,GUILLAUME PIERRE: "Fast Docker container deployment in Fog computing infrastructures", 《ALMADL UNIVERSITY OF BOLOGNA DIGITAL LIBRARY》, 14 March 2019 (2019-03-14) *

Also Published As

Publication number Publication date
CN116700902B (en) 2024-03-12

Similar Documents

Publication Publication Date Title
JP5758995B2 (en) System, method and computer-readable storage medium for sharing analysis results between virtual machines
EP1974264B1 (en) Method and system for sharing files among different virtual machine images
US7260738B2 (en) System and method for splitting an image across multiple computer readable media
US9170855B2 (en) Virtual application extension points
JP5025901B2 (en) Determining the largest group of dependent software updates that are valid for installation
CN104220987B (en) Using the method and system installed
CN110532098B (en) Method and system for providing GPU (graphics processing Unit) service
CN105335253A (en) Method and device for creating virtual machine system disk snapshots
JPH1083280A (en) Method and device for installing packages by package subordinacy
CN107506221A (en) Application program updating method, apparatus and equipment
KR20070048638A (en) Creating volume images
CN101308471A (en) Method and device for data restoration
US10338910B2 (en) Multi-tenant upgrading
JP2008502968A (en) Method for loading software comprising an intermediate object-oriented language onto a portable device
CN110908671A (en) Method and device for constructing docker mirror image and computer readable storage medium
EP3844937B1 (en) Synchronizing in-use source data and an unmodified migrated copy thereof
CN107943572A (en) Data migration method, device, computer equipment and storage medium
Civolani et al. FogDocker: Start container now, fetch image later
CN113127150A (en) Rapid deployment method and device of cloud native system, electronic equipment and storage medium
CN106406923A (en) Processing method and device of dynamic library file
US20100312865A1 (en) Asynchronous update of virtualized applications
US11418555B1 (en) Systems and methods for streaming an application via object storage
CN116700902B (en) Container acceleration deployment method and device for asynchronous parallel extraction of mirror image layer
CN115336237A (en) Predictive provisioning of remotely stored files
CN115080114B (en) Application program transplanting processing method, device and medium

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