Method and apparatus for controlling state of pipeline task

文档序号:1952199 发布日期:2021-12-10 浏览:22次 中文

阅读说明:本技术 用于控制流水线任务的状态的方法和装置 (Method and apparatus for controlling state of pipeline task ) 是由 韩相元 姜鲁 乔杰 白雄雄 于 2021-01-25 设计创作,主要内容包括:本公开的实施例公开了用于控制流水线任务的状态的方法和装置。该方法的一具体实施方式包括:接收用于指示修改流水线任务的当前状态的状态修改请求;按照状态修改请求,修改运行流水线任务的容器的当前状态。该实施方式实现了对流水线任务的状态的灵活控制。(Embodiments of the present disclosure disclose methods and apparatus for controlling the state of pipelined tasks. One embodiment of the method comprises: receiving a state modification request indicating a modification of a current state of the pipelined task; and modifying the current state of the container running the pipeline task according to the state modification request. This embodiment enables flexible control of the state of pipeline tasks.)

1. A method for controlling the state of a pipelined task, comprising:

receiving a state modification request indicating a modification of a current state of the pipelined task;

and modifying the current state of the container running the pipeline task according to the state modification request.

2. The method of claim 1, wherein the state modification request is to indicate a suspension or resumption of execution of the pipeline task.

3. The method of claim 1, wherein the modify state request includes a task identification for identifying the pipeline task; and

modifying the current state of the container running the pipeline task according to the state modification request, wherein the modifying comprises the following steps:

determining a container for running the pipeline task according to the task identifier;

and modifying the current state of the container according to the state modification request.

4. The method of claim 3, wherein said modifying a current state of a container running said pipelined task in accordance with said state modification request further comprises:

determining an electronic device operating the container;

and controlling the electronic equipment to modify the current state of the container according to the state modification request.

5. The method of claim 4, wherein said controlling said electronic device to modify a current state of said container in accordance with said state modification request comprises:

and sending a state control instruction to the electronic equipment, wherein the state control instruction is used for controlling the electronic equipment to modify the current state of the container according to the state modification request.

6. The method of claim 5, wherein the method further comprises:

receiving feedback information aiming at the state control instruction and sending the feedback information, wherein the feedback information is used for indicating an execution result of the state control instruction.

7. A system for controlling the state of a pipeline task comprises a client and a server, wherein the server comprises a master server and at least one slave server;

the client is used for sending a state modification request for indicating the current state of the pipeline task to be modified to the main server;

the master server is used for determining a container for running the pipeline task and a slave server for running the container according to the state modification request; and sending a state control instruction to the determined slave server, wherein the state control instruction is used for controlling the determined slave server to modify the current state of the container according to the state modification request.

8. The system of claim 7, wherein the slave server running the container is configured to send feedback information for the state control instruction to the master server, wherein the feedback information is used to indicate an execution result of the state control instruction;

the main server is used for sending the feedback information to the client;

and the client is used for generating prompt information corresponding to the feedback information.

9. An apparatus for controlling the state of a pipelined task, comprising:

a receiving unit configured to receive a state modification request indicating a modification of a current state of the pipeline task;

a modification unit configured to modify a current state of a container running the pipeline task according to the state modification request.

10. A server, comprising:

one or more processors;

a storage device having one or more programs stored thereon;

when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-6.

11. A computer-readable medium, on which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1-6.

Technical Field

Embodiments of the present disclosure relate to the field of computer technologies, and in particular, to a method and apparatus for controlling a state of a pipeline task.

Background

Pipeline (pipeline) is a suite of officially offered plug-ins that can be used to implement and integrate continuous delivery in jenkins. The user can define the corresponding pipeline task according to the requirement. For example, a user may define a step of a Continuous Integration (CI) or Continuous Delivery (CD) process, such that defined pipeline tasks may be performed instead of manually performing CI or CD.

Many task deployments or configurations can be automatically realized by using pipeline, and various task processing efficiencies are improved. For example, it can be used for continuous, automatic building or testing of software projects, monitoring the execution of external tasks, assisting in the orchestration and distribution of services, and so forth.

Disclosure of Invention

Embodiments of the present disclosure propose methods and apparatuses for controlling the state of pipelined tasks.

In a first aspect, an embodiment of the present disclosure provides a method for controlling a state of a pipeline task, the method including: receiving a state modification request indicating a modification of a current state of the pipelined task; and modifying the current state of the container running the pipeline task according to the state modification request.

In a second aspect, an embodiment of the present disclosure provides a system for controlling a state of a pipeline task, including a client and a server, where the server includes a master server and at least one slave server; the client is used for sending a state modification request for indicating the current state of the pipeline task to be modified to the main server; the main server is used for determining a container for running the pipeline task and a slave server for running the container according to the state modification request; and sending a state control instruction to the determined slave server, wherein the state control instruction is used for controlling the determined slave server to modify the current state of the container according to the state modification request.

In a third aspect, an embodiment of the present disclosure provides an apparatus for controlling a state of a pipeline task, the apparatus including: a receiving unit configured to receive a state modification request indicating a modification of a current state of the pipeline task; a modification unit configured to modify a current state of a container running the pipeline task according to the state modification request.

In a fourth aspect, an embodiment of the present disclosure provides a server, including: one or more processors; storage means for storing one or more programs; when the one or more programs are executed by the one or more processors, the one or more processors are caused to implement the method as described in any implementation of the first aspect.

In a fifth aspect, embodiments of the present disclosure provide a computer-readable medium on which a computer program is stored, which computer program, when executed by a processor, implements the method as described in any of the implementations of the first aspect.

According to the method and the device for controlling the state of the pipeline task, when the state modification request for the pipeline task is received, the current state of the pipeline task is modified by modifying the current state of a container running the pipeline task according to the state modification request, and the state of the pipeline task does not need to be directly modified.

Drawings

Other features, objects and advantages of the disclosure will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings in which:

FIG. 1 is an exemplary system architecture diagram in which one embodiment of the present disclosure may be applied;

FIG. 2 is a flow diagram for one embodiment of a method for controlling the state of a pipelined task, according to the present disclosure;

FIG. 3 is a flow diagram of yet another embodiment of a method for controlling pipelined tasks in accordance with the present disclosure;

FIG. 4 is a timing diagram of one embodiment of a system for controlling pipeline tasks, according to an embodiment of the present disclosure;

FIG. 5 is a schematic diagram of one application scenario of a system for controlling pipeline tasks, in accordance with an embodiment of the present disclosure;

FIG. 6 is a block diagram illustrating one embodiment of an apparatus for controlling pipelined tasks in accordance with the present disclosure;

FIG. 7 is a schematic structural diagram of an electronic device suitable for use in implementing embodiments of the present disclosure.

Detailed Description

The present disclosure is described in further detail below with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant invention and not restrictive of the invention. It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings.

It should be noted that, in the present disclosure, the embodiments and features of the embodiments may be combined with each other without conflict. The present disclosure will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.

Fig. 1 illustrates an exemplary architecture 100 to which embodiments of the presently disclosed method for controlling a state of a pipelined task or apparatus for controlling a state of a pipelined task may be applied.

As shown in fig. 1, system architecture 100 may include terminal devices 101, 102, 103 and server 104. Various types of connections may be used for communication between end devices 101, 102, 103 and server 104, such as wired, wireless communication links, or fiber optic cables, among others.

The terminal devices 101, 102, 103 interact with the server 104 via the network to receive or send messages or the like. Various client applications may be installed on the terminal devices 101, 102, 103. Such as browser-type applications, search-type applications, social platforms, instant messaging tools, development-type applications, and so forth.

The terminal apparatuses 101, 102, and 103 may be hardware or software. When the terminal devices 101, 102, 103 are hardware, they may be various electronic devices including, but not limited to, smart phones, tablet computers, e-book readers, laptop portable computers, desktop computers, and the like. When the terminal apparatuses 101, 102, 103 are software, they can be installed in the electronic apparatuses listed above. It may be implemented as multiple pieces of software or software modules (e.g., multiple pieces of software or software modules to provide distributed services) or as a single piece of software or software module. And is not particularly limited herein.

The server 104 may be a server that provides various services, such as a backend server that provides support for the terminal devices 101, 102, 103. The server 104 may receive a state modification request sent by the terminal devices 101, 102, 103 for modifying the current state of the pipeline task, and modify the current state of the corresponding pipeline task according to the state modification request.

It should be noted that the server 104 may also directly receive the status modification request sent by the user by using the user, or receive the status modification request generated by triggering a preset trigger condition. At this time, the server 104 may also modify the current state of the corresponding pipeline task according to the state modification request. At this time, the terminal apparatuses 101, 102, 103 may not exist.

It should be noted that the method for controlling the state of the pipeline task provided by the embodiment of the present disclosure is generally performed by the server 104, and accordingly, the apparatus for controlling the state of the pipeline task is generally disposed in the server 104.

It should also be noted that the terminal devices 101, 102, 103 may also receive the above-mentioned state modification request, and modify the current state of the corresponding pipeline task according to the state modification request. At this time, the method for controlling the state of the pipeline task may be executed by the terminal device 101, 102, 103, and accordingly, a means for controlling the state of the pipeline task may also be provided in the terminal device 101, 102, 103. At this point, the exemplary system architecture 100 may not have a server 104.

The server 104 may be hardware or software. When the server 104 is hardware, it may be implemented as a distributed server cluster composed of multiple servers, or may be implemented as a single server. When the server 104 is software, it may be implemented as multiple pieces of software or software modules (e.g., multiple pieces of software or software modules used to provide distributed services), or as a single piece of software or software module. And is not particularly limited herein.

It should be understood that the number of terminal devices and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.

With continued reference to FIG. 2, a flow 200 of one embodiment of a method for controlling the state of a pipelined task in accordance with the present disclosure is shown. The method for controlling the state of the pipeline task comprises the following steps:

at step 201, a state modification request is received for indicating a modification of a current state of a pipeline task.

In the present embodiment, a pipeline task may be a task for achieving various purposes. Specifically, the pipeline task may be predefined according to actual application requirements. Each pipeline task may include several steps.

The state of the pipeline task can be determined according to the actual application scenario. For example, the state a pipelined task has may refer to the state provided for the pipelined task by the tool used to create the pipelined task. By way of example, a pipelined task has states that include, but are not limited to: running, paused, not started, etc. The current state of the pipeline task may refer to the state of the pipeline task at the current time.

The state modification request may be for requesting modification of a current state of the pipeline task. I.e. switching the pipelined task from the current state to another state. By way of example, when the pipeline task has states including running, suspended, and not started, the state switching of the pipeline task includes, but is not limited to: the method comprises the steps of switching from running to suspended (namely, carrying out suspended operation on the pipeline task), switching from running to non-started (namely, carrying out stop operation on the pipeline task), switching from suspended to non-started, switching from non-started to running (namely, carrying out start operation on the pipeline task), and switching from suspended to running (namely, carrying out recovery operation on the pipeline task).

An execution main body (for example, a server 104 shown in fig. 1) of the method for controlling the state of the pipeline task may receive a state modification request (for example, in the form of an HTTP request) sent by other electronic devices (for example, terminal devices 101, 102, 103 and the like shown in fig. 1), may receive a state modification request submitted by a user of the execution main body to the execution main body, may receive a state modification request triggered by a timed task, and the like.

Step 202, modifying the current state of the container running the pipeline task according to the state modification request.

In this embodiment, the pipeline task may run in different electronic devices in different application scenarios. For example, the pipeline task may be executed in the execution main body, an electronic device communicatively connected to the execution main body, an electronic device that sends a status modification request, or the like.

Specifically, the electronic device running the pipeline task may run the pipeline task using container technology. Specifically, the electronic device may deploy a base environment supporting containerization thereon by installing a container engine or the like. The container engine may be any of various existing container engines, including but not limited to: docker, Rocket, Odin, Runc, and the like.

The electronic device may then deploy various container orchestration tools thereon to manage the life cycle of the container and maintain and expand the applications containerized thereon, according to the actual application needs. The container arrangement tool may be any of various existing container arrangement tools, including but not limited to: kubernets, Mesos, Swarm, Fleet, etc.

The electronic device may then allocate container instances from the computing resources available to the system, and may then deploy various applications in different container instances to run. For example, an application or framework, a tool, or the like for creating and managing pipeline may be installed in the container instance, and then a pipeline task may be created and run using the application or framework for creating and managing pipeline installed in the electronic device. At this time, the container instance corresponding to the pipeline task can be regarded as the container for running the pipeline task.

The state of the container can be determined according to the actual application scenario. For example, a container may have a state that refers to the state provided by the container engine and container orchestration tool corresponding to the container for the container. By way of example, the container has a state that includes, but is not limited to: running, pausing, stopping, etc. The current state of the container may refer to the state of the container at the current time.

The state of the container may also be modified as required to switch between different states. As an example, when the container has a state including running, pausing, and stopping, the switching of the state of the container includes, but is not limited to: switching from running to pausing (i.e., performing a pause operation on the container), switching from running to stopping (i.e., performing a stop operation on the container), switching from pausing to stopping, switching from stopping to running (i.e., performing a start operation on the container), and switching from pausing to running (i.e., performing a resume operation on the container).

After receiving the state modification request, the execution main body may modify the current state of the container running the pipeline task according to the state modification request, and since the pipeline task may be generally regarded as a process running in a corresponding container, a change in the state of the container naturally affects a change in the state of the pipeline task in the container, so that the modification of the current state of the pipeline task is achieved by modifying the current state of the container running the pipeline task.

Optionally, the modification status request may include a task identification for identifying the corresponding pipeline task. The task identifier may be various types of identifiers. At this time, after receiving the state modification request, the execution main body may determine the corresponding pipeline task according to the task identifier therein, thereby determining the container running the pipeline task, and then may modify the state of the container running the pipeline task according to the state modification request.

Specifically, the correspondence between the task identification and the corresponding container may be recorded in advance. For example, a correspondence relationship between the task identifier and a container identifier for identifying the container is set in advance. At this time, the execution main body can find the corresponding container identifier according to the task identifier, so as to determine the container for running the pipeline task indicated by the task identifier, and further modify the state of the container.

Or, the state modification request may further include a container identifier corresponding to the container corresponding to the pipeline task indicated by the task identifier. At this time, the execution subject may determine the container for running the pipeline task indicated by the task identifier directly according to the container identifier in the state modification request.

In some cases, there may be multiple containers, each of which may run different pipeline tasks. At this time, different containers can be distinguished through task identifiers, container identifiers and the like, so that the container corresponding to the pipeline task for which the state modification request is directed is conveniently determined, and further, the state change of the pipeline task is accurately controlled.

Alternatively, a default state change may be set. For example, if the current state of the container is in a pause state, the container is restored by default to modify the current state of the container to be in operation. If the current state of the container is in operation, performing pause operation on the container by default to modify the current state of the container to be in pause. At this time, the execution principal, after receiving the modification request, may modify the current state of the container running the tasks of the pipeline according to the default state change.

Optionally, the modified status request may include target status information. The target state information may be used to indicate the modified state, that is, to indicate that the current state of the pipeline task is modified to the target state. At this time, the current state of the container running the pipeline task may be modified to the target state according to the target state indicated by the target state information in the modified state request.

In some alternative implementations of the present embodiment, the state modification request may be used to indicate to suspend (pause) or resume (restore) the execution of the pipeline task. Specifically, when the state modification request indicates that the running of the pipeline task is suspended, it may refer to modifying the current state (e.g., running) of the pipeline task to be suspended. When the state modification request indicates to resume the running of the pipeline task, it may refer to modifying the current state (e.g., in a pause) of the pipeline task to be running.

In some cases, some tools for creating and running pipeline tasks can only start or stop the running of the pipeline tasks. At this time, for the pipeline task in operation, the pause operation cannot be performed, and only the stop operation can be performed, so that the pipeline task can be restarted to be operated from the beginning when the pipeline task is started next time, and for the pipeline task which is arranged in a complicated manner, the task completion efficiency can be greatly influenced by stopping each time.

The method provided by the above embodiment of the present disclosure implements the modification of the state of the pipeline task by modifying the state of the container running the pipeline task after receiving the state modification request for the pipeline task. Because various container arrangement tools support various operations (such as pause, recovery and the like) on the state of the container at present, the container can be switched between various states more flexibly. Based on the method, flexible control of the task state of the pipeline is achieved by controlling the state change of the container. For example, the suspension and the recovery of the pipeline tasks can be controlled by means of the suspension and the recovery of the state of the container, so that the problem that the corresponding tasks can only be executed again at the beginning each time due to the fact that the pipeline tasks can only be stopped is solved, and the task completion efficiency is improved.

With further reference to FIG. 3, a flow 300 of yet another embodiment of a method for controlling the state of a pipelined task is shown. The process 300 of the method for controlling the state of a pipeline task includes the steps of:

in step 301, a state modification request is received for indicating a modification of a current state of a pipeline task.

Step 302, determining a container for running the pipeline task according to the task identifier of the pipeline task.

Step 303, determine the electronic device operating the container.

In this embodiment, after determining the container for running the pipeline task, the execution main body may further determine the electronic device running the container. Wherein the electronic device operating the container may be various types of electronic devices. For example, the runtime container electronics can be either a physical host or a cloud host.

Optionally, the state modification request may further include a device identifier for identifying the electronic device. At this time, the execution subject may determine the electronic device corresponding to the container running the pipeline task according to the device identifier in the state modification request.

Optionally, a task identifier corresponding to the pipeline task, a container for running the pipeline task, and a corresponding relationship between the electronic device corresponding to the container may be recorded in advance. For example, a correspondence between a device task identifier, a container identifier, and a device identifier for identifying an electronic device may be beforehand. At this time, the execution main body can search the corresponding container identifier and the corresponding equipment identifier according to the task identifier, and further determine a container for running the pipeline task and the electronic equipment for running the container.

In some cases, the execution principal may act as a master server and the electronic device running the container may act as a slave server communicatively coupled to the execution principal. The executing agent may correspond to one or more slave servers. At this time, the execution main body can distinguish different slave servers according to the task identifier, the container identifier, the equipment identifier and the like, and distinguish different containers in each slave server and the pipeline task in each container, so as to conveniently determine the electronic equipment corresponding to the container corresponding to the pipeline task for which the state modification request is directed, and further accurately control the state change of the pipeline task.

And step 304, controlling the electronic equipment to modify the current state of the container according to the state modification request.

In this embodiment, the execution principal may send a control instruction or command to the electronic device to control the electronic device to modify the current state of the container running the pipeline task according to the state modification request.

Alternatively, the execution body may send the state control instruction to the electronic device. The state control instruction may be used to control the electronic device to modify a current state of a container running the corresponding pipeline task according to the state modification request.

The execution body may establish a communication connection with the electronic device running the container in various ways. For example, the connection means include, but are not limited to: SSL (Secure Sockets Layer), TLS (Transport Layer Security), SET (Secure Electronic Transaction protocol), SSH (Secure Shell protocol).

Taking SSH connection as an example, at this time, the execution principal may send an SSH command to the determined electronic device (the electronic device indicated by the found device identifier), and the SSH command carries the container identifier. And then, after receiving the SSH command, the corresponding electronic equipment searches the corresponding container according to the container identifier therein and modifies the state of the searched container.

Optionally, the execution body may also receive feedback information for the state control instruction. Wherein the feedback information may be used to indicate the execution result of the state control instruction. The execution result may indicate a success of execution or a failure of execution, and when the execution result indicates a failure of execution, the execution result may further indicate a specific failure reason, and the like.

The feedback information may be sent to the main body by the electronic device of the operation container, for example, a return semaphore of the state control instruction sent by the execution main body may be directly returned to the execution main body as the feedback information.

The execution body may then send feedback information to make the relevant user aware of the execution results. For example, when a state modification request sent by a user through a terminal device is received, feedback information can be sent to the terminal device, so that the user corresponding to the terminal device can know information such as whether state modification for a pipeline task is successful in time. Specifically, after receiving the feedback information, the terminal device may generate corresponding prompt information according to the feedback information to prompt the user of the execution result for the state modification of the pipeline task.

The content that is not described in detail in the steps 301-304 can refer to the related description in the corresponding embodiment of fig. 2, and is not described herein again.

In the method for controlling the state of the pipeline task in this embodiment, the state modification request for the pipeline task is received, and the container for running the pipeline task and the electronic device for running the container are determined according to the task identifier in the state modification request, so that the corresponding electronic device can be accurately controlled to modify the state of the corresponding container, and the state of the pipeline task can be accurately controlled.

With further reference to FIG. 4, a timing diagram 400 of one embodiment of a system for controlling the state of pipelined tasks is shown. The system for controlling the state of a pipelined task may include a client and a server. Wherein the server may comprise one or more slave servers.

As shown in fig. 4, in step 401, the client sends a state modification request to the primary server.

In this step, the state modification request may be used to indicate that the current state of the pipeline task is modified.

In this step, the state modification request may be for requesting modification of the current state of the pipeline task. I.e. switching the pipelined task from the current state to another state.

Optionally, the modification status request may include a task identification for identifying the corresponding pipeline task. The task identifier may be various types of identifiers. At this time, after receiving the modification status request, the main server may determine the corresponding pipeline task according to the task identifier therein.

In step 402, the master server determines a container for running a corresponding pipeline task and a slave server for running the container according to the received state modification request.

In this step, each slave server may run a pipeline task using container technology. Specifically, each slave server may have a base environment supporting containerization previously deployed thereon by installing a container engine or the like. The container engine may be any of various existing container engines, including but not limited to: docker, Rocket, Odin, Runc, and the like.

Each slave server may then deploy various container orchestration tools on it, according to the actual application needs, to manage the container lifecycle and maintain, expand the applications containerized on it. The container arrangement tool may be any of various existing container arrangement tools, including but not limited to: kubernets, Mesos, Swarm, Fleet, etc.

Each slave server may then allocate container instances from the computing resources available to the system, and may then deploy various applications in different container instances to run. For example, an application or framework, a tool, etc. for creating and managing pipeline may be installed in the container instance, and then a pipeline task may be created and run using the application or framework for creating and managing pipeline installed in the slave server. At this time, the container instance corresponding to the pipeline task can be regarded as the container for running the pipeline task.

The master server may be pre-recorded with the containers running in each slave server, and the pipeline tasks running in each container running in each slave server. Therefore, the master server can quickly locate the container running the pipeline task and the slave server running the container according to the pipeline task indicated by the status request.

For example, the master server may pre-record a correspondence between a task identifier for identifying the pipeline task, a container identifier for identifying the container, and a device identifier for identifying the slave server. At this time, after receiving the state modification request including the task identifier, the corresponding container identifier and the device identifier may be searched according to the task identifier therein, so as to determine the container running the pipeline task according to the searched container identifier, and determine the slave server running the container according to the device identifier.

In step 403, the master server sends a state control command to the determined slave server.

In this step, the state control instruction may be used to control the determined slave server to modify the current state of the container according to the state modification request. For example, the execution principal may send an SSH command to the determined slave server, and the SSH command carries the container identifier. Then, after receiving the SSH command, the slave server searches for a corresponding container according to the container identifier therein, and modifies the state of the searched container.

In step 404, the slave server sends feedback information for the state control command to the master server.

In this step, the feedback information may be used to indicate the execution result of the state control instruction. The execution result may indicate success or failure of execution, and when the execution result indicates failure of execution, the execution result may further indicate a specific failure reason, and the like.

For example, the slave server may directly return the return semaphore of the state control instruction sent by the execution main body as feedback information to the execution main body.

In step 405, the main server sends the feedback information to the client.

In step 406, the client generates corresponding prompt information according to the received feedback information.

In this step, the terminal device may generate prompt information to prompt a user of a modification result for the state modification of the pipeline task.

For the content not described in detail in this embodiment, reference may be made to the related description in the embodiment corresponding to fig. 2 and fig. 3, and details are not repeated here.

With continued reference to FIG. 5, FIG. 5 is an illustrative application scenario 500 of the system for controlling the state of a pipelined task in accordance with the present embodiments. In the application scenario of fig. 5, a user uses the terminal device 501 to pause a pipeline-01 in operation, then the terminal device 501 sends a corresponding state modification request to the server 502, and an identifier (pipeline id) of the pipeline for which the user pauses the operation is carried in the state modification request is "01", and the user operation (action) is pause (pause).

After receiving the state modification request, the server 502 searches the database 503 for the container name "a" of the container corresponding to the pipeline id "01" and the host IP address "B" of the corresponding host. Then, the server 502 may send an SSH command to the server 504 with the IP address "B", where the SSH command carries a container Name (Name) "a" and a user operation "pause", so that the slave server 504 performs pause control on the container "a", and thus a pipeline with a pipeline id of "01" running in the container "a" is also paused.

Server 504 may then feed back information of the success of the execution to server 502. The server 502 feeds back information of successful execution to the terminal device 501. After receiving the information of successful execution, the terminal device may provide a new page 506 to the user, so that the user can resume the paused pipeline at any time according to the requirement.

In the application scenario, the terminal device sends a state modification request indicating a pipeline to be suspended to the server, the server searches for the corresponding container and the host, and then sends a control command to the corresponding host to control the corresponding host to suspend the running pipeline container, so that the pipeline to be suspended is successfully suspended. Based on this, the user may also send a state modification request indicating to resume the pipeline to the server, and the server may also search for the corresponding container and the host, and then send a control command to the corresponding host to control the corresponding host to resume the container of the currently paused pipeline, thereby successfully resuming the running of the currently paused pipeline. Therefore, a user can conveniently pause or resume the pipeline according to actual application requirements.

The system for controlling the state of the pipeline task, provided by the above-mentioned embodiments of the present disclosure, sends a state modification request for indicating a modification of the current state of the pipeline task to the master server, the master server determines a container running the pipeline task and a slave server running the container according to the state modification request, and controls the slave server to modify the state of the container, so as to flexibly control the state change of the pipeline task by means of the state change of the container.

With further reference to fig. 6, as an implementation of the methods shown in the above figures, the present disclosure provides an embodiment of an apparatus for controlling a state of a pipeline task, which corresponds to the method embodiment shown in fig. 2, and which is particularly applicable in various electronic devices.

As shown in fig. 6, the apparatus 600 for controlling the state of the pipeline task provided by the present embodiment includes a receiving unit 601 and a modifying unit 602. Wherein the receiving unit 601 is configured to receive a state modification request for indicating a modification of a current state of the pipeline task; the modification unit 602 is configured to modify a current state of a container running the pipelined task in accordance with the state modification request. In the present embodiment, in the apparatus 600 for controlling the state of the pipeline task: the specific processing of the receiving unit 601 and the modifying unit 602 and the technical effects thereof can refer to the related descriptions of step 201 and step 202 in the corresponding embodiment of fig. 2, which are not repeated herein.

In some alternative implementations of the present embodiment, the state modification request is used to indicate that execution of the pipeline task is paused or resumed.

In some optional implementations of this embodiment, the modification status request includes a task identifier for identifying the pipeline task; and the modifying unit 602 is further configured to: determining a container for running the pipeline task according to the task identifier; and modifying the current state of the container according to the state modification request.

In some optional implementations of the present embodiment, the modifying unit 602 is further configured to: determining an electronic device operating the container; and according to the state modification request, controlling the electronic equipment to modify the current state of the container.

In some optional implementations of the present embodiment, the modifying unit 602 is further configured to: and sending a state control instruction to the electronic equipment, wherein the state control instruction is used for controlling the electronic equipment to modify the current state of the container according to the state modification request.

In some optional implementations of this embodiment, the apparatus 600 for controlling the state of the pipeline task further includes: the sending unit is configured to receive feedback information for the state control instruction and send the feedback information, wherein the feedback information is used for indicating an execution result of the state control instruction.

The apparatus provided by the above embodiment of the present disclosure receives, by a receiving unit, a state modification request for indicating a modification of a current state of a pipeline task; the modification unit modifies a current state of a container running the pipeline task according to the state modification request. Therefore, more flexible state control of the pipeline task is realized by means of state control of the container running the pipeline task.

Referring now to FIG. 7, a block diagram of an electronic device (e.g., the server of FIG. 1) 700 suitable for use in implementing embodiments of the present disclosure is shown. The server shown in fig. 7 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.

As shown in fig. 7, electronic device 700 may include a processing means (e.g., central processing unit, graphics processor, etc.) 701 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)702 or a program loaded from storage 708 into a Random Access Memory (RAM) 703. In the RAM 703, various programs and data necessary for the operation of the electronic apparatus 700 are also stored. The processing device 701, the ROM 702, and the RAM 703 are connected to each other by a bus 704. An input/output (I/O) interface 705 is also connected to bus 704.

Generally, the following devices may be connected to the I/O interface 705: input devices 706 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; an output device 707 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 708 including, for example, magnetic tape, hard disk, etc.; and a communication device 709. The communication means 709 may allow the electronic device 700 to communicate wirelessly or by wire with other devices to exchange data. While fig. 7 illustrates an electronic device 700 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided. Each block shown in fig. 7 may represent one device or may represent multiple devices as desired.

In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such embodiments, the computer program may be downloaded and installed from a network via the communication means 709, or may be installed from the storage means 708, or may be installed from the ROM 702. The computer program, when executed by the processing device 701, performs the above-described functions defined in the methods of embodiments of the present disclosure.

It should be noted that the computer readable medium described in the embodiments of the present disclosure may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In embodiments of the disclosure, a computer 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. In embodiments of the present disclosure, however, a computer readable signal medium may comprise a propagated data signal with computer 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 computer readable signal medium may also be any computer readable medium that is not a computer 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 computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.

The computer readable medium may be embodied in the server; or may exist separately and not be assembled into the server. The computer readable medium carries one or more programs which, when executed by the server, cause the server to: receiving a state modification request indicating a modification of a current state of the pipelined task; and modifying the current state of the container running the pipeline task according to the state modification request.

Computer program code for carrying out operations for embodiments of the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, 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 computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).

The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.

The units described in the embodiments of the present disclosure may be implemented by software or hardware. The described units may also be provided in a processor, and may be described as: a processor includes a receiving unit and a modifying unit. Where the names of these units do not in some cases constitute a limitation of the unit itself, for example, a receiving unit may also be described as a "unit receiving a state modification request indicating a current state of a modifying pipeline task".

The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention in the embodiments of the present disclosure is not limited to the specific combination of the above-mentioned features, but also encompasses other embodiments in which any combination of the above-mentioned features or their equivalents is made without departing from the inventive concept as defined above. For example, the above features and (but not limited to) technical features with similar functions disclosed in the embodiments of the present disclosure are mutually replaced to form the technical solution.

18页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种多路径并行执行的分支合并系统及分支合并方法

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!