WO2023066245A1 - 容器引擎和容器引擎的实现方法、电子设备、存储介质 - Google Patents

容器引擎和容器引擎的实现方法、电子设备、存储介质 Download PDF

Info

Publication number
WO2023066245A1
WO2023066245A1 PCT/CN2022/125913 CN2022125913W WO2023066245A1 WO 2023066245 A1 WO2023066245 A1 WO 2023066245A1 CN 2022125913 W CN2022125913 W CN 2022125913W WO 2023066245 A1 WO2023066245 A1 WO 2023066245A1
Authority
WO
WIPO (PCT)
Prior art keywords
container
communication protocol
module
sent
node
Prior art date
Application number
PCT/CN2022/125913
Other languages
English (en)
French (fr)
Inventor
张徐瑜
谈虎
刘建军
陈俊霖
梁显龙
王亮
李龙江
况明富
薛志宏
李翌
Original Assignee
中兴通讯股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2023066245A1 publication Critical patent/WO2023066245A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines

Definitions

  • Embodiments of the present disclosure relate to but are not limited to the technical field of cloud computing containers, and specifically relate to a container engine and a method for implementing the container engine, electronic equipment, and a computer-readable storage medium.
  • container technology provides an independent execution environment for business programs.
  • deployment, startup, and deletion of containers are fast and have great impact on central processing units (CPU, Center Processing Unit), memory, and input and output (IO, Input).
  • IO input and output
  • Output has zero performance loss.
  • container engines led by Docker, Containerd, and Container Runtime Interface Open have emerged.
  • These container engines provide APIs (Application Programming Interface) and command lines to the outside world, and provide container image management functions and container lifecycle management functions through APIs and command lines.
  • APIs Application Programming Interface
  • container engines widely used in the industry such as Docker, Containerd, and CRI-O are generally deployed on worker nodes together with the node agent of the container orchestration system, while the management node only deploys the API of the container orchestration system. This deployment method causes the container engine on the working node and the node agent of the container orchestration system to have the problem of excessive consumption of the CPU and memory resources of the working node.
  • Embodiments of the present disclosure provide a container engine, a method for implementing the container engine, an electronic device, and a computer-readable storage medium.
  • an embodiment of the present disclosure provides a method for implementing a container engine, which is applied to a first device installed on a management node.
  • the method includes: sending a container operation request to the second device using a communication protocol; receiving a container operation request using the communication protocol The container operation response sent by the second device.
  • an embodiment of the present disclosure provides a method for implementing a container engine, which is applied to a second device installed on a management node or a working node.
  • the method includes: using a communication protocol to receive a container operation request sent by the first device, Perform a container operation; send a container operation response to the first device by using the communication protocol.
  • an embodiment of the present disclosure provides an electronic device, including: at least one processor; a memory, at least one program is stored in the memory, and when the at least one program is executed by the at least one processor, any of the above-mentioned A method for implementing a container engine.
  • an embodiment of the present disclosure provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, any implementation method of the above-mentioned container engine is implemented.
  • an embodiment of the present disclosure provides a container engine, including: a first device and a second device; the first device is set on a management node, and the second device is set on a management node or a worker node; wherein, the The first device includes a container engine core module, and the container engine core module includes: a container management submodule configured to send a container operation request to the master agent submodule; a master agent submodule configured to send a container operation request to the master agent submodule using a communication protocol
  • the container operation submodule of the second device sends a container operation request; adopts the communication protocol to receive the container operation response sent by the container operation submodule of the second device;
  • the second device includes: a container gasket module and a container Runtime module;
  • the container shim module includes: the container operation sub-module configured to receive the container operation request sent by the master agent sub-module of the first device by using the communication protocol, and operate the container The request is sent to the container runtime module;
  • FIG. 1 is a schematic structural diagram of a container engine in the related art
  • FIG. 2 is a block diagram of a container engine provided by an embodiment of the present disclosure
  • FIG. 3 is a flowchart of a method for implementing a container engine applied to a management node provided by an embodiment of the present disclosure
  • FIG. 4 is a flowchart of a method for implementing a container engine applied to a worker node provided by another embodiment of the present disclosure.
  • container engines led by Docker, Containerd and CRI-O have emerged. These container engines provide APIs and command lines externally, and provide container image management functions and container lifecycle management functions through APIs and command lines.
  • container engines widely used in the industry such as Docker, Containerd and CRI-O can be divided into the following major modules functionally: container engine core module, container shim module and container runtime module, as shown in Figure 1, the container engine core
  • the modules specifically include: API sub-module, client sub-module, container management sub-module, container image management sub-module, node management sub-module and image storage sub-module;
  • the container spacer module specifically includes: input and output forwarding sub-module, container resource recovery sub-module Module and container operation sub-module;
  • container runtime module specifically includes: Open Container Standard (OCI, Open Container Initiative) runtime sub-module or LXC (Linux Container) sub-module.
  • the API sub-module is responsible for providing container engine functions and service software interface sub-modules to the outside (such as the container orchestration system).
  • the client submodule is responsible for the command-line tools provided by the container engine for container and image operations.
  • the container management sub-module is responsible for managing the life cycle status of containers such as creation, operation, stop and deletion.
  • the container image management sub-module is responsible for the management of image status and relationship between images.
  • the node management sub-module is responsible for managing information such as node resources and security status.
  • the image storage sub-module is responsible for the management of the actual files or devices of the image, as well as the reading and writing of the image content.
  • the input and output forwarding sub-module is responsible for forwarding the external input to the container, and forwarding the output of the container to the container engine.
  • the container resource recycling submodule is responsible for reclaiming the system resources consumed by dead containers.
  • the container operation sub-module is responsible for calling the container runtime module to directly initiate operations such as creating, running, stopping, deleting, and viewing the container.
  • the OCI runtime submodule is a container runtime tool that meets the definition of the OCI specification, and is responsible for performing specific operations such as creating, running, stopping, deleting, and viewing containers on the operating system.
  • the LXC submodule is provided in the open source Linux Contianer project, which can create, run, stop and delete, and view the tools or dynamic libraries of containers on Linux.
  • the container engine provides API submodules or client submodules to the container orchestration system.
  • the container orchestration system (such as K8S (Kubernetes), K3S, etc.) uses the API submodule or client submodule to instruct the container engine to complete image creation, image deletion, image query, Image management functions such as image import, image export, pull image from warehouse, and push image to warehouse, as well as container management functions such as container creation, container deletion, container start, container stop, container suspension, container recovery, and container status query.
  • the functions realized by calling the underlying operating system are integrated into the OCI runtime submodule or LXC submodule;
  • the container engine maintains a container life-cycle state management, and the container operation is completed by the container operation submodule by calling the OCI runtime submodule or LXC submodule; and in order to handle the resource recovery at the exit time of the internal process of the container, the internal process of the transit container
  • the standard input, standard output and standard error of the container engine are designed with container shim modules.
  • a set of cloud computing clusters is formed with the container orchestration system as the management entry and the container engine as the work implementation unit.
  • Business developers can quickly deploy business process groups in the form of containers to the internal nodes of the cluster through the container orchestration system.
  • each physical device such as a server or a single board, etc.
  • the management node is usually a server or single board with sufficient CPU, memory, and storage resources, and the container orchestration system is deployed on the management node.
  • Work nodes are generally servers or single-board devices with relatively tight CPU, memory, and storage resources.
  • the container orchestration agent and container engine are deployed on the worker nodes, and the container runs on the container engine.
  • one or more management nodes can be deployed in the cluster; according to the workload indicators of the cluster, one or more working nodes can be deployed in the cluster. In extreme cases, there are situations where the management node and worker nodes are located on the same physical device.
  • the API of the container orchestration system is deployed on the management node, and the node agent and container engine of the container orchestration system are deployed on the worker nodes.
  • the user needs to create a container, he only needs to send instructions to the API of the container orchestration system located on the management node, and the API of the container orchestration system instructs the container engine to complete the actual container creation, startup and management work through the node agent.
  • the container engine on the working node and the node agent of the container orchestration system have the problem of excessive consumption of the CPU and memory resources of the working node. Taking the open source Containerd engine as an example, creating and starting 500 containers requires 300 megabytes of memory space.
  • FIG. 2 is a block diagram of a container engine provided by an embodiment of the present disclosure. As shown in FIG. 2, the embodiment of the present disclosure transforms the deployment structure of the container engine on the cluster, and splits the container engine into a first device 201 and at least one second device 202. The first device 201 and the second device 202 are completely independent.
  • the first device 201 and the second device 202 are in a master-slave mode, such as one master and one slave, one master and multiple slaves, and so on.
  • the first device 201 is a master device and is configured on a management node
  • the second device 202 is a slave device and is configured on a working node.
  • the first device 201 and the second device 202 can be set on the management node at the same time, that is, the management node also assumes the function of the working node.
  • connection between the first device 201 and the second device 202 may use any one of bus technology, wired network technology, and wireless network technology.
  • the first device 201 includes: a container engine core module 2011
  • the second device 202 includes: a slave agent module 2021 , a container shim module 2022 and a container runtime module 2023 .
  • the container engine core module 2011 includes: an API submodule, a client submodule, a container management submodule, a container image management submodule and a main-end agent submodule.
  • the slave agent module 2021 includes: a communication submodule, a mirror image storage submodule and a node management submodule. In some other exemplary embodiments, the slave agent module 2021 includes: a communication submodule and a node management submodule, and the image storage submodule is an independent module. In some other exemplary embodiments, the slave agent module 2021 includes: a communication submodule and an image storage submodule, and the node management submodule is an independent module. In some other exemplary embodiments, the slave agent module 2021 includes: a communication submodule, the image storage submodule is an independent module, and the node management submodule is also an independent module.
  • the container shim module 2022 includes: an input and output forwarding submodule, a container resource reclamation submodule and a container operation submodule.
  • the container runtime module 2023 includes: an OCI runtime submodule or an LXC submodule.
  • the first device 201 communicates with the second device 202 using a Remote Procedure Call Protocol (RPC, Remote Procedure Call Protocol), that is, uses RPC to call the second device 202 to implement corresponding functions.
  • RPC Remote Procedure Call Protocol
  • the master agent submodule communicates with the slave agent module 2021 by using RPC, that is, uses RPC to call the slave agent module 2021 to realize corresponding functions.
  • the first device 201 when the first device 201 and the second device 202 are set on the management node at the same time, the first device 201 uses Unix socket (Sock) or inter-process communication (IPC, Inter-Process Communication) Communicate with the second device 202 .
  • the master agent submodule communicates with the slave agent module 2021 using Unix Sock or IPC.
  • the communication establishment between the first device 201 and the second device 202 adopts a C/S model.
  • the first device 201 serves as a client
  • the second device 202 serves as a server.
  • the first device 201 obtains the address and port of the second device 202 after being powered on, and according to the address and port of the second device 202 Actively establish a link and register with the second device 202 .
  • the slave proxy module 2021 communicates with the mirror storage sub-module through IPC.
  • the image storage submodule is used as a submodule of the slave agent module 2021, the image storage submodule and the slave agent module 2021 share the same process, which reduces the occupation of process resources by the second device 202.
  • the master proxy submodule when the mirror storage submodule is an independent module, communicates indirectly with the mirror storage submodule through the slave proxy module 2021 via RPC. In some other exemplary embodiments, when the mirror storage sub-module is an independent module, the master proxy sub-module directly communicates with the mirror storage sub-module by using RPC.
  • the slave agent module 2021 communicates with the node management submodule through IPC.
  • the node management submodule is used as a submodule of the slave agent module 2021, the node management submodule and the slave agent module 2021 share the same process, which reduces the occupation of process resources by the second device 202.
  • the master proxy submodule when the node management submodule is an independent module, communicates indirectly with the node management submodule through the slave proxy module 2021 via RPC. In some other exemplary embodiments, when the node management submodule is an independent module, the master agent submodule directly communicates with the node management submodule by using RPC.
  • the container shim module 2022, the container runtime module 2023, and the slave-end agent module 2021 are implemented by independent processes, the container shim module 2022 communicates with the slave-end agent module 2021 using IPC, and the container runtime module 2023 uses IPC to communicate with the slave agent module 2021.
  • the master proxy submodule communicates directly with the container shim module 2022 using ttrpc, thereby speeding up container operations.
  • ttrpc is the code name of an open source software project, such as GRPC for low-memory environments.
  • the master agent submodule communicates indirectly with the container shim module 2022 through the slave agent module 2021 by using RPC.
  • the container shim module 2022 calls the container runtime module 2023 to implement container operations, thereby simplifying the slave agent module 2021 .
  • the transformation of the above-mentioned container engine architecture will lead to changes in some internal implementation methods of the container engine.
  • the following describes the internal implementation method based on the transformed container engine. It should be noted that the following method description is not the entire implementation process of the container engine. , but some implementation processes different from the internal implementation methods of the container engine before transformation, and the described implementation methods are not used to limit the implementation process of the container engine after transformation.
  • Fig. 3 is a flowchart of a method for implementing a container engine applied to a management node provided by an embodiment of the present disclosure.
  • an embodiment of the present disclosure provides a method for implementing a container engine, which is applied to a first device set on a management node, and the method includes:
  • Step 300 Send a container operation request to the second device by using a communication protocol.
  • the communication protocol includes any one of the following: RPC, socket, IPC. Specifically, if the first device and the second device are set on the management node at the same time, the communication protocol used may be socket or IPC, if the first device is set on the management node, and the second device is set on the working node, Then the adopted communication protocol may be RPC.
  • a container operation request when receiving the API request sent by the container orchestration system, may be sent to the second device by using a communication protocol according to content requested by the API request. If the API request requests container operation, the container operation request can be directly sent to the second device through the communication protocol to realize the container operation; or the container mirror operation request can be sent to the second device through the communication protocol to realize the container mirror Operation, and then use the communication protocol to send a container operation request to the second device, so as to implement the container operation. For example, when creating a container, you need to create a container image first, and then create a container. When you need to create a container, you can first send an API request to create the container image, and then send an API request to create the container, or you can just Send an API request to create a container image and container.
  • the API request can be monitored through a Unix socket file or a specified network port.
  • the container operation includes at least one of the following: container creation, container deletion, container running, container stop, container suspension, container recovery, creating a new process in the container, querying container information, and the like.
  • the container image operation includes at least one of the following: container image creation, container image deletion, container image information query, format conversion, container read-write layer creation, and the like.
  • Step 301 using a communication protocol to receive a container operation response sent by the second device.
  • the method before using the communication protocol to send the container operation request to the second device, the method further includes at least one of the following:
  • the node status query response includes: node status information
  • a container image operation request when receiving the API request sent by the container orchestration system, may be sent to the second device by using a communication protocol according to content requested by the API request.
  • the method also includes:
  • the console type parameter is included in the container creation request or the process creation request and sent to the second device by using a communication protocol.
  • the link types of standard input, standard error, and standard output include: linking standard input, standard error, and standard output to a specified console, linking standard input, standard error, and standard output to a specified file, Do not link.
  • console type parameter may be sent to the first device by the container orchestration system or other external systems.
  • the method further includes:
  • the communication protocol is used to monitor the port of the first device to receive the standard output and standard error of the container sent by the second device, and output the standard output and standard error of the container to a designated console.
  • the method further includes:
  • the file name of the specified file is included in the container creation request or the process creation request and sent to the second device by using a communication protocol.
  • the first device and the second device need to establish a link, and when the first device acts as a client, it needs to communicate with the second device.
  • Device registration before sending a container operation request to the second device using the communication protocol, the method further includes: sending a link establishment request to the second device using the communication protocol according to the pre-configured address and port of the second device, and receiving the second device using the communication protocol.
  • the link establishment response sent by the second device is used to complete the establishment of the link; the registration command is sent to the second device by using the communication protocol, and the registration response sent by the second device is received by the communication protocol to complete the registration.
  • the address and port of the second device may be pre-configured in the configuration file.
  • each second device If there are two or more second devices, the address and port of each second device are respectively configured in the configuration file, and the first device establishes a link with each second device and registers with each second device.
  • the method further includes: periodically sending a keep-alive message to the second device by using the communication protocol, so as to implement a health check mechanism.
  • the method before sending the first node resource application request to the second device, the method further includes:
  • the container shim module creation response includes: a port of the container shim module.
  • FIG. 4 is a flowchart of a method for implementing a container engine applied to a worker node provided by another embodiment of the present disclosure.
  • FIG. 4 another embodiment of the present disclosure provides a method for implementing a container engine, which is applied to a second device set on a management node or a working node, and the method includes:
  • Step 400 Receive a container operation request sent by the first device by using a communication protocol, and perform container operation.
  • the communication protocol includes any one of the following: RPC, socket, IPC. Specifically, if the first device and the second device are set on the management node at the same time, the communication protocol used may be socket or IPC, if the first device is set on the management node, and the second device is set on the working node, Then the adopted communication protocol may be RPC.
  • the container operation includes at least one of the following: container creation, container deletion, container running, container stop, container suspension, container recovery, creating a new process in the container, querying container information, and the like.
  • Step 401 Send a container operation response to the first device by using a communication protocol.
  • the method before using the communication protocol to receive the container operation request sent by the first device, the method further includes at least one of the following:
  • the node status query response includes: node status information
  • the communication protocol is used to receive the container mirroring operation request sent by the first device, and the container mirroring operation is performed, and the communication protocol is used to send the container mirroring operation response to the first device.
  • the container image operation includes at least one of the following: container image creation, container image deletion, container image information query, format conversion, container read-write layer creation, and the like.
  • the method also includes:
  • the communication protocol is used to receive the console type parameter sent by the first device, and the console type parameter is used to indicate the connection type of standard input, standard error and standard output.
  • the method further includes:
  • the standard output and standard error of the container are received, and the standard output and standard error of the container are sent to the first device through the port of the first device by using a communication protocol.
  • the method further includes:
  • the method further includes: using the communication protocol to monitor the pre-configured address and port of the second device to receive the link establishment request sent by the first device, using communication The protocol sends a link establishment response to the first device to complete the establishment of the link; uses the communication protocol to receive the registration command sent by the first device, executes the registration command, and uses the communication protocol to send a registration response to the first device to complete the registration.
  • the address and port of the second device may be pre-configured.
  • the specific configuration method is not limited, for example, it can be configured in a configuration file.
  • each second device If there are two or more second devices, the address and port of each second device are respectively configured in the configuration file, and the first device establishes a link with each second device and registers with each second device.
  • the method further includes: using the communication protocol to periodically receive a keep-alive message sent by the first device, so as to implement a health check mechanism.
  • the method before receiving the first node resource application request sent by the first device, the method further includes:
  • the container shim module creation response includes: a port of the container shim module.
  • another embodiment of the present disclosure provides an electronic device, including: at least one processor; a memory, at least one program is stored in the memory, and when at least one program is executed by at least one processor, any of the above-mentioned The implementation method of the container engine.
  • the processor is a device with data processing capability, which includes but not limited to central processing unit (CPU), etc.
  • the memory is a device with data storage capability, which includes but not limited to random access memory (RAM, more specifically SDRAM , DDR, etc.), read-only memory (ROM), charged erasable programmable read-only memory (EEPROM), flash memory (FLASH).
  • RAM random access memory
  • ROM read-only memory
  • EEPROM charged erasable programmable read-only memory
  • FLASH flash memory
  • the processor and the memory are connected to each other through a bus, and further connected to other components of the computing device.
  • another embodiment of the present disclosure provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, any implementation method of the above-mentioned container engine is implemented.
  • another embodiment of the present disclosure provides a container engine, including: a first device 201 and a second device 202; the first device is set on a management node, and the second device is set on a management node or work node.
  • the first device includes a container engine core module 2011, and the container engine core module 2011 includes: a container management sub-module configured to send a container operation request to the main-end proxy sub-module; a main-end proxy sub-module configured to adopt a communication protocol Sending a container operation request to the container operation submodule of the second device; receiving a container operation response sent by the container operation submodule of the second device using a communication protocol.
  • the second device 202 includes: a container shim module 2022 and a container runtime module 2023;
  • the container shim module 2022 includes: the container operation sub-module configured to receive the main-end proxy sub-module of the first device 201 using a communication protocol
  • the container operation request sent by the module sends the container operation request to the container runtime module 2023;
  • the container runtime module 2023 is configured to perform container operations, and sends a container operation response to the container operation sub-module;
  • the container operation sub-module is also configured as : sending a container operation response to the main-end agent submodule of the first device 201 by using a communication protocol.
  • the master proxy submodule communicates directly with the container shim module 2022 using ttrpc, thereby speeding up container operations.
  • the master agent submodule communicates indirectly with the container shim module 2022 through the slave agent module 2021 by using RPC.
  • the second device 202 further includes: a slave agent module 2021, and the slave agent module 2021 includes: a communication submodule configured to realize communication with the master agent submodule by using a communication protocol.
  • the first device and the second device need to establish a link, and when the first device acts as a client, it needs to communicate with the second device.
  • Device registration The specific implementation is that the master agent sub-module is also configured to: send a link establishment request to the slave agent module 2021 using a communication protocol according to the address and port of the preconfigured slave agent module 2021, and receive a link establishment request from the slave agent module 2021 using a communication protocol. Send the link establishment response to complete the establishment of the link; use the communication protocol to send a registration command to the slave agent module 2021, and use the communication protocol to receive the registration response sent by the slave agent module 2021 to complete the registration.
  • the second device 202 also includes: a slave agent module 2021 configured to monitor the pre-configured address and port of the slave agent module 2021 using a communication protocol to receive the link establishment request sent by the master agent submodule, and send a message to the master using a communication protocol.
  • the end agent submodule sends a link establishment response to complete the establishment of the link; uses the communication protocol to receive the registration command sent by the master agent submodule, executes the registration command, and uses the communication protocol to send a registration response to the master agent submodule to complete the registration .
  • the address and port of the slave agent module 2021 can be pre-configured in the configuration file.
  • each second device If there are two or more second devices, the address and port of each second device are respectively configured in the configuration file, and the first device establishes a link with each second device and registers with each second device.
  • the master agent submodule is also configured to: use a communication protocol to periodically send a keep-alive message to the slave agent module 2021 to implement a health check mechanism; the slave agent module 2021 is also configured to: use The communication protocol periodically receives the keep-alive message sent by the master proxy submodule of the first device, so as to implement a health check mechanism.
  • the container engine core module 2011 of the first device 201 further includes: an API submodule configured to receive the API request sent by the container orchestration system, and send the request to the container management submodule according to the content requested by the API request A container operation request, or send a container image operation request to the container image management submodule;
  • the container image management submodule is configured to receive the container image operation request sent by the API submodule, and send it to the image storage submodule of the second device using a communication protocol
  • the container image operation request is to receive the container image operation response sent by the image storage sub-module of the second device using the communication protocol;
  • the container management sub-module is also configured to: receive the container operation request sent by the API sub-module, and use the communication protocol to send the container image operation response to the second device
  • the container operation submodule of the second device sends a container operation request, and receives a container operation response sent by the container operation submodule of the second device using a communication protocol;
  • the second device 202 also includes a slave agent module 2021, and the slave agent module 2021 includes: a mirror storage submodule configured to receive a container mirror operation request sent by the container mirror management submodule of the first device using a communication protocol, and perform container mirroring. Operation, using a communication protocol to send a container image operation response to the container image management sub-module of the first device; the container operation sub-module is further configured to: use a communication protocol to receive a container operation request sent by the container management sub-module of the first device, and perform container Operation, using a communication protocol to send a container operation response to the container management submodule of the first device.
  • the container management submodule is further configured to: send a node status query request to the master agent submodule;
  • the module sends a node status query request, and uses a communication protocol to receive a node status query response sent by the node management submodule of the second device, wherein the node status query response includes: node status information; and sends the node status query response to the container management submodule.
  • the second device 202 also includes a slave agent module 2021, and the slave agent module 2021 includes: a node management submodule configured to receive a node status query request sent by the master agent submodule of the first device using a communication protocol, and query the node status information, using a communication protocol to send a node status query response to the master agent submodule of the first device, wherein the node status query response includes: node status information.
  • a node management submodule configured to receive a node status query request sent by the master agent submodule of the first device using a communication protocol, and query the node status information, using a communication protocol to send a node status query response to the master agent submodule of the first device, wherein the node status query response includes: node status information.
  • the container management submodule is further configured to: send the first node resource application request to the main-end proxy sub-module; the main-end proxy sub-module is also configured to: use a communication protocol to send The management submodule sends the first node resource application request, receives the first node resource application response sent by the node management submodule of the second device using a communication protocol, and sends the first node resource application response to the container management submodule.
  • the second device 202 also includes a slave agent module 2021, and the slave agent module 2021 includes: a node management submodule configured to receive the first node resource application request sent by the master agent submodule of the first device using a communication protocol, for The first device allocates the first node resource, and sends a first node resource application response to the main-end proxy submodule of the first device by using a communication protocol.
  • a node management submodule configured to receive the first node resource application request sent by the master agent submodule of the first device using a communication protocol, for The first device allocates the first node resource, and sends a first node resource application response to the main-end proxy submodule of the first device by using a communication protocol.
  • the container management submodule is further configured to: send a second node resource application request to the main-end proxy sub-module; the main-end proxy sub-module is also configured to: use a communication protocol to send The management submodule sends the second node resource application request, receives the second node resource application response sent by the node management submodule of the second device through the communication protocol, and sends the second node resource application response to the container management submodule.
  • the second device 202 also includes a slave agent module 2021, and the slave agent module 2021 includes: a node management submodule configured to receive a second node resource application request sent by the master agent submodule of the first device using a communication protocol, for The first device allocates resources of the second node, and sends a resource application response of the second node to the main-end agent submodule of the first device by using a communication protocol.
  • a node management submodule configured to receive a second node resource application request sent by the master agent submodule of the first device using a communication protocol, for The first device allocates resources of the second node, and sends a resource application response of the second node to the main-end agent submodule of the first device by using a communication protocol.
  • the container engine core module 2011 further includes: a client submodule configured to receive a console type parameter, the console type parameter is used to indicate the connection type of standard input, standard error and standard output, and will control
  • the console type parameter is sent to the container management submodule; the container management submodule is also configured to: send the console type parameter to the master agent submodule; the master agent submodule is also used to: use the communication protocol to include the console type parameter
  • the container shim module 2022 also includes: an input-output forwarding submodule configured to receive the console type parameter and send the console type parameter to the container operation submodule.
  • the container management submodule is further configured to: if the console type parameter is used to indicate that standard input, standard error, and standard output are linked to a specified console, the port Send to the main-end proxy submodule; the main-end proxy submodule is also configured to: use a communication protocol to include the port of the container management submodule in the container creation request or process creation request and send it to the input-output forwarding submodule of the second device; Using a communication protocol to send the standard input of the container to the input-output forwarding sub-module of the second device through the port of the container management sub-module; using a communication protocol to monitor the port of the container management sub-module to receive the input-output forwarding sub-module of the second device.
  • Standard output and standard error of the container send the standard output and standard error of the container to the container management submodule; the container management submodule is also configured to: output the standard output and standard error of the container to the specified console.
  • the input and output forwarding submodule is also configured to: in the case that the console type parameter is used to indicate that the standard input, standard error, and standard output are linked to the specified console, use the communication protocol to receive the primary end proxy submodule of the first device to send The port of the container management submodule; adopt the communication protocol to receive the standard input of the container sent by the master agent submodule of the first device through the port of the container management submodule, and send the standard input of the container to the container operation submodule; Standard output and standard error are sent to the container management submodule through the ports of the container management submodule.
  • the container operation sub-module is also configured to: input the standard input of the container into the container; receive the standard output and standard error of the container, and send the standard output and standard error of the container to the input-output forwarding sub-module.
  • the container management submodule is further configured to: send a console type parameter to the main The terminal proxy submodule; the main terminal proxy submodule is further configured to: use the communication protocol to include the file name of the specified file in the container creation request or the process creation request and send it to the input-output forwarding submodule of the second device.
  • the input-output forwarding submodule is further configured to: when the console type parameter is used to indicate that the standard input, standard error and standard output are linked to the specified file, use the communication protocol to receive the file name of the specified file sent by the first device; Create a specified file with the file name of the received specified file, and send the file name of the specified file to the container operation submodule; the container operation submodule is also configured to: write the standard input and standard error of the container to the specified file middle.
  • the container engine provided by the embodiment of the present disclosure is implemented by splitting the container engine into a first device and a second device.
  • the first device is set on the management node
  • the second device is set on the management node or the working node
  • the core module of the container engine is reserved.
  • the first device there is no need to change the way the container engine orchestration system interfaces with the container engine, and the container shim module and the container runtime module remain in the second device, because the resource consumption of the container shim module and the container runtime module Relatively few, but the core module of the container engine consumes a lot of resources. Therefore, the embodiment of the present disclosure saves the resource consumption of the working nodes while using the original container engine orchestration system to connect to the container engine.
  • the master agent submodule is further configured to: use a communication protocol to send a container shim module creation request to the communication submodule of the second device, and use a communication protocol to receive the request sent by the communication submodule of the second device.
  • the container shim module creates responses.
  • the slave agent module 2021 also includes: a communication submodule configured to receive a container shim module creation request sent by the first device using a communication protocol, create a container shim module, and send a container shim module creation request to the first device using a communication protocol. response.
  • a communication submodule configured to receive a container shim module creation request sent by the first device using a communication protocol, create a container shim module, and send a container shim module creation request to the first device using a communication protocol. response.
  • the functional modules/units in the system, and the device can be implemented as software, firmware, hardware, and an appropriate combination thereof.
  • the division between functional modules/units mentioned in the above description does not necessarily correspond to the division of physical components; for example, one physical component may have multiple functions, or one function or step may be composed of several physical components. Components cooperate to execute.
  • Some or all of the physical components may be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit .
  • Such software may be distributed on computer readable media, which may include computer storage media (or non-transitory media) and communication media (or transitory media).
  • computer storage media includes both volatile and nonvolatile media implemented in any method or technology for storage of information, such as computer readable instructions, data structures, program modules, or other data. permanent, removable and non-removable media.
  • Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disk (DVD) or other optical disk storage, magnetic cartridges, tape, magnetic disk storage or other magnetic storage, or may be used Any other medium that stores desired information and can be accessed by a computer.
  • communication media typically embodies computer readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media .

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)
  • Computer And Data Communications (AREA)

Abstract

本公开提供了一种容器引擎和容器引擎的实现方法、电子设备、计算机可读存储介质。应用于设置在管理节点的第一装置的容器引擎的实现方法包括:采用通信协议向第二装置发送容器操作请求;采用所述通信协议接收所述第二装置发送的容器操作响应。应用于设置在管理节点或工作节点的第二装置的容器引擎的实现方法包括:采用通信协议接收所述第一装置发送的容器操作请求,进行容器操作;采用所述通信协议向所述第一装置发送容器操作响应。

Description

容器引擎和容器引擎的实现方法、电子设备、存储介质
相关申请的交叉引用
本公开要求在2021年10月18日提交国家知识产权局、申请号为CN202111212628.4和N202111212628.4、发明名称为“容器引擎和容器引擎的实现方法、电子设备、存储介质”的中国专利申请的优先权,这些申请的全部内容通过引用结合在本公开中。
技术领域
本公开实施例涉及但不限于云计算容器技术领域,具体涉及容器引擎和容器引擎的实现方法、电子设备、计算机可读存储介质。
背景技术
容器技术作为云计算领域的热门技术,为业务程序提供独立的执行环境的同时,容器的部署、启动、删除迅速且对中央处理器(CPU,Center Processing Unit)、内存和输入输出(IO,Input Output)的性能损耗为零。
在容器领域出现了以Docker、Containerd和容器运行接口—开放(CRI-O,Container Runtime Interface Open)为首的容器引擎。这些容器引擎对外提供应用程序接口(API,Application Programming Interface)和命令行,通过API和命令行提供容器镜像管理功能和容器生命期管理功能。目前业界应用广泛的容器引擎如Docker、Containerd和CRI-O一般同容器编排系统的节点代理一起部署在工作节点上,而管理节点仅部署容器编排系统的API。这种部署方式使得工作节点上的容器引擎和容器编排系统的节点代理存在过度消耗工作节点的CPU和内存资源的问题。
发明内容
本公开实施例提供一种容器引擎和容器引擎的实现方法、电子设备、计算机可读存储介质。
第一方面,本公开实施例提供一种容器引擎的实现方法,应用于设置在管理节点的第一装置,该方法包括:采用通信协议向第二装置发送容器操作请求;采用所述通信协议接收所述第二装置发送的容器操作响应。
第二方面,本公开实施例提供一种容器引擎的实现方法,应用于设置在管理节点或工作节点的第二装置,该方法包括:采用通信协议接收所述第一装置发送的容器操作请求,进行容器操作;采用所述通信协议向所述第一装置发送容器操作响应。
第三方面,本公开实施例提供一种电子设备,包括:至少一个处理器;存储器,存储器上存储有至少一个程序,当所述至少一个程序被所述至少一个处理器执行时,实现上述任意一种容器引擎的实现方法。
第四方面,本公开实施例提供一种计算机可读存储介质,计算机可读存储介质上存储有计算机程序,所述计算机程序被处理器执行时实现上述任意一种容器引擎的实现方法。
第五方面,本公开实施例提供一种容器引擎,包括:第一装置和第二装置;所述第一装置设置在管理节点,所述第二装置设置在管理节点或工作节点;其中,所述第一装置包括容器引擎核心模块,容器引擎核心模块包括:容器管理子模块,被配置成向主端代理子模块发送容器操作请求;主端代理子模块,被配置成采用通信协议向所述第二装置的容器操作子模块发送容器操作请求;采用所述通信协议接收所述第二装置的容器操作子模块发送的容器操作响应;其中,所述第二装置包括:容器垫片模块和容器运行时模块;所述容器垫片模块包括:所述容器操作子模块,被配置成采用所述通信协议接收所述第一装置的主端代理子模块发送的容器操作请求,将所述容器操作请求发送给容器运行时模块;所述容器运行时模块,被配置成进行容器操作,向所述容器操作子模块发送容器操作响应;所述容器操作子模块还用于:采用所述通信协议向所述第一装置的主端代理子模块发送容器操作响应。
附图说明
图1为相关技术中容器引擎的结构示意图;
图2为本公开实施例提供的容器引擎的组成框图;
图3为本公开一个实施例提供的应用于管理节点的容器引擎的实现方法的流程图;
图4为本公开另一个实施例提供的应用于工作节点的容器引擎的实现方法的流程图。
具体实施方式
为使本领域的技术人员更好地理解本公开的技术方案,下面结合附图对本公开提供的容器引擎和容器引擎的实现方法、电子设备、计算机可读存储介质进行详细描述。
在下文中将参考附图更充分地描述示例实施例,但是所述示例实施例可以以不同形式来体现且不应当被解释为限于本文阐述的实施例。反之,提供这些实施例的目的在于使本公开透彻和完整,并将使本领域技术人员充分理解本公开的范围。
在不冲突的情况下,本公开各实施例及实施例中的各特征可相互组合。
如本文所使用的,术语“和/或”包括至少一个相关列举条目的任何和所有组合。
本文所使用的术语仅用于描述特定实施例,且不意欲限制本公开。如本文所使用的,单数形式“一个”和“该”也意欲包括复数形式,除非上下文另外清楚指出。还将理解的是,当本说明书中使用术语“包括”和/或“由……制成”时,指定存在所述特征、整体、步骤、操作、元件和/或组件,但不排除存在或添加至少一个其它特征、整体、步骤、操作、元件、组件和/或其群组。
除非另外限定,否则本文所用的所有术语(包括技术和科学术语)的含 义与本领域普通技术人员通常理解的含义相同。还将理解,诸如那些在常用字典中限定的那些术语应当被解释为具有与其在相关技术以及本公开的背景下的含义一致的含义,且将不解释为具有理想化或过度形式上的含义,除非本文明确如此限定。
在容器领域出现了以Docker、Containerd和CRI-O为首的容器引擎。这些容器引擎对外提供API和命令行,通过API和命令行提供容器镜像管理功能和容器生命期管理功能。目前业界应用广泛的容器引擎如Docker、Containerd和CRI-O从功能上可以划分为以下几大模块:容器引擎核心模块、容器垫片模块和容器运行时模块,如图1所示,容器引擎核心模块具体包括:API子模块、客户端子模块、容器管理子模块、容器镜像管理子模块、节点管理子模块和镜像存储子模块;容器垫片模块具体包括:输入输出转发子模块、容器资源回收子模块和容器操作子模块;容器运行时模块具体包括:开放容器标准(OCI,Open Container Initiative)运行时子模块或LXC(Linux Container)子模块。
下面描述各个子模块的功能。
API子模块负责对外部(如容器编排系统)提供容器引擎功能和服务软件接口子模块。
客户端子模块负责容器引擎提供的针对容器、镜像操作的命令行工具。
容器管理子模块负责对容器进行创建、运行、停止和删除等生命期状态的管理。
容器镜像管理子模块负责镜像状态、镜像之间的关系的管理。
节点管理子模块负责管理节点资源和安全状态等信息。
镜像存储子模块负责镜像的实际文件或设备的管理,以及针对镜像内容的读写。
输入输出转发子模块负责将外部的输入转发到容器内部,并将容器内部的输出转发给容器引擎。
容器资源回收子模块负责将死亡的容器消耗的系统资源进行回收。
容器操作子模块负责调用容器运行时模块直接对容器发起创建、运行、停止和删除、查看等操作。
OCI运行时子模块为满足OCI规范定义的容器运行时工具,负责在操作系统上执行创建、运行、停止和删除、查看容器等具体操作。
LXC子模块为开源Linux Contianer项目中提供,能在Linux上创建、运行、停止和删除、查看容器的工具或动态库。
容器引擎对容器编排系统提供API子模块或客户端子模块,容器编排系统(例如K8S(Kubernetes)、K3S等)使用API子模块或客户端子模块,指示容器引擎完成镜像创建、镜像删除、镜像查询、镜像导入、镜像导出、从仓库拉取镜像、推送镜像到仓库等镜像管理功能,以及容器创建、容器删除、容器启动、容器停止、容器暂停、容器恢复、容器状态查询等容器管理功能。当前容器引擎的实现中,将容器创建、容器删除、容器启动、容器停止、容器暂停、容器恢复等这些通过调用底层的操作系统来实现的功能集成到OCI运行时子模块或LXC子模块中;容器引擎内部维护一个容器生命期状态管理,容器操作则是容器操作子模块通过调用OCI运行时子模块或LXC子模块来完成;而为了处理容器内部进程的退出时刻的资源回收,中转容器内部进程的标准输入、标准输出和标准错误,容器引擎都设计了容器垫片模块。
K8S、K3S、Docker Swarm等主要容器编排系统的出现,使得在集群环境下,部署、升级容器更加便捷。如此形成了一套以容器编排系统为管理入口,容器引擎为工作实施单元的云计算集群。业务开发者可以将业务进程组以容器的形式通过容器编排系统迅速的部署到集群内部节点上。在这样的云计算集群中,各个物理设备(如服务器或单板等)根据其上承载的功能单元的不同分为管理节点和工作节点。管理节点往往是CPU、内存和存储资源比较充足的服务器或单板,管理节点上部署容器编排系统。工作节点一般是CPU、内存和存储资源比较紧张的服务器或单板设备。工作节点上部署容器编排代理和容器引擎,容器正是运行在容器引擎上。根据集群设计的可靠性、响应速率等指标,集群中可以部署一个或多个管理节点;根据集群的工作负载指标,集群中可以部署一个或多个工作节点。在 极端情况下存在管理节点和工作节点位于同一物理设备的情况。
在常规的云计算集群节点上,管理节点上部署容器编排系统的API,而在工作节点上部署容器编排系统的节点代理和容器引擎。当用户需要创建容器时,只需要发送指令给位于管理节点的容器编排系统的API,容器编排系统的API通过节点代理指示容器引擎完成实际的容器创建、启动和管理工作。但是工作节点上的容器引擎和容器编排系统的节点代理存在过度消耗工作节点的CPU和内存资源的问题。以开源Containerd引擎为例,创建和启动500个容器需要消耗300兆(M)字节的内存空间。这对于以嵌入式设备为工作节点的资源受限的集群来说是不可接受的,这点在物联网(IOT,Internet Of Things)集群领域尤为突出。如在工作节点上仅部署OCI运行时子模块或LXC子模块,那么需开发满足容器编排系统调用容器引擎所需适配模块,又存在开发工作量大,系统不稳定的问题。
图2为本公开实施例提供的容器引擎的组成框图。如图2所示,本公开实施例将容器引擎在集群上的部署结构进行改造,将容器引擎拆分为第一装置201和至少一个第二装置202,第一装置201和第二装置202是完全独立的。
其中,第一装置201和第二装置202之间为主从模式,如一主一从、一主多从等。具体的,第一装置201为主装置,设置在管理节点上,第二装置202为从装置,设置在工作节点上。在某些情况下,第一装置201和第二装置202可以同时设置在管理节点上,即管理节点同时也承担工作节点的功能。
其中,第一装置201和第二装置202之间可以采用总线技术、有线网络技术、无线网络技术中的任意一种链接。
其中,第一装置201包括:容器引擎核心模块2011,第二装置202包括:从端代理模块2021、容器垫片模块2022和容器运行时模块2023。
其中,容器引擎核心模块2011包括:API子模块、客户端子模块、容器管理子模块、容器镜像管理子模块和主端代理子模块。
在一些示例性实施例中,从端代理模块2021包括:通信子模块、镜 像存储子模块和节点管理子模块。在另一些示例性实施例中,从端代理模块2021包括:通信子模块和节点管理子模块,而镜像存储子模块作为一个独立模块。在另一些示例性实施例中,从端代理模块2021包括:通信子模块和镜像存储子模块,而节点管理子模块作为一个独立模块。在另一些示例性实施例中,从端代理模块2021包括:通信子模块,而镜像存储子模块作为一个独立模块,节点管理子模块也作为一个独立模块。
其中,容器垫片模块2022包括:输入输出转发子模块、容器资源回收子模块和容器操作子模块。
其中,容器运行时模块2023包括:OCI运行时子模块或LXC子模块。
在一些示例性实施例中,第一装置201采用远程过程调用协议(RPC,Remote Procedure Call Protocol)与第二装置202通信,也就是采用RPC调用第二装置202实现相应的功能。例如,主端代理子模块采用RPC与从端代理模块2021通信,也就是采用RPC调用从端代理模块2021实现相应的功能。
在一些示例性实施例中,当第一装置201和第二装置202同时设置在管理节点上时,第一装置201采用Unix套接字(Sock)或进程间通信(IPC,Inter-Process Communication)与第二装置202通信。例如,主端代理子模块采用Unix Sock或IPC与从端代理模块2021通信。
在一些示例性实施例中,第一装置201和第二装置202之间的通信建立采用C/S模型。例如第一装置201作为客户端,第二装置202作为服务端。这样,第二装置202启动后在第二装置202的地址和端口上进行监听,而第一装置201在上电后获取到第二装置202的地址和端口,根据第二装置202的地址和端口主动与第二装置202建立链接和注册。
在一些示例性实施例中,当镜像存储子模块作为一个独立模块时,从端代理模块2021和镜像存储子模块之间采用IPC进行通信。当镜像存储子模块作为从端代理模块2021的一个子模块时,镜像存储子模块与从端代理模块2021共用同一个进程,这样减少了第二装置202对进程资源的占用。
在一些示例性实施例中,当镜像存储子模块作为一个独立模块时,主端代理子模块采用RPC通过从端代理模块2021中转与镜像存储子模块间接通信。在另一些示例性实施例中,当镜像存储子模块作为一个独立模块时,主端代理子模块采用RPC与镜像存储子模块直接通信。
在一些示例性实施例中,当节点管理子模块作为一个独立模块时,从端代理模块2021和节点管理子模块之间采用IPC进行通信。当节点管理子模块作为从端代理模块2021的一个子模块时,节点管理子模块与从端代理模块2021共用同一个进程,这样减少了第二装置202对进程资源的占用。
在一些示例性实施例中,当节点管理子模块作为一个独立模块时,主端代理子模块采用RPC通过从端代理模块2021中转与节点管理子模块间接通信。在另一些示例性实施例中,当节点管理子模块作为一个独立模块时,主端代理子模块采用RPC与节点管理子模块直接通信。
在一些示例性实施例中,容器垫片模块2022、容器运行时模块2023、从端代理模块2021分别采用独立进程实现,容器垫片模块2022采用IPC与从端代理模块2021通信,容器运行时模块2023采用IPC与从端代理模块2021通信。
在一些示例性实施例中,主端代理子模块采用ttrpc与容器垫片模块2022直接通信,从而加快了容器操作的速度。其中,ttrpc是一个开源软件项目代号,开源软件项目例如低内存环境GRPC实现(GRPC for low-memory environments)。
在一些示例性实施例中,主端代理子模块采用RPC通过从端代理模块2021中转与容器垫片模块2022间接通信。
在一些示例性实施例中,容器垫片模块2022调用容器运行时模块2023实现容器操作,从而简化了从端代理模块2021。
上述容器引擎架构的改造,会导致的容器引擎的部分内部实现方法的变化,下面描述基于改造后的容器引擎的内部实现方法,需要说明的是,下面的方法描述并不是容器引擎的全部实现过程,而是与改造前的容器引 擎的内部实现方法不同的一些实现过程,所描述的实现方法不用于限定改造后的容器引擎的实现过程。
图3为本公开一个实施例提供的应用于管理节点的容器引擎的实现方法的流程图。
第一方面,参照图3,本公开一个实施例提供一种容器引擎的实现方法,应用于设置在管理节点的第一装置,该方法包括:
步骤300、采用通信协议向第二装置发送容器操作请求。
在一些示例性实施例中,通信协议包括以下任意一个:RPC、套接字、IPC。具体的,如果第一装置和第二装置同时设置在管理节点上,则采用的通信协议可以是套接字或IPC,如果第一装置设置在管理节点上,第二装置设置在工作节点上,则采用的通信协议可以是RPC。
在一些示例性实施例中,可以在接收到容器编排系统发送的API请求时,根据API请求所请求的内容采用通信协议向第二装置发送容器操作请求。如果API请求所请求的是容器操作,则可以直接采用通信协议向第二装置发送容器操作请求,以实现容器操作;也可以先采用通信协议向第二装置发送容器镜像操作请求,以实现容器镜像操作,再采用通信协议向第二装置发送容器操作请求,以实现容器操作。例如,创建容器时,需要先创建容器镜像,再创建容器,那么在需要创建容器时,可以先发送一个API请求,实现容器镜像的创建,再发送一个API请求,实现容器的创建,也可以仅发送一个API请求,实现容器镜像和容器的创建。
在一些示例性实施例中,可以通过在Unix套接字文件或指定网络端口监听API请求。
在一些示例性实施例中,容器操作包括以下至少之一:容器创建、容器删除、容器运行、容器停止、容器暂停、容器恢复、在容器中创建新进程、查询容器信息等。
在一些示例性实施例中,容器镜像操作包括以下至少之一:容器镜像创建、容器镜像删除、查询容器镜像信息、格式转换、创建容器读写层等。
步骤301、采用通信协议接收第二装置发送的容器操作响应。
在一些示例性实施例中,采用通信协议向第二装置发送容器操作请求之前,该方法还包括以下至少之一:
采用通信协议向第二装置发送节点状态查询请求,采用通信协议接收第二装置发送的节点状态查询响应;其中,节点状态查询响应包括:节点状态信息;
采用通信协议向第二装置发送第一节点资源申请请求,采用通信协议接收第二装置发送的第一节点资源申请响应;
采用通信协议向第二装置发送第二节点资源申请请求,采用通信协议接收第二装置发送的第二节点资源申请响应;
采用通信协议向第二装置发送容器镜像操作请求,采用通信协议接收第二装置发送的容器镜像操作响应。
在一些示例性实施例中,可以在接收到容器编排系统发送的API请求时,根据API请求所请求的内容采用通信协议向第二装置发送容器镜像操作请求。
在一些示例性实施例中,该方法还包括:
接收控制台类型参数,控制台类型参数用于指示标准输入、标准错误和标准输出的链接类型;
采用通信协议将控制台类型参数包含在容器创建请求或进程创建请求中发送给第二装置。
在一些示例性实施例中,标准输入、标准错误和标准输出的链接类型包括:将标准输入、标准错误和标准输出链接到指定控制台、将标准输入、标准错误和标准输出链接到指定文件、不作链接。
在一些示例性实施例中,控制台类型参数可以由容器编排系统或者其他外部系统发送给第一装置。
在一些示例性实施例中,在控制台类型参数用于指示将标准输入、标准错误和标准输出链接到指定控制台的情况下,该方法还包括:
采用通信协议将第一装置的端口包含在容器创建请求或进程创建请 求中发送给第二装置;
采用通信协议将容器的标准输入通过第一装置的端口发送给第二装置;
采用通信协议监听第一装置的端口以接收第二装置发送的容器的标准输出和标准错误,将容器的标准输出和标准错误输出到指定控制台。
在一些示例性实施例中,在控制台类型参数用于指示将标准输入、标准错误和标准输出链接到指定文件的情况下,该方法还包括:
采用通信协议将指定文件的文件名包含在容器创建请求或进程创建请求中发送给第二装置。
在一些示例性实施例中,第一装置在和第二装置之间采用C/S模型进行通信时,第一装置和第二装置需要建立链接,并且第一装置作为客户端时需要向第二装置注册。具体实现为,采用通信协议向第二装置发送容器操作请求之前,该方法还包括:根据预先配置的第二装置的地址和端口采用通信协议向第二装置发送链接建立请求,采用通信协议接收第二装置发送的链接建立响应,以完成链路的建立;采用通信协议向第二装置发送注册命令,采用通信协议接收第二装置发送的注册响应,以完成注册。
在一些示例性实施例中,第二装置的地址和端口可以预先在配置文件中配置。
如果第二装置为两个或两个以上,则配置文件中分别配置每一个第二装置的地址和端口,第一装置分别与每一个第二装置建立链接以及向每一个第二装置注册。
在一些示例性实施例中,采用通信协议接收第二装置发送的注册响应后,该方法还包括:采用通信协议周期性向第二装置发送保活消息,以实现健康检查机制。
在一些示例性实施例中,向第二装置发送第一节点资源申请请求之前,该方法还包括:
采用通信协议向第二装置发送容器垫片模块创建请求,采用通信协议 接收第二装置发送的容器垫片模块创建响应。
在一些示例性实施例中,容器垫片模块创建响应包括:容器垫片模块的端口。
图4为本公开另一个实施例提供的应用于工作节点的容器引擎的实现方法的流程图。
第二方面,参照图4,本公开另一个实施例提供一种容器引擎的实现方法,应用于设置在管理节点或工作节点的第二装置,该方法包括:
步骤400、采用通信协议接收第一装置发送的容器操作请求,进行容器操作。
在一些示例性实施例中,通信协议包括以下任意之一:RPC、套接字、IPC。具体的,如果第一装置和第二装置同时设置在管理节点上,则采用的通信协议可以是套接字或IPC,如果第一装置设置在管理节点上,第二装置设置在工作节点上,则采用的通信协议可以是RPC。
在一些示例性实施例中,容器操作包括以下至少之一:容器创建、容器删除、容器运行、容器停止、容器暂停、容器恢复、在容器中创建新进程、查询容器信息等。
步骤401、采用通信协议向第一装置发送容器操作响应。
在一些示例性实施例中,采用通信协议接收第一装置发送的容器操作请求之前,该方法还包括以下至少之一:
采用通信协议接收第一装置发送的节点状态查询请求,查询节点状态信息,采用通信协议向第一装置发送节点状态查询响应;其中,节点状态查询响应包括:节点状态信息;
采用通信协议接收第一装置发送的第一节点资源申请请求,为第一装置分配第一节点资源,采用通信协议向第一装置发送第一节点资源申请响应;
采用通信协议接收第一装置发送的第二节点资源申请请求,为第一装置分配第二节点资源,采用通信协议向第一装置发送第二节点资源申请响 应;
采用通信协议接收第一装置发送的容器镜像操作请求,进行容器镜像操作,采用通信协议向第一装置发送容器镜像操作响应。
在一些示例性实施例中,容器镜像操作包括以下至少之一:容器镜像创建、容器镜像删除、查询容器镜像信息、格式转换、创建容器读写层等。
在一些示例性实施例中,该方法还包括:
采用通信协议接收第一装置发送的控制台类型参数,控制台类型参数用于指示标准输入、标准错误和标准输出的链接类型。
在一些示例性实施例中,在控制台类型参数用于指示将标准输入、标准错误和标准输出链接到指定控制台的情况下,该方法还包括:
采用通信协议接收第一装置发送的第一装置的端口;
采用通信协议接收第一装置通过第一装置的端口发送的容器的标准输入,将容器的标准输入输入到容器中;
接收容器的标准输出和标准错误,采用通信协议将容器的标准输出和标准错误通过第一装置的端口发送给第一装置。
在一些示例性实施例中,在控制台类型参数用于指示将标准输入、标准错误和标准输出链接到指定文件的情况下,该方法还包括:
采用通信协议接收第一装置发送的指定文件的文件名;
创建文件名为接收到的指定文件的文件名的指定文件,将容器的标准输入和标准错误写入指定文件中。
在一些示例性实施例中,第一装置在和第二装置之间采用C/S模型进行通信时,第一装置和第二装置需要建立链接,并且第一装置作为客户端时需要向第二装置注册。具体实现为,采用通信协议接收第一装置发送的容器操作请求之前,该方法还包括:采用通信协议监听预先配置的第二装置的地址和端口以接收第一装置发送的链接建立请求,采用通信协议向第一装置发送链接建立响应,以完成链路的建立;采用通信协议接收第一装置发送的注册命令,执行注册命令,采用通信协议向第一装置发送注册响 应,以完成注册。
在一些示例性实施例中,第二装置的地址和端口可以预先配置。具体的配置方式不作限定,例如可以配置在配置文件中。
如果第二装置为两个或两个以上,则配置文件中分别配置每一个第二装置的地址和端口,第一装置分别与每一个第二装置建立链接以及向每一个第二装置注册。
在一些示例性实施例中,采用通信协议向第一装置发送注册响应后,该方法还包括:采用通信协议周期性接收第一装置发送的保活消息,以实现健康检查机制。
在一些示例性实施例中,接收第一装置发送的第一节点资源申请请求之前,该方法还包括:
采用通信协议接收第一装置发送的容器垫片模块创建请求,创建容器垫片模块,采用通信协议向第一装置发送容器垫片模块创建响应。
在一些示例性实施例中,容器垫片模块创建响应包括:容器垫片模块的端口。
第三方面,本公开另一个实施例提供一种电子设备,包括:至少一个处理器;存储器,存储器上存储有至少一个程序,当至少一个程序被至少一个处理器执行时,实现上述任意一种容器引擎的实现方法。
其中,处理器为具有数据处理能力的器件,其包括但不限于中央处理器(CPU)等;存储器为具有数据存储能力的器件,其包括但不限于随机存取存储器(RAM,更具体如SDRAM、DDR等)、只读存储器(ROM)、带电可擦可编程只读存储器(EEPROM)、闪存(FLASH)。
在一些实施例中,处理器、存储器通过总线相互连接,进而与计算设备的其它组件连接。
第四方面,本公开另一个实施例提供一种计算机可读存储介质,计算机可读存储介质上存储有计算机程序,计算机程序被处理器执行时实现上述任意一种容器引擎的实现方法。
如图2所示,第五方面,本公开另一个实施例提供一种容器引擎,包括:第一装置201和第二装置202;第一装置设置在管理节点,第二装置设置在管理节点或工作节点。
其中,第一装置包括容器引擎核心模块2011,容器引擎核心模块2011包括:容器管理子模块,被配置成向主端代理子模块发送容器操作请求;主端代理子模块,被配置成采用通信协议向第二装置的容器操作子模块发送容器操作请求;采用通信协议接收第二装置的容器操作子模块发送的容器操作响应。
其中,第二装置202包括:容器垫片模块2022和容器运行时模块2023;容器垫片模块2022包括:所述容器操作子模块,被配置成采用通信协议接收第一装置201的主端代理子模块发送的容器操作请求,将容器操作请求发送给容器运行时模块2023;容器运行时模块2023,被配置成进行容器操作,向容器操作子模块发送容器操作响应;容器操作子模块还被配置成:采用通信协议向第一装置201的主端代理子模块发送容器操作响应。
在一些示例性实施例中,主端代理子模块采用ttrpc与容器垫片模块2022直接通信,从而加快了容器操作的速度。
在另一些示例性实施例中,主端代理子模块采用RPC通过从端代理模块2021中转与容器垫片模块2022间接通信。这种情况下,第二装置202还包括:从端代理模块2021,从端代理模块2021包括:通信子模块,被配置成采用通信协议实现与主端代理子模块之间的通信。
在一些示例性实施例中,第一装置在和第二装置之间采用C/S模型进行通信时,第一装置和第二装置需要建立链接,并且第一装置作为客户端时需要向第二装置注册。具体实现为,主端代理子模块还被配置成:根据预先配置的从端代理模块2021的地址和端口采用通信协议向从端代理模块2021发送链接建立请求,采用通信协议接收从端代理模块2021发送的链接建立响应,以完成链路的建立;采用通信协议向从端代理模块2021发送注册命令,采用通信协议接收从端代理模块2021发送的注册响应,以完成注册。
第二装置202还包括:从端代理模块2021,被配置成采用通信协议监听预先配置的从端代理模块2021的地址和端口以接收主端代理子模块发送的链接建立请求,采用通信协议向主端代理子模块发送链接建立响应,以完成链路的建立;采用通信协议接收主端代理子模块发送的注册命令,执行注册命令,采用通信协议向主端代理子模块发送注册响应,以完成注册。
在一些示例性实施例中,从端代理模块2021的地址和端口可以预先在配置文件中配置。
如果第二装置为两个或两个以上,则配置文件中分别配置每一个第二装置的地址和端口,第一装置分别与每一个第二装置建立链接以及向每一个第二装置注册。
在一些示例性实施例中,主端代理子模块还被配置成:采用通信协议周期性向从端代理模块2021发送保活消息,以实现健康检查机制;从端代理模块2021还被配置成:采用通信协议周期性接收第一装置的主端代理子模块发送的保活消息,以实现健康检查机制。
在一些示例性实施例中,第一装置201的容器引擎核心模块2011还包括:API子模块,被配置成接收容器编排系统发送的API请求,根据API请求所请求的内容向容器管理子模块发送容器操作请求,或向容器镜像管理子模块发送容器镜像操作请求;容器镜像管理子模块,被配置成接收API子模块发送的容器镜像操作请求,采用通信协议向第二装置的镜像存储子模块发送容器镜像操作请求,采用通信协议接收第二装置的镜像存储子模块发送的容器镜像操作响应;容器管理子模块还被配置成:接收API子模块发送的容器操作请求,采用通信协议向第二装置的容器操作子模块发送容器操作请求,采用通信协议接收第二装置的容器操作子模块发送的容器操作响应;
第二装置202还包括从端代理模块2021,从端代理模块2021包括:镜像存储子模块,被配置成采用通信协议接收第一装置的容器镜像管理子模块发送的容器镜像操作请求,进行容器镜像操作,采用通信协议向第一装置的容器镜像管理子模块发送容器镜像操作响应;容器操作子模块还被 配置成:采用通信协议接收第一装置的容器管理子模块发送的容器操作请求,进行容器操作,采用通信协议向第一装置的容器管理子模块发送容器操作响应。
在一些示例性实施例中,容器管理子模块还被配置成:向主端代理子模块发送节点状态查询请求;主端代理子模块还被配置成:采用通信协议向第二装置的节点管理子模块发送节点状态查询请求,采用通信协议接收第二装置的节点管理子模块发送的节点状态查询响应,其中,节点状态查询响应包括:节点状态信息;将节点状态查询响应发送给容器管理子模块。
第二装置202还包括从端代理模块2021,从端代理模块2021包括:节点管理子模块,被配置成采用通信协议接收第一装置的主端代理子模块发送的节点状态查询请求,查询节点状态信息,采用通信协议向第一装置的主端代理子模块发送节点状态查询响应,其中,节点状态查询响应包括:节点状态信息。
在一些示例性实施例中,容器管理子模块还被配置成:向主端代理子模块发送第一节点资源申请请求;主端代理子模块还被配置成:采用通信协议向第二装置的节点管理子模块发送第一节点资源申请请求,采用通信协议接收第二装置的节点管理子模块发送的第一节点资源申请响应,将第一节点资源申请响应发送给容器管理子模块。
第二装置202还包括从端代理模块2021,从端代理模块2021包括:节点管理子模块,被配置成采用通信协议接收第一装置的主端代理子模块发送的第一节点资源申请请求,为第一装置分配第一节点资源,采用通信协议向第一装置的主端代理子模块发送第一节点资源申请响应。
在一些示例性实施例中,容器管理子模块还被配置成:向主端代理子模块发送第二节点资源申请请求;主端代理子模块还被配置成:采用通信协议向第二装置的节点管理子模块发送第二节点资源申请请求,采用通信协议接收第二装置的节点管理子模块发送的第二节点资源申请响应,将第二节点资源申请响应发送给容器管理子模块。
第二装置202还包括从端代理模块2021,从端代理模块2021包括: 节点管理子模块,被配置成采用通信协议接收第一装置的主端代理子模块发送的第二节点资源申请请求,为第一装置分配第二节点资源,采用通信协议向第一装置的主端代理子模块发送第二节点资源申请响应。
在一些示例性实施例中,容器引擎核心模块2011还包括:客户端子模块,被配置成接收控制台类型参数,控制台类型参数用于指示标准输入、标准错误和标准输出的链接类型,将控制台类型参数发送给容器管理子模块;容器管理子模块还被配置成:将控制台类型参数发送给主端代理子模块;主端代理子模块还用于:采用通信协议将控制台类型参数包含在容器创建请求或进程创建请求中发送给第二装置的输入输出转发子模块。
容器垫片模块2022还包括:输入输出转发子模块,被配置成接收控制台类型参数,将控制台类型参数发送给容器操作子模块。
在一些示例性实施例中,容器管理子模块还被配置成:在控制台类型参数用于指示将标准输入、标准错误和标准输出链接到指定控制台的情况下,将容器管理子模块的端口发送给主端代理子模块;主端代理子模块还被配置成:采用通信协议将容器管理子模块的端口包含在容器创建请求或进程创建请求中发送给第二装置的输入输出转发子模块;采用通信协议将容器的标准输入通过容器管理子模块的端口发送给第二装置的输入输出转发子模块;采用通信协议监听容器管理子模块的端口以接收第二装置的输入输出转发子模块发送的容器的标准输出和标准错误,将容器的标准输出和标准错误发送给容器管理子模块;容器管理子模块还被配置成:将容器的标准输出和标准错误输出到指定控制台。
输入输出转发子模块还被配置成:在控制台类型参数用于指示将标准输入、标准错误和标准输出链接到指定控制台的情况下,采用通信协议接收第一装置的主端代理子模块发送的容器管理子模块的端口;采用通信协议接收第一装置的主端代理子模块通过容器管理子模块的端口发送的容器的标准输入,将容器的标准输入发送给容器操作子模块;将容器的标准输出和标准错误通过容器管理子模块的端口发送给容器管理子模块。
容器操作子模块还被配置成:将容器的标准输入输入到容器中;接收容器的标准输出和标准错误,将容器的标准输出和标准错误发送给输入输 出转发子模块。
在一些示例性实施例中,容器管理子模块还被配置成:在控制台类型参数用于指示将标准输入、标准错误和标准输出链接到指定文件的情况下,将控制台类型参数发送给主端代理子模块;主端代理子模块还被配置成:采用通信协议将指定文件的文件名包含在容器创建请求或进程创建请求中发送给第二装置的输入输出转发子模块。
输入输出转发子模块还被配置成:在控制台类型参数用于指示将标准输入、标准错误和标准输出链接到指定文件的情况下,采用通信协议接收第一装置发送的指定文件的文件名;创建文件名为接收到的指定文件的文件名的指定文件,将指定文件的文件名发送给容器操作子模块;容器操作子模块还被配置成:将容器的标准输入和标准错误写入指定文件中。
本公开实施例提供的容器引擎,将容器引擎拆分为第一装置和第二装置来实现,第一装置设置在管理节点,第二装置设置在管理节点或工作节点,将容器引擎核心模块保留在第一装置中,不需要改变容器引擎编排系统对接容器引擎的方式,并且,容器垫片模块和容器运行时模块保留在第二装置中,由于容器垫片模块和容器运行时模块对资源消耗比较少,而容器引擎核心模块对资源消耗比较大,因此,本公开实施例在使用原有容器引擎编排系统对接容器引擎的同时,节省了工作节点的资源消耗。
在一些示例性实施例中,主端代理子模块还被配置成:采用通信协议向第二装置的通信子模块发送容器垫片模块创建请求,采用通信协议接收第二装置的通信子模块发送的容器垫片模块创建响应。
从端代理模块2021还包括:通信子模块,被配置成采用通信协议接收第一装置发送的容器垫片模块创建请求,创建容器垫片模块,采用通信协议向第一装置发送容器垫片模块创建响应。
本领域普通技术人员可以理解,上文中所公开方法中的全部或某些步骤、系统、装置中的功能模块/单元可以被实施为软件、固件、硬件及其适当的组合。在硬件实施方式中,在以上描述中提及的功能模块/单元之间的划分不一定对应于物理组件的划分;例如,一个物理组件可以具有多个功 能,或者一个功能或步骤可以由若干物理组件合作执行。某些物理组件或所有物理组件可以被实施为由处理器,如中央处理器、数字信号处理器或微处理器执行的软件,或者被实施为硬件,或者被实施为集成电路,如专用集成电路。这样的软件可以分布在计算机可读介质上,计算机可读介质可以包括计算机存储介质(或非暂时性介质)和通信介质(或暂时性介质)。如本领域普通技术人员公知的,术语计算机存储介质包括在用于存储信息(诸如计算机可读指令、数据结构、程序模块或其它数据)的任何方法或技术中实施的易失性和非易失性、可移除和不可移除介质。计算机存储介质包括但不限于RAM、ROM、EEPROM、闪存或其它存储器技术、CD-ROM、数字多功能盘(DVD)或其它光盘存储、磁盒、磁带、磁盘存储或其它磁存储器、或者可以用于存储期望的信息并且可以被计算机访问的任何其它的介质。此外,本领域普通技术人员公知的是,通信介质通常包含计算机可读指令、数据结构、程序模块或者诸如载波或其它传输机制之类的调制数据信号中的其它数据,并且可包括任何信息递送介质。
本文已经公开了示例实施例,并且虽然采用了具体术语,但它们仅用于并仅应当被解释为一般说明性含义,并且不用于限制的目的。在一些实例中,对本领域技术人员显而易见的是,除非另外明确指出,否则可单独使用与特定实施例相结合描述的特征、特性和/或元素,或可与其它实施例相结合描述的特征、特性和/或元件组合使用。因此,本领域技术人员将理解,在不脱离由所附的权利要求阐明的本公开的范围的情况下,可进行各种形式和细节上的改变。

Claims (22)

  1. 一种容器引擎的实现方法,应用于设置在管理节点的第一装置,该方法包括:
    采用通信协议向第二装置发送容器操作请求;
    采用所述通信协议接收所述第二装置发送的容器操作响应。
  2. 根据权利要求1所述的容器引擎的实现方法,所述采用通信协议向第二装置发送容器操作请求之前,该方法还包括以下至少之一:
    采用所述通信协议向所述第二装置发送节点状态查询请求,采用所述通信协议接收所述第二装置发送的节点状态查询响应,其中,所述节点状态查询响应包括:节点状态信息;
    采用所述通信协议向所述第二装置发送第一节点资源申请请求,采用所述通信协议接收所述第二装置发送的第一节点资源申请响应;
    采用所述通信协议向所述第二装置发送第二节点资源申请请求,采用所述通信协议接收所述第二装置发送的第二节点资源申请响应;或者
    采用所述通信协议向所述第二装置发送容器镜像操作请求,采用所述通信协议接收所述第二装置发送的容器镜像操作响应。
  3. 根据权利要求1所述的容器引擎的实现方法,该方法还包括:
    接收控制台类型参数,所述控制台类型参数用于指示标准输入、标准错误和标准输出的链接类型;
    采用所述通信协议将所述控制台类型参数包含在容器创建请求或进程创建请求中发送给所述第二装置。
  4. 根据权利要求3所述的容器引擎的实现方法,在所述控制台类型参数用于指示将所述标准输入、标准错误和标准输出链接到指定控制台的情 况下,该方法还包括:
    采用所述通信协议将所述第一装置的端口包含在所述容器创建请求或进程创建请求中发送给所述第二装置;
    采用所述通信协议将容器的标准输入通过所述第一装置的端口发送给所述第二装置;
    采用所述通信协议监听所述第一装置的端口以接收所述第二装置发送的容器的标准输出和标准错误,将所述容器的标准输出和标准错误输出到所述指定控制台。
  5. 根据权利要求3所述的容器引擎的实现方法,在所述控制台类型参数用于指示将所述标准输入、标准错误和标准输出链接到指定文件的情况下,该方法还包括:
    采用所述通信协议将所述指定文件的文件名包含在所述容器创建请求或进程创建请求中发送给所述第二装置。
  6. 根据权利要求1-5任意一项所述的容器引擎的实现方法,所述采用通信协议向第二装置发送容器操作请求之前,该方法还包括:
    根据预先配置的所述第二装置的地址和端口采用所述通信协议向所述第二装置发送链接建立请求,采用所述通信协议接收所述第二装置发送的链接建立响应;
    采用所述通信协议向所述第二装置发送注册命令,采用所述通信协议接收所述第二装置发送的注册响应。
  7. 根据权利要求1-5任意一项所述的容器引擎的实现方法,所述向第二装置发送第一节点资源申请请求之前,该方法还包括:
    采用所述通信协议向所述第二装置发送容器垫片模块创建请求,采用所述通信协议接收所述第二装置发送的容器垫片模块创建响应。
  8. 根据权利要求7所述的容器引擎的实现方法,其中,所述容器垫片模块创建响应包括:容器垫片模块的端口。
  9. 根据权利要求1-5任意一项所述的容器引擎的实现方法,其中,所述通信协议包括以下任意一个:远程过程调用协议RPC、套接字、进程间通信IPC。
  10. 一种容器引擎的实现方法,应用于设置在管理节点或工作节点的第二装置,该方法包括:
    采用通信协议接收所述第一装置发送的容器操作请求,进行容器操作;
    采用所述通信协议向所述第一装置发送容器操作响应。
  11. 根据权利要求10所述的容器引擎的实现方法,所述采用通信协议接收所述第一装置发送的容器操作请求之前,该方法还包括以下至少之一:
    采用所述通信协议接收所述第一装置发送的节点状态查询请求,查询节点状态信息,采用所述通信协议向所述第一装置发送节点状态查询响应;其中,所述节点状态查询响应包括:所述节点状态信息;
    采用所述通信协议接收第一装置发送的第一节点资源申请请求,为所述第一装置分配第一节点资源,采用所述通信协议向所述第一装置发送第一节点资源申请响应;
    采用所述通信协议接收所述第一装置发送的第二节点资源申请请求,为所述第一装置分配第二节点资源,采用所述通信协议向所述第一装置发送第二节点资源申请响应;或者
    采用所述通信协议接收所述第一装置发送的容器镜像操作请求,进行容器镜像操作,采用所述通信协议向所述第一装置发送容器镜像操作响应。
  12. 根据权利要求10所述的容器引擎的实现方法,该方法还包括:
    采用所述通信协议接收所述第一装置发送的控制台类型参数,所述控制台类型参数用于指示标准输入、标准错误和表征输出的链接类型。
  13. 根据权利要求12所述的容器引擎的实现方法,在所述控制台类型参数用于指示将所述标准输入、标准错误和标准输出链接到指定控制台的情况下,该方法还包括:
    采用所述通信协议接收所述第一装置发送的所述第一装置的端口;
    采用所述通信协议接收所述第一装置通过所述第一装置的端口发送的容器的标准输入,将所述容器的标准输入输入到所述容器中;
    接收容器的标准输出和标准错误,采用所述通信协议将所述容器的标准输出和标准错误通过所述第一装置的端口发送给所述第一装置。
  14. 根据权利要求12所述的容器引擎的实现方法,在所述控制台类型参数用于指示将所述标准输入、标准错误和标准输出链接到指定文件的情况下,该方法还包括:
    采用所述通信协议接收所述第一装置发送的所述指定文件的文件名;
    创建文件名为接收到的所述指定文件的文件名的所述指定文件,将容器的标准输入和标准错误写入所述指定文件中。
  15. 根据权利要求10-14任意一项所述的容器引擎的实现方法,所述采用通信协议接收所述第一装置发送的容器操作请求之前,该方法还包括:
    采用所述通信协议监听预先配置的所述第二装置的地址和端口以接收所述第一装置发送的链接建立请求,采用所述通信协议向所述第一装置发送链接建立响应;
    采用所述通信协议接收所述第一装置发送的注册命令,执行所述注册命令,采用所述通信协议向所述第一装置发送注册响应。
  16. 根据权利要求10-14任意一项所述的容器引擎的实现方法,所述接收第一装置发送的第一节点资源申请请求之前,该方法还包括:
    采用所述通信协议接收所述第一装置发送的容器垫片模块创建请求,创建容器垫片模块,采用所述通信协议向所述第一装置发送容器垫片模块创建响应。
  17. 根据权利要求16所述的容器引擎的实现方法,其中,所述容器垫片模块创建响应包括:容器垫片模块的端口。
  18. 根据权利要求10-14任意一项所述的容器引擎的实现方法,其中,所述通信协议包括以下任意之一:远程过程调用协议RPC、套接字、进程间通信IPC。
  19. 一种电子设备,包括:
    至少一个处理器;
    存储器,所述存储器上存储有至少一个程序,当所述至少一个程序被所述至少一个处理器执行时,实现权利要求1-9任意一项所述的容器引擎的实现方法,或权利要求10-18任意一项所述的容器引擎的实现方法。
  20. 一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机程序,所述计算机程序被处理器执行时实现权利要求1-9任意一项所述的容器引擎的实现方法,或权利要求10-18任意一项所述的容器引擎的实现方法。
  21. 一种容器引擎,包括:第一装置和第二装置;所述第一装置设置在管理节点,所述第二装置设置在管理节点或工作节点;
    其中,所述第一装置包括容器引擎核心模块,容器引擎核心模块包括:
    容器管理子模块,被配置成向主端代理子模块发送容器操作请求;
    主端代理子模块,被配置成采用通信协议向所述第二装置的容器操作子模块发送容器操作请求;采用所述通信协议接收所述第二装置的容器操作子模块发送的容器操作响应;
    其中,所述第二装置包括:容器垫片模块和容器运行时模块;
    所述容器垫片模块包括:所述容器操作子模块,被配置成采用所述通信协议接收所述第一装置的主端代理子模块发送的容器操作请求,将所述容器操作请求发送给容器运行时模块;
    所述容器运行时模块,被配置成进行容器操作,向所述容器操作子模块发送容器操作响应;
    所述容器操作子模块还被配置成:采用所述通信协议向所述第一装置的主端代理子模块发送容器操作响应。
  22. 根据权利要求21所述的容器引擎,其中,所述第一装置和所述第二装置之间采用总线技术、有线网络技术、无线网络技术中的任意一种链接。
PCT/CN2022/125913 2021-10-18 2022-10-18 容器引擎和容器引擎的实现方法、电子设备、存储介质 WO2023066245A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111212628.4 2021-10-18
CN202111212628.4A CN115994014A (zh) 2021-10-18 2021-10-18 容器引擎和容器引擎的实现方法、电子设备、存储介质

Publications (1)

Publication Number Publication Date
WO2023066245A1 true WO2023066245A1 (zh) 2023-04-27

Family

ID=85990641

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/125913 WO2023066245A1 (zh) 2021-10-18 2022-10-18 容器引擎和容器引擎的实现方法、电子设备、存储介质

Country Status (2)

Country Link
CN (1) CN115994014A (zh)
WO (1) WO2023066245A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117435510A (zh) * 2023-12-20 2024-01-23 深圳市智慧城市科技发展集团有限公司 自动化测试方法、终端设备及计算机可读存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107766157A (zh) * 2017-11-02 2018-03-06 山东浪潮云服务信息科技有限公司 基于国产cpu和os的分布式容器集群框架实现方法
CN109918198A (zh) * 2019-02-18 2019-06-21 中国空间技术研究院 一种基于用户特征预测的仿真云平台负载调度系统及方法
CN110851241A (zh) * 2019-11-20 2020-02-28 杭州安恒信息技术股份有限公司 Docker容器环境的安全防护方法、装置及系统
US20210133000A1 (en) * 2019-11-01 2021-05-06 Sap Portals Israel Ltd. Lightweight remote process execution

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107766157A (zh) * 2017-11-02 2018-03-06 山东浪潮云服务信息科技有限公司 基于国产cpu和os的分布式容器集群框架实现方法
CN109918198A (zh) * 2019-02-18 2019-06-21 中国空间技术研究院 一种基于用户特征预测的仿真云平台负载调度系统及方法
US20210133000A1 (en) * 2019-11-01 2021-05-06 Sap Portals Israel Ltd. Lightweight remote process execution
CN110851241A (zh) * 2019-11-20 2020-02-28 杭州安恒信息技术股份有限公司 Docker容器环境的安全防护方法、装置及系统

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117435510A (zh) * 2023-12-20 2024-01-23 深圳市智慧城市科技发展集团有限公司 自动化测试方法、终端设备及计算机可读存储介质
CN117435510B (zh) * 2023-12-20 2024-04-02 深圳市智慧城市科技发展集团有限公司 自动化测试方法、终端设备及计算机可读存储介质

Also Published As

Publication number Publication date
CN115994014A (zh) 2023-04-21

Similar Documents

Publication Publication Date Title
CN110462589B (zh) 本地装置协调器中的按需代码执行
CN109976667B (zh) 一种镜像管理方法、装置及系统
WO2017071460A1 (zh) 一种容器监控方法和装置
JP2020096357A (ja) コンテナオーケストレーションサービスを使用した動的ルーティング
CN113939805A (zh) 一种进程间通信的方法及系统
CN107959582B (zh) 一种切片实例的管理方法及装置
CN110352401B (zh) 具有按需代码执行能力的本地装置协调器
CN109766199B (zh) 一种机器人操作系统中的节点通信方法和装置
WO2022171083A1 (zh) 基于物联网设备的信息处理方法、相关设备及存储介质
WO2014101475A1 (zh) 云平台应用部署方法及装置
CN111787126B (zh) 容器创建方法、服务器及存储介质
US20210409346A1 (en) Metadata driven static determination of controller availability
JP5932981B2 (ja) アプリケーション起動フレームワーク
WO2020001162A1 (zh) 容器管理方法、装置和设备
CN114281263B (zh) 容器集群管理系统的存储资源处理方法、系统和设备
US20210092073A1 (en) Resource trees by management controller
WO2023066245A1 (zh) 容器引擎和容器引擎的实现方法、电子设备、存储介质
CN113382077B (zh) 微服务调度方法、装置、计算机设备和存储介质
CN113342554B (zh) Io多路复用方法、介质、设备和操作系统
CN112698930B (zh) 一种获取服务器标识的方法、装置、设备及介质
CN114328097A (zh) 一种文件监控方法、装置、电子设备和存储介质
US20230195695A1 (en) File Sharing Method and Terminal Device
US8442939B2 (en) File sharing method, computer system, and job scheduler
EP4318236A1 (en) Management method and system for computing node
CN114827177A (zh) 一种分布式文件系统的部署方法、装置及电子设备

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22882850

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 2022882850

Country of ref document: EP

ENP Entry into the national phase

Ref document number: 2022882850

Country of ref document: EP

Effective date: 20240508

NENP Non-entry into the national phase

Ref country code: DE