Method for providing container service, container system, and related apparatus
By providing a combination of basic mirroring and public mirroring, the problem of inefficiency in storage space occupation and update in the container image management mode is solved, and more efficient container creation and mirroring management is achieved.
Patent Information
- Application Number
- PCT/CN2024/105025
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-11-30
- Filing Date
- 2024-07-11
- Publication Date
- 2025-03-13
AI Technical Summary
In the prior art, the container image management mode cannot effectively reduce storage space usage and improve image update efficiency, resulting in inefficient container creation.
By providing a combination of basic mirroring and public mirroring, users can choose basic mirroring to create containers and mount public mirrors in containers to avoid downloading public mirrors and simplify image management and update processes.
It reduces the storage space occupied by the node where the container is located, simplifies the mirror management and update process, and improves the efficiency and flexibility of container creation.
Smart Images

Figure CN2024105025_13032025_PF_FP_ABST
Abstract
Description
Method for providing container services, container system and related devices
[0001] This application claims priority to Chinese patent application No. 202311132414.5 filed on September 4, 2023, with invention name “Container application method, container system and related devices thereof”, and priority to Chinese patent application No. 202311653766.5 filed on November 30, 2023, with invention name “Method for providing container services, container system and related devices”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The present application relates to the field of container technology, and in particular to a method for providing container services, a container system, and related devices. Background Art
[0003] Currently, the internet and traditional industries are deeply integrated. In a rapidly changing market environment, business models are constantly evolving, and internet applications must rapidly iterate to adapt to new business needs. Against this backdrop, container (Docker) technology has emerged, and deploying application software using containers is becoming increasingly widespread.
[0004] For example, container technology can be applied to distributed clusters. Each node in a distributed cluster can run multiple containers, each containing an independent container image. This allows each node to host multiple applications simultaneously, and the isolation provided by container images prevents interference between them. The combination of distributed clusters and container technology provides a high-performance, more flexible, scalable, and manageable computing environment, which is then used to provide services to users. Leveraging container technology to provide more efficient services to users is currently a key focus.
[0005] Summary of the Invention
[0006] This application provides a method for providing container services, a container system, and related devices, which can improve the management difficulty of container images and provide users with more efficient services. The technical solution is as follows:
[0007] In a first aspect, a method for providing a container service is provided, which is applied to a container system. The container system provides multiple base images and common images corresponding to the multiple base images, wherein the common image includes common portions of multiple preset images, the multiple base images include non-public portions of the multiple preset images, and each base image corresponds to a preset image. The method includes:
[0008] A container image selection interface is provided, which is used to instruct a user to select a base image for creating a first container from the multiple base images; an identifier of the first base image selected by the user from the container image selection interface is received; based on the identifier of the first base image, a first container is created using the first base image, and the public image is mounted in the first container, where the first container is used to provide services for the user.
[0009] In this solution, the container system provides users with a base image and a public image. Users can create containers using the base image and then mount the public image, eliminating the need to download the public image. This reduces the storage space occupied by the node where the container resides. Furthermore, the separate public image facilitates management and allows for rapid updates and upgrades. Since the public image is mounted, user-created containers can be quickly updated by simply updating the public image. This approach, without downloading the public image and instead using mounting, also makes container creation more efficient.
[0010] Optionally, the container system includes a distributed cluster, and the method is applied to a management node in the distributed cluster, which also includes multiple working nodes; based on the identifier of the first base image, creating a first container using the first base image includes: sending a container creation instruction to the first working node, the container creation instruction carries the identifier of the first base image, and the container creation instruction is used to instruct the first working node to create a first container on the first working node based on the identifier of the first base image using the first base image, and the first working node is one of the multiple working nodes.
[0011] Optionally, the multiple base images and public images are stored in a container image repository included in the distributed cluster; the container creation instruction is also used to instruct the first working node to download the first base image from the container image repository based on the identifier of the first base image when the first working node does not store the first base image.
[0012] Optionally, the multiple base images mentioned above also include user-defined images. That is, the base images in the container system include both base images provided by the container service provider and user-defined images.
[0013] Optionally, the user has modification permissions for some or all of the multiple base images. That is, the user can download some or all of the base images to the user's local device to modify them, and then upload the modified base images to the container system.
[0014] The user-defined image mentioned above includes a customized image obtained by a user after customizing and updating one or more base images, or also includes an original image created by the user.
[0015] Optionally, the method further includes: providing a container image download interface, the container image download interface being used to instruct the user to select a base image to be downloaded from the multiple base images; receiving an identifier of a second base image selected by the user from the container image download interface; downloading the second base image to the user's local device based on the identifier of the second base image; providing a container image creation interface, the container image creation interface being used to instruct the user to modify the second base image; and obtaining a third base image uploaded by the user from the container image creation interface, the third base image being a base image obtained by the user modifying the second base image. That is, the user can download and modify the base image through the container image download interface and the container image creation interface.
[0016] Optionally, the user does not have modification permissions on the public image.
[0017] Optionally, the method further includes: providing a public image update interface, the public image update interface being used to instruct the container service developer to update the public image; and obtaining the updated public image from the public image update interface. That is, the public image is managed and updated by the container service developer.
[0018] Optionally, the public image is stored in a container image repository, and the method further includes: replacing the public image stored in the container image repository with an updated public image. Since the public image is mounted in the container created for the user by mounting, after the public image is updated, the container created for the user will also be updated synchronously. It can be seen that this solution can quickly update all containers by updating a public image. In the related art, if you want to update the public parts of multiple preset images, you need to update and publish the multiple preset images one by one, and the node that creates the container needs to download the updated preset image again before it can use the updated preset image to update the container.
[0019] Optionally, the base image includes an operating system layer image and / or an engine layer image, and the public image includes a business layer image. That is, since the operating system and engine typically don't require frequent maintenance and updates, the operating system and engine layer images can be used as the base images. Since the business layer typically requires frequent maintenance and updates, the business layer content can be created as a public image.
[0020] The engine layer image includes an artificial intelligence (AI) engine layer image.
[0021] The public image includes one or more of a security reinforcement component, a remote access component, a website service component, a cloud service software development kit (SDK), an encryption component, and a decryption component.
[0022] In a second aspect, another method for providing a container service is provided. The container system provides multiple base images and public images corresponding to the multiple base images. The public images include public parts of multiple preset images. The multiple base images include non-public parts of multiple preset images. Each base image corresponds to a preset image. The container system includes a distributed cluster. The method is applied to a first working node in the distributed cluster. The method includes:
[0023] A container creation instruction is received, where the container creation instruction carries an identifier of a first base image, where the first base image is one of multiple base images; based on the identifier of the first base image, a first container is created using the first base image, and the public image is mounted in the first container, where the first container is used to provide services for the user.
[0024] In this solution, the container system provides users with a base image and a public image. Users can create containers using the base image and then mount the public image, eliminating the need to download the public image. This reduces the storage space occupied by the node where the container resides. Furthermore, the separate public image facilitates management and allows for rapid updates and upgrades. Since the public image is mounted, user-created containers can be quickly updated by simply updating the public image. This approach, without downloading the public image and instead using mounting, also makes container creation more efficient.
[0025] Optionally, the user has modification permission for some or all of the multiple base images, and / or the user does not have modification permission for the public image.
[0026] Optionally, the method further includes: deleting container images that meet the aging condition on the first working node. That is, the working node in this solution can also automatically clean up aging images, thereby reducing unnecessary storage space waste on the working node.
[0027] The aging conditions include that the version of the container image is lower than the reference version, and / or the time when the container image was last used exceeds the reference time from the current time.
[0028] Optionally, the basic image includes an operating system layer image and / or an engine layer image, and the public image includes a business layer image.
[0029] Optionally, the engine layer image includes an AI engine layer image.
[0030] In a third aspect, a device for providing container services is provided. The device has the functionality to implement the method for providing container services described in the first or second aspect. The device includes one or more modules configured to implement the method for providing container services described in the first or second aspect.
[0031] In a fourth aspect, a container system is provided, wherein the container system is used to implement the method for providing container services provided in the first aspect or the second aspect.
[0032] In a fifth aspect, a computing device is provided, comprising a processor and a memory, wherein the memory is configured to store a program for executing the method for providing a container service as provided in the first or second aspect, and to store data related to implementing the method for providing a container service as provided in the first or second aspect. The processor is configured to execute the program stored in the memory. The computing device may further include a communication bus for establishing a connection between the processor and the memory.
[0033] In a sixth aspect, a computing device cluster is provided, wherein the computing device cluster includes at least one computing device, each computing device including a processor and a memory; the processor of the at least one computing device is used to execute instructions stored in the memory of the at least one computing device, so that the computing device cluster performs the steps of the method for providing container services as provided in the first or second aspect above.
[0034] In a seventh aspect, a computer-readable storage medium is provided, wherein instructions are stored in the computer-readable storage medium. When the computer-readable storage medium is executed on a computer, the computer executes the steps of the method for providing container services described in the first or second aspect above.
[0035] In an eighth aspect, a computer program product comprising instructions is provided, which, when executed on a computer, causes the computer to execute the steps of the method for providing container services described in the first or second aspect above.
[0036] The technical effects obtained in the above-mentioned third to eighth aspects are similar to the technical effects obtained by the corresponding technical means in the first or second aspect, and will not be repeated here.
[0037] The technical solution provided by this application can at least bring the following beneficial effects:
[0038] In this solution, the container system provides users with a base image and a public image. Users can create containers using the base image and then mount the public image, eliminating the need to download the public image. This reduces the storage space occupied by the node where the container resides. Furthermore, the separate public image facilitates management and allows for rapid updates and upgrades. Since the public image is mounted, user-created containers can be quickly updated by simply updating the public image. This approach, without downloading the public image and instead using mounting, also makes container creation more efficient. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] FIG1 is an architecture diagram of a distributed cluster provided in an embodiment of the present application;
[0040] FIG2 is a flowchart of a method for providing container services provided in an embodiment of the present application;
[0041] FIG3 is a schematic diagram of a container image provided in an embodiment of the present application;
[0042] FIG4 is an architecture diagram of a container system provided in an embodiment of the present application;
[0043] FIG5 is a schematic structural diagram of an apparatus for providing container services according to an embodiment of the present application;
[0044] FIG6 is a schematic structural diagram of another apparatus for providing container services according to an embodiment of the present application;
[0045] FIG7 is a schematic diagram of the structure of a computing device provided in an embodiment of the present application;
[0046] FIG8 is a schematic diagram of the structure of a computing device cluster provided in an embodiment of the present application;
[0047] FIG9 is a schematic diagram of the structure of another computing device cluster provided in an embodiment of the present application. DETAILED DESCRIPTION
[0048] In order to make the objectives, technical solutions and advantages of the embodiments of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.
[0049] First, the background technology and implementation environment involved in the embodiments of the present application are introduced.
[0050] Container images are a lightweight, portable, and consistent deployment method that accelerates the development and delivery of cloud-native applications. Container images can be used to create containers for users, allowing them to perform tasks within the container. For example, a container can provide users with a development environment in which they can develop program code. This development environment can be an AI development environment, where the container is used to develop AI models or engines. For another example, the development environment can be an application (APP) development environment, where the container is used to develop a wide variety of APPs. Of course, containers can also provide users with services or environments beyond the development environment, allowing them to perform any possible tasks within the container.
[0051] Taking containers as an example, in AI scenarios, container images greatly simplify the development, deployment, and management of AI models and engines. Through container images, users (such as developers) can package applications and their dependencies into a portable unit that can be deployed in any environment. Container images can provide a consistent operating environment, eliminating configuration issues and dependency conflicts caused by different environments. At the same time, the lightweight and fast startup capabilities of container images make deploying and scaling applications in cloud environments more efficient. Currently, comprehensive cloudification and containerization are being actively promoted. Containerization solutions mainly include managed container services, container orchestration tools, and container-related automation and management tools.
[0052] A distributed cluster is a relatively powerful computing architecture. A distributed cluster includes multiple working nodes. These multiple working nodes may include computing nodes with computing resources as the core, or may also include nodes with other resources as the core. Working nodes may have different names in different scenarios, and the embodiments of the present application do not limit this. Taking the case where these multiple working nodes include multiple computing nodes as an example, in some scenarios, these multiple computing nodes utilize network connections to provide users with high-performance, large-scale computing power through collaborative work. A distributed cluster distributes the computing load to each computing node, thereby realizing parallel computing. Each computing node has independent computing power and storage resources. Through mutual communication and collaboration, data and tasks are effectively shared between computing nodes, accelerating the computing process.
[0053] Distributed clusters are characterized by scalability and high availability. They can dynamically increase or decrease worker nodes in the cluster as needed, flexibly adjusting or allocating node resources to meet computing needs of varying scale and complexity. Furthermore, because worker nodes in a cluster are independent of each other, if a worker node fails or malfunctions, other worker nodes can continue to operate, ensuring the continuous availability of the entire cluster. In cloud computing scenarios, distributed clusters can support large-scale data processing and analysis, accelerate machine learning and deep learning, and train large models, providing real-time data processing and flexible computing power.
[0054] Currently, container technology is being applied to distributed clusters. In a distributed cluster, each worker node can run multiple containers, each containing an independent container image. This allows each node to host multiple applications simultaneously, and the isolation provided by container images prevents interference between them. The combination of distributed clusters and container technology provides a more flexible, scalable, and manageable computing environment. Stated another way, distributed clusters provide high-performance computing capabilities, while container images simplify application deployment and management, making deploying and running applications in distributed clusters more convenient and reliable.
[0055] In the related technologies of distributed cluster architecture based on container technology, a series of AI interactive development and training environments that support containerization are provided, providing convenient and efficient services for AI application developers. These services provide a wide variety of container images based on conditions such as AI engine type, driver version or operating system for AI application developers to choose based on their own business scenarios. At present, the solution for managing containers in a distributed cluster can be summarized as follows: each working node in the cluster directly pulls the corresponding container image from the container image warehouse based on the container image selected by the user, and creates a business container for the user based on the pulled container image (in the embodiment of this application, the business container is referred to as a container).
[0056] However, container service developers pre-install a wide variety of container images (hereinafter referred to as pre-installed images) in the container image repository. Pre-installed images are usually large. For example, according to research on some manufacturers, the size of each pre-installed image is currently over 30GB. Since each working node in the distributed cluster needs to pull these pre-installed images to create a container, the container images alone will occupy a large amount of storage space in the distributed cluster.
[0057] For example, if a distributed cluster consists of 200 worker nodes, each of which requires 30 container images, and each container image is 30GB in size, the storage space occupied by the container images in the distributed cluster will reach 200 * 30 * 30GB = 180TB. This is a considerable increase in the storage space of the distributed cluster.
[0058] Moreover, the container image management mode in the current related technology cannot quickly realize the update and adjustment of user-defined container images. Specifically, user-defined container images generally need to be built based on the preset images provided by the container cloud vendor service, but the service-related parts of the preset images (such as permissions, security or network access, etc.) are directly integrated into the preset images, and users cannot update and adjust them. For example, assuming that due to a cloud service security attack, the security firmware in the preset image needs to be updated, then the cloud vendor needs to update each preset image, and the user needs to re-pull the updated preset image, and then re-create the custom image with updated security firmware based on the re-pulled preset image. It can be seen that when the cloud service security is attacked, since the user's custom image is no longer a system preset image at this time, the cloud vendor cannot modify and update the user's custom image, resulting in the security attack cannot be repaired in time.
[0059] In addition, due to the wide variety of pre-installed images in related technologies, the management process for container image production, modification, testing, and release is relatively complex. For example, in a distributed cluster, each working node contains 30 container images, and these 30 container images all contain the same small file. Then, even if only this small file is modified, such as this small file is a security firmware, if this security firmware is modified, it will still need to go through at least 30 image release processes because each container image needs to be re-produced and released. As can be seen, this not only increases the workload of development and operation and maintenance, but may also delay the rapid release of new or updated functions.
[0060] Based on the above problems, an embodiment of the present application provides a method for providing container services, which specifically includes a container management method and a container creation method. In this solution, the container system provides multiple base images and public images corresponding to the multiple base images. The public image includes the public parts of multiple preset images, and the multiple base images include the non-public parts of the multiple preset images. Each base image corresponds to a preset image. That is, the public image is a container image shared by the multiple base images. In other words, the public image in this solution includes the public parts of multiple preset images in the related art, and it can be considered that the public image is obtained by extracting the public parts of the multiple preset images. The use of public images can make container creation more efficient, while reducing the storage space occupied by the container image on the node where the container is located, and facilitates the management and rapid update and upgrade of the container image.
[0061] This solution can be applied to a distributed cluster, a single server, or any other possible system architecture. The system architecture and business scenarios described in the embodiments of this application are intended to more clearly illustrate the technical solutions of the embodiments of this application and do not constitute a limitation on the technical solutions provided by the embodiments of this application. Those skilled in the art will appreciate that, with the evolution of system architecture and the emergence of new business scenarios, the technical solutions provided by the embodiments of this application are equally applicable to similar technical problems.
[0062] Taking a distributed cluster as an example, Figure 1 is a schematic diagram of the structure of a distributed cluster provided in an embodiment of the present application. This distributed cluster can form part or all of a container system. Referring to Figure 1, the distributed cluster includes multiple worker nodes and a management node. The management node establishes a wireless or wired communication connection with the multiple worker nodes. Optionally, wireless or wired communication connections are also established between the multiple worker nodes.
[0063] The management node is used to receive the identifier of the first base image selected by the user from the container image selection interface, wherein the container image selection interface is used to instruct the user to select a base image for creating the first container from multiple base images. The management node is also used to send a container creation instruction to the first working node, and the container creation instruction carries the identifier of the first base image, and the container creation instruction is used to instruct the first working node to create a first container on the first working node using the first base image based on the identifier of the first base image. That is, the first working node is used to receive the container creation instruction of the management node, and to create a first container on the first working node using the first base image based on the identifier of the first base image. For details of the specific implementation method, please refer to the method embodiment of Figure 2 below. Among them, the first working node is one of the above-mentioned multiple working nodes.
[0064] Optionally, the management node and the multiple working nodes are independent devices, or the management node and the second working node belong to the same device, and the second working node is one of the multiple working nodes.
[0065] Optionally, the distributed cluster further includes a scheduler, which is used to instruct the management node to assign work to the multiple worker nodes, such as assigning nodes to create and run containers. The scheduler can be an independent device, such as a control node. Alternatively, the scheduler is a module deployed on the control node, which can be implemented by software, hardware, or a combination of software and hardware. Alternatively, the scheduler is a module deployed on the management node, which can be implemented by software, hardware, or a combination of software and hardware. Of course, the scheduler can also be deployed on any worker node.
[0066] Next, the method for providing container services provided by the embodiment of the present application is introduced.
[0067] FIG2 is a flowchart of a method for providing container services according to an embodiment of the present application. The method is applied to a container system, which may be the container system described above. Specifically, the container system provides multiple base images and common images corresponding to the multiple base images. The common images include common portions of multiple pre-installed images, and the multiple base images include non-common portions of the pre-installed images. Each base image corresponds to a pre-installed image. Referring to FIG2 , the method includes the following steps.
[0068] Step 201: providing a container image selection interface, wherein the container image selection interface is used to instruct a user to select a base image for creating a first container from a plurality of base images.
[0069] In embodiments of the present application, the container system may be a cloud system that provides container services. The container system may include a distributed cluster, where each worker node in the distributed cluster may be implemented by one or more servers. The container system may also include a single server, which may also be implemented by one or more servers.
[0070] The container system provides a container image selection interface for users to select the base image needed to create a container. A base image can be a container image in a container image repository, for example, a pre-installed container image in the repository. The container image repository also includes public images, which do not require users to select through the container image selection interface.
[0071] For example, a container image selection interface is presented on the user's local device. The container image selection interface may display the name or other identifier of each base image among multiple base images, and may also display relevant information about each base image, such as an introduction to the functions of the base image. The user may select at least one base image according to their needs. The selection method provided by the container image selection interface to the user may include a click method, a check box method, or other methods.
[0072] Of course, the container image selection interface may also display prompts for multiple base images, such as prompting the user to enter the name or other identifier of the base image required to create the first container. In other words, the container image selection interface may also support the user selecting a base image by entering the image name or other identifier.
[0073] It should be understood that the container image selection interface can support any one or more methods of selecting a base image, for example, supporting both clicking or checking, and supporting the user entering the image name, and the embodiments of the present application are not limited to this.
[0074] In some embodiments, the base image includes an operating system layer image and / or an engine layer image, and the public image includes a business layer image. That is, in these embodiments, the base image is created based on the operating system and / or engine, and the public image is created based on the service business. In other embodiments, the base image and public image can also be created based on other division requirements, which are not limited in the embodiments of this application.
[0075] The operating system layer images include various types and versions of operating system images. For example, as shown in FIG3 , the operating system layer images include unutu18.04 system images, debian10.2 system images, centos8.2 system images, or other system images.
[0076] Engine-layer images include engine images of various fields, types, and versions. For example, as shown in Figure 3, when container technology is applied to AI scenarios, engine-layer images include AI engine-layer images, such as the PyTorch engine image, the MindSpore engine image, the MXNet engine image, and other engine images.
[0077] Public images can include service-related images provided by container service developers or third parties. For example, public images include one or more of security hardening components, remote access components, website service components, cloud service software development kits (SDKs), encryption components, and decryption components.
[0078] Taking AI scenarios as an example, the contents of the AI engine layer and operating system layer in different container images are usually different. This is usually determined by factors such as different AI engine types and operating system types. The most important feature of these two layers is that they do not require frequent modification. In fact, once the container image is pulled to the working node, it will not change again, and can be used by users for a long time. The business layer usually integrates cloud vendor business-related components, such as remote access services (such as SSH), web services, security hardening components, cloud service SDKs, encryption and decryption components, etc. A more prominent feature of the business layer is that all container images in related technologies have this part of content, and cloud vendors need to frequently modify and release this part as the business evolves, such as the common fixes for cloud service security vulnerabilities. Based on this, the basic image in the AI scenario can include operating system layer images and AI engine layer images, and the public image includes service business-related images.
[0079] Step 202: Receive the identifier of the first base image selected by the user from the container image selection interface.
[0080] Taking this solution as an example, when applied to a distributed cluster, the management node in the distributed cluster receives the identifier of the first base image selected by the user from the container image selection interface. When applied to a single server, the server obtains the identifier of the first base image from the container image selection interface. The first base image is the base image used to create the first container.
[0081] Step 203: Based on the identifier of the first base image, a first container is created using the first base image, and the public image is mounted in the first container. The first container is used to provide services for the user.
[0082] Taking the application of this solution in a distributed cluster as an example, one implementation method for the management node to create a first container using the first base image based on the identifier of the first base image is: sending a container creation instruction to the first working node, the container creation instruction carrying the identifier of the first base image, the container creation instruction being used to instruct the first working node to create the first container on the first working node using the first base image based on the identifier of the first base image, where the first working node is one of multiple working nodes. That is, the first working node obtains the identifier of the first base image from the container creation instruction of the management node, and based on the identifier of the first base image, creates the first container on the first working node using the first base image.
[0083] Optionally, the first working node is a working node selected from multiple working nodes. For example, the management node selects the first working node from the multiple working nodes, or the distributed cluster further includes a control node, and the control node selects the first working node from the multiple working nodes. The management node or the control node can select the working node through a scheduler. The strategy for selecting the working node can be a load balancing strategy, a random selection strategy, a sequential selection strategy, or other strategies, which is not limited in the embodiments of the present application.
[0084] The multiple base images and public images are stored in a container image repository included in the distributed cluster. The container creation instruction is also used to instruct the first worker node to download the first base image from the container image repository based on the identifier of the first base image when the first worker node does not store the first base image. In other words, when the first worker node does not store the first base image, the first worker node needs to first download (also referred to as pull) the first base image from the container image repository based on the identifier of the first container image.
[0085] It should be understood that the container image repository can be implemented through a storage device in the container system. The storage device can be an independent storage device, that is, it exists independently, or it can be integrated on the management node or other nodes of the distributed cluster, or it can be integrated on the above-mentioned single server.
[0086] Exemplarily, the first basic image includes the unutu18.04 system image. Assuming that the first working node does not store the unutu18.04 system image, the first working node first downloads the unutu18.04 system image from the container image repository, and then uses the unutu18.04 system image to create a first container. The first container provides a unutu operating system environment.
[0087] After creating the first container, the first working node mounts the public image in the first container by synchronizing files contained in the public image to a directory of the first container.
[0088] As can be seen from the above, this solution does not require downloading public images, and the base image reduces the content of the public image compared to the preset image in the related technology, and the base image is relatively small, thus saving the storage space occupied by the container image on the working node.
[0089] For example, consider a container image repository containing 30 base images. Assuming each worker node contains these 30 base images and that these 30 base images share a common image, each worker node saves the equivalent storage space of 30 business-layer images compared to related technologies. If the number of worker nodes in a distributed cluster is large, the resulting storage space savings can be substantial.
[0090] In addition, since users usually have the need to customize and modify the operating system layer image and / or engine layer image, the separate management of the business layer image achieves the decoupling of the operating system layer and / or engine layer from the business layer image. The business layer image is managed, maintained, and updated by the container service developer. After creating a container using the user-defined image, the business layer image can be mounted on the container.
[0091] Furthermore, multiple base images typically don't require frequent updates and management; container service developers can manage and update public images on demand. This simplifies the management of multiple pre-built images in related technologies to a single public image in this solution, simplifying the image management process, significantly reducing management complexity and improving the efficiency of image update and release.
[0092] Optionally, the multiple base images mentioned above also include user-defined images. That is, the base images in the container system include both base images provided by the container service provider and user-defined images. Next, we will introduce user-defined images.
[0093] In an embodiment of the present application, the user has modification permissions for some or all of the above-mentioned multiple base images, that is, the user can download some or all of the base images to the user's local device for modification, and upload the modified base images to the container system.
[0094] The container system also provides a container image download interface that instructs the user to select a base image to download from the multiple base images. The specific implementation is similar to the method in which the user selects the first base image from the multiple base images, and will not be repeated here.
[0095] After the user selects the base image to be downloaded through the container image download interface, the container system receives the identifier of the second base image selected by the user from the container image download interface, and downloads the second base image to the user's local device based on the identifier of the second base image.
[0096] The container system also provides a container image creation interface for instructing the user to modify the second base image. The container system then receives a third base image uploaded by the user through the container image creation interface. The third base image is the base image obtained by modifying the second base image. In other words, the user can modify the second base image to obtain a third base image and then upload the third base image.
[0097] Optionally, after obtaining the third base image, the container system stores the third base image in a container image repository.
[0098] Taking the application of this method to a distributed cluster as an example, the management node in the distributed cluster receives the identifier of the second base image selected by the user from the container image download interface, and based on the identifier of the second base image, downloads the second base image to the user's local device. The management node receives the third base image uploaded by the user from the container image creation interface, and stores the third base image in the container image repository. Taking the application of this method to a single server as an example, the server receives the identifier of the second base image selected by the user from the container image download interface, and based on the identifier of the second base image, downloads the second base image to the user's local device. The server receives the third base image uploaded by the user from the container image creation interface, and stores the third base image in the container image repository.
[0099] The third base image is a new version image relative to the second base image. When the container system stores the third base image in the container image repository, it obtains the storage address of the third base image, that is, the address of the third base image in the container image repository. The address of the third base image in the container image repository is similar to the address of the second base image in the container image repository, for example, the address prefix is the same, and the image version number in the address suffix is different. The storage address of the base image is used to download the base image, such as for downloading the base image by a worker node or for downloading the base image by a user's local device.
[0100] Optionally, the container image creation interface can also support users creating images without referencing base images in a container image repository. For example, a user can create an operating system image through the container image creation interface. Specifically, user-defined images include those created by users customizing and updating one or more base images, or they can also include original images created by users.
[0101] Optionally, if the container system has created a second container for the user using the second base image, then after the user uploads the third base image, the container system is also triggered to update the second container using the third base image. In other words, the user's modification and upload of the second base image also triggers an automatic update of the second container.
[0102] In some other embodiments, the user does not have the permission to modify the above-mentioned multiple base images, that is, the container system does not support the user to modify the multiple base images provided by the container system to the user.
[0103] In this embodiment of the present application, users do not have modification permissions on public images, which are managed and updated by the container service developer. Of course, in other embodiments, users may also have modification permissions on public images. For example, users with designated identities may also be able to update public images. These users may include users who have collaborated with the container service provider or users who have been security-authenticated by the container service provider.
[0104] For example, if a container service developer manages and updates public images, the container system also provides a public image update interface that instructs the container service developer to update the public image and retrieves the updated public image from the interface. This means that the container service developer can manage and update public images.
[0105] Public image updates are typically intended to synchronize updates to containers created for each user, or to update the services provided by the public image in the container. Optionally, after the container system obtains the updated public image, it replaces the public image stored in the container image repository with the updated public image. Since public images are mounted in each user's container, updating the public image in the container image repository essentially also synchronizes updates to the container where the public image is mounted. This shows that this solution can quickly update and publish the content contained in the public image without having to modify the pre-installed images one by one.
[0106] The public image can be replaced by deleting the public image before the update and storing the public image after the update, and the public image before the update and the public image after the update have the same address. Alternatively, the public image can be replaced by storing the public image after the update and retaining the public image before the update, the address of the public image after the update and the address of the public image after the update can be different, and the address of the public image after the update can be used to mount the public image after the update.
[0107] In order not to waste the storage space of the working nodes, the container system can also delete the container images that meet the aging conditions on each working node. The container system can delete the container images that meet the aging conditions periodically, regularly, or under event triggering. Among them, event triggering includes the operation triggering of the container service developer or the operation triggering of the administrator or other event triggering. Multiple working nodes in the container system can delete container images according to the same or different periods, or delete container images according to the same or different scheduled times. The objects of event triggering can include one or more working nodes. For example, the administrator can trigger the deletion of container images on one or more working nodes through operation.
[0108] Taking the application of this method to a distributed cluster as an example, each working node automatically cleans up the container images that meet the aging conditions in its own stored container images. For example, the first working node deletes the container images that meet the aging conditions on the first working node. Of course, each working node can also delete the container images that meet the aging conditions under the instructions of the management node or control node or other devices, and the embodiments of the present application are not limited to this. Taking the application of this method to a single server as an example, the server can automatically clean up the container images that meet the aging conditions in its own stored container images.
[0109] The aging condition includes the container image version being lower than the reference version, and / or the container image being last used for a period exceeding the reference duration. Of course, the aging condition may also include other possible conditions, which are not limited in this embodiment of the application.
[0110] Next, please refer to the container system shown in Figure 4 to exemplify the embodiment of the present application.
[0111] As shown in Figure 4, the container system includes a distributed cluster, which includes a management node, multiple worker nodes, and a container image repository. The management node can also be called a master node. The management node is deployed with an image management component and a container creation component. Each worker node is deployed with an image cleanup component and an image execution component. The container image repository is used to store base images and public images.
[0112] The image management component manages base images and / or public images, such as controlling their upgrades and releases. Specifically, it controls the image execution component on each worker node. Alternatively, the image management component issues management commands for base images and / or public images, while the image execution component executes these commands.
[0113] For example, the image management component is responsible for issuing upgrade instructions for base and / or public images. The image execution component receives upgrade instructions and executes them. It also synchronizes relevant files from public images to directories on worker nodes.
[0114] The image cleanup component is used to age the container images on the working nodes, that is, to delete the container images on the working nodes that meet the aging conditions, such as deleting container images with older versions or those that have not been used for a long time.
[0115] The container creation component is used to create and delete containers. Specifically, it is used to mount the public image file in the directory of the working node where the container is located into the container while using the basic image to create the container, so as to provide corresponding services through the container.
[0116] In some embodiments, the image management component may be represented as image-manager, the container creation component may be represented as traffic-controller, the image cleanup component may be represented as image-cleanup-operator, and the image execution component may be represented as traffic-image-operator.
[0117] It should be understood that the above component names are not intended to limit the functions of the components, nor are the components themselves intended to be the only implementation of this solution. In specific implementations, this solution may also be implemented through other components or modules.
[0118] In summary, in the embodiments of the present application, the container system provides users with a base image and a public image. Users can create containers using the base image and mount the public image, eliminating the need to download the public image. This reduces the storage space occupied by the node where the container is located. Furthermore, since a separate public image exists, it is easier to manage and quickly update and upgrade the public image. Since the public image is mounted, the container created for the user can be quickly updated by quickly updating the public image. The fact that there is no need to download the public image and the mounting method also makes container creation more efficient.
[0119] Figure 5 is a structural diagram of a device for providing container services provided in an embodiment of the present application. The device can be implemented as part or all of a computing device by software, hardware, or a combination of both. The computing device can be any management node or server in the above method embodiment. In an embodiment of the present application, the device is included in a container system, and the container system provides multiple base images and public images corresponding to the multiple base images. The public image includes the public part of multiple preset images, and the multiple base images include the non-public part of the multiple preset images. Each base image corresponds to a preset image. Referring to Figure 5, the device includes: a providing module 501, a receiving module 502, and a creating module 503.
[0120] Providing module 501, for providing a container image selection interface, the container image selection interface is used to instruct a user to select a base image for creating a first container from the multiple base images;
[0121] A receiving module 502 is configured to receive an identifier of a first base image selected by a user from a container image selection interface;
[0122] The creation module 503 is configured to create a first container using the first base image based on the identifier of the first base image, and mount the public image in the first container. The first container user provides services for the user.
[0123] Optionally, the method is applied to a management node in a distributed cluster, the distributed cluster also including a plurality of working nodes;
[0124] The creation module 503 includes:
[0125] A sending unit is used to send a container creation instruction to a first working node, where the container creation instruction carries an identifier of a first base image. The container creation instruction is used to instruct the first working node to create a first container on the first working node using the first base image based on the identifier of the first base image. The first working node is one of the multiple working nodes.
[0126] Optionally, the multiple base images and the common images are stored in a container image repository included in the distributed cluster;
[0127] The container creation instruction is also used to instruct the first working node to download the first base image from the container image repository based on the identifier of the first base image when the first working node does not store the first base image.
[0128] Optionally, the multiple base images mentioned above also include user-defined images.
[0129] Optionally, the user has modification permission on some or all of the above multiple base images.
[0130] Optionally, module 501 is provided, further configured to provide a container image download interface, the container image download interface being configured to instruct a user to select a base image to be downloaded from a plurality of base images;
[0131] The receiving module 502 is further configured to receive an identifier of a second base image selected by a user from the container image download interface;
[0132] The device also includes:
[0133] A download module, configured to download the second base image to a local device of a user based on the identifier of the second base image;
[0134] Providing module 501, further used to provide a container image creation interface, the container image creation interface is used to instruct the user to modify the second base image;
[0135] The receiving module 502 is further configured to receive a third base image uploaded by a user from the container image creation interface. The third base image is a base image obtained by modifying the second base image by the user.
[0136] Optionally, the user does not have modification permission on the above public image.
[0137] Optionally, module 501 is provided, further configured to provide a public image update interface, the public image update interface being used to instruct the container service developer to update the public image;
[0138] The receiving module 502 is further configured to obtain the updated public image from the public image update interface.
[0139] Optionally, the public image is stored in a container image repository, and the apparatus further includes:
[0140] The replacement module is used to replace the public image stored in the container image repository with an updated public image.
[0141] Optionally, the basic image includes an operating system layer image and / or an engine layer image, and the public image includes a business layer image.
[0142] Optionally, the engine layer image includes an AI engine layer image.
[0143] Optionally, the public image includes one or more of a security reinforcement component, a remote access component, a website service component, a cloud service SDK, an encryption component, and a decryption component.
[0144] In an embodiment of the present application, the container system provides users with a base image and a public image. Users can create a container using the base image and mount the public image. There is no need to download the public image, which reduces the storage space occupied by the node where the container is located. In addition, since there is a separate public image, it is easy to manage and quickly update and upgrade the public image. Since the public image is mounted, the container created for the user can be quickly updated by quickly updating the public image. Without downloading the public image and using the mounting method, container creation is also more efficient.
[0145] It should be noted that the above-described embodiments of the apparatus for providing container services illustrate the division of the aforementioned functional modules when creating a container. In actual applications, the aforementioned functions can be assigned to different functional modules as needed, i.e., the internal structure of the apparatus can be divided into different functional modules to perform all or part of the functions described above. Furthermore, the apparatus for providing container services and the method for providing container services in the above-described embodiments share the same concept. The specific implementation process is detailed in the method embodiments and will not be further elaborated here.
[0146] Figure 6 is a schematic diagram of the structure of another device for providing container services provided by an embodiment of the present application. The device can be implemented as part or all of a computing device by software, hardware, or a combination of both. The computing device can be the first working node or server in the above method embodiment. In an embodiment of the present application, the container system provides multiple base images and public images corresponding to the multiple base images. The public images include the public parts of multiple preset images. The multiple base images include the non-public parts of the multiple preset images. Each base image corresponds to a preset image. The container system includes a distributed cluster, and the device is included in the first working node in the distributed cluster. Referring to Figure 6, the device includes: a receiving module 601 and a creation module 602.
[0147] A receiving module 601 is configured to receive a container creation instruction, where the container creation instruction carries an identifier of a first base image, where the first base image is one of multiple base images.
[0148] The creation module 602 is configured to create a first container using the first base image based on the identifier of the first base image, and mount a public image in the first container, where the public image is a container image shared by the multiple base images.
[0149] Optionally, the user has modification permission for some or all of the multiple base images, and / or the user does not have modification permission for the public image.
[0150] Optionally, the device further comprises:
[0151] The image cleaning module is used to delete the container images that meet the aging conditions on the first working node.
[0152] Optionally, the aging condition includes that the version of the container image is lower than the reference version, and / or that the time between the last use of the container image and the current time exceeds a reference duration.
[0153] Optionally, the basic image includes an operating system layer image and / or an engine layer image, and the public image includes a business layer image.
[0154] Optionally, the engine layer image includes an AI engine layer image.
[0155] In an embodiment of the present application, the container system provides users with a base image and a public image. Users can create a container using the base image and mount the public image. There is no need to download the public image, which reduces the storage space occupied by the node where the container is located. In addition, since there is a separate public image, it is easy to manage and quickly update and upgrade the public image. Since the public image is mounted, the container created for the user can be quickly updated by quickly updating the public image. Without downloading the public image and using the mounting method, container creation is also more efficient.
[0156] It should be noted that the above-described embodiments of the apparatus for providing container services illustrate the division of the aforementioned functional modules when creating a container. In actual applications, the aforementioned functions can be assigned to different functional modules as needed, i.e., the internal structure of the apparatus can be divided into different functional modules to perform all or part of the functions described above. Furthermore, the apparatus for providing container services and the method for providing container services in the above-described embodiments share the same concept. The specific implementation process is detailed in the method embodiments and will not be further elaborated here.
[0157] The providing module 501, receiving module 502, creating module 503, receiving module 601, and creating module 602 described above can all be implemented via software, hardware, or a combination of software and hardware. For example, the implementation of creating module 503 will be described below using creating module 503 as an example. Similarly, the implementation of other modules can refer to the implementation of creating module 503.
[0158] As an example of a software functional unit, the creation module 503 may include code running on a computing instance. The computing instance may include at least one of a physical host (computing device), a virtual machine, and a container. Furthermore, the computing instance may be one or more. For example, the creation module 503 may include code running on multiple hosts / virtual machines / containers. It should be noted that the multiple hosts / virtual machines / containers used to run the code may be distributed in the same region or in different regions. Furthermore, the multiple hosts / virtual machines / containers used to run the code may be distributed in the same availability zone (AZ) or in different AZs, each AZ including one data center or multiple geographically close data centers. Typically, a region may include multiple AZs.
[0159] Similarly, multiple hosts / virtual machines / containers running the code can be distributed within the same virtual private cloud (VPC) or across multiple VPCs. Typically, a VPC is set up within a region. Cross-region communication between two VPCs within the same region, or between VPCs in different regions, requires a communication gateway within each VPC to interconnect the VPCs.
[0160] As an example of a hardware functional unit, the creation module 503 may include at least one computing device, such as a server. Alternatively, the module A may be implemented using an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). The PLD may be a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.
[0161] The multiple computing devices included in the creation module 503 can be distributed in the same region or in different regions. The multiple computing devices included in the creation module 503 can be distributed in the same AZ or in different AZs. Similarly, the multiple computing devices included in the A module can be distributed in the same VPC or in multiple VPCs. The multiple computing devices can be any combination of servers, ASICs, PLDs, CPLDs, FPGAs, GALs, and other computing devices.
[0162] It should be noted that, in other embodiments, the creation module 503 can be used to execute any step in the method for providing container services, and other modules such as the creation module 602 can also be used to execute any step in the method for providing container services. The steps that the providing module 501, the receiving module 502, the creation module 503, the receiving module 601, and the creation module 602 are responsible for implementing can be specified as needed. The full functions of the device for providing container services are achieved by respectively implementing different steps in the method for providing container services through the providing module 501, the receiving module 502, and the creation module 503, or the receiving module 601 and the creation module 602.
[0163] An embodiment of the present application further provides a container system, which includes a management node and a working node.
[0164] The management node is used to implement the corresponding functions of the management node in the above method embodiment. The working node is used to implement the corresponding functions of the working node in the above method embodiment.
[0165] Both the management node and the working node can be implemented by software or hardware. For example, the implementation of the working node is described below. Similarly, the implementation of the management node can refer to the implementation of the working node.
[0166] As an example of a software functional unit, a module may include a working node that runs on a computing instance. The computing instance may be at least one of a physical host (computing device), a virtual machine, a container, and other computing devices. Furthermore, the computing device may be one or more. For example, a working node may include code running on multiple hosts / virtual machines / containers. It should be noted that the multiple hosts / virtual machines / containers used to run the application may be distributed in the same region or in different regions. The multiple hosts / virtual machines / containers used to run the code may be distributed in the same AZ or in different AZs, and each AZ includes one data center or multiple geographically close data centers. Typically, a region may include multiple AZs.
[0167] Similarly, the multiple hosts / virtual machines / containers running the code can be distributed within the same VPC or across multiple VPCs. Typically, a VPC is located within a region. Cross-region communication between two VPCs within the same region, or between VPCs in different regions, requires a communication gateway within each VPC to interconnect the VPCs.
[0168] A module is an example of a hardware functional unit. A working node may include at least one computing device, such as a server. Alternatively, a working node may be implemented using an ASIC or a PLD. The PLD may be implemented using a CPLD, FPGA, GAL, or any combination thereof.
[0169] The multiple computing devices included in a worker node can be distributed in the same region or in different regions. They can be distributed in the same AZ or in different AZs. Similarly, they can be distributed in the same VPC or across multiple VPCs. These multiple computing devices can be any combination of servers, ASICs, PLDs, CPLDs, FPGAs, GALs, and other computing devices.
[0170] The present application also provides a computing device 100. As shown in FIG7 , computing device 100 includes a bus 102, a processor 104, a memory 106, and a communication interface 108. Processor 104, memory 106, and communication interface 108 communicate with each other via bus 102. Computing device 100 may be a server or a terminal device. It should be understood that this application does not limit the number of processors and memories in computing device 100.
[0171] Bus 102 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, among others. Buses may be classified as address buses, data buses, control buses, and the like. For ease of illustration, FIG7 illustrates a single bus line, but this does not imply a single bus or type of bus. Bus 102 may include a path for transmitting information between various components of computing device 100 (e.g., memory 106, processor 104, and communication interface 108).
[0172] The processor 104 may include any one or more processors such as a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).
[0173] The memory 106 may include volatile memory, such as random access memory (RAM). The processor 104 may also include non-volatile memory, such as read-only memory (ROM), flash memory, hard disk drive (HDD), or solid state drive (SSD).
[0174] Memory 106 stores executable program code. Processor 104 executes the executable program code to implement the functions of the aforementioned providing module 501, receiving module 502, and creating module 503, or the receiving module 601 and creating module 602, thereby implementing the method for providing container services. In other words, memory 106 stores instructions for executing the method for providing container services.
[0175] Alternatively, the memory 106 stores executable code, and the processor 104 executes the executable code to implement the functions of the aforementioned management node, worker node, or server, respectively, thereby implementing the method for providing container services. In other words, the memory 106 stores instructions for executing the method for providing container services.
[0176] The communication interface 108 uses a transceiver module such as, but not limited to, a network interface card or a transceiver to implement communication between the computing device 100 and other devices or a communication network.
[0177] Embodiments of the present application also provide a computing device cluster. The computing device cluster includes at least one computing device. The computing device can be a server, such as a central server, an edge server, or a local server in a local data center. In some embodiments, the computing device can also be a terminal device such as a desktop computer, a laptop computer, or a smartphone.
[0178] As shown in Figure 8, the computing device cluster includes at least one computing device 100. The memory 106 in one or more computing devices 100 in the computing device cluster may store the same instructions for executing the method for providing container services.
[0179] In some possible implementations, the memory 106 of one or more computing devices 100 in the computing device cluster may also store partial instructions for executing the method for providing container services. In other words, the combination of one or more computing devices 100 can jointly execute the instructions for executing the method for providing container services.
[0180] It should be noted that the memory 106 in different computing devices 100 in the computing device cluster can store different instructions, each for executing part of the functions of a management node, a worker node, or a server. In other words, the instructions stored in the memory 106 in different computing devices 100 can implement the functions of one or more of the providing module 501, the receiving module 502, and the creating module 503, or the receiving module 601 and the creating module 602.
[0181] In some possible implementations, one or more computing devices in a computing device cluster may be connected via a network. The network may be a wide area network (WAN) or a local area network (LAN), etc. FIG. 9 shows a possible implementation. As shown in FIG. 9 , two computing devices 100A and 100B are connected via a network. Specifically, the network is connected via a communication interface in each computing device. In this type of possible implementation, the memory 106 in the computing device 100A stores instructions for executing the functions of the providing module 501. At the same time, the memory 106 in the computing device 100B stores instructions for executing the functions of the receiving module 502 and the creating module 503. Alternatively, the memory 106 in the computing device 100A stores instructions for executing the functions of the receiving module 601. At the same time, the memory 106 in the computing device 100B stores instructions for executing the functions of the creating module 602.
[0182] The connection method between the computing device clusters shown in FIG9 may be based on the fact that the method for providing container services provided by the embodiments of the present application requires a large amount of data storage and computing, and therefore, it is considered to delegate the functions implemented by the receiving module 502 and the creating module 503 to the computing device 100B, or delegate the functions of the creating module 602 to the computing device 100B.
[0183] It should be understood that the functions of the computing device 100A shown in FIG9 may also be completed by multiple computing devices 100. Similarly, the functions of the computing device 100B may also be completed by multiple computing devices 100.
[0184] The present application also provides another computing device cluster. The connection relationship between the computing devices in this computing device cluster can be similar to the connection methods of the computing device clusters shown in Figures 8 and 9. However, the memory 106 in one or more computing devices 100 in this computing device cluster can store the same instructions for executing the method for providing container services.
[0185] In some possible implementations, the memory 106 of one or more computing devices 100 in the computing device cluster may also store partial instructions for executing the method for providing container services. In other words, the combination of one or more computing devices 100 can jointly execute the instructions for executing the method for providing container services.
[0186] It should be noted that the memory 106 in different computing devices 100 in the computing device cluster can store different instructions for executing partial functions of the container system. In other words, the instructions stored in the memory 106 in different computing devices 100 can implement the functions of one or more devices such as the management node and the worker node.
[0187] Embodiments of the present application also provide a computer program product containing instructions. The computer program product may be software or a program product containing instructions that can be run on a computing device or stored on any available medium. When the computer program product is run on at least one computing device, it causes the at least one computing device to execute a method for providing a container service.
[0188] Embodiments of the present application also provide a computer-readable storage medium. The computer-readable storage medium can be any available medium that can be stored by a computing device, or a data storage device such as a data center that contains one or more available media. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a magnetic tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive). The computer-readable storage medium includes instructions that instruct the computing device to execute a method for providing a container service.
[0189] In the above embodiments, all or part of the embodiments can be implemented by software, hardware, firmware, or any combination thereof. When implemented using software, all or part of the embodiments can be implemented in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium can be any available medium that can be accessed by a computer, or a data storage device such as a server or data center that includes one or more available media integrated therein. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, or a magnetic tape), an optical medium (e.g., a digital versatile disc (DVD)), or a semiconductor medium (e.g., a solid state disk (SSD)). It is worth noting that the computer-readable storage medium mentioned in the embodiments of the present application may be a non-volatile storage medium, in other words, a non-transient storage medium.
[0190] It should be understood that the "at least one" mentioned herein refers to one or more, and "a plurality of" refers to two or more. In the description of the embodiments of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" in this article is merely a description of the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in order to facilitate a clear description of the technical solutions of the embodiments of the present application, in the embodiments of the present application, words such as "first" and "second" are used to distinguish between identical or similar items with substantially the same functions and effects. Those skilled in the art will understand that words such as "first" and "second" do not limit the quantity and execution order, and words such as "first" and "second" do not necessarily limit them to be different.
[0191] It should be noted that the information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, stored data, displayed data, etc.) and signals involved in the embodiments of this application are all authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data need to comply with the relevant laws, regulations and standards of relevant countries and regions.
[0192] The above description is an embodiment provided for this application and is not intended to limit this application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of this application should be included in the scope of protection of this application.
Claims
1. A method for providing container services, characterized in that: Applied to a container system, the container system provides a plurality of base images and public images corresponding to the plurality of base images, the public image includes a public part of a plurality of preset images, the plurality of base images include a non-public part of the plurality of preset images, and each base image corresponds to a preset image; the method comprises: Providing a container image selection interface, wherein the container image selection interface is used to instruct a user to select a base image for creating a first container from the multiple base images; Receiving an identifier of a first base image selected by the user from the container image selection interface; Based on the identifier of the first base image, the first base image is used to create the first container, and the public image is mounted in the first container, where the first container is used to provide services for the user.
2. The method according to claim 1, characterized in that The container system includes a distributed cluster, the method is applied to a management node in the distributed cluster, and the distributed cluster also includes a plurality of working nodes; The step of creating the first container using the first base image based on the identifier of the first base image includes: A container creation instruction is sent to a first working node, where the container creation instruction carries an identifier of the first base image, and is used to instruct the first working node to create the first container on the first working node using the first base image based on the identifier of the first base image, where the first working node is one of the multiple working nodes.
3. The method according to claim 2, characterized in that The multiple base images and the common image are stored in a container image repository included in the distributed cluster; The container creation instruction is also used to instruct the first working node to download the first base image from the container image repository based on an identifier of the first base image when the first working node does not store the first base image.
4. The method according to any one of claims 1 to 3, characterized in that: The multiple base images also include user-defined images.
5. The method according to any one of claims 1 to 4, characterized in that: The user has modification authority for some or all of the multiple base images.
6. The method according to claim 5, characterized in that The method further comprises: Providing a container image download interface, wherein the container image download interface is used to instruct the user to select a base image to be downloaded from the multiple base images; Receiving an identifier of a second base image selected by the user from the container image download interface; Based on the identifier of the second base image, downloading the second base image to the local device of the user; Providing a container image production interface, wherein the container image production interface is used to instruct the user to modify the second base image; A third base image uploaded by the user from the container image creation interface is received, where the third base image is a base image obtained by the user modifying the second base image.
7. The method according to any one of claims 1 to 6, characterized in that: The user does not have modification authority for the public image.
8. The method according to any one of claims 1 to 7, characterized in that: The method further comprises: Providing a public image update interface, wherein the public image update interface is used to instruct the container service developer to update the public image; The updated public image is obtained from the public image update interface.
9. The method according to claim 8, characterized in that The public image is stored in a container image repository, and the method further includes: The public image stored in the container image repository is replaced with the updated public image.
10. The method according to any one of claims 1 to 9, characterized in that: The basic image includes an operating system layer image and / or an engine layer image, and the public image includes a business layer image.
11. The method according to any one of claims 1 to 10, characterized in that: The engine layer image includes an artificial intelligence AI engine layer image.
12. The method according to any one of claims 1 to 11, characterized in that: The public image includes one or more of a security reinforcement component, a remote access component, a website service component, a cloud service software development kit SDK, an encryption component, and a decryption component.
13. A method for providing container services, characterized in that: The container system provides multiple base images and public images corresponding to the multiple base images, the public images include public parts of multiple preset images, the multiple base images include non-public parts of the multiple preset images, each base image corresponds to a preset image, the container system includes a distributed cluster, and the method is applied to a first working node in the distributed cluster; the method includes: Receive a container creation instruction, where the container creation instruction carries an identifier of a first base image, where the first base image is one of the multiple base images; Based on the identifier of the first base image, a first container is created using the first base image, and the public image is mounted in the first container, where the first container is used to provide services for users.
14. The method according to claim 13, characterized in that The user has modification authority for some or all of the multiple base images, and / or the user does not have modification authority for the public image.
15. The method according to claim 13 or 14, characterized in that The method further comprises: The container images that meet the aging condition on the first working node are deleted.
16. The method according to claim 15, characterized in that The aging condition includes that the version of the container image is lower than the reference version, and / or the time when the container image was last used exceeds the reference time from the current time.
17. The method according to any one of claims 13 to 16, characterized in that: The basic image includes an operating system layer image and / or an engine layer image, and the public image includes a business layer image.
18. The method according to claim 17, characterized in that The engine layer image includes an artificial intelligence AI engine layer image.
19. A device for providing container services, characterized in that: The device is included in a container system, the container system provides a plurality of base images and public images corresponding to the plurality of base images, the public images include a public part of a plurality of preset images, and the plurality of base images include a non-public part of the plurality of preset images; the device includes: A module is provided, configured to provide a container image selection interface, wherein the container image selection interface is configured to instruct a user to select a base image for creating a first container from the plurality of base images; A receiving module, configured to receive an identifier of a first base image selected by the user from the container image selection interface; A creation module is used to create the first container using the first base image based on the identifier of the first base image, and mount the public image in the first container, wherein the first container is used to provide services for the user.
20. A device for providing container services, characterized in that: The container system provides a plurality of base images and public images corresponding to the plurality of base images, wherein the public image includes a public part of a plurality of preset images, and the plurality of base images include a non-public part of the plurality of preset images. The container system includes a distributed cluster, and the device is included in a first working node in the distributed cluster; the device includes: A receiving module, configured to receive a container creation instruction, wherein the container creation instruction carries an identifier of a first base image, and the first base image is one of the multiple base images; A creation module is used to create a first container using the first base image based on the identifier of the first base image, and to The image is mounted in the first container, and the first container is used to provide services for users.
21. A container system, characterized in that: The container system is used to implement the method according to any one of claims 1 to 18.
22. A computing device, characterized in that The computing device includes a processor and a memory; The processor is configured to execute instructions stored in the memory so that the computing device performs the steps of the method according to any one of claims 1 to 18.
23. A computing device cluster, characterized in that: comprising at least one computing device, each computing device comprising a processor and a memory; The processor of the at least one computing device is used to execute instructions stored in the memory of the at least one computing device, so that the computing device cluster performs the steps of the method according to any one of claims 1-18.
24. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 18 is implemented.
25. A computer program product, characterized in that The computer program product stores computer instructions, and when the computer instructions are executed by a processor, the steps of the method according to any one of claims 1 to 18 are implemented.
Citation Information
Patent Citations
Method for providing container service, container system and related device
CN119557042A
A container management method and device in a Docker system
CN108984268A
Master node, slave node, system and method for mirror image management of distributed container cluster
CN110647580A
XWIKI system configuration method and system and computer equipment
CN110673923A
Container mirror image providing method, container mirror image loading method, related equipment and related system
CN111324421A
Cited By
Container security creation method in large model scene, medium, equipment and product
CN120315812A