Container creation method and device, and computer-readable storage medium

By deploying CPU architecture simulator on Kubernetes Worker nodes, the problem of not being able to create different CPU architecture containers on a single node in the prior art is solved, and flexible container creation and reduce development and testing costs are realized.

CN115145692BActive Publication Date: 2025-02-14CHINA TELECOM CORP LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210821259.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-13
Publication Date
2025-02-14
Estimated Expiration
2042-07-13

AI Technical Summary

Technical Problem

The existing technology cannot create containers different from physical CPU architecture in Kubernetes on a single Worker node, resulting in the need to prepare multiple CPU hardware resources during development and testing, resulting in cost pressure and resource waste.

Method used

By deploying the CPU architecture simulator on the worker node, the binding relationship between the Kubernetes Worker node agent and the container CPU architecture is decoupled, allowing the worker node to report the type of CPU architecture they support. The master node is based on the mirror CPU architecture type specified by the user. Select the appropriate worker node to create the container.

Benefits of technology

It implements the creation of containers of multiple different CPU architecture types on a single Worker node, reducing the cost of application development testing and improving the flexibility of container creation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115145692B_ABST
    Figure CN115145692B_ABST
Patent Text Reader

Abstract

The present disclosure relates to a container creation method and device, a computer storable medium, and the field of cloud computing technology. The container creation method includes: receiving container creation information generated by a master node, wherein the container creation information includes information of a user-specified image; determining a user-specified CPU architecture type based on the information of the user-specified image; selecting a simulator corresponding to the user-specified CPU architecture type from the CPU architecture simulators of the working node; and creating a container using the simulator corresponding to the user-specified CPU architecture type. According to the present disclosure, the flexibility of container creation is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical field of cloud computing, and in particular to a container creation method and device, and a computer-readable storage medium. Background Art

[0002] In cloud service technology, containers are lightweight technologies that can create more container instances based on the same amount of resources compared to physical machines and virtual machines. Containers need to be managed and connected to the external environment in an orderly manner to achieve tasks such as scheduling, load balancing, and distribution. Kubernetes is an industrial-grade container orchestration platform launched by Google that allows automated deployment, management, and expansion of containerized applications. It has now become the de facto standard for container orchestration.

[0003] With the continuous development of CPU architectures such as ARM and open source RISC-V, as well as the research and development of domestic CPUs, more and more applications need to adapt to CPUs of multiple architectures at the same time. If the application is required to support multiple CPU architectures, it should be tested on multiple CPU architectures when developing the application. Therefore, server resources with different CPU architectures need to be prepared. As applications are gradually containerized, containers can be created on Kubernetes nodes to implement application development and testing. Summary of the invention

[0004] According to a first aspect of the present disclosure, a container creation method is provided, which is executed by a working node, including: receiving container creation information generated by a master node, wherein the container creation information includes information of an image specified by a user; determining a CPU architecture type specified by the user based on the information of the image specified by the user; selecting a simulator corresponding to the CPU architecture type specified by the user from the CPU architecture simulators possessed by the working node; and creating a container using the simulator corresponding to the CPU architecture type specified by the user.

[0005] In some embodiments, the container creation method further includes: sending the type of the CPU architecture simulator of the working node to the master node.

[0006] In some embodiments, the container creation method further includes: determining the type of the CPU architecture simulator of the working node according to the file of the CPU architecture simulator in the file directory of the working node.

[0007] In some embodiments, determining the CPU architecture type specified by the user according to the information of the image specified by the user includes:

[0008] According to the information of the image specified by the user, obtain the metadata of the image specified by the user;

[0009] Determine the CPU architecture type specified by the user based on the metadata of the image specified by the user.

[0010] In some embodiments, creating a container using a simulator corresponding to a CPU architecture type specified by a user includes:

[0011] Map the binary file of the simulator in the file directory of the working node to the file directory of the container.

[0012] In some embodiments, creating a container using a simulator corresponding to a CPU architecture type specified by a user includes:

[0013] Generate a parameter list for starting the container according to the container creation information and the simulator corresponding to the CPU architecture type specified by the user, wherein the parameter list for starting the container includes the name of the simulator corresponding to the CPU architecture type specified by the user;

[0014] Create a container based on the parameter list of container startup.

[0015] In some embodiments, the information of the image specified by the user includes an address of the image specified by the user.

[0016] According to a second aspect of the present disclosure, a container creation method is provided, which is executed by a master node and includes:

[0017] Receive a container creation request from a user, wherein the container creation request includes information of an image specified by the user;

[0018] Determine the CPU architecture type specified by the user based on the information of the image specified by the user;

[0019] Receive the types of CPU architecture simulators that the plurality of worker nodes have;

[0020] Selecting a target working node from the plurality of working nodes according to a CPU architecture type specified by a user and types of CPU architecture simulators possessed by the plurality of working nodes;

[0021] Generate container creation information according to the user's container creation request, wherein the container creation information instructs the target working node to create a container.

[0022] In some embodiments, selecting a target working node from a plurality of working nodes according to a CPU architecture type specified by a user and types of CPU architecture simulators possessed by the plurality of working nodes comprises:

[0023] A target worker node is selected from worker nodes having a CPU architecture simulator corresponding to the CPU architecture type specified by the user.

[0024] In some embodiments, selecting a target working node from working nodes having a CPU architecture simulator corresponding to a CPU architecture type specified by a user comprises:

[0025] Select the target working node based on the preset filtering conditions.

[0026] In some embodiments, the preset filtering condition includes at least one of the CPU model, memory size and remaining resources of the working node.

[0027] According to a third aspect of the present disclosure, a container creation device is provided, which is deployed on a working node and includes:

[0028] A receiving module is configured to receive container creation information generated by the master node, wherein the container creation information includes information of the image specified by the user;

[0029] A determination module is configured to determine a CPU architecture type specified by a user based on information of an image specified by a user;

[0030] A selection module is configured to select a simulator corresponding to a CPU architecture type specified by a user from the CPU architecture simulators possessed by the working node;

[0031] The creation module is configured to create a container using a simulator corresponding to a CPU architecture type specified by a user.

[0032] According to a fourth aspect of the present disclosure, a container creation device is provided, which is deployed on a master node and includes:

[0033] A first receiving module is configured to receive a container creation request from a user, wherein the container creation request includes information of an image specified by the user;

[0034] A determination module is configured to determine a CPU architecture type specified by a user based on information of an image specified by a user;

[0035] A second receiving module is configured to receive types of CPU architecture simulators possessed by a plurality of working nodes;

[0036] A selection module is configured to select a target working node from the plurality of working nodes according to a CPU architecture type specified by a user and types of CPU architecture simulators possessed by the plurality of working nodes;

[0037] The generation module is configured to generate container creation information according to a container creation request of a user, wherein the container creation information indicates that a target working node creates a container.

[0038] According to a fifth aspect of the present disclosure, a cluster system is provided, comprising a working node and a master node according to any embodiment of the present disclosure.

[0039] According to a sixth aspect of the present disclosure, a container creation device is provided, including:

[0040] Memory; and

[0041] A processor coupled to the memory, wherein the processor is configured to execute the container creation method according to any one of the embodiments based on instructions stored in the memory.

[0042] According to a seventh aspect of the present disclosure, a computer storable medium is provided, on which computer program instructions are stored. When the instructions are executed by a processor, the container creation method according to any embodiment of the present disclosure is implemented. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] The accompanying drawings, which constitute a part of the specification, illustrate embodiments of the present disclosure and, together with the description, serve to explain the principles of the present disclosure.

[0044] The present disclosure may be more clearly understood from the following detailed description with reference to the accompanying drawings, in which:

[0045] Figure 1 A flowchart of a container creation method according to some embodiments of the present disclosure is shown;

[0046] Figure 2 A flowchart of a container creation method according to some other embodiments of the present disclosure is shown;

[0047] Figure 3 A schematic diagram showing a container creation method according to some other embodiments of the present disclosure is shown;

[0048] Figure 4 A block diagram showing a container creation device according to some embodiments of the present disclosure

[0049] Figure 5 A block diagram showing a container creation device according to some other embodiments of the present disclosure;

[0050] Figure 6 A block diagram of a cluster system according to some embodiments of the present disclosure is shown;

[0051] Figure 7 A block diagram of a container creation device according to some other embodiments of the present disclosure is shown;

[0052] Figure 8 A block diagram of a computer system for implementing some embodiments of the present disclosure is shown. DETAILED DESCRIPTION

[0053] Various exemplary embodiments of the present disclosure will now be described in detail with reference to the accompanying drawings. It should be noted that the relative arrangement of components and steps, numerical expressions and numerical values ​​set forth in these embodiments do not limit the scope of the present disclosure unless otherwise specifically stated.

[0054] At the same time, it should be understood that for the convenience of description, the sizes of the various parts shown in the drawings are not drawn according to the actual proportional relationship.

[0055] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the present disclosure, its application, or uses.

[0056] Technologies, methods, and equipment known to ordinary technicians in the relevant art may not be discussed in detail, but where appropriate, the technologies, methods, and equipment should be considered as part of the specification.

[0057] In all examples shown and discussed herein, any specific values ​​should be interpreted as merely exemplary and not as limiting. Therefore, other examples of the exemplary embodiments may have different values.

[0058] It should be noted that like reference numerals and letters refer to similar items in the following figures, and therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.

[0059] In related technologies, Kubernetes can only create containers with the same CPU architecture on a Worker node, and the CPU architecture of the container must be consistent with the physical CPU architecture of the Worker node. If the application is required to be adaptable to multiple CPU architectures, multiple CPU hardware resources need to be prepared during the development and testing of the application, which causes huge cost pressure and resource waste.

[0060] The present disclosure proposes a container creation method and device, and a computer-readable storage medium, which realize the creation of a container that is different from the physical architecture of a Worker node on a single Worker node of Kubernetes.

[0061] Figure 1 A flowchart of a container creation method according to some embodiments of the present disclosure is shown.

[0062] like Figure 1 As shown, the container creation method includes steps S110-S140, which are executed by the working node.

[0063] In step S110, container creation information generated by the master node is received, wherein the container creation information includes information of the image specified by the user.

[0064] For example, the database corresponding to the container creation information is monitored, and when the creation information in the monitoring database is added or changed, the new container creation information and the information that the master node instructs the current working node to create the container are obtained.

[0065] In some embodiments, the information of the image specified by the user includes an address of the image specified by the user.

[0066] In some embodiments, the container creation method further includes sending the type of the CPU architecture simulator of the working node to the master node.

[0067] For example, multiple types of CPU architecture simulators are deployed on the working node. On the basis of reporting the physical CPU architecture type of the working node, the working node also adds the reporting of the type of the CPU architecture simulator of the node.

[0068] Each worker node uses the CPU architecture simulator provided by Qemu (Quick Emulator) to start a container with a different CPU architecture from the worker node. Each CPU architecture corresponds to a simulator. In order to let the scheduler of the master node know the CPU architecture type supported by the worker node, each worker node reports the CPU architecture type supported by the node (that is, the type of CPU architecture simulator that the worker node has) to the master node.

[0069] The master node determines which worker node is used as the target node to create a container based on the type of CPU architecture simulator of each worker node and the image information specified by the user.

[0070] In some embodiments, the container creation method further includes determining the type of CPU architecture simulator of the working node based on the file of the CPU architecture simulator in the file directory of the working node.

[0071] For example, the simulator of the CPU architecture is saved as a binary file in the standard directory of the working node. The working node confirms which CPU architecture simulators are included in the node by querying the file directory (for example, / usr / bin / ).

[0072] The present disclosure decouples the binding relationship between the Kubernetes Worker node agent and the container CPU architecture by deploying a CPU architecture simulator on the worker node. The worker node reports the CPU architecture simulator type of the node, rather than just the physical CPU architecture type of the node, which can provide more options for the scheduling of the master node.

[0073] In step S120, the CPU architecture type specified by the user is determined according to the information of the image specified by the user.

[0074] For example, the worker node agent parses the type of CPU architecture corresponding to the container image specified by the user.

[0075] In some embodiments, determining the user-specified CPU architecture type according to the information of the user-specified image includes: obtaining metadata of the user-specified image according to the information of the user-specified image; and determining the user-specified CPU architecture type according to the metadata of the user-specified image.

[0076] For example, the working node downloads the metadata of the image specified by the user from the image repository according to the address of the image specified by the user, and then uses the docker inspect command to view the metadata of the image specified by the user, thereby determining the CPU architecture type specified by the user and determining which simulator of this node should be used to simulate the CPU architecture corresponding to the image.

[0077] In step S130 , a simulator corresponding to the CPU architecture type specified by the user is selected from the CPU architecture simulators possessed by the working node.

[0078] For example, if the CPU architecture type specified by the user is x86, the x86 architecture simulator is selected to create the container.

[0079] By parsing the CPU architecture requirements of the container image selected by the user, the corresponding CPU architecture simulator is selected as needed, and then a container of the corresponding CPU architecture can be created using the CPU architecture simulator.

[0080] In step S140 , a container is created using a simulator corresponding to the CPU architecture type specified by the user.

[0081] In some embodiments, creating a container using a simulator corresponding to a CPU architecture type specified by a user includes mapping a binary file of the simulator under a file directory of a working node to a file directory of the container.

[0082] For example, if the container type to be created is different from the physical CPU architecture type of the Worker node, an emulator is required. When starting the container, the corresponding emulator needs to be mapped to the container through file mapping, so its startup parameters will change. This disclosure adjusts the container startup parameters to ensure that the CPU architecture emulator file is correctly mapped to the container. If you need to create an arm architecture container on a worker node with an x86 physical architecture, use the following command:

[0083] docker run-itd --privileged-v / usr / bin / qemu-arm-static: / usr / bin / qemu-arm-static ioft / armhf-ubuntu:trusty / bin / bash

[0084] Among them, -v / usr / bin / qemu-arm-static: / usr / bin / qemu-arm-static is a new addition based on the original command for creating a container, that is, mapping the binary files of the simulator in the file directory of the working node to the file directory of the container.

[0085] The present disclosure decouples the binding relationship between the physical CPU architecture of the working node and the CPU architecture of the container that can be created by the node by creating a container using a CPU architecture simulator.

[0086] In some embodiments, creating a container using a simulator corresponding to a CPU architecture type specified by a user includes: generating a parameter list for starting the container based on container creation information and the simulator corresponding to the CPU architecture type specified by the user, wherein the parameter list for starting the container includes the name of the simulator corresponding to the CPU architecture type specified by the user; and creating a container based on the parameter list for starting the container.

[0087] For example, in the parameter list of container startup, add the name of the simulator corresponding to the CPU architecture type specified by the user, and pass the modified container startup parameters to the container runtime interface. According to the parameters such as the name of the simulator corresponding to the CPU architecture type specified by the user, the container runtime engine (Container Engine) is called through the container runtime interface (Container Runtime Interface, CRI) to create the container.

[0088] The present disclosure schedules and creates containers through a CPU architecture simulator, so that a working node not only supports the creation of containers with a CPU architecture that is the same as the physical CPU architecture of the node on the node, but also supports the creation of containers with a physical CPU architecture different from the node on the node. Thus, a working node can support the creation of containers with multiple different types of CPU architectures, and is no longer limited to the physical CPU architecture of the node, thereby improving the flexibility of creating containers.

[0089] In addition, the simulator decouples the binding relationship between the physical CPU architecture of the working node and the CPU architecture of the container that the node can create. It supports the creation of multiple containers with different CPU architecture types on a working node without the need for hardware resources with multiple different CPU architectures, reducing the cost of application development and testing.

[0090] Figure 2 A flowchart of a container creation method according to some other embodiments of the present disclosure is shown.

[0091] like Figure 2 As shown, the container creation method includes steps S210-S250, which are executed by the master node.

[0092] In step S210, a container creation request from a user is received, wherein the container creation request includes information of an image specified by the user, and the information of the image specified by the user includes an address of the image specified by the user.

[0093] For example, the user selects an image, sends a container creation request to the master node, and specifies the required CPU architecture type.

[0094] In step S220, the CPU architecture type specified by the user is determined according to the information of the image specified by the user.

[0095] For example, according to the address of the image specified by the user in the information of the image specified by the user, the image repository is queried to obtain the CPU architecture type corresponding to the information of the image specified by the user.

[0096] In step S230, the types of CPU architecture simulators possessed by the plurality of working nodes are received.

[0097] For example, the type of CPU architecture simulator of the node reported by each working node after receiving the query.

[0098] In step S240, a target working node is selected from the plurality of working nodes according to the CPU architecture type specified by the user and the types of CPU architecture simulators possessed by the plurality of working nodes.

[0099] For example, if a worker node has a simulator that has the same CPU architecture type as the one specified by the user, the worker node is selected as the target worker node.

[0100] In some embodiments, a target working node is selected from multiple working nodes based on a CPU architecture type specified by a user and the types of CPU architecture simulators possessed by the multiple working nodes, including: selecting a target working node from working nodes possessing a CPU architecture simulator corresponding to the CPU architecture type specified by the user.

[0101] For example, if there are multiple nodes that have simulators corresponding to the CPU architecture type specified by the user, one of them is selected as the target working node.

[0102] In some embodiments, selecting a target working node from working nodes having a CPU architecture simulator corresponding to a CPU architecture type specified by a user includes: selecting the target working node according to a preset filtering condition.

[0103] For example, if there are multiple nodes that have simulators corresponding to the CPU architecture type specified by the user, a target working node is selected from them according to a preset strategy.

[0104] In some embodiments, the preset filtering conditions include at least one of the CPU model, memory size, and remaining resources of the working node.

[0105] For example, follow the two steps below to schedule the working nodes.

[0106] 1. Filtering stage: Select the worker nodes that meet the image CPU architecture requirements, and filter out candidate worker nodes from the worker nodes that meet the requirements based on the user's requirements for the container's CPU model and memory size.

[0107] 2. In the optimization stage, the candidate working nodes are further screened, for example, the candidate nodes with the most remaining resources are selected.

[0108] In step S250, container creation information is generated according to the user's container creation request, wherein the container creation information instructs the target working node to create a container.

[0109] For example, container creation information including the image address specified by the user is generated and stored in a database, and the target working node is scheduled to create a container.

[0110] The present disclosure selects the target working node based on the type of CPU architecture simulator of each working node, rather than just based on the type of physical CPU architecture of each working node. The CPU architecture simulator is used to solve the problem that the master node is limited by the type of physical CPU architecture of the working node when selecting the target node, so that more working nodes can be selected, which is conducive to finding a more suitable target node from them without being limited by its physical CPU architecture, thereby improving the flexibility of scheduling and reducing costs.

[0111] Figure 3 A schematic diagram of a container creation method according to some other embodiments of the present disclosure is shown.

[0112] like Figure 3 As shown, first, each worker node detects one or more simulator types of the node, and then the worker node reports the simulator type of the node to the master node;

[0113] Then, the user selects the image and initiates a container creation request through the k8s API Sever.

[0114] The scheduler parses the cpu architecture type required by the image from the container creation request, and selects nodes that support the architecture based on the supported CPU architecture type reported by each Worker node, and completes the scheduling in combination with the preset scheduling strategy. Among them, the supported CPU architecture type reported by each Worker node is provided by the "node CPU architecture capability reporting module" of each computing node.

[0115] The scheduled Worker node agent receives the request to create a container, and parses the CPU architecture corresponding to the container image. The Worker node agent generates a parameter list for starting the container corresponding to the simulator based on the container creation specifications and the CPU architecture specified by the image, and maps the binary file of the simulator corresponding to the CPU architecture to the container through the -v parameter).

[0116] Finally, the Worker node agent calls the container runtime engine through the container runtime interface according to the previously generated parameters to complete the container creation.

[0117] Figure 4 A block diagram of a container creation device according to some embodiments of the present disclosure is shown.

[0118] like Figure 4 As shown, the container creation device 40 includes a receiving module 401 , a determining module 402 , a selecting module 403 , and a creating module 404 .

[0119] The receiving module 401 is configured to receive the container creation information generated by the master node, wherein the container creation information includes the information of the image specified by the user, such as executing Figure 1 Step S110 shown;

[0120] The determination module 402 is configured to determine the CPU architecture type specified by the user according to the information of the image specified by the user, for example, by executing Figure 2 Step S120 shown;

[0121] The selection module 403 is configured to select a simulator corresponding to the CPU architecture type specified by the user from the CPU architecture simulators of the working node, for example, Figure 1 Step S130 shown;

[0122] The creation module 404 is configured to create a container using a simulator corresponding to the CPU architecture type specified by the user, for example, by executing Figure 1 Step S140 is shown.

[0123] Figure 5 A block diagram of a container creation device according to some other embodiments of the present disclosure is shown.

[0124] like Figure 5 As shown, the container creation device 50 is deployed on the master node, and includes a first receiving module 501 , a determining module 502 , a second receiving module 503 , a selecting module 504 , and a generating module 505 .

[0125] The first receiving module 501 is configured to receive a container creation request from a user, wherein the container creation request includes information about the image specified by the user, such as executing Figure 2 Step S210 is shown.

[0126] The determination module 502 is configured to determine the CPU architecture type specified by the user according to the information of the image specified by the user, for example, by executing Figure 2 Step S220 is shown.

[0127] The second receiving module 503 is configured to receive the types of CPU architecture simulators of the multiple working nodes, for example, Figure 2 Step S230 is shown.

[0128] The selection module 504 is configured to select a target working node from the multiple working nodes according to the CPU architecture type specified by the user and the types of CPU architecture simulators of the multiple working nodes, for example, by executing Figure 2 Step S240 is shown.

[0129] The generation module 505 is configured to generate container creation information according to the user's container creation request, wherein the container creation information indicates that the target working node creates a container, for example, by executing Figure 2 Step S250 is shown.

[0130] Figure 6 A block diagram of a cluster system according to some embodiments of the present disclosure is shown.

[0131] like Figure 6 As shown, the cluster system 6 includes a working node 4 and a master node 5, wherein the working node includes a container creation device according to some examples of the present disclosure, and the master node includes a container creation device according to some examples of the present disclosure. .

[0132] Figure 7 A block diagram of a container creation device according to some other embodiments of the present disclosure is shown.

[0133] like Figure 7As shown, the traffic prediction device 7 includes a memory 71; and a processor 72 coupled to the memory 71, and the memory 71 is used to store and execute the traffic prediction method. The processor 72 is configured to execute the container creation method in any of the embodiments of the present disclosure based on the instructions stored in the memory 71.

[0134] Figure 8 A block diagram of a computer system for implementing some embodiments of the present disclosure is shown.

[0135] like Figure 8 As shown, the computer system 80 may be embodied in the form of a general-purpose computing device. The computer system 80 includes a memory 810, a processor 820, and a bus 800 that connects the various system components.

[0136] The memory 810 may include, for example, a system memory, a non-volatile storage medium, etc. The system memory may store, for example, an operating system, an application, a boot loader, and other programs. The system memory may include a volatile storage medium, such as a random access memory (RAM) and / or a cache memory. The non-volatile storage medium may store, for example, instructions for executing the container creation method in any of the embodiments of the present disclosure. The non-volatile storage medium includes, but is not limited to, a disk memory, an optical memory, a flash memory, and the like.

[0137] The processor 820 can be implemented by a general processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistors, etc. Discrete hardware components. Accordingly, each module such as the judgment module and the determination module can be implemented by a central processing unit (CPU) running instructions in a memory that execute corresponding steps, or can be implemented by a dedicated circuit that executes corresponding steps.

[0138] The bus 800 may use any of a variety of bus architectures, including, but not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MCA) bus, and a Peripheral Component Interconnect (PCI) bus.

[0139] The computer system 80 may also include an input / output interface 830, a network interface 840, a storage interface 850, etc. These interfaces 830, 840, 850, the memory 810, and the processor 820 may be connected via a bus 800. The input / output interface 830 may provide a connection interface for input / output devices such as a display, a mouse, and a keyboard. The network interface 840 may provide a connection interface for various networked devices. The storage interface 850 may provide a connection interface for external storage devices such as a floppy disk, a USB flash drive, and an SD card.

[0140] Here, various aspects of the present disclosure are described with reference to flowcharts and / or block diagrams of methods, devices, and computer program products according to embodiments of the present disclosure. It should be understood that each frame of the flowchart and / or block diagram and the combination of frames can be implemented by computer-readable program instructions.

[0141] These computer-readable program instructions may be provided to a processor of a general-purpose computer, a special-purpose computer or other programmable device to produce a machine, so that the processor executes the instructions to produce means for implementing the functions specified in one or more blocks in the flowchart and / or block diagram.

[0142] These computer-readable program instructions can also be readable and stored in a computer-readable memory, which cause the computer to work in a specific manner to produce a product, including instructions for implementing the functions specified in one or more blocks in the flowchart and / or block diagram.

[0143] The present disclosure can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects.

[0144] Through the container creation method and device and computer-readable storage medium in the above embodiments, the flexibility of container creation is improved and the cost of development and testing is reduced.

[0145] So far, the container creation method and device, and computer-readable storage medium according to the present disclosure have been described in detail. In order to avoid obscuring the concept of the present disclosure, some details known in the art are not described. Based on the above description, those skilled in the art can fully understand how to implement the technical solution disclosed herein.

Claims

1. A container creation method, executed by a working node, comprising: Receive container creation information generated by the master node, wherein the container creation information includes information of the image specified by the user; Determine the CPU architecture type specified by the user based on the information of the image specified by the user; When the CPU architecture type specified by the user is different from the physical CPU architecture type of the working node, selecting a simulator corresponding to the CPU architecture type specified by the user from the CPU architecture simulators possessed by the working node; Creates a container using an emulator that corresponds to the CPU architecture type specified by the user.

2. The container creation method according to claim 1, further comprising: The type of the CPU architecture simulator of the working node is sent to the master node.

3. The container creation method according to claim 2, further comprising: The type of the CPU architecture simulator of the working node is determined according to the file of the CPU architecture simulator in the file directory of the working node.

4. The container creation method according to claim 1, wherein: Determining the CPU architecture type specified by the user according to the information of the image specified by the user includes: According to the information of the image specified by the user, obtain the metadata of the image specified by the user; Determine the CPU architecture type specified by the user based on the metadata of the image specified by the user.

5. The container creation method according to claim 1, wherein: The step of creating a container by using a simulator corresponding to a CPU architecture type specified by a user includes: Map the binary file of the simulator in the file directory of the working node to the file directory of the container.

6. The container creation method according to claim 1, wherein: The step of creating a container by using a simulator corresponding to a CPU architecture type specified by a user includes: Generate a parameter list for starting the container according to the container creation information and the simulator corresponding to the CPU architecture type specified by the user, wherein the parameter list for starting the container includes the name of the simulator corresponding to the CPU architecture type specified by the user; Create a container based on the parameter list of container startup.

7. The container creation method according to claim 1, wherein: The information of the image specified by the user includes the address of the image specified by the user.

8. A container creation method, executed by a master node, comprising: Receive a container creation request from a user, wherein the container creation request includes information of an image specified by the user; Determine the CPU architecture type specified by the user based on the information of the image specified by the user; Receive the types of CPU architecture simulators that the plurality of worker nodes have; Selecting a target working node from the plurality of working nodes according to a CPU architecture type specified by a user and types of CPU architecture simulators possessed by the plurality of working nodes, wherein the CPU architecture type specified by the user is different from a physical CPU architecture type of the target working node; Generate container creation information according to the user's container creation request, wherein the container creation information instructs the target working node to create a container.

9. The container creation method according to claim 8, wherein: The step of selecting a target working node from the multiple working nodes according to the CPU architecture type specified by the user and the types of CPU architecture simulators possessed by the multiple working nodes comprises: A target worker node is selected from worker nodes having a CPU architecture simulator corresponding to the CPU architecture type specified by the user.

10. The container creation method according to claim 8, wherein: Select a target worker node from the worker nodes that have a CPU architecture simulator corresponding to the CPU architecture type specified by the user, including: Select the target working node based on the preset filtering conditions.

11. The container creation method according to claim 10, wherein: The preset filtering condition includes at least one of a CPU model, a memory size, and remaining resources of a working node.

12. A container creation device, deployed on a working node, comprising: A receiving module is configured to receive container creation information generated by the master node, wherein the container creation information includes information of the image specified by the user; A determination module is configured to determine a CPU architecture type specified by a user based on information of an image specified by a user; A selection module is configured to select a simulator corresponding to the CPU architecture type specified by the user from the CPU architecture simulators possessed by the working node when the CPU architecture type specified by the user is different from the physical CPU architecture type of the working node; The creation module is configured to create a container using a simulator corresponding to a CPU architecture type specified by a user.

13. A container creation device, deployed on a master node, comprising: A first receiving module is configured to receive a container creation request from a user, wherein the container creation request includes information of an image specified by the user; A determination module is configured to determine a CPU architecture type specified by a user based on information of an image specified by a user; A second receiving module is configured to receive types of CPU architecture simulators possessed by a plurality of working nodes; A selection module is configured to select a target working node from a plurality of working nodes according to a CPU architecture type specified by a user and types of CPU architecture simulators possessed by the plurality of working nodes, wherein the CPU architecture type specified by the user is different from a physical CPU architecture type of the target working node; The generation module is configured to generate container creation information according to a container creation request of a user, wherein the container creation information indicates that a target working node creates a container.

14. A cluster system, comprising a working node and a master node, wherein: The working node includes the container creation device according to claim 12, and the master node includes the container creation device according to claim 13.

15. A container creation device, comprising: Memory; as well as A processor coupled to the memory, wherein the processor is configured to execute the container creation method according to any one of claims 1 to 11 based on instructions stored in the memory.

16. A computer storable medium having computer program instructions stored thereon, wherein when the instructions are executed by a processor, the container creation method according to any one of claims 1 to 11 is implemented.

Citation Information

Patent Citations

  • Management method and device based on system virtual machine, electronic equipment and storage medium

    CN112667361A

  • Scheduling method and device and master node

    CN113900778A