Task processing method, device and storage medium
By sending shell container creation commands and processing task commands in the Linux environment, deep learning training tasks are triggered directly in the shell container, which solves the inconvenient problem of developers needing to switch to the web page to trigger tasks, and improves the convenience and convenience of task execution. efficiency.
Patent Information
- Application Number
- CN202311125854.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-06-28
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2039-06-28
AI Technical Summary
After editing and compiling the code in the Linux environment, developers need to switch to the web page to trigger the training task, which is inconvenient.
By sending the shell container creation command, establishing an SSH connection, receiving and processing the task processing commands input by the user, and triggering the deep learning training task directly in the shell container, the operation process is simplified.
It realizes the function of directly triggering training tasks in the Linux environment, avoiding the step of switching to the web page, and improving the convenience and efficiency of operation.
Smart Images

Figure CN117215635B
Abstract
Description
[0001] This application is a divisional application of the Chinese patent application with application number 201910577574.8 filed on June 28, 2019 and invention name “Task processing method, device and storage medium”. Technical Field
[0002] The present application relates to the field of program development and testing, and in particular to a task processing method, device and computer-readable storage medium. Background Art
[0003] With the development of artificial intelligence (AI) technology, various training platforms for providing training and reasoning services have emerged. Usually, the training platform can provide platform functions to developers through web pages. However, developers usually edit and compile code in a Linux environment. In this case, after completing code editing and compiling operations, developers need to switch to the web page and click the corresponding button to trigger the training task, which is extremely inconvenient. Summary of the invention
[0004] The embodiment of the present application provides a task processing method, device and storage medium. The technical solution is as follows:
[0005] In one aspect, a task processing method is provided, the method comprising:
[0006] Sending a shell container creation command, where the shell container creation command is used to instruct to create a shell container on the first server;
[0007] Displaying a secure shell protocol SSH command interface, and establishing a connection with the shell container based on a login operation detected on the SSH command interface;
[0008] Receive a task processing command input by a user in the SSH command interface, and send the task processing command to the shell container, so that the shell container returns a processing result based on the task processing command, and the processing result includes task information of a deep learning training task running based on the image of the shell container.
[0009] Optionally, establishing a connection with the shell container based on a login operation detected on the SSH command interface includes:
[0010] Receive a login command entered by a user in the SSH command interface, wherein the login command carries user account information;
[0011] Sending a container login request to the first server according to the login command, wherein the container login request carries user account information;
[0012] Receive port information of a port corresponding to the shell container, where the port information is sent by the first server after verifying the user account information;
[0013] A connection is established with the shell container through the port information of the port corresponding to the shell container.
[0014] Optionally, before receiving the task processing command input by the user in the SSH command interface, the method further includes:
[0015] Receiving a first command input by a user in the SSH command interface, where the first command carries a first task identifier, and the first task identifier is used to indicate that the first command is a command for a task for creating an image of a shell container;
[0016] The first command is sent to the shell container, so that the shell container creates an image of the shell container based on the first command.
[0017] Optionally, the method further comprises:
[0018] Receiving an image processing command input by a user in the SSH command interface, where the image processing command is one of an image deletion command, an image list acquisition command, and an image information acquisition command;
[0019] Sending the image processing command to the shell container to instruct the shell container to perform a corresponding operation on the image of the shell container based on the image processing command;
[0020] Receive the image processing result sent by the shell container.
[0021] Optionally, the task processing command is one of a task creation command, a task deletion command, a task restart command, a task list viewing command and a task information viewing command.
[0022] Optionally, when the task processing command is a task creation command, the task creation command is used to instruct the creation of a first task container on the first server, and the first task container is used to run a specified script to execute a first task, and the first task is a deep learning training task run based on the image of the shell container.
[0023] Optionally, the method further comprises:
[0024] After receiving the task error notification message, receiving a task restart command input by the user in the SSH command interface, the task error notification message is used to prompt the user that the first task execution error occurred, and the task restart command carries the container identifier of the first task container;
[0025] The task restart command is sent to the shell container to instruct the shell container to restart the first task container.
[0026] Optionally, the first task container includes a first process created for the first task, and the method further includes:
[0027] After receiving the task error notification message, receiving a second command input by a user on the command interface, the second command including a task identifier of the first task;
[0028] Sending the second command to the shell container to instruct the shell container to obtain the execution information of the first task container, delete the first process in the first task container, and re-create a second process for the first task, where the second process is managed by the shell container;
[0029] Receive execution information of the first task container sent by the shell container.
[0030] On the other hand, a task processing method is provided, which is applied to a first server, wherein the first server includes a shell container and a backend service module, and the method includes:
[0031] The shell container receives the task processing command sent by the client, and sends the task processing command to the backend service module, in which the image of the shell container is stored;
[0032] The backend service module sends the task processing command to the second server so that the second server processes the task processing command, and the second server refers to a server for providing multiple services corresponding to the web page;
[0033] The backend service module receives the processing result returned by the second server, and forwards the processing result to the shell container, wherein the processing result includes task information of the deep learning training task running based on the image of the shell container;
[0034] The shell sends the processing result to the client.
[0035] Optionally, before the shell container receives the task processing command sent by the client, it also includes:
[0036] The shell container receives a first command sent by the client, where the first command carries a first task identifier, where the first task identifier is used to indicate that the first command is a command for a task for creating an image of a shell container;
[0037] The shell container sends an image creation command to the backend service module, wherein the image creation command carries the first task identifier;
[0038] The backend service module determines a shell container identifier according to the first task identifier;
[0039] The backend service module calls the docker service, generates an image of the shell container according to the shell container identifier, and stores the image of the shell container.
[0040] Optionally, the image creation command also includes an image name;
[0041] After storing the image of the shell container, the method further includes:
[0042] The backend service module sends the image information of the shell container to the second server, so that the second server adds an image record of the image of the shell container in the image record table according to the image information of the shell container, wherein the image information of the shell container includes the image name.
[0043] Optionally, the method further comprises:
[0044] The shell container receives the image processing command sent by the client, and sends the image processing command to the backend service module, where the image processing command is one of an image deletion command, an image list acquisition command, and an image information acquisition command;
[0045] The backend service module sends the mirror processing command to the second server, so that the second server performs a corresponding processing operation according to the mirror processing command;
[0046] The backend service module receives the image processing result returned by the second server, and sends the image processing result to the shell container;
[0047] The shell container sends the image processing result to the client.
[0048] Optionally, the task processing command is one of a task creation command, a task deletion command, a task restart command, a task list viewing command and a task information viewing command.
[0049] Optionally, the first server also includes a first task container, which is used to execute a first task, and the first task refers to a deep learning training task running based on the image of the shell container.
[0050] Optionally, the task processing command is a task creation command, and before the backend service module receives the processing result returned by the second server, the backend service module further includes:
[0051] The backend service module receives a task container creation command, wherein the task container creation command is sent by the second server after receiving the task creation instruction, the task creation command is used to instruct the creation of the first task, and the task container creation command is used to instruct the creation of the first task container;
[0052] The backend service module creates the first task container according to the image of the shell container;
[0053] After the first task container is created, the backend service module sends a first notification message to the second server, so that the second server adds the first task to a task list according to the first notification message, wherein the first notification message is used to indicate that the first task container is created successfully;
[0054] Correspondingly, the backend service module receives the processing result returned by the second server, including:
[0055] The backend service module receives a task creation success message fed back by the second server, where the task creation success message is used to indicate that the first task is created successfully.
[0056] Optionally, the method further comprises:
[0057] The first task container runs a specified script to execute the first task;
[0058] When an error occurs in the execution of the first task, the first server retains the first task container;
[0059] When the shell container receives the task restart command sent by the client, the shell container sends the task restart command to the backend service module, where the task restart command carries the container identifier of the first task container;
[0060] The backend service module restarts the first task container according to the container identifier of the first task container by calling the docker command.
[0061] Optionally, the method further comprises:
[0062] The first task container runs a specified script to execute the first task, and the first task container includes the first process;
[0063] When an error occurs in the execution of the first task, the shell container sends a task error notification message to the client;
[0064] When the shell container receives the second command sent by the client, the shell container sends the second command to the backend service module, where the second command includes the task identifier of the first task;
[0065] The backend service module calls the execution interface according to the task identifier of the first task;
[0066] The shell container obtains the execution information of the first task container through the execution interface, creates a second process for the first task in the first task container, deletes the first process, and the second process is managed by the shell container.
[0067] In another aspect, a client is provided, the client comprising:
[0068] A sending module, used for sending a shell container creation command, where the shell container creation command is used for instructing to create a shell container on the first server;
[0069] A connection module, used to display a secure shell protocol SSH command interface, and establish a connection with the shell container based on a login operation detected on the SSH command interface;
[0070] A receiving module is used to receive a task processing command input by a user in the SSH command interface, and send the task processing command to the shell container, so that the shell container returns a processing result based on the task processing command, and the processing result includes task information of a deep learning training task running based on the image of the shell container.
[0071] Optionally, the connection module is specifically used for:
[0072] Receive a login command entered by a user in the SSH command interface, wherein the login command carries user account information;
[0073] Sending a container login request to the first server according to the login command, wherein the container login request carries user account information;
[0074] Receive port information of a port corresponding to the shell container, where the port information is sent by the first server after verifying the user account information;
[0075] A connection is established with the shell container through the port information of the port corresponding to the shell container.
[0076] Optionally, the receiving module is further used to receive a first command entered by a user in the SSH command interface, where the first command carries a first task identifier, and the first task identifier is used to indicate that the first command is a command for a task for creating an image of a shell container;
[0077] The sending module is further configured to send the first command to the shell container, so that the shell container creates an image of the shell container based on the first command.
[0078] Optionally, the receiving module is further used to receive an image processing command input by a user in the SSH command interface, where the image processing command is one of an image deletion command, an image list acquisition command, and an image information acquisition command;
[0079] The sending module is further used to send the image processing command to the shell container to instruct the shell container to perform a corresponding operation on the image of the shell container based on the image processing command;
[0080] The receiving module is also used to receive the image processing result sent by the shell container.
[0081] Optionally, the task processing command is one of a task creation command, a task deletion command, a task restart command, a task list viewing command and a task information viewing command.
[0082] Optionally, when the task processing command is a task creation command, the task creation command is used to instruct the creation of a first task container on the first server, and the first task container is used to run a specified script to execute a first task, and the first task is a deep learning training task run based on the image of the shell container.
[0083] Optionally, the receiving module is further used to receive a task restart command input by a user in the SSH command interface after receiving a task error notification message, wherein the task error notification message is used to prompt the user that an error has occurred in the execution of the first task, and the task restart command carries a container identifier of the first task container;
[0084] The sending module is further used to send the task restart command to the shell container to instruct the shell container to restart the first task container.
[0085] Optionally, the first task container includes a first process created for the first task;
[0086] The receiving module is further configured to receive a second command input by a user on the command interface after receiving the task error notification message, wherein the second command includes a task identifier of the first task;
[0087] The sending module is further used to send the second command to the shell container to instruct the shell container to obtain the execution information of the first task container, delete the first process in the first task container, and re-create the second process for the first task, the second process being managed by the shell container;
[0088] The receiving module is further used to receive the execution information of the first task container sent by the shell container.
[0089] On the other hand, a server is provided, the server comprising: a shell container and a backend service module;
[0090] The shell container is used to receive the task processing command sent by the client and send the task processing command to the backend service module, in which the image of the shell container is stored;
[0091] A backend service module, used for sending the task processing command to the second server so that the second server processes the task processing command, the second server being a server used for providing a variety of services corresponding to the web page;
[0092] The backend service module is further used to receive the processing result returned by the second server, and forward the processing result to the shell container, wherein the processing result includes task information of the deep learning training task running based on the image of the shell container;
[0093] The shell container is also used to send the processing result to the client.
[0094] Optionally, the shell container is further used to receive a first command sent by the client, the first command carrying a first task identifier, and the first task identifier is used to indicate that the first command is a command for a task for creating an image of the shell container; and send an image creation command to the backend service module, the image creation command carrying the first task identifier;
[0095] The backend service module is used to determine the shell container identifier according to the first task identifier; call the docker service, generate the image of the shell container according to the shell container identifier, and store the image of the shell container.
[0096] Optionally, the image creation command also includes an image name;
[0097] The backend service module is also used to send the image information of the shell container to the second server, so that the second server adds the image record of the image of the shell container in the image record table according to the image information of the shell container, and the image information of the shell container includes the image name.
[0098] Optionally, the shell container is further used to receive an image processing command sent by the client, and send the image processing command to the backend service module, where the image processing command is one of an image deletion command, an image list acquisition command, and an image information acquisition command;
[0099] The backend service module is also used to send an image processing command to the second server, so that the second server performs a corresponding processing operation according to the image processing command; receive the image processing result returned by the second server, and send the image processing result to the shell container;
[0100] The shell container is also used to send the image processing result to the client.
[0101] Optionally, the task processing command is one of a task creation command, a task deletion command, a task restart command, a task list viewing command, and a task information viewing command.
[0102] Optionally, the server also includes a first task container, which is used to execute a first task, and the first task refers to a deep learning training task run based on the image of the shell container.
[0103] Optionally, the task processing command is a task creation command;
[0104] The backend service module is also used to receive a task container creation command, the task container creation command is sent by the second server after receiving the task creation instruction, the task creation command is used to instruct the creation of the first task, and the task container creation command is used to instruct the creation of the first task container; create the first task container according to the image of the shell container; after the first task container is created, send a first notification message to the second server, so that the second server adds the first task to the task list according to the first notification message, and the first notification message is used to indicate that the first task container is created successfully;
[0105] Correspondingly, the backend service module is further used to receive a task creation success message fed back by the second server, where the task creation success message is used to indicate that the first task is created successfully.
[0106] Optionally, the first task container is used to run a specified script to perform the first task;
[0107] When an error occurs in the execution of the first task, the server retains the first task container;
[0108] When the shell container receives the task restart command sent by the client, the shell container is further used to send the task restart command to the backend service module, where the task restart command carries the container identifier of the first task container;
[0109] The backend service module is further used to restart the first task container according to the container identifier of the first task container by calling a docker command.
[0110] Optionally, the first task container is used to run a specified script to perform the first task, and the first task container includes the first process;
[0111] When an error occurs in the execution of the first task, the shell container is further used to send a task error notification message to the client; when the shell container receives a second command sent by the client, the shell container sends a second command to the backend service module, where the second command includes a task identifier of the first task;
[0112] The backend service module is further used to call the execution interface according to the task identifier of the first task;
[0113] The shell container is further used to obtain the execution information of the first task container through the execution interface, create a second process for the first task in the first task container, delete the first process, and the second process is managed by the shell container.
[0114] On the other hand, there is provided a client, the client comprising a processor, a communication interface, a memory and a communication bus;
[0115] Wherein, the processor, the communication interface and the memory communicate with each other via the communication bus;
[0116] The memory is used to store computer programs;
[0117] The processor is used to execute the program stored in the memory to implement the aforementioned task processing method.
[0118] In another aspect, a server is provided, the server comprising a processor, a communication interface, a memory, and a communication bus;
[0119] Wherein, the processor, the communication interface and the memory communicate with each other via the communication bus;
[0120] The memory is used to store computer programs;
[0121] The processor is used to execute the program stored in the memory to implement the aforementioned task processing method.
[0122] On the other hand, a computer-readable storage medium is provided, wherein a computer program is stored in the storage medium, and when the computer program is executed by a processor, the steps of the task processing method provided above are implemented.
[0123] The beneficial effects brought by the technical solution provided by the embodiment of the present application include at least:
[0124] In an embodiment of the present application, the client can send the received task processing command directly to the shell container on the first server, the shell container can send the task processing command to the back-end service module, and the back-end service module can send the task processing command to the second server, which processes the task processing command and returns the processing result. The back-end service module can receive the processing result and send the processing result to the shell container. It can be seen that in an embodiment of the present application, the task can be triggered directly in the shell container. In this way, after the developer completes code editing, compiling and other work, the task can be triggered directly through the shell container in the Linux environment, without having to switch to the web page to trigger the task by clicking the corresponding button, which is more convenient to operate. BRIEF DESCRIPTION OF THE DRAWINGS
[0125] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0126] Figure 1 It is a system architecture diagram of a training platform provided in an embodiment of the present application;
[0127] Figure 2 It is a flow chart of a method for creating a shell container and a mirror of a shell container provided by an embodiment of the present application;
[0128] Figure 3 is a flow chart of a task processing method provided in an embodiment of the present application;
[0129] Figure 4 is a flow chart of a mirror processing method provided by an embodiment of the present application;
[0130] Figure 5is a structural diagram of a task processing device provided in an embodiment of the present application;
[0131] Figure 6 is a structural diagram of a task processing device provided in an embodiment of the present application;
[0132] Figure 7 It is a schematic diagram of the device structure of a server provided in an embodiment of the present application. DETAILED DESCRIPTION
[0133] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.
[0134] Before explaining the embodiments of the present application in detail, the application scenarios involved in the embodiments of the present application are first introduced.
[0135] At present, deep learning models are widely used in various industries. For example, in the field of intelligent transportation, deep learning models can be used to identify and classify vehicle images collected by monitoring equipment. For another example, in the field of security, deep learning models can be used to identify facial images collected by image acquisition equipment, etc.
[0136] Before using a deep learning model for image recognition, the deep learning model needs to be trained first. Based on this, various training platforms for deep learning training calculations have emerged. Usually, developers can perform code editing, compiling and testing in the Linux environment of the training platform. After code editing, compiling and testing are completed, developers usually need to use the platform functions of the training platform to perform model training and reasoning. The task processing method provided in the embodiment of the present application can be used to trigger training tasks in the Linux environment after the developer completes code editing, compiling and testing to achieve model training and reasoning.
[0137] Next, the system architecture involved in the task processing method provided in the embodiment of the present application is introduced.
[0138] Figure 1 is a system architecture diagram of a training platform provided in an embodiment of the present application. Figure 1 As shown, the system includes a web client 101 , a web server 102 , a master server 103 and a plurality of slave servers 104 .
[0139] The web client 101 may refer to a terminal that provides platform functions to developers through a web page. A web page may be displayed on the web client 101.
[0140] The web server 102 refers to a server running a web service, which can be used for business processing. For example, in an embodiment of the present application, the web server 102 can receive a task processing request from the server 104 and process the task processing request. It should be noted that the web server 102 can store image information of all images created in the system. In addition, the web server 102 can also store task information of tasks currently being executed in the system.
[0141] The master server 103 may be deployed with a Kubernetes master component. Kubernetes is a container orchestration framework that can deploy applications in different servers in a containerized manner, and can orchestrate and manage containers in Pod units. The master server 103 can allocate Pods to slave servers 104 through the Kubernetes master component to implement resource scheduling of multiple slave servers 104.
[0142] Pods may be run on multiple slave servers 104, and backend service modules may be deployed on multiple slave servers 104. Pods may include one or more containers, each of which may have an application running in it. Backend service modules may be used to implement various function calls.
[0143] It should be noted that each of the above servers may refer to a server. In this case, each server may run one service or multiple services. Alternatively, each server may refer to a server cluster. In this case, the server cluster may jointly implement one service or multiple services. The embodiments of the present application do not limit this.
[0144] In the embodiment of the present application, before running the deep learning training task through the image of the shell container and processing the task processing command through the shell container, the shell container and the image of the shell container can be created first. Figure 2 This section describes how to create a shell container and a shell container image. Figure 2 As shown, this method can be applied to Figure 1 In the system architecture shown, the method includes the following steps:
[0145] Step 201: The client sends a shell container creation command to a first server, where the shell container creation command is used to instruct to create a shell container on the first server.
[0146] The user can perform specified operations on the web page displayed by the client to trigger the shell container creation command. After detecting the shell container creation command, the client can send the shell container creation command to the third server through the second server. Among them, the second server refers to the web server running the web service, that is, the server for providing multiple services corresponding to the web page. The third server may refer to the master server with the master component of Kubernetes deployed. After receiving the shell container creation command sent by the client, the third server can assign the corresponding slave server, that is, the first server, to the shell container to be created according to the shell container creation command. Afterwards, the third server can send the shell container creation instruction to the first server. Among them, the backend service module is deployed on the first server.
[0147] Step 202: The first server creates a shell container according to the shell container creation command, and returns a creation success message to the client.
[0148] After receiving the shell container creation command, the first server creates a shell container.
[0149] It should be noted that the shell container refers to a container with the SSH (Secure Shell) service enabled, that is, a user can log in to the container through the SSH tool.
[0150] After creating the shell container, the first server may return a creation success message to the client indicating that the shell container is successfully created.
[0151] Step 203: After receiving the creation success message, the client displays the SSH command interface, and establishes a connection with the shell container based on the login operation detected on the SSH command interface.
[0152] After receiving the notification message that the shell container is successfully created, the client can display the SSH command interface. The SSH command interface is the command interface of the SSH tool. Afterwards, if the user wants to use the shell container, the login operation can be performed on the SSH command interface. When the client detects the user's login operation, a container login request can be sent to the first server, and the container login request carries the user account information.
[0153] A corresponding SSH service module may be deployed on the first server. The SSH service module may authenticate the client according to the user account information carried in the container login request. After the authentication is passed, the SSH service module may send the port information of the port corresponding to the shell container to the client's SSH tool. The SSH tool may establish a connection between the client and the shell container according to the port information.
[0154] When the connection between the client and the shell container is established, it is equivalent to logging into the shell container. Since the shell container is a container created in the Linux environment, after logging into the shell container, the user can enter code editing, compiling and other commands in the SSH command interface to implement code editing, compiling and testing in the shell container. After completing code editing, compiling and testing operations, the user can enter the command line tool startup command on the SSH command interface. After the shell container receives the command line tool startup command, if it is the first time to receive the command, the shell container can display a prompt message for prompting the user to enter the user account information, and the user can enter the user account information for logging into the shell container. After receiving the user account information, the shell container can send the user account information to the backend service module, and the backend service module can verify the user account information, and after the verification is passed, return the token value corresponding to the user account information. After that, the shell container can start the command line tool. Among them, the token value can be used to distinguish different users. That is, different users correspond to different token values. It should be noted that the above-mentioned command line tool can refer to a tool installed in the shell container for implementing the subsequent steps and the method in the subsequent embodiments.
[0155] Step 204: The client receives a first command input by the user in the SSH command interface, and sends the first command to the shell container, where the first command carries a first task identifier.
[0156] After establishing a connection with the shell container and starting the command line tool in the shell container, the user can enter a first command in the SSH command interface. The first command carries a first task identifier, which is used to indicate that the first command is a command for a task for creating an image of the shell container.
[0157] After receiving the first command, the client may send the first command to the shell container through the connection with the shell container.
[0158] It should be noted that the first command may also carry the image name of the image of the shell container set by the user.
[0159] Step 205: When the shell container receives the first command, it sends an image creation command to the backend service module, where the image creation command carries the first task identifier.
[0160] After receiving the first command, the shell container can obtain the first task identifier included in the first command, and generate an image creation command according to the first task identifier. At this time, the image creation command carries the first task identifier.
[0161] It should be noted that, in a possible implementation, after obtaining the first task identifier, the shell container may also obtain the aforementioned token value, and carry the token value in the image creation command.
[0162] Furthermore, when the first command also includes an image name set by the user, the image creation command may also include the image name. Exemplarily, the image creation command may be a commit command.
[0163] After generating the image creation command, the shell container can send the image creation command to the backend service module.
[0164] Step 206: The backend service module determines the shell container identifier according to the first task identifier.
[0165] After receiving the image creation command, the backend service module may first generate a shell container identifier for identifying the shell container according to the first task identifier carried by the command.
[0166] Step 207: The backend service module calls the docker service, generates an image of the shell container according to the shell container identifier, and stores the image of the shell container.
[0167] After the shell container identifier is generated, the backend service module can call the docker service to generate an image of the shell container according to the shell container identifier.
[0168] It should be noted that a docker service module may be deployed on the first server, and the backend service module may call the docker service module and pass the shell container identifier and the image name to the docker service module. After receiving the shell container identifier and the image name, the docker service module may determine the shell container according to the shell container identifier, and then generate an image of the shell container according to the shell container. At the same time, the docker service module may name the image of the shell container according to the aforementioned received image name.
[0169] After generating the image of the shell container, the backend service module can send a storage command to the docker service module, and the docker service module can store the image of the shell container in the image repository according to the storage command.
[0170] Step 208: The backend service module sends the image information of the shell container to the second server, where the image information of the shell container includes the image name.
[0171] After storing the image of the shell container in the image warehouse, the back-end service module can call the web service interface, and then send the image information of the shell container to the second server through the web service interface. Among them, the image information of the shell container includes the image name, creation time, image size and image description of the image of the shell container. The embodiment of the present application does not make specific limitations on this. It should be noted that the image description may include the image name. In this case, the image information does not need to include the image name separately. Alternatively, the image description may not include the image name, but only include the content description information of the image of the shell container.
[0172] Step 209: the second server adds an image record of the image of the shell container in the image record table according to the image information of the shell container, and returns a successful adding notification message to the backend service module.
[0173] After receiving the image information of the shell container, the second server may store the image name of the shell container as an image record in the image record table. Alternatively, when the image information also includes other information, the second server may store the information in the image record table, that is, the image information of the shell container is taken as an image record.
[0174] Afterwards, the second server may return a notification message indicating that the mirror record is added successfully to the backend service module, so as to notify the backend service module.
[0175] Step 210: The backend service module sends a successful adding notification message to the shell container.
[0176] Step 211: The shell container returns an image creation success notification message to the client according to the adding success notification message.
[0177] After receiving the adding success notification message returned by the backend service module, the Shell container can determine that the image of the shell container has been successfully created. At this time, the shell container can return the image creation success notification message to the client through the connection between the shell container and the client to prompt the user that the image of the shell container has been successfully created.
[0178] After creating the shell container image, the user can then enter the task processing command on the SSH command interface and Figure 3 The task processing method in the illustrated embodiment processes the task command.
[0179] Figure 3 is a flowchart of a task processing method provided in an embodiment of the present application. The method can be applied to Figure 1 The system architecture shown in Figure 3 As shown, the method may include the following steps:
[0180] Step 301: The client receives a task processing command input by a user in the SSH command interface, and sends the task processing command to a shell container.
[0181] After creating the image of the shell container, the user can then enter a task processing command on the SSH command interface. The task processing command can be used to trigger the corresponding task. The task processing command can be one of a task creation command, a task deletion command, a task restart command, a task list viewing command, and a task information viewing command. After receiving the task processing command, the client can send the task processing command to the shell container.
[0182] Step 302: The shell container sends a task processing command to the backend service module.
[0183] After receiving the task processing command, the Shell container may forward the task processing command to the backend service module.
[0184] Step 303: The backend service module sends the task processing command to the second server, so that the second server processes the task processing command.
[0185] After receiving the task processing command sent by the shell container, the backend service module can call the web service interface to send the task processing command to the second server, so that the second server processes the task processing command according to the image record of the shell container's image.
[0186] Among them, when the task processing command is a task creation command, the back-end service module can receive a task container creation command sent by the second server according to the task creation command, the task creation command is used to indicate the creation of a first task, and the task container creation command is used to indicate the creation of a first task container; the back-end service module creates the first task container according to the image of the shell container; after the first task container is created, the back-end service module sends a first notification message to the second server, so that the second server adds the first task to the task list according to the first notification message, and the first notification message is used to indicate that the first task container is created successfully.
[0187] Exemplarily, after receiving the task creation command, the backend service module can call the web service interface to forward the task creation command to the second server. The task creation command can carry a second task identifier, which is used to identify the first task. After receiving the task creation command, the second server can generate a task container creation command and send the task container creation command to the third server. The task container creation command is used to instruct the creation of a first task container. The first task container is used to execute the first task. The first task refers to a deep learning training task that runs based on the image of the shell container.
[0188] The third server can allocate the corresponding server to the first task container to be created by the task container creation command according to the load balancing of each slave server. In the embodiment of the present application, the assigned server is still the first server as an example for explanation. The third server can send the task container creation command to the first server, and after receiving the task container creation command, the first server can create the first task container according to the specified script. Among them, the specified script is running in the first task container, and the specified script refers to a script that relies on the image of the shell container to implement the deep learning training task. That is, when the first task container executes the first task, it needs to use the image of the shell container.
[0189] After the first task container is successfully created, the backend service module may send a first notification message to the second server, and the first notification message is used to indicate that the first task container is successfully created. Optionally, the first notification message may carry a second task identifier. After receiving the first notification message, the second server may add the second task identifier to the task list. Optionally, the first notification message may also carry other detailed task information about the first task. In this case, the second server may also store the second task identifier and the detailed task information of the first task in correspondence.
[0190] After storing the second task identifier and the task information of the first task, the second server may generate a task creation success message and send the task creation success message to the backend service module. At this point, the first task is created.
[0191] Optionally, when the task processing command is a task deletion command, the backend service module can call the web backend service interface to forward the task deletion command to the second server. The task deletion command may carry the identifier of the task to be deleted. After receiving the task deletion command, the second server can delete the task identifier carried by the task deletion command from the task list, and delete the stored task information corresponding to the task identifier. At the same time, the background service module can also generate a corresponding task container identifier based on the task identifier carried in the task deletion command, and call the docker service to destroy the corresponding task container based on the task container identifier.
[0192] Optionally, when the task processing command is a task information viewing command, the backend service module can call the web backend service interface to forward the task information viewing command to the second server. The task information viewing command can carry a task identifier. After receiving the task information viewing command, the second server can obtain the task information corresponding to the task identifier according to the carried task identifier, and return the task information to the backend service module.
[0193] Optionally, when the task processing command is a task stop command, the backend service module can determine the container identifier according to the task identifier carried in the task stop command, and then the backend service module can call the docker service to suspend the process in the container identified by the container identifier. At the same time, the backend service module can also forward the task stop command to the second server, and the second server can update the task information corresponding to the task identifier carried in the task stop command, and return an update success message to the backend service module.
[0194] Optionally, when the task processing command is a task restart command, it can be processed with reference to the relevant implementation method of the task stop command, which is not limited in this embodiment of the present application.
[0195] It should be noted that, as mentioned above, when the first server includes a first task container, the first task container can execute the first task by running a specified script. In the process of the first task container executing the first task, if the first task execution fails, the first server can retain the first task container and return a task error notification message to the client. After receiving the task error notification message, the client displays the notification message to prompt the user. At this time, the user can modify the specified script through the SSH command interface. Alternatively, the specified script can also be modified in other ways. After the modification of the specified script is completed, the user can enter a task restart command in the SSH command interface, and the client can receive the task restart command and send the task restart command to the shell container. Among them, the task container command carries the container identifier of the first task container. When the shell container receives the task restart command, it can forward the task restart command to the backend service module. The backend service module restarts the first task container according to the container identifier of the first task container by calling the docker command.
[0196] In the related art, when a user triggers a task through a web page, an error message will be sent to the client when an error occurs during task execution. At this time, if the user needs to modify the specified script, it is necessary to switch to the Linux environment to modify the specified script, so that the task container corresponding to the task will be destroyed. Later, when the developer has completed the modification, it is necessary to switch back to the web page and re-trigger the task. After re-triggering the task, the client needs to wait for the third server to reallocate resources to the task to create a task container. In the case of tight cluster resources, it takes a long time to reallocate resources.
[0197] In an embodiment of the present application, after the first task container executes the first task with an error, the first server can retain the first task container. At this time, the user can modify the specified script. After the modification is completed, the user can enter the task restart instruction in the SSH command interface, and the shell container can send the task restart instruction to the back-end service module. After receiving the task restart instruction, the back-end service module can call the docker service to restart the first task container according to the container identifier of the first task container in the task restart instruction. In this way, the first task container can continue to run the modified specified script to execute the first task without waiting in line for the reallocation of resources to rebuild the task container, thereby improving the efficiency of task execution.
[0198] Optionally, in some possible examples, during the process of executing the first task in the first task container, if the first task execution fails, after the client receives the task error notification message, the user can also enter a second command in the SSH command interface after modifying the specified script. The second command carries the task identifier of the first task. The client can send the second command to the shell container. The shell container can forward the second command to the backend service module. After receiving the second command, the backend service module can call the execution interface according to the task identifier of the first task in the second command; then, the shell container obtains the execution information of the first task container through the execution interface, creates a second process for the first task in the first task container, and deletes the first process. Among them, the first process is a process included in the first task container for executing the first task. The second process is a process re-created for the first task after deleting the first process, and the second process is managed by the shell container. After obtaining the execution information of the first task container, the shell container can send the execution information of the first task container to the client. The client can display the execution information of the first task container so that the user can locate the problem according to the execution information of the first task container. It should be noted that the execution information of the first task container may include various operation parameters and operation logs in the first task container.
[0199] Exemplarily, a user may enter a second command in the SSH command interface, and the second command may be an exec command. After receiving the second command, the shell container forwards the second command to the backend service module. Among them, in addition to the task identifier of the first task, the second command may also include user account information. After receiving the second command, the backend service module may generate a corresponding container identifier according to the task identifier, and call the execution interface, that is, the exec interface, through the container identifier. The shell container may obtain the execution information in the first task container through the execution interface according to the container identifier, and forward it to the client for display. Developers may view the execution information in the first task container to locate and troubleshoot problems and perform debugging. Since in the case of an error in task execution, if the execution information is to be obtained, the first process needs to be terminated. However, generally, the life cycle of the first task container is consistent with the first process, and when the first process ends, the life cycle of the first task cycle will also end. Based on this, while obtaining the execution information, the shell container may create a second process for the first task in the first task container through the execution interface, and delete the first process. At this time, the second process is managed by the command line tool in the shell container. Since the second process is managed by the command line tool in the shell container, the life cycle of the second process will be consistent with the life cycle of the command line tool in the shell container, and the second process is created for the first task in the first task container, so the life cycle of the first task container will be consistent with the second process. In this way, by creating the second process, the shell container can control the first task container from being destroyed. After the problem is troubleshooted, the shell container can start the second process, so that the first task container continues to execute the first task.
[0200] It can be seen that by using the above method to troubleshoot problems, users can directly enter the task container to view the execution information, which is conducive to users quickly and conveniently locating problems for debugging. In addition, after the troubleshooting and debugging are completed, the first task container can continue to execute the first task through the second process, so there is no need to queue, which improves the debugging efficiency when resources are tight.
[0201] It should be noted that in the aforementioned task processing process, the user can write a script in the shell container, which may include a task creation command and a task deletion command. The shell container can create and delete tasks by executing the commands of the script, and the script may also include instructions for adjusting the parameters in the specified script. In this way, after creating a task according to the task creation instructions in the script, the corresponding task can be executed and the task processing result can be obtained. When the task processing result does not meet the specified conditions, the task can be deleted through the task deletion command, and the parameters in the specified script corresponding to the first task can be automatically adjusted. After the adjustment, create the task again according to the task creation command. It can be seen that this method can be used to automatically adjust the parameters for the training task.
[0202] Step 304: The backend service module receives the processing result returned by the second server, and forwards the processing result to the shell container.
[0203] It should be noted that, as can be seen from the content introduced in the aforementioned step 302, the second server can return different processing results to the backend service module according to different task processing commands.
[0204] Exemplarily, when the task processing command is a task creation command, the processing result returned by the second server to the backend service module will be a task creation success message. When the task processing command is a task information viewing command, the processing result returned by the second server to the backend service module will be the acquired task information. The processing result is not described in detail in this embodiment of the present application.
[0205] After the backend service module receives the processing result, it can send the processing result to the shell container.
[0206] Step 305: The shell container forwards the processing result to the client.
[0207] Step 306: The client displays the processing result.
[0208] After receiving the processing result sent by the shell container, the client can display the processing result in the SSH command interface to notify the user.
[0209] In an embodiment of the present application, the client can send the received task processing command directly to the shell container on the first server, the shell container can forward the task processing command to the back-end service module, the back-end service module can send the task processing command to the second server, and the second server processes the task processing command and returns the processing result. The back-end service module can receive the processing result, and send the processing result to the shell container, and then forward it to the client for display. It can be seen that in an embodiment of the present application, the task can be triggered directly in the shell container. In this way, after the developer completes code editing, compilation and other work, the task can be triggered directly through the shell container in the Linux environment, without having to switch to the web page to trigger the task by clicking the corresponding button, which is more convenient to operate.
[0210] In addition, in the related art, the image created by the developer outside the cluster often lacks the configuration required for the platform to run. Without these configurations, the image cannot be used normally on the platform, and the image made by the user himself may have some security risks. In the embodiment of the present application, after creating a shell container, the developer can install various applications in the shell container, and then create an image of the shell container to obtain a private image that meets the user's needs, reducing security risks.
[0211] exist Figure 2 In the embodiment shown, after creating the image of the shell container, the backend service module can call the docker service to store the image of the shell container in the image warehouse, and the second server can add the image record of the image of the shell container in the image record table according to the image information of the shell container. Figure 4 The image processing method shown processes the image of the shell container.
[0212] Figure 4 A flowchart of a mirror processing method is provided. Figure 4 As shown, the method comprises the following steps:
[0213] Step 401: The client receives an image processing command input by a user in an SSH command interface, and sends the image processing command to a shell container. The image processing command is one of an image deletion command, an image list acquisition command, and an image information acquisition command.
[0214] The user can enter the image processing command in the SSH command interface, and the client can receive the image processing command entered by the user and send the image processing command to the shell container through the connection with the shell container.
[0215] Step 402: The shell container forwards the image processing command to the backend service module.
[0216] Step 403: The backend service module sends a mirror processing command to the second server, so that the second server performs a corresponding processing operation according to the mirror processing command.
[0217] When the image processing command is an image deletion command, the backend service module can call the web service interface according to the token value carried in the image deletion command, and forward the image deletion command to the second server through the web service interface. The image deletion command can also carry the image name. It should also be noted that the token value carried in the image deletion command is added to the command by the shell container when forwarding the command to the backend service module.
[0218] After receiving the image deletion command, the second server can delete the corresponding image record in the image record table according to the image name, and delete all other image information corresponding to the image record. Afterwards, the second server can send a deletion notification message to the backend service module, and the deletion notification message is used to indicate that the image record has been successfully deleted.
[0219] Optionally, when the image processing command is an image list acquisition command, the backend service module can also call the web service interface according to the token value in the image list acquisition command, and forward the image list acquisition command to the second server. After receiving the image list acquisition command, the second server can obtain the stored image list and return the image list to the backend service module.
[0220] Optionally, when the image processing command is an image information acquisition command, the backend service module can also call the web service interface according to the token value in the image list acquisition command, and forward the image information acquisition command to the second server, and the image information acquisition command can also carry the image name. The second server can obtain the corresponding image information according to the image name and return it to the backend service module.
[0221] Step 404: The backend service module receives the image processing result returned by the second server, and sends the image processing result to the shell container.
[0222] As can be seen from the aforementioned step 403, the image processing results are different according to the image processing commands. The backend service module can feed back the image processing results received from the second server to the shell container.
[0223] It should be noted that the image processing command sent by the aforementioned shell container can also be an image download command. In this case, after receiving the image download command, the backend service module does not need to call the web service interface, but can call the docker save command according to the image name and storage path carried in the image download command to save the image corresponding to the image name to the corresponding storage path.
[0224] Step 405: The shell container forwards the image processing result to the client.
[0225] Step 406: The client displays the mirroring result.
[0226] The client displays the image processing result sent by the shell container on the SSH command interface to notify the user.
[0227] In an embodiment of the present application, an image of a shell container can be created through a shell container, and the image of the created shell container can be managed through the shell container according to an image processing command, thereby simplifying the operation of developers.
[0228] See also Figure 5 The embodiment of the present application provides a task processing device 500, which can be applied to a client. The device 500 includes:
[0229] A sending module 501 is used to send a shell container creation command, where the shell container creation command is used to instruct to create a shell container on a first server;
[0230] A connection module 502 is used to display a secure shell protocol SSH command interface and establish a connection with a shell container based on a login operation detected on the SSH command interface;
[0231] The receiving module 503 is used to receive the task processing command entered by the user in the SSH command interface, and send the task processing command to the shell container so that the shell container returns the processing result based on the task processing command, and the processing result includes the task information of the deep learning training task running based on the image of the shell container.
[0232] Optionally, the connection module 502 is specifically configured to:
[0233] Receive the login command entered by the user in the SSH command interface, which carries the user account information;
[0234] Sending a container login request to the first server according to the login command, where the container login request carries user account information;
[0235] Receive port information of the port corresponding to the shell container, where the port information is sent by the first server after verifying the user account information;
[0236] Establish a connection with the shell container through the port information of the port corresponding to the shell container.
[0237] Optionally, the receiving module 503 is further used to receive a first command entered by a user in the SSH command interface, where the first command carries a first task identifier, and the first task identifier is used to indicate that the first command is a command for a task for creating an image of a shell container;
[0238] The sending module 501 is further configured to send a first command to the shell container, so that the shell container creates an image of the shell container based on the first command.
[0239] Optionally, the receiving module 503 is further used to receive an image processing command input by a user in the SSH command interface, where the image processing command is one of an image deletion command, an image list acquisition command, and an image information acquisition command;
[0240] The sending module 501 is further used to send an image processing command to the shell container to instruct the shell container to perform a corresponding operation on the image of the shell container based on the image processing command;
[0241] The receiving module 503 is further used to receive the image processing result sent by the shell container.
[0242] Optionally, the task processing command is one of a task creation command, a task deletion command, a task restart command, a task list viewing command, and a task information viewing command.
[0243] Optionally, when the task processing command is a task creation command, the task creation command is used to instruct the creation of a first task container on a first server, and the first task container is used to run a specified script to execute a first task, and the first task is a deep learning training task run based on an image of a shell container.
[0244] Optionally, the receiving module 503 is further used to receive a task restart command input by the user in the SSH command interface after receiving the task error notification message, the task error notification message is used to prompt the user that the first task execution error occurs, and the task restart command carries the container identifier of the first task container;
[0245] The sending module 501 is further configured to send a task restart command to the shell container to instruct the shell container to restart the first task container.
[0246] Optionally, the first task container includes a first process created for the first task;
[0247] The receiving module 503 is further used to receive a second command input by the user in the command interface after receiving the task error notification message, where the second command includes the task identifier of the first task;
[0248] The sending module 501 is further used to send a second command to the shell container to instruct the shell container to obtain the execution information of the first task container, delete the first process in the first task container, and re-create a second process for the first task, and the second process is managed by the shell container;
[0249] The receiving module 503 is further configured to receive the execution information of the first task container sent by the shell container.
[0250] See also Figure 6 , the embodiment of the present application provides a task processing device 600, which is applied to a first server, and the task processing device 600 includes: a shell container 601 and a backend service module 602;
[0251] The shell container 601 is used to receive the task processing command sent by the client and send the task processing command to the backend service module 602, in which the image of the shell container is stored;
[0252] The backend service module 602 is used to send the task processing command to the second server so that the second server processes the task processing command. The second server refers to a server for providing multiple services corresponding to the web page;
[0253] The backend service module 602 is further used to receive the processing result returned by the second server, and forward the processing result to the shell container, where the processing result includes task information of the deep learning training task running based on the image of the shell container;
[0254] The shell container 601 is also used to send the processing result to the client.
[0255] Optionally, the shell container 601 is further used to receive a first command sent by the client, the first command carries a first task identifier, and the first task identifier is used to indicate that the first command is a command for a task for creating an image of the shell container; and send an image creation command to the backend service module 602, the image creation command carrying the first task identifier;
[0256] The backend service module 602 is used to determine the shell container identifier according to the first task identifier; call the docker service, generate an image of the shell container according to the shell container identifier, and store the image of the shell container.
[0257] Optionally, the image creation command also includes an image name;
[0258] The backend service module 602 is also used to send the image information of the shell container to the second server, so that the second server adds an image record of the image of the shell container in the image record table according to the image information of the shell container, and the image information of the shell container includes an image name.
[0259] Optionally, the shell container 601 is further used to receive an image processing command sent by the client, and send the image processing command to the backend service module 602, where the image processing command is one of an image deletion command, an image list acquisition command, and an image information acquisition command;
[0260] The backend service module 602 is also used to send an image processing command to the second server, so that the second server performs a corresponding processing operation according to the image processing command; receive the image processing result returned by the second server, and send the image processing result to the shell container 601;
[0261] The shell container 601 is also used to send the image processing result to the client.
[0262] Optionally, the task processing command is one of a task creation command, a task deletion command, a task restart command, a task list viewing command, and a task information viewing command.
[0263] Optionally, the device 600 also includes a first task container, which is used to execute a first task, and the first task refers to a deep learning training task running based on the image of the shell container.
[0264] Optionally, the task processing command is a task creation command;
[0265] The backend service module 602 is also used to receive a task container creation command, which is sent by the second server after receiving the task creation instruction. The task creation command is used to instruct the creation of the first task, and the task container creation command is used to instruct the creation of the first task container; the first task container is created according to the image of the shell container; after the first task container is created, a first notification message is sent to the second server, so that the second server adds the first task to the task list according to the first notification message, and the first notification message is used to indicate that the first task container is created successfully;
[0266] Correspondingly, the backend service module 602 is further used to receive a task creation success message fed back by the second server, where the task creation success message is used to indicate that the first task is created successfully.
[0267] Optionally, the first task container is used to run a specified script to perform the first task;
[0268] When an error occurs in the execution of the first task, the server retains the first task container;
[0269] When the shell container 601 receives the task restart command sent by the client, the shell container 601 is further used to send the task restart command to the backend service module 602, where the task restart command carries the container identifier of the first task container;
[0270] The backend service module 602 is further configured to restart the first task container according to the container identifier of the first task container by calling a docker command.
[0271] Optionally, the first task container is used to run a specified script to execute a first task, and the first task container includes a first process;
[0272] When an error occurs in the execution of the first task, the shell container 601 is further used to send a task error notification message to the client; when the shell container receives a second command sent by the client, it sends the second command to the backend service module 602, where the second command includes a task identifier of the first task;
[0273] The backend service module 602 is further used to call the execution interface according to the task identifier of the first task;
[0274] The shell container 601 is also used to obtain the execution information of the first task container through the execution interface, and to create a second process for the first task in the first task container, delete the first process, and the second process is managed by the shell container.
[0275] In the embodiments of the present application, tasks may include deep learning tasks, may include training tasks of neural network models, may include tasks that utilize neural networks to perform target recognition (face recognition, body recognition, vehicle recognition, license plate recognition, etc.), behavior recognition, target tracking, speech recognition and other functions, and may also include other deep learning-related tasks, which are not limited here.
[0276] Figure 7 FIG. 1 shows a schematic diagram of a server 700 for performing task processing provided by an exemplary embodiment of the present application. Figure 2-4 The functions of the server in the embodiment shown can be achieved by Figure 7 The server shown in can be implemented. The server can be a server in the background server cluster. Specifically:
[0277] The server 700 includes a central processing unit (CPU) 701, a system memory 704 including a random access memory (RAM) 702 and a read-only memory (ROM) 703, and a system bus 705 connecting the system memory 704 and the central processing unit 701. The server 700 also includes a basic input / output system (I / O system) 706 that helps transfer information between various components in the computer, and a large-capacity storage device 707 for storing an operating system 713, application programs 714, and other program modules 715.
[0278] The basic input / output system 706 includes a display 708 for displaying information and an input device 709 such as a mouse and a keyboard for user inputting information. The display 708 and the input device 709 are connected to the central processing unit 701 through an input / output controller 710 connected to the system bus 705. The basic input / output system 706 may also include an input / output controller 710 for receiving and processing inputs from a plurality of other devices such as a keyboard, a mouse, or an electronic stylus. Similarly, the input / output controller 710 also provides output to a display screen, a printer, or other types of output devices.
[0279] The mass storage device 707 is connected to the central processing unit 701 through a mass storage controller (not shown) connected to the system bus 705. The mass storage device 707 and its associated computer-readable media provide non-volatile storage for the server 700. That is, the mass storage device 707 may include a computer-readable medium (not shown) such as a hard disk or a CD-ROM drive.
[0280] Without loss of generality, computer readable media may include computer storage media and communication media. Computer storage media include volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information such as computer readable instructions, data structures, program modules or other data. Computer storage media include RAM, ROM, EPROM, EEPROM, flash memory or other solid-state storage technologies, CD-ROM, DVD or other optical storage, cassettes, magnetic tapes, disk storage or other magnetic storage devices. Of course, those skilled in the art will appreciate that computer storage media are not limited to the above. The above-mentioned system memory 704 and mass storage device 707 can be collectively referred to as memory.
[0281] According to various embodiments of the present application, the server 700 can also be connected to a remote computer on the network through a network such as the Internet. That is, the server 700 can be connected to the network 712 through the network interface unit 711 connected to the system bus 705, or the network interface unit 711 can be used to connect to other types of networks or remote computer systems (not shown).
[0282] The memory also includes one or more programs, which are stored in the memory and configured to be executed by the CPU. The one or more programs include instructions for performing the task processing method provided in the embodiment of the present application.
[0283] The present application also provides a non-transitory computer-readable storage medium. When the instructions in the storage medium are executed by the processor of the server, the server can execute the above-mentioned Figure 2-4 The illustrated embodiment provides a task processing method.
[0284] The present application also provides a computer program product including instructions, which, when executed on a computer, enables the computer to execute the above Figure 2-4 The illustrated embodiment provides a task processing method.
[0285] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.
[0286] The above description is only an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims
1. A task processing method, It is characterized in that The method comprises: Sending a shell container creation command, wherein the shell container creation command is used to instruct to create a shell container on a first server, wherein the first server includes a backend server module, and the backend server module stores an image of the shell container; Displaying a secure shell protocol SSH command interface, and establishing a connection with the shell container based on a login operation detected on the SSH command interface; Receive a task processing command input by the user in the SSH command interface, and send the task processing command to the shell container, so that the shell container returns a processing result obtained by the second server based on the task processing command, wherein the second server refers to a server for providing multiple services corresponding to a web page, and the processing result includes task information of a deep learning training task running based on the image of the shell container, the task processing command is forwarded from the shell container to the second server by the back-end server module, and the processing result is forwarded from the second server to the shell container by the back-end server module.
2. The method according to claim 1, It is characterized in that The step of establishing a connection with the shell container based on a login operation detected on the SSH command interface includes: Receive a login command entered by a user in the SSH command interface, wherein the login command carries user account information; Sending a container login request to the first server according to the login command, wherein the container login request carries user account information; Receive port information of a port corresponding to the shell container, where the port information is sent by the first server after verifying the user account information; A connection is established with the shell container through the port information of the port corresponding to the shell container.
3. The method according to claim 1, It is characterized in that Before receiving the task processing command input by the user on the SSH command interface, the method further includes: Receiving a first command input by a user in the SSH command interface, where the first command carries a first task identifier, and the first task identifier is used to indicate that the first command is a command for a task for creating an image of a shell container; The first command is sent to the shell container, so that the shell container creates an image of the shell container based on the first command.
4. The method according to claim 1, It is characterized in that The method further comprises: Receiving an image processing command input by a user in the SSH command interface, where the image processing command is one of an image deletion command, an image list acquisition command, and an image information acquisition command; Sending the image processing command to the shell container to instruct the shell container to perform a corresponding operation on the image of the shell container based on the image processing command; Receive the image processing result sent by the shell container.
5. The method according to any one of claims 1 to 4, It is characterized in that The task processing command is one of a task creation command, a task deletion command, a task restart command, a task list viewing command, and a task information viewing command.
6. The method according to any one of claims 1 to 4, It is characterized in that When the task processing command is a task creation command, the task creation command is used to instruct the creation of a first task container on the first server, and the first task container is used to run a specified script to execute a first task, and the first task is a deep learning training task run based on the image of the shell container.
7. The method according to claim 6, It is characterized in that The method further comprises: After receiving the task error notification message, receiving a task restart command input by the user in the SSH command interface, the task error notification message is used to prompt the user that the first task execution error occurred, and the task restart command carries the container identifier of the first task container; The task restart command is sent to the shell container to instruct the shell container to restart the first task container.
8. The method according to claim 6, It is characterized in that The first task container includes a first process created for the first task, and the method further includes: After receiving the task error notification message, receiving a second command input by a user in the SSH command interface, where the second command includes a task identifier of the first task; Sending the second command to the shell container to instruct the shell container to obtain the execution information of the first task container, delete the first process in the first task container, and re-create a second process for the first task, where the second process is managed by the shell container; Receive execution information of the first task container sent by the shell container.
9. A task processing device, It is characterized in that The device comprises: A sending module, used for sending a shell container creation command, wherein the shell container creation command is used for instructing to create a shell container on a first server, wherein the first server includes a backend server module, and the backend server module stores an image of the shell container; A connection module, used to display a secure shell protocol SSH command interface, and establish a connection with the shell container based on a login operation detected on the SSH command interface; A receiving module is used to receive a task processing command input by a user in the SSH command interface, and send the task processing command to the shell container, so that the shell container returns a processing result obtained by a second server based on the task processing command, wherein the second server refers to a server for providing multiple services corresponding to a web page, and the processing result includes task information of a deep learning training task running based on the image of the shell container, the task processing command is forwarded from the shell container to the second server by the back-end server module, and the processing result is forwarded from the second server to the shell container by the back-end server module.
10. The device according to claim 9, It is characterized in that The connection module is used for: Receive a login command entered by a user in the SSH command interface, wherein the login command carries user account information; send a container login request to the first server according to the login command, wherein the container login request carries user account information; receive port information of a port corresponding to the shell container, wherein the port information is sent by the first server after verifying the user account information; and establish a connection with the shell container through the port information of the port corresponding to the shell container.
11. The device according to claim 9, It is characterized in that The receiving module is further used to receive a first command input by a user in the SSH command interface, where the first command carries a first task identifier, and the first task identifier is used to indicate that the first command is a command for a task for creating an image of a shell container; The sending module is further configured to send the first command to the shell container, so that the shell container creates an image of the shell container based on the first command.
12. The device according to claim 9, It is characterized in that The receiving module is further used to receive an image processing command input by a user in the SSH command interface, where the image processing command is one of an image deletion command, an image list acquisition command, and an image information acquisition command; The sending module is further used to send the image processing command to the shell container to instruct the shell container to perform a corresponding operation on the image of the shell container based on the image processing command; The receiving module is also used to receive the image processing result sent by the shell container.
13. The device according to any one of claims 9 to 12, It is characterized in that The task processing command is one of a task creation command, a task deletion command, a task restart command, a task list viewing command, and a task information viewing command.
14. The device according to any one of claims 9 to 12, It is characterized in that When the task processing command is a task creation command, the task creation command is used to instruct the creation of a first task container on the first server, and the first task container is used to run a specified script to execute a first task, and the first task is a deep learning training task run based on the image of the shell container.
15. The device according to claim 14, It is characterized in that The receiving module is further configured to receive a task restart command input by a user in the SSH command interface after receiving a task error notification message, wherein the task error notification message is used to prompt the user that an error has occurred in the execution of the first task, and the task restart command carries a container identifier of the first task container; The sending module is further used to send the task restart command to the shell container to instruct the shell container to restart the first task container.
16. The device according to claim 14, It is characterized in that The first task container includes a first process created for the first task, and the receiving module is further used to receive a second command input by a user in the SSH command interface after receiving a task error notification message, wherein the second command includes a task identifier of the first task; The sending module is further used to send the second command to the shell container to instruct the shell container to obtain the execution information of the first task container, delete the first process in the first task container, and re-create the second process for the first task, the second process being managed by the shell container; The receiving module is further used to receive the execution information of the first task container sent by the shell container.
17. A computer-readable storage medium, It is characterized in that The storage medium stores a computer program, and when the computer program is executed by a processor, the steps of any method of claims 1-8 are implemented.
