Container management method and apparatus, and device and medium

By mounting the cloud storage system to the read-write layer of the root file system when the container starts and retaining incremental data when deleting requests, the problem of data loss after container migration or restart is solved, and the full amount of container data is persisted, which improves the user experience.

WO2025194649A1PCT designated stage Publication Date: 2025-09-25DOUYIN VISION CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/107954
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-03-18
Filing Date
2024-07-26
Publication Date
2025-09-25

AI Technical Summary

Technical Problem

After a container is migrated or restarted, all data in the container except the subdirectory data is lost, affecting the user experience.

Method used

When the target container starts, the cloud storage system specified by the storage volume is mounted to the read-write layer of the root file system, and in response to the deletion request, the incremental data in the read-write layer and the cloud storage system is retained. After restarting, it is remounted to the read-write layer of the root file system.

Benefits of technology

It achieves persistent storage of incremental data in containers and improves the user experience of accessing data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024107954_25092025_PF_FP_ABST
    Figure CN2024107954_25092025_PF_FP_ABST
Patent Text Reader

Abstract

The embodiments of the present disclosure relate to a container management method and apparatus, and a device and a medium. The method comprises: when a target container is started, mounting a cloud storage system designated by a storage volume to a read-write layer in a root file system of the target container; and in response to a deletion request for the target container, executing a retention operation on incremental data in the read-write layer and the cloud storage system, and after the target container is restarted, re-mounting the cloud storage system to the read-write layer in the root file system of the restarted target container.
Need to check novelty before this filing date? Find Prior Art

Description

Container management method, device, equipment and medium

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS

[0002] This application claims priority to the Chinese patent application filed on March 18, 2024, with application number 202410311286.9 and invention name “A container management method, device, equipment and medium”. The entire contents of the application are incorporated by reference into this application. Technical Field

[0003] The present disclosure relates to the field of cloud computing technology, and in particular to a container management method, apparatus, device, and medium. Background Art

[0004] In a container orchestration system, container data can be stored through mounted volumes or cloud disks. However, volumes or cloud disks can only be mounted to a subdirectory of a container. After the container is migrated or restarted, only the data in this subdirectory is preserved, and other data in the container is lost, affecting the user experience.

[0005] Summary of the Invention

[0006] In order to solve the above technical problems, the present disclosure provides a container management method, apparatus, device and medium.

[0007] An embodiment of the present disclosure provides a container management method, the method comprising:

[0008] When the target container is started, the cloud storage system specified by the storage volume is mounted to the read-write layer in the root file system of the target container;

[0009] In response to a deletion request for the target container, a retention operation is performed on the read-write layer and the incremental data in the cloud storage system, and after the target container is restarted, the cloud storage system is remounted to the read-write layer of the root file system of the restarted target container.

[0010] The present disclosure also provides a container management device, the device comprising:

[0011] A mounting module, configured to mount the cloud storage system specified by the storage volume to the read-write layer of the root file system of the target container when the target container is started;

[0012] A retention module is used to perform a retention operation on the read-write layer and the incremental data in the cloud storage system in response to a deletion request for the target container, and to remount the cloud storage system to the read-write layer of the root file system of the restarted target container after the target container is restarted.

[0013] An embodiment of the present disclosure further provides an electronic device, comprising: a processor; a memory for storing instructions executable by the processor; and the processor for reading the executable instructions from the memory and executing the instructions to implement the container management method provided in the embodiment of the present disclosure.

[0014] An embodiment of the present disclosure further provides a computer-readable storage medium, wherein the storage medium stores a computer program, and the computer program is used to execute the container management method provided by the embodiment of the present disclosure.

[0015] The embodiments of the present disclosure further provide a computer program product, including a computer program / instruction, wherein the computer program / instruction, when executed by a processor, implements the steps of the container management method provided in the embodiments of the present disclosure.

[0016] The technical solution provided by the embodiment of the present disclosure has the following advantages over the existing technology: the container management solution provided by the embodiment of the present disclosure mounts the cloud storage system specified by the storage volume to the read-write layer in the root file system of the target container when the target container is started; in response to a deletion request for the target container, a retention operation is performed on the read-write layer and the incremental data in the cloud storage system, and after the target container is restarted, the cloud storage system is remounted to the read-write layer of the root file system of the restarted target container. By adopting the above technical solution, the cloud storage system specified by the storage volume is mounted to the read-write layer of the root file system, and the data in the read-write layer is stored through the cloud storage system. When the target container is subsequently deleted, the incremental data in the read-write layer and the cloud storage system are retained. After the target container is restarted, the cloud storage system can be remounted to read the retained incremental data. The incremental data of the container is not affected by the deletion of the container and is persistently preserved, thereby realizing the persistent preservation of the full data of the container and improving the user's data access experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The above and other features, advantages, and aspects of the various embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and that the originals and elements are not necessarily drawn to scale.

[0018] FIG1 is a schematic diagram of container management provided by related technologies;

[0019] FIG2 is a schematic diagram of a process of a container management method provided by some embodiments of the present disclosure;

[0020] FIG3 is a schematic diagram of container management provided by some embodiments of the present disclosure;

[0021] FIG4 is a schematic diagram of starting a target container according to some embodiments of the present disclosure;

[0022] FIG5 is a schematic structural diagram of a container management device provided in some embodiments of the present disclosure;

[0023] FIG6 is a schematic structural diagram of an electronic device provided in some embodiments of the present disclosure. DETAILED DESCRIPTION

[0024] The following describes embodiments of the present disclosure in more detail with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as limited to the embodiments described herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of protection of the present disclosure.

[0025] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.

[0026] As used herein, the term "including" and its variations are open-ended, i.e., "including but not limited to." The term "based on" means "based, at least in part, on." The term "one embodiment" means "at least one embodiment," the term "another embodiment" means "at least one additional embodiment," and the term "some embodiments" means "at least some embodiments." Other terms are defined in the following description.

[0027] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

[0028] It should be noted that the modifications of "one" and "multiple" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, they should be understood as "one or more".

[0029] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.

[0030] In native container orchestration systems, container data is stored through mounted volumes or cloud disks. Figure 1 illustrates container management in related technologies. As shown in Figure 1, a volume or cloud disk can only be bound to a subdirectory within a container, replacing the original contents of the subdirectory with the contents of the volume or cloud disk. After a container is migrated or restarted, the data in the subdirectory is retained, but other data in the container, such as the writable layer, is lost, impacting the user experience.

[0031] For example, in a cloud-based integrated development environment, the default home directory of a container is mounted on a storage system, and all user data in the home directory is stored on the storage system. This allows the user data in the home directory to be preserved after the container is migrated or restarted. However, other data, such as installation packages generated by the user in the container environment, is lost.

[0032] In order to solve the above problems, the embodiments of the present disclosure provide a container management method, which is introduced below in conjunction with specific embodiments.

[0033] Figure 2 is a flow chart of a container management method provided by some embodiments of the present disclosure. The method can be executed by a container management device, wherein the device can be implemented using software and / or hardware and can generally be integrated into an electronic device. As shown in Figure 2, the container management method includes:

[0034] Step 201: When the target container is started, the cloud storage system specified by the storage volume is mounted to the read-write layer in the root file system of the target container.

[0035] The target container can be the container currently being started in the container orchestration system, or any one or more containers in a container group. This embodiment does not limit the type of the target container. For example, the target container can be a standard container that meets a certain container interface specification, regardless of the specific container interface specification.

[0036] A container orchestration system can be used to manage containerized applications across multiple hosts in a cloud platform. A container orchestration system can be understood as a container orchestration engine, used to automatically deploy, scale, and manage containerized applications. A container group in a container orchestration system is the smallest unit created or deployed by the system. A container group encapsulates one or more containers.

[0037] The storage volume can be understood as an abstraction of the cloud storage system at the container orchestration system level. The storage volume can be used to store data in the read-write layer of the root file system. The storage volume can be a pre-defined volume in the container orchestration system. The life cycle of the storage volume can be different from the life cycle of the target container, and the life cycle of the storage volume can be independent of the life cycle of the target container. For example, after the target container is deleted, the data stored in the storage volume can still exist. The life cycle characteristics of the storage volume create a basis for retaining previously stored data after the target container is restarted. The cloud storage system can be a data storage system implemented based on cloud technology. The cloud storage system can store data in the cloud based on the cloud storage system. The cloud storage system is also called a cloud disk. In some embodiments of the present disclosure, the cloud storage system is a block storage cloud system. The block storage cloud system can be a cloud storage system that divides data into blocks and stores and accesses data in blocks. The block storage cloud system is also called a block storage cloud disk.

[0038] The root file system (RootFS) can be a file system used to provide an isolated execution environment for the container process. The root file system can be understood as a union file system. The root file system can include a read-only layer (LowerDir) and a read-write layer (UpperDir). The read-only layer can be a layer with read-only access rights. The read-only layer can be used to store read-only image data. The read-write layer can be a layer with read-write access rights. The read-write layer is also called a writable layer. The read-write layer can be used to store readable and writable data. The read-write layer can be located above the read-only layer. The read-write layer can be used to record modifications to files in the root file system.

[0039] In the embodiment of the present disclosure, the container management method may be executed by a container orchestration system, that is, the container management device may be provided in the container orchestration system.

[0040] In an embodiment of the present disclosure, the container management device can start the target container in response to a user's request to start the target container. During the startup process, the cloud storage system corresponding to the storage volume can be mounted to the read-write layer of the root file system of the target container, and the data in the read-write layer can be stored through the cloud storage system.

[0041] In some embodiments of the present disclosure, when the target container is started, the cloud storage system specified by the storage volume is mounted to the read-write layer in the root file system of the target container, including: when the target container is started by calling the container running tool, the directory of the read-write layer of the root file system of the target container is set to the mount directory of the storage volume of the specified cloud storage system.

[0042] The container runtime tool can be a lightweight container runtime tool that can be used to create and run containers. The mount directory ( / mount-path) can be the directory where the storage volume is mounted, and the mount directory can be understood as the mount point of the storage volume.

[0043] In this embodiment, after the root file system is built, a container runtime tool is invoked based on the Open Container Initiative to start the target container. During the target container startup process, if the container runtime tool determines that the mount directory recorded in the annotation is a read-write layer directory, indicating that the read-write layer directory is designated as the mount directory for the cloud storage system, the container management device sets the read-write layer directory of the target container's root file system as the mount directory for the cloud storage system's storage volume. If the container runtime tool determines that the mount directory recorded in the mount annotation is not a read-write layer directory, the cloud storage system's storage volume is mounted according to the mount directory recorded in the mount annotation.

[0044] Figure 3 is a schematic diagram of container management provided by some embodiments of the present disclosure. In Figure 3, the merge directory (MergeDir) can be a directory of the root file system perceived by the container. As shown in Figure 3, the node agent in the container orchestration system mounts the storage system to the host machine and specifies the directory of the writable layer of the root file system of the target container as the mount directory of the cloud storage system. The container execution tool starts the target container and mounts the cloud storage system to the readable layer of the root file system.

[0045] In the above solution, the root file system of the target container is built based on the container runtime, and the container running tool is called to start the target container. Through the cooperation of the container runtime and the container running tool, the cloud storage system is mounted to the read-write layer when the target container is started, creating a foundation for the subsequent retention of incremental data.

[0046] Step 202: In response to the deletion request for the target container, a retention operation is performed on the read-write layer and the incremental data in the cloud storage system, and after the target container is restarted, the cloud storage system is remounted to the read-write layer of the root file system of the restarted target container.

[0047] Among them, the deletion request may be a request to instruct to delete the target container. In some embodiments of the present disclosure, the deletion request includes a migration request or a restart request. Among them, the migration request may be a request to instruct to migrate the target container from one container orchestration system node to another container orchestration system node. The restart request may be a request to instruct to restart the target container. In this embodiment, in response to the migration request or restart request for the target container, the container management device will retain the incremental data in the read-write layer and the cloud storage system, and after the target container is restarted, the cloud storage system will be remounted to the read-write layer of the root file system of the restarted target container. In the case of migrating or restarting the target container, the original incremental data of the read-write layer corresponding to the target container can be retained.

[0048] Incremental data can be used to record changes during the target container's operation. This incremental data can be data recorded in the read-write layer of the target container's root file system. Because the cloud storage system is mounted on this read-write layer, this incremental data is specifically stored in the cloud storage system. A retention operation can be performed without deleting the incremental data. This retention operation can be implemented by executing corresponding retention code.

[0049] In the embodiment of the present disclosure, during the operation of the target container, since the cloud storage system is mounted on the read-write layer of the root file system, and the data changes during the operation of the target container are recorded in the read-write layer through incremental data, the incremental data will be synchronized to the cloud storage system, thereby realizing the synchronization of data changes in the target container. If the user needs to delete the target container, the user can create a corresponding deletion process, which generates a deletion request for the target container and sends the deletion request to the container management device. The container management device responds to the deletion request, executes the deletion of the target container, and intercepts the deletion of the incremental data in the read-write layer and the cloud storage system, thereby realizing the retention of the incremental data in the read-write layer and the cloud storage system.

[0050] Furthermore, after the target container is restarted, the cloud storage system is remounted to the read-write layer of the root file system of the restarted target container. The data in the read-write layer is the data stored in the cloud storage system, that is, the data recorded in the read-write layer before the target container was deleted.

[0051] In some embodiments of the present disclosure, a retention operation is performed on the read-write layer and the incremental data in the cloud storage system, including: obtaining the target directory of the read-write layer recorded in the annotation of the target container; if it is determined that the target directory is the same as the mount directory of the cloud storage system, then determining that the cloud storage system is mounted to the read-write layer, and performing a retention operation on the read-write layer and the incremental data in the cloud storage system.

[0052] The target directory may be a basis for determining whether to retain incremental data. The target directory may be the directory where the read-write layer is mounted if the incremental data is to be retained. It is understood that if the read-write layer is mounted on the target directory, the incremental data in the read-write layer is retained; if the read-write layer is not mounted on the target directory, the incremental data in the read-write layer is not retained.

[0053] In this embodiment, in response to receiving a delete operation on a target container, the container management device parses the annotation in the target container, obtains the target directory of the read-write layer described in the annotation, and obtains the mount directory currently mounted by the cloud storage system. A determination is made as to whether the target directory and the mount directory are consistent. If so, indicating that the cloud storage system is currently mounted to the read-write layer of the root file system, the incremental data in the read-write layer and the cloud storage system are retained. If the target directory and the mount directory are inconsistent, indicating that the cloud storage system is not currently mounted to the read-write layer of the root file system, the incremental data in the read-write layer is not retained and is deleted.

[0054] In the above solution, whether the cloud storage system is mounted on the read-write layer is determined based on the comparison between the target directory and the mount directory, and when the cloud storage system is mounted on the read-write layer, incremental data in the read-write layer is retained.

[0055] The container management solution provided by the embodiment of the present disclosure mounts the cloud storage system specified by the storage volume to the read-write layer in the root file system of the target container when the target container is started; in response to a deletion request for the target container, a retention operation is performed on the read-write layer and the incremental data in the cloud storage system, and after the target container is restarted, the cloud storage system is remounted to the read-write layer of the root file system of the restarted target container. By adopting the above technical solution, the cloud storage system specified by the storage volume is mounted to the read-write layer of the root file system, and the data in the read-write layer is stored through the cloud storage system. When the target container is subsequently deleted, the incremental data in the read-write layer and the cloud storage system are retained. After the target container is restarted, the cloud storage system can be remounted to read the retained incremental data. The incremental data of the container is not affected by the deletion of the container and is persistently preserved, thereby realizing the persistent preservation of the full data of the container and improving the user's data access experience.

[0056] In related technologies, the storage system is mounted to a subdirectory of the container. The storage system cannot perceive the root file system as a joint file system, nor can it perceive the read-write layer in the root file system. However, in the embodiments of the present disclosure, operations on the root file system are implemented, and the container is mounted to the read-write layer of the root file system, thereby achieving the preservation of incremental data in the read-write layer. If the mirror data in the read-only layer does not change, this incremental data combined with the mirror data in the read-only layer is the entire data of the target container, thereby achieving the full preservation of the target container data.

[0057] In some embodiments of the present disclosure, before the target container is started, the container management method further includes: mounting the cloud storage system to the host machine of the target container, and building a root file system of the target container based on the container runtime.

[0058] The container runtime is an industry-standard container runtime that enables one or more of the following functions: managing the container lifecycle, pulling or pushing container images, managing the storage of images and container data, calling command-line tools to run containers, and managing container networks and network interfaces. The host machine can be a physical or virtual machine running a node in the container orchestration system.

[0059] In this embodiment, the node agent in the container orchestration system can mount the cloud storage system to the host machine of the target container, and call the container runtime based on the pre-set remote procedure call service through the container runtime interface, and build the root file system of the target container through the container runtime. Specifically, the image is downloaded from the pre-set image repository, and the image includes multiple compressed files, one compressed file corresponds to a layer in the read-only layer, and the compressed file is decompressed to the directory of the corresponding layer to obtain the read-only layer of the root file system. The read-write layer of the root file system is set to an empty directory to obtain the root file system. During the construction of the root file system, the container runtime records the mount directory of the cloud storage system through annotations, and the mount directory recorded in the annotation can be a directory of the read-write layer.

[0060] Figure 4 is a schematic diagram of starting a target container provided by some embodiments of the present disclosure. As shown in Figure 4, the node agent in the container orchestration system mounts the cloud storage system to the host machine, calls the container runtime based on a pre-set remote procedure call service through the container runtime interface, and the container runtime builds the root file system of the target container and calls the container runtime tool through the Open Container Initiative to start the target container through the container runtime tool.

[0061] In the above solution, the construction of the root file system is realized, which lays the foundation for the subsequent mounting of the cloud storage system.

[0062] In some embodiments of the present disclosure, the container management method further includes: adding a retention code to the deletion code of the target container, wherein the retention code is used to not perform a deletion operation on incremental data of the read-write layer when determining that the target container is deleted.

[0063] Among them, the deletion code can be an existing functional code for deleting the target container, and the deletion code can include a migration code for migrating the target container or a container code for restarting the target container. The retention code can be a newly added functional code for retaining incremental data, and the retention code can be a logic code branch for retaining incremental data newly added to the deletion code. The retention code can be a code built based on a conditional statement, and the judgment condition of the retention code can be that the mount directory of the cloud storage system is a directory of the read-write layer of the root file system, and the execution operation can be not performing a deletion operation on the incremental data of the read-write layer. This embodiment does not limit the type of the conditional statement. For example, the conditional statement can be an if-then statement.

[0064] In this embodiment, a retention code is added to the existing deletion code for the target container. Subsequently, when the target container is deleted, the deletion code for the target container is executed, and the retention code for the incremental data in the deletion code is also executed, thereby preserving the incremental data in the read-write layer when deleting the target container. This creates a code-based foundation for subsequently deleting the target container while preserving the incremental data in the read-write layer.

[0065] In some embodiments of the present disclosure, when the target container is started, after the cloud storage system is mounted to the read-write layer in the root file system of the target container, the container management method further includes: in response to a data operation request for the target container, storing incremental data corresponding to the data operation request in the read-write layer and the cloud storage system.

[0066] The data operation request may be a request to process data in the target container. This embodiment does not limit the type of the data operation request. For example, the data operation request may be one or more of add, delete, and modify. This embodiment does not limit the layer of the data operated on by the data operation request. For example, the data may be in a read-only layer or a read-write layer.

[0067] In this embodiment, after mounting the cloud storage system to the read-write layer of the target container's root file system, if a user needs to operate on the data in the target container, the user can create a corresponding operation process and use the operation process to send a data operation request to the container management device. After receiving the data operation request, the container management device parses the data operation request. If the data operation request is to add or modify data in the read-only layer, the container management device can copy the data to the read-write layer and perform the addition or modification operation on the data in the read-write layer according to the data operation request. The corresponding incremental data is generated and stored in the read-write layer and the cloud storage system. If the data operation request is to delete data in the read-only layer, the container management device can create masking data for the data in the read-write layer, thereby hiding the data and using the masking data as incremental data.

[0068] If the data operation request is for processing existing incremental data in the read-write layer, one or more of adding, deleting, and modifying are performed on the existing incremental data according to the data operation request to obtain new incremental data corresponding to the data operation request.

[0069] In the above solution, incremental data is stored in the read-write layer and the cloud storage system in response to data operation requests, thus processing the data operation requests. The full data set can be constructed based on this incremental data and the read-only data in the read-only layer.

[0070] Next, the container management method in the embodiment of the present disclosure is further illustrated by using a specific example.

[0071] In this embodiment, the node agent in the container orchestration system mounts the cloud storage system to the host machine. In this case, the cloud storage system can be a directory on the host machine. The root file system of the target container is generated during the container runtime. This root file system can be understood as a union file system. The read-only layer of the root file system stores read-only image data, and the directory of the read-write layer of the root file system is the directory mounted by the cloud storage system. Data changes in the target container are synchronized to the cloud storage system in the form of incremental data in the read-write layer.

[0072] The container management solution provided by the embodiment of the present disclosure specifies the mount directory of the cloud storage system as the directory of the read-write layer of the root file system when assembling the root file directory during container runtime. The cloud storage system is then used to save the data in the writable layer of the root file system. This incremental data is combined with the mirror data in the read-only layer to achieve full preservation of the target container data.

[0073] Figure 5 is a schematic diagram of the structure of a container management device provided in some embodiments of the present disclosure. The device can be implemented by software and / or hardware and can generally be integrated into an electronic device. As shown in Figure 5, the container management device includes:

[0074] The mounting module 501 is used to mount the cloud storage system specified by the storage volume to the read-write layer in the root file system of the target container when the target container is started;

[0075] The retention module 502 is used to perform a retention operation on the read-write layer and the incremental data in the cloud storage system in response to a deletion request for the target container, and remount the cloud storage system to the read-write layer of the root file system of the restarted target container after the target container is restarted.

[0076] In some embodiments of the present disclosure, the mounting module 501 is used to:

[0077] When the target container is started by calling a container running tool, the directory of the read-write layer of the root file system of the target container is set to be the mount directory of the storage volume of the designated cloud storage system.

[0078] In some embodiments of the present disclosure, the retention module 502 is configured to:

[0079] Obtaining the target directory of the read-write layer recorded in the annotation of the target container;

[0080] If it is determined that the target directory is the same as the mount directory of the cloud storage system, the cloud storage system is determined to be mounted to the read-write layer, and a retention operation is performed on the read-write layer and the incremental data in the cloud storage system.

[0081] In some embodiments of the present disclosure, the container management device further includes:

[0082] The construction module is used to mount the cloud storage system to the host machine of the target container before the target container is started, and to build the root file system of the target container based on the container runtime.

[0083] In some embodiments of the present disclosure, the container management device further includes:

[0084] An adding module is used to add a reservation code to the deletion code of the target container, wherein the reservation code is used to not perform a deletion operation on the incremental data of the read-write layer when it is determined that the target container is deleted.

[0085] In some embodiments of the present disclosure, the container management device further includes:

[0086] The storage module is used to mount the cloud storage system to the read-write layer in the root file system of the target container when the target container is started, and then, in response to a data operation request for the target container, store the incremental data corresponding to the data operation request in the read-write layer and the cloud storage system.

[0087] In some embodiments of the present disclosure, the deletion request includes a migration request or a restart request, and the cloud storage system is a block storage cloud system.

[0088] The container management device provided in the embodiments of the present disclosure can execute the container management method provided in any embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects of the execution method.

[0089] A computer program product, comprising a computer program / instruction, wherein when the computer program / instruction is executed by a processor, the steps of the container management method are implemented.

[0090] FIG6 is a schematic structural diagram of an electronic device provided in some embodiments of the present disclosure.

[0091] 6 , which illustrates a schematic diagram of the structure of an electronic device 600 suitable for implementing embodiments of the present disclosure. The electronic device 600 in the embodiments of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. The electronic device illustrated in FIG6 is merely an example and should not limit the functionality or scope of use of the embodiments of the present disclosure.

[0092] As shown in Figure 6, the electronic device 600 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage device 608 into a random access memory (RAM) 603. Various programs and data required for the operation of the electronic device 600 are also stored in the RAM 603. The processing device 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0093] Typically, the following devices may be connected to the I / O interface 605: an input device 606 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 608 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 609. The communication device 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. Although FIG. 6 shows the electronic device 600 with various devices, it should be understood that not all of the devices shown are required to be implemented or present. More or fewer devices may alternatively be implemented or present.

[0094] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product that includes a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via the communication device 609, or installed from the storage device 608, or installed from the ROM 602. When the computer program is executed by the processing device 601, the above-mentioned functions defined in the container management method of the embodiment of the present disclosure are performed.

[0095] It should be noted that the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or component, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, 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), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, device, or component. In the present disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to wires, optical cables, RF (radio frequency), etc., or any suitable combination thereof.

[0096] In some embodiments, the client and server can communicate using any currently known or later developed network protocol, such as HTTP (HyperText Transfer Protocol), and can be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or later developed network.

[0097] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.

[0098] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device: when the target container is started, mounts the cloud storage system specified by the storage volume to the read-write layer in the root file system of the target container; in response to a deletion request for the target container, performs a retention operation on the read-write layer and incremental data in the cloud storage system, and after the target container is restarted, remounts the cloud storage system to the read-write layer of the root file system of the restarted target container.

[0099] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages, or a combination thereof, including, but not limited to, object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on the remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through 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., through the Internet using an Internet service provider).

[0100] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the module, program segment, or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of the boxes in the block diagram and / or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0101] The units involved in the embodiments described in this disclosure may be implemented in software or hardware, wherein the name of a unit does not necessarily limit the unit itself.

[0102] The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, and without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chip (SOCs), complex programmable logic devices (CPLDs), and the like.

[0103] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, 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), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0104] It is understandable that before using the technical solutions disclosed in the embodiments of this disclosure, the type, scope of use, usage scenarios, etc. of the information involved in this disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.

[0105] The above description is merely a preferred embodiment of the present disclosure and an illustration of the technical principles employed. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by the specific combination of the above-mentioned technical features, but also includes other technical solutions formed by any combination of the above-mentioned technical features or their equivalents without departing from the above-mentioned disclosed concepts. For example, a technical solution formed by replacing the above-mentioned features with (but not limited to) technical features with similar functions disclosed in this disclosure.

[0106] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details have been included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.

[0107] Although the subject matter has been described in language specific to structural features and / or methodological logical acts, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are merely example forms of implementing the claims.

Claims

1. A container management method, characterized in that: include: When the target container is started, the cloud storage system specified by the storage volume is mounted to the read-write layer in the root file system of the target container; In response to a deletion request for the target container, a retention operation is performed on the read-write layer and the incremental data in the cloud storage system, and after the target container is restarted, the cloud storage system is remounted to the read-write layer of the root file system of the restarted target container.

2. The method according to claim 1, characterized in that When the target container starts, the cloud storage system specified by the storage volume is mounted to the read-write layer of the root file system of the target container, including: When the target container is started by calling a container running tool, the directory of the read-write layer of the root file system of the target container is set to be the mount directory of the storage volume of the designated cloud storage system.

3. The method according to claim 1, characterized in that Performing a retention operation on the read-write layer and the incremental data in the cloud storage system includes: Obtaining the target directory of the read-write layer recorded in the annotation of the target container; If it is determined that the target directory is the same as the mount directory of the cloud storage system, the cloud storage system is determined to be mounted to the read-write layer, and a retention operation is performed on the read-write layer and the incremental data in the cloud storage system.

4. The method according to claim 1, wherein Before starting the target container, the method further includes: The cloud storage system is mounted on the host machine of the target container, and a root file system of the target container is constructed based on the container runtime.

5. The method according to claim 1, wherein The method further comprises: A reservation code is added to the deletion code of the target container, wherein the reservation code is used to not perform a deletion operation on the incremental data of the read-write layer when it is determined that the target container is deleted.

6. The method according to claim 1, characterized in that When the target container is started, after mounting the cloud storage system to the read-write layer in the root file system of the target container, the method further includes: In response to a data operation request for the target container, incremental data corresponding to the data operation request is stored in the read-write layer and the cloud storage system.

7. The method according to claim 1, characterized in that The deletion request includes a migration request or a restart request, and the cloud storage system is a block storage cloud system.

8. A container management method, characterized in that: include: A mounting module, configured to mount the cloud storage system specified by the storage volume to the read-write layer of the root file system of the target container when the target container is started; A retention module is used to perform a retention operation on the read-write layer and the incremental data in the cloud storage system in response to a deletion request for the target container, and to remount the cloud storage system to the read-write layer of the root file system of the restarted target container after the target container is restarted.

9. An electronic device, characterized in that: The electronic device comprises: processor; a memory for storing instructions executable by the processor; The processor is configured to read the executable instructions from the memory and execute the instructions to implement the container management method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that The storage medium stores a computer program, and the computer program is used to execute the container management method according to any one of claims 1 to 7.

11. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the steps of the container management method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • DOCKER container creation method, apparatus and system

    CN107590033A

  • IDV desktop password-free terminal, server, system and method based on container technology

    CN112052060A

  • Container processing method, device and system, and electronic equipment

    CN113296878A

  • Information processing method and device based on cloud platform, equipment and medium

    CN116339920A

  • Container starting method and device, electronic equipment and storage medium

    CN116483514A