CN114489929A - Starting method and device of container group, electronic equipment and storage medium - Google Patents

Starting method and device of container group, electronic equipment and storage medium Download PDF

Info

Publication number
CN114489929A
CN114489929A CN202111593135.XA CN202111593135A CN114489929A CN 114489929 A CN114489929 A CN 114489929A CN 202111593135 A CN202111593135 A CN 202111593135A CN 114489929 A CN114489929 A CN 114489929A
Authority
CN
China
Prior art keywords
container
sandbox
service
pool
starting
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111593135.XA
Other languages
Chinese (zh)
Inventor
蔡岳阳
黄景平
段江南
刘秀华
彭世柱
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tianyi Cloud Technology Co Ltd
Original Assignee
Tianyi Cloud Technology Co Ltd
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 Tianyi Cloud Technology Co Ltd filed Critical Tianyi Cloud Technology Co Ltd
Priority to CN202111593135.XA priority Critical patent/CN114489929A/en
Publication of CN114489929A publication Critical patent/CN114489929A/en
Pending legal-status Critical Current

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
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45562Creating, deleting, cloning virtual machine instances
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45575Starting, stopping, suspending or resuming virtual machine instances
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45587Isolation or security of virtual machine instances
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45595Network integration; Enabling network access in virtual machine instances

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)

Abstract

The application discloses a starting method and device of a container group, electronic equipment and a storage medium, which belong to the technical field of containers, and the method comprises the following steps: the method comprises the steps of obtaining a starting instruction of a container group, wherein the starting instruction comprises starting information of the container group, obtaining a sandbox container based on the starting information and a locally stored sandbox container pool, obtaining a service container based on the starting information and the locally stored service container pool, and starting the service container after the sandbox container is started so as to start one container group. In this way, starting the container group by means of the pre-saved sandbox container pool and the service container pool can avoid creating the service container by pulling the mirror image, and therefore, the container group can be started quickly.

Description

Starting method and device of container group, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of container technologies, and in particular, to a method and an apparatus for starting a container group, an electronic device, and a storage medium.
Background
Kubernetes, which is used for managing a uniform resource pool formed by a plurality of machines, and provides a running environment for containerized application use on the basis of the uniform resource pool. The smallest unit of scheduling in kubernets is a group of containers (Pod), one Pod can load at least one container (container) inside.
In the related art, the Pod creation process is as follows: 1) receiving Yaml for creating Pod by a Kubernets ApiServer; 2) the Scheduler monitors the event of creating Pod, finds the most suitable Node through scheduling calculation and sets Pod. 3) And if the Kubelet on the corresponding Node finds that the Pod needs to be newly added, triggering the ADD event in the Handler to perform corresponding logic processing. At this time, SyncPod in the contiinerruntime completes the creation of the container entity in Pod, mainly calculating whether the Sandbox and the contiiner change, creating a Sandbox container, starting a service container, and the like. The start container includes the pull mirror, the configuration information of the production service container, the call container runtime API to create the container, start the container, and execute the post start hook. It follows that the process of creating a group of containers is very long.
Disclosure of Invention
The embodiment of the application provides a starting method and device of a container group, an electronic device and a storage medium, which are used for solving the problem that the creation time of the container group is long in the related art.
In a first aspect, an embodiment of the present application provides a method for starting a container group, including:
acquiring a starting instruction of a container group, wherein the starting instruction comprises starting information of the container group;
acquiring a sandbox container based on the starting information and a locally stored sandbox container pool;
acquiring a service container based on the starting information and a locally stored service container pool;
and after the sandbox container is started, starting the service container to start a container group.
In a second aspect, an embodiment of the present application provides an actuating device for a container group, including:
the instruction acquisition module is used for acquiring a starting instruction of the container group, wherein the starting instruction comprises starting information of the container group;
the sandbox container acquisition module is used for acquiring a sandbox container based on the starting information and a locally stored sandbox container pool;
a service container acquisition module, configured to acquire a service container based on the start information and a service container pool stored locally;
and the container starting module is used for starting the service container after the sandbox container is started so as to start a container group.
In a third aspect, an embodiment of the present application provides an electronic device, including: at least one processor, and a memory communicatively coupled to the at least one processor, wherein:
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method for starting a group of containers as described above.
In a fourth aspect, an embodiment of the present application provides a storage medium, where when instructions in the storage medium are executed by a processor of an electronic device, the electronic device is capable of executing the method for starting a container group.
In the embodiment of the application, a starting instruction of a container group is obtained, the starting instruction includes starting information of the container group, a sandbox container is obtained based on the starting information and a locally stored sandbox container pool, a service container is obtained based on the starting information and the locally stored service container pool, and after the sandbox container is started, the service container is started to start one container group. In this way, starting the container group by means of the pre-saved sandbox container pool and the service container pool can avoid creating the service container by pulling the mirror image, and therefore, the container group can be started quickly.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
FIG. 1 is a schematic diagram of a process for creating a container pool according to an embodiment of the present disclosure;
fig. 2 is a schematic flowchart of creating a container pool according to an embodiment of the present disclosure;
fig. 3 is a flowchart of a method for starting a container group according to an embodiment of the present application;
fig. 4 is a flowchart of a method for starting a container group according to another embodiment of the present application;
fig. 5 is a schematic structural diagram of an actuating device for a container group according to an embodiment of the present disclosure;
fig. 6 is a schematic hardware structure diagram of an electronic device for implementing a method for starting a container group according to an embodiment of the present application.
Detailed Description
In order to solve the problem that the creation time of a container group is relatively long in the related art, embodiments of the present application provide a method and an apparatus for starting a container group, an electronic device, and a storage medium.
The preferred embodiments of the present application will be described below with reference to the accompanying drawings of the specification, it should be understood that the preferred embodiments described herein are merely for illustrating and explaining the present application, and are not intended to limit the present application, and that the embodiments and features of the embodiments in the present application may be combined with each other without conflict.
To facilitate understanding of the present application, the present application refers to technical terms in which:
container, a technique for packaging software into standardized units for development, delivery, and deployment.
K8s, an open source platform for automated deployment, capacity expansion and operation and maintenance of container clusters. An application developer does not need to care about specific allocation and setting of basic resources such as a bottom CPU (Central processing Unit), a memory, a network and the like, but only needs to concentrate on describing a Deployment architecture of the containerized application, and submits the basic resources to Kubernets through an declarative Application Program Interface (API), and the Kubernets can use various resource objects such as Service, Deployment, Pod and the like to complete automatic Deployment according to the expectation of a user.
pod, the smallest dispatch unit of Kubernetes, can load at least one container inside one pod.
Sandbox containers (PodSandbox containers), often abbreviated PodSandbox, are used to provide a network stack for the service containers, one sandbox container for at least one service container. Before a business container is started, a sandbox container needs to be started. In the embodiment of the application, one sandbox container corresponds to one service container.
In some scenarios, such as function computation, the server completes the launch pod (including application container real-time creation), business processing, and response in one request of the client. The speed of the pod start-up in the related art is slow, so that the response time of the request which arrives at the same time is very long, and the response time becomes a pain point which affects the upper layer service.
Therefore, the embodiment of the application provides a method for starting a pod, so as to increase the starting speed of the pod. To achieve this, a pool of service containers may be established first. Fig. 1 is a schematic diagram of a process for creating a container pool according to an embodiment of the present disclosure, where a client may provide an ApiServer (deployed on a management node of kubernets) with a creation requirement of the container pool, that is, a Custom Resource (CR), a container pool controller (typically deployed on a service node of kubernets) may monitor the creation requirement of the container pool from the ApiServer, issue a container pool rule to a container pool agent (typically deployed on each service node of kubernets) based on the creation requirement of the container pool, and then each container pool agent locally creates a sandbox container pool poddsdboxpool and a service container pool based on the issued container pool rule.
Fig. 2 is a schematic flowchart of a process for creating a container pool according to an embodiment of the present application, where any containerPool receives a command to create a containerPool, initializes map < string, list > as a podscandbox pool, keys are app + version of CR, creates a podscandbox according to CR configuration rules, and places the podscandbox in the podscandbox pool, that is, vlue is an example of the podscandbox. Then, map < string, list > is initialized as provider pool, key is app + version of CR, according to the CR configuration rule, a service container is created, and the service container is put into the provider pool, that is, vlue is a service container instance.
Fig. 3 is a flowchart of a method for starting a container group according to an embodiment of the present application, where kubelet (generally deployed on each service node of Kubernetes) monitors a create pod, calls a running sandbox container (RunPodSandbox), CRI obtains a PodSandbox return from the PodSandbox port, and calls a create container (CreateContainer) to obtain a service container return from the container port.
Fig. 4 is a flowchart of a method for starting a container group according to an embodiment of the present application, including the following steps.
In step 401, a start instruction of a container group is obtained, and the start instruction includes start information of the container group.
The start information includes information such as what container is started, how many containers are started, and the like.
In step 402, a sandbox container is obtained based on the startup information and the locally stored pool of sandbox containers.
In order to be adaptive to a calling interface of an existing sandbox container of Kubernetes and reduce intrusion to the Kubernetes, a first calling request initiated to the sandbox container through a container runtime interface such as a running sandbox container (RunPodSandbox) can be intercepted, the first calling request comprises a starting requirement such as app and version, the starting requirement is determined according to starting information, then the sandbox container which is in an idle state and meets the starting requirement is obtained from a sandbox container pool, and the first calling request is responded based on an obtaining result of the sandbox container.
For example, when the sandbox container is successfully obtained, the first call request may be responded to based on the container identifier of the sandbox container; and when the sandbox container is not acquired successfully, executing the original corresponding flow of creating the sandbox container of the first calling request, and responding to the first calling request based on the container identifier of the sandbox container after the sandbox container is created successfully.
In step 403, a service container is obtained based on the start information and the locally stored service container pool.
Similarly, in order to be able to adapt to the call interface of the service container existing in kubernets and also in order to mitigate intrusion to kubernets, a second call request initiated to the service container through a container runtime interface, such as a create container (CreateContainer), may be intercepted, where the second call request includes a start requirement, and then, a service container in an idle state and meeting the start requirement is obtained from a service container pool, and then, based on an obtaining result of the service container, the second call request is responded.
For example, when the service container is successfully acquired, the second invocation request may be responded based on the container identifier of the service container; and when the service container is not successfully acquired, executing a process of creating the service container originally corresponding to the second calling request, and after the service container is successfully created, responding to the second calling request based on the container identifier of the service container.
In step 404, after the sandbox container is started, the service container is started to start a group of containers.
Typically, a network stack is provided after the sandbox container is started, by means of which the service container can be successfully started, thereby successfully starting a group of containers.
In step 405, a remove instruction for a container group is fetched.
In step 406, the sandbox container is released.
Similarly, to be able to adapt to the removal interface of kubernets' existing sandbox containers, and also to mitigate intrusions into kubernets, a first removal request initiated on a sandbox container through a container runtime interface, such as a remove sandbox container (removepod sandbox), may be intercepted, released based on the first removal request, and responded to based on the release results of the sandbox container. Releasing the sandbox container may be operations of releasing resources occupied by the sandbox container, updating the state of the sandbox container to an available state, and the like.
In step 407, the service container is released.
Similarly, in order to be able to adapt to the removal interface of the service container already existing in kubernets, and also in order to mitigate intrusions into kubernets, a second removal request initiated on the service container through a container runtime interface, such as a removal service container (RemoveContainer), may be intercepted, the service container released based on the second removal request, and the second removal request responded based on the result of the release of the service container. Releasing the service container may be releasing a resource occupied by the service container, updating a state of the service container to an available state, and the like.
In addition, in specific implementation, the sandbox container pool and the business container pool can be managed according to the following steps:
if a container adding instruction is received, adding a new sandbox container in the sandbox container pool, and adding a new business container in the business container pool;
if a container removal instruction is received, removing the corresponding sandbox container from the sandbox container pool, and removing the corresponding business container from the business container pool;
if a container updating instruction is received, updating a service container corresponding to the service container pool, or updating a sandbox container corresponding to the sandbox container pool and updating a service container corresponding to the service container pool;
and if the container checking instruction is received, acquiring sandbox container information of the sandbox container pool, acquiring service container information of the service container pool, and responding to the container checking instruction based on the sandbox container information and the service container information.
The application provides a method for rapidly starting a Pod, which can be used for modifying real-time creation of a container into pre-creation in a scene such as real-time creation of a service container and completion of service processing so as to rapidly start the Pod, thereby greatly reducing the response time of a client request.
The following describes a container group starting method provided in the embodiments of the present application with reference to specific embodiments.
The core steps of the present application include Container pool processing and Container Runtime Interface (CRI) processing. Wherein, the containment pool processing is realized by a set of CS framework for managing the containment pool. The Server is used as a control surface to maintain the configuration of the container pool and send the configuration to the Client, and the Client receives the configuration and completes the actual maintenance of the container pool. CRI processing, using a new CRI to access Kubelet (deployed on each service node), and taking out and returning container from container pool by implementing the CRI to execute the command of Kubelet, thereby completing container start.
The method mainly comprises the following steps:
1. and the component can be deployed in a Deployment mode and is responsible for managing container pool rules.
As a Server implemented based on the gRPC, the containerPoolController can list (list) and monitor (watch) the custom resource (ContainerPoolRule CR) of the container pool rule after starting, and wait for the container pool agent (containerPoolAgent) to initiate a connection establishment request. After the connection with the contianerpoolagent is established, the contianerpoolcontroller can aggregate the conteinerepoolrule CR meeting the condition according to the node information of the node where the contianerpoolagent is submitted, and issue the aggregated conteinerepoolrule CR to the contianerpoolagent. Meanwhile, the contiiner poilcontroller may issue the event of changing contiiner poilcolrule CR from the watch to the contiiner poilcolvent through the duplex channel.
2. And realizing the contianerpoolagent, wherein the component can be deployed in a DaemonSet mode and is responsible for establishing with a contianerpoolController and receiving the instruction issued by the contianerpoolController.
a. For the containererpoolrule CR add instruction.
The contianerpoolagent forms a Key according to the app and the version, and initializes two empty lists as values, one is placed in the contianer pool map, and the other is placed in the podscanbox pool map, that is, the keys in the contianer pool map and the podscanbox pool map are both the app and the version. And then, creating a podSandpox and a service container according to the containerPoolRule CR, and respectively adding the podSandpox and the service container into the two lists, namely, the continer instance (namely, a service container example) is stored in the list of the continer pool map, and the podsandbox instance (namely, a sandbox container example) is stored in the list of the podsandbox pool map.
b. For the ContainerPoolRule CR delete instruction.
The container pool agent forms a Key according to the app and the version, and based on the Key, corresponding service containers and sandbox containers are removed from the container pool map and the podscanbox pool map respectively.
c. For the ContainerPoolRule CR update instruction.
The contianerpoolagent respectively obtains list from contianer pool map and podscanbox pool map according to Key formed by app and version, and changes the number and/or configuration of contiaes according to the number of configuration change podSandbox.
d. For the ContainerPoolRule CR query instruction.
Respectively obtaining list from the container pool map and the podscanbox pool map, and returning the actual situation.
3. Implementation of specific container runtime CRI for interaction with Kubelet, mainly related to runpod sandbox, CreateContainer, removepod sandbox and RemoveContainer.
Generally, when creating a pod, the following steps a and b are performed.
a. When a running sandbox container (RunPodSandbox) is called by a Kubelet, acquiring apps and version through a label (Labels) in a configuration file (RunPodSandbox request. config) requested by the running sandbox container, acquiring a PodSandbox from a podscandbox pool map according to the apps and the version, marking the PodSandbox as used if the PodSandbox is acquired, and then constructing a running sandbox container response (RunPodSandbox response) by using the container identification of the PodSandbox and returning; if the PodSandbox is not acquired, calling an actual PodSandbox creating flow in the container runtime, and putting the created PodSandbox into a PodSandbox pool map.
b. When a Kubelet calls a create container (CreateContainer), acquiring app and version through Labels in a configuration file (CreateContainerRequest. Config.) of a create container request, acquiring a container (service container) from a container pool map according to the app and version, marking the container as used if the container is acquired, and then constructing a create container response (CreateContainerResponentresponse) by using a container identifier of the container and returning; and if the container is not acquired, calling an actual container creating flow during the container operation, and putting the created container into a container pool map.
Generally, upon removing a pod, the following steps c and d are performed.
c. When the Kubelet calls to remove a sandbox container (RemovePodSandbox), a PodSandbox Id is obtained by a remove sandbox container request (RemovePodSandbox request), then a sandbox, an app and a version are obtained by the PodSandbox Id, the sandbox is placed back into the podscanbox pool according to the app and the version, and finally a remove sandbox container response (RemovePodSandbox response) is returned.
d. When the Kubelet calls to remove the service container (removecontainerer), acquiring the ContainerId through a remove service container request (RemoveContainerRequest), then acquiring the container, the app and the version through the ContainerId, putting the container back into the container pool according to the app and the version, and finally returning a remove service container response (RemoveContainerResponse).
In the embodiment of the application, the cached container pool can be generated according to the strategy customization, for example, the number of the caches, the strategy of the caches, and the like, the generation mode of the container pool is flexible, and the container is created in advance and cached in the container pool, so that the mirror image is prevented from being pulled and the container is prevented from being created in real time, the time consumption is shortened, and therefore, the pod can be created quickly. In addition, the CRI of the original container can be butted by the new CRI, and the excessive invasion of the original logic is avoided.
In particular, kubernets may be used in conjunction with a knative framework, and the start-up procedure of a pod will be described below with the combination of the two.
1) Preparing 5 virtual machines configured as a 16G memory and an 8-core CPU, deploying a Kubernets cluster with high availability (3 management nodes and 2 service nodes), and deploying components such as a container PoolController, a container PoolAgent and a ktative (deployed on each service node) on the Kubernets cluster. The contierpoolcontroller completes initialization and monitors the port, and after the contierpoolagent is started, the connection is established through the service of the contierpoolcontroller.
2) A ContainerPoolRule CR is written and submitted to the API Server.
3) The containerPoolController monitors the ContainerPoolRule CR, converts the ContainerPoolRule CR into an internal instruction and sends the internal instruction to the containerPoolAgent on each node.
4) After the contianerpoolagent on each node receives the instruction, the local podscanbox and contianer spots are initialized. And the actually created container can be viewed through the ps command of the container runtime.
5) The ksvc CR is written and submitted to the API Server, and the API Server processes the ksvc CR to obtain a uniform resource locator (ulr).
6) The client initiates a request through url, and then the client triggers a knetive to call Kubernets to create pod.
When the method provided in the embodiments of the present application is implemented in software or hardware or a combination of software and hardware, a plurality of functional modules may be included in the electronic device, and each functional module may include software, hardware or a combination of software and hardware.
Based on the same technical concept, embodiments of the present application further provide a starting device for a container group, where the principle of the starting device for a container group to solve the problem is similar to the starting method for a container group, so that the implementation of the starting device for a container group can refer to the implementation of the starting method for a container group, and repeated details are not repeated.
Fig. 5 is a schematic structural diagram of a starting apparatus for a container group according to an embodiment of the present disclosure, including an instruction obtaining module 501, a sandbox container obtaining module 502, a service container obtaining module 503, and a container starting module 504.
An instruction obtaining module 501, configured to obtain a start instruction of a container group, where the start instruction includes start information of the container group;
a sandbox container acquiring module 502, configured to acquire a sandbox container based on the start information and a locally stored sandbox container pool;
a service container obtaining module 503, configured to obtain a service container based on the start information and a service container pool stored locally;
a container starting module 504, configured to start the service container after the sandbox container is started, so as to start a container group.
In some embodiments, the sandbox container acquisition module 502 is specifically configured to:
intercepting a first call request initiated to a sandbox container through a container runtime interface, wherein the first call request comprises a starting requirement, and the starting requirement is determined according to the starting information;
obtaining a sandbox container which is in an idle state and meets the starting requirement from the sandbox container pool;
and responding to the first calling request based on the acquisition result of the sandbox container.
In some embodiments, the service container acquiring module 503 is specifically configured to:
intercepting a second calling request initiated to a service container through a container runtime interface, wherein the second calling request comprises the starting requirement;
acquiring a service container which is in an idle state and meets the starting requirement from the service container pool;
and responding to the second calling request based on the acquisition result of the service container.
In some embodiments, a sandbox container release module 505 and a business container release module 506 are also included:
the instruction obtaining module 501 is further configured to obtain a removal instruction of a container group after a container group is started;
the sandbox container releasing module 505 is configured to release the sandbox container;
the service container releasing module 506 is configured to release the service container.
In some embodiments, the sandbox container release module 505 is specifically configured to:
intercepting a first removal request initiated on the sandbox container through a container runtime interface;
releasing the sandbox container based on the first removal request;
responding to the first removal request based on a result of the release of the sandbox container;
in some embodiments, the service container releasing module 506 is specifically configured to:
intercepting a second removal request initiated to the service container through a container runtime interface;
releasing the service container based on the second removal request;
responding to the second removal request based on a release result of the service container.
In some embodiments, a container management module 507 is further included for managing the sandbox container pool and the business container pool according to the following steps:
if a container adding instruction is received, adding a new sandbox container in the sandbox container pool, and adding a new service container in the service container pool;
if a container removal instruction is received, removing the corresponding sandbox container from the sandbox container pool, and removing the corresponding service container from the service container pool;
if a container updating instruction is received, updating a service container corresponding to the service container pool, or updating a sandbox container corresponding to the sandbox container pool and updating a service container corresponding to the service container pool;
and if a container checking instruction is received, acquiring sandbox container information of the sandbox container pool, acquiring service container information of the service container pool, and responding to the container checking instruction based on the sandbox container information and the service container information.
The division of the modules in the embodiments of the present application is schematic, and only one logic function division is provided, and in actual implementation, there may be another division manner, and in addition, each function module in each embodiment of the present application may be integrated in one processor, may also exist alone physically, or may also be integrated in one module by two or more modules. The coupling of the various modules to each other may be through interfaces that are typically electrical communication interfaces, but mechanical or other forms of interfaces are not excluded. Thus, modules described as separate components may or may not be physically separate, may be located in one place, or may be distributed in different locations on the same or different devices. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode.
Having described the comparative learning method and apparatus of the exemplary embodiments of the present application, an electronic device according to another exemplary embodiment of the present application is next described.
An electronic device 130 implemented according to this embodiment of the present application is described below with reference to fig. 6. The electronic device 130 shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present application.
As shown in fig. 6, the electronic device 130 is represented in the form of a general electronic device. The components of the electronic device 130 may include, but are not limited to: the at least one processor 131, the at least one memory 132, and a bus 133 that connects the various system components (including the memory 132 and the processor 131).
Bus 133 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, a processor, or a local bus using any of a variety of bus architectures.
The memory 132 may include readable media in the form of volatile memory, such as Random Access Memory (RAM)1321 and/or cache memory 1322, and may further include Read Only Memory (ROM) 1323.
Memory 132 may also include a program/utility 1325 having a set (at least one) of program modules 1324, such program modules 1324 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may comprise an implementation of a network environment.
The electronic device 130 may also communicate with one or more external devices 134 (e.g., keyboard, pointing device, etc.), with one or more devices that enable a user to interact with the electronic device 130, and/or with any devices (e.g., router, modem, etc.) that enable the electronic device 130 to communicate with one or more other electronic devices. Such communication may occur through input/output (I/O) interfaces 135. Also, the electronic device 130 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the internet) via the network adapter 136. As shown, network adapter 136 communicates with other modules for electronic device 130 over bus 133. It should be understood that although not shown in the figures, other hardware and/or software modules may be used in conjunction with electronic device 130, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
In an exemplary embodiment, a computer-readable storage medium comprising instructions, such as the memory 132 comprising instructions, executable by the processor 131 to perform the contrast learning method described above is also provided. Alternatively, the storage medium may be a non-transitory computer readable storage medium, which may be, for example, a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
In an example embodiment, an electronic device of the present application may include at least one processor, and at least one memory. Wherein the memory stores program code which, when executed by the processor, causes the processor to perform the steps of any of the exemplary methods provided herein.
In an exemplary embodiment, a computer program product is also provided, which, when executed by an electronic device, enables the electronic device to implement any of the exemplary methods provided herein.
Also, a computer program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable Disk, a hard Disk, a RAM, a ROM, an Erasable Programmable Read-Only Memory (EPROM), a flash Memory, an optical fiber, a Compact Disk Read-Only Memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The program product for start-up of a group of containers in an embodiment of the application may be a CD-ROM and comprise program code and may be run on a computing device. However, the program product of the present application is not limited thereto, and in this document, a readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A readable signal medium may include a propagated data signal with readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A readable signal medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, Radio Frequency (RF), etc., or any suitable combination of the foregoing.
Program code for carrying out operations of the present application may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server. In situations involving remote computing devices, the remote computing devices may be connected to the user computing device over any kind of Network, such as a Local Area Network (LAN) or Wide Area Network (WAN), or may be connected to external computing devices (e.g., over the internet using an internet service provider).
It should be noted that although several units or sub-units of the apparatus are mentioned in the above detailed description, such division is merely exemplary and not mandatory. Indeed, the features and functions of two or more of the units described above may be embodied in one unit, according to embodiments of the application. Conversely, the features and functions of one unit described above may be further divided into embodiments by a plurality of units.
Further, while the operations of the methods of the present application are depicted in the drawings in a particular order, this does not require or imply that these operations must be performed in this particular order, or that all of the illustrated operations must be performed, to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step execution, and/or one step broken down into multiple step executions.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While the preferred embodiments of the present application have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all alterations and modifications as fall within the scope of the application.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present application without departing from the spirit and scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include such modifications and variations as well.

Claims (10)

1. A method for starting a group of containers, comprising:
acquiring a starting instruction of a container group, wherein the starting instruction comprises starting information of the container group;
acquiring a sandbox container based on the starting information and a locally stored sandbox container pool;
acquiring a service container based on the starting information and a locally stored service container pool;
and after the sandbox container is started, starting the service container to start a container group.
2. The method of claim 1, wherein obtaining a sandbox container based on the startup information and a pool of locally stored sandbox containers comprises:
intercepting a first call request initiated to a sandbox container through a container runtime interface, wherein the first call request comprises a starting requirement, and the starting requirement is determined according to the starting information;
obtaining a sandbox container which is in an idle state and meets the starting requirement from the sandbox container pool;
and responding to the first calling request based on the acquisition result of the sandbox container.
3. The method of claim 2, wherein obtaining a service container based on the startup information and a locally stored service container pool comprises:
intercepting a second calling request initiated to a service container through a container runtime interface, wherein the second calling request comprises the starting requirement;
acquiring a service container which is in an idle state and meets the starting requirement from the service container pool;
and responding to the second calling request based on the acquisition result of the service container.
4. The method of claim 1, after initiating a group of containers, further comprising:
acquiring a removal instruction of the container group;
releasing the sandbox container;
and releasing the service container.
5. The method of claim 4, wherein releasing the sandbox container comprises:
intercepting a first removal request initiated on the sandbox container through a container runtime interface;
releasing the sandbox container based on the first removal request;
responding to the first removal request based on a result of the release of the sandbox container.
6. The method of claim 5, wherein releasing the traffic container comprises:
intercepting a second removal request initiated to the service container through a container runtime interface;
releasing the service container based on the second removal request;
responding to the second removal request based on a release result of the service container.
7. The method of claim 1, wherein the sandbox container pool and the business container pool are managed according to the following steps:
if a container adding instruction is received, adding a new sandbox container in the sandbox container pool, and adding a new service container in the service container pool;
if a container removal instruction is received, removing the corresponding sandbox container from the sandbox container pool, and removing the corresponding service container from the service container pool;
if a container updating instruction is received, updating a service container corresponding to the service container pool, or updating a sandbox container corresponding to the sandbox container pool and updating a service container corresponding to the service container pool;
and if a container checking instruction is received, acquiring sandbox container information of the sandbox container pool, acquiring service container information of the service container pool, and responding to the container checking instruction based on the sandbox container information and the service container information.
8. An apparatus for actuating a group of containers, comprising:
the instruction acquisition module is used for acquiring a starting instruction of the container group, wherein the starting instruction comprises starting information of the container group;
the sandbox container acquisition module is used for acquiring a sandbox container based on the starting information and a locally stored sandbox container pool;
a service container acquisition module, configured to acquire a service container based on the start information and a service container pool stored locally;
and the container starting module is used for starting the business container after the sandbox container is started so as to start a container group.
9. An electronic device, comprising: at least one processor, and a memory communicatively coupled to the at least one processor, wherein:
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-8.
10. A storage medium, wherein instructions in the storage medium, when executed by a processor of an electronic device, enable the electronic device to perform the method of any of claims 1-8.
CN202111593135.XA 2021-12-23 2021-12-23 Starting method and device of container group, electronic equipment and storage medium Pending CN114489929A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111593135.XA CN114489929A (en) 2021-12-23 2021-12-23 Starting method and device of container group, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111593135.XA CN114489929A (en) 2021-12-23 2021-12-23 Starting method and device of container group, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114489929A true CN114489929A (en) 2022-05-13

Family

ID=81493589

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111593135.XA Pending CN114489929A (en) 2021-12-23 2021-12-23 Starting method and device of container group, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114489929A (en)

Similar Documents

Publication Publication Date Title
US20200052982A1 (en) In situ triggered function as a service within a service mesh
CN111026430A (en) Method and system for flexible node composition on local or distributed computer system
WO2024077885A1 (en) Management method, apparatus and device for container cluster, and non-volatile readable storage medium
US11093279B2 (en) Resources provisioning based on a set of discrete configurations
CN111262908A (en) Task construction method and system based on jenkins
CN110609755A (en) Message processing method, device, equipment and medium for cross-block chain node
CN115686805A (en) GPU resource sharing method and device, and GPU resource sharing scheduling method and device
CN110659104B (en) Service monitoring method and related equipment
CN115248692A (en) Device and method for supporting cloud deployment of multiple deep learning framework models
CN114489954A (en) Tenant creation method based on virtualization platform, tenant access method and equipment
CN109343970B (en) Application program-based operation method and device, electronic equipment and computer medium
CN114490062A (en) Local disk scheduling method and device, electronic equipment and storage medium
CN114546648A (en) Task processing method and task processing platform
CN115543393B (en) Upgrade method, electronic device and storage medium
CN115361382B (en) Data processing method, device, equipment and storage medium based on data group
CN114489929A (en) Starting method and device of container group, electronic equipment and storage medium
US11422861B2 (en) Data processing method and computer device
CN116149701A (en) Online software upgrading method and system for edge terminal
CN116166413A (en) Lifecycle management for workloads on heterogeneous infrastructure
CN112306625B (en) Method and related device for deploying virtual machine
CN115686813A (en) Resource scheduling method and device, electronic equipment and storage medium
CN112448833B (en) Multi-management-domain communication method and device
CN112905273A (en) Service calling method and device
CN113312429B (en) Intelligent contract management system, method, medium, and article in a blockchain
CN112732400A (en) VNF management method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination