CN117707609A - Method and device for managing script tasks based on container arrangement management tool - Google Patents

Method and device for managing script tasks based on container arrangement management tool Download PDF

Info

Publication number
CN117707609A
CN117707609A CN202410166518.6A CN202410166518A CN117707609A CN 117707609 A CN117707609 A CN 117707609A CN 202410166518 A CN202410166518 A CN 202410166518A CN 117707609 A CN117707609 A CN 117707609A
Authority
CN
China
Prior art keywords
management tool
image file
script
container
user
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202410166518.6A
Other languages
Chinese (zh)
Other versions
CN117707609B (en
Inventor
王丽
杨宜
邹永强
杨晖
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Accumulus Technologies Tianjin Co Ltd
Original Assignee
Accumulus Technologies Tianjin Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Accumulus Technologies Tianjin Co Ltd filed Critical Accumulus Technologies Tianjin Co Ltd
Priority to CN202410166518.6A priority Critical patent/CN117707609B/en
Publication of CN117707609A publication Critical patent/CN117707609A/en
Application granted granted Critical
Publication of CN117707609B publication Critical patent/CN117707609B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Stored Programmes (AREA)

Abstract

The invention provides a method and a device for managing script tasks based on a container arrangement management tool, comprising the following steps: receiving a script task acquisition instruction; acquiring list information of all script tasks currently running on a container arrangement management tool; receiving a script task selection instruction to be processed, and determining a script task to be processed from the list information; receiving a first selection instruction of a user, judging whether the name of a target branch input by the user is received or not in a first preset time period, if so, extracting and storing the latest image file on the target branch of the code management tool, and if not, extracting and storing the latest image file on the main branch of the code management tool; and sending the latest image file to a container arrangement management tool, wherein the container arrangement management tool is used for restarting the script task to be processed according to the latest image file. Therefore, the image file can be automatically changed by one-key operation, the script task is restarted, the testing work efficiency is improved, and the manual operation is reduced.

Description

Method and device for managing script tasks based on container arrangement management tool
Technical Field
The embodiment of the invention relates to the technical field of computers, in particular to a method and a device for managing script tasks based on a container arrangement management tool.
Background
In the related art, when Kubernetes are used, most of the operations are performed based on the functions of the Kubernetes, but the operation software of the Kubernetes is too heavy to quickly operate to restart scripts, replace image files, edit script container configuration and the like, so that the time consumption and the efficiency are low in the use process. For example, if the program in the Kubernetes container needs to be redeployed, the latest code image of the program code needs to be firstly entered into the docker and acquired through the git command, the latest code image in the container is updated through the docker, and the program is restarted by executing the kubectl rollout restart deployment myapp command, so that the operation process is complicated, the efficiency is low, and the error is easy.
Disclosure of Invention
The embodiment of the invention provides a method and a device for managing script tasks based on a container arrangement management tool, which are used for solving the technical problems that in the related art, when tasks such as restarting scripts, replacing image files and the like are executed by using Kubernetes, the operation process is complicated, the efficiency is low and errors are easy to occur.
In order to solve the above technical problems, the embodiments of the present invention provide the following aspects:
in a first aspect, an embodiment of the present invention provides a method for managing script tasks based on a container orchestration management tool, where the method includes:
receiving a script task acquisition instruction input by a user;
acquiring list information of all script tasks currently running on the container arrangement management tool according to the script task acquisition instruction;
receiving a to-be-processed script task selection instruction input by a user, and determining a to-be-processed script task from the list information according to the to-be-processed script task selection instruction;
sending out first prompt information, wherein the first prompt information is used for prompting the user to determine whether to replace an image file corresponding to the script task to be processed;
receiving a first selection instruction of the user, wherein the first selection instruction is used for indicating to replace the image file;
judging whether the name of the target branch input by the user is received in a first preset time period according to the first selection instruction, wherein the target branch stores a target image file;
if the name of the target branch input by the user is received in the first preset time period, extracting and storing a latest image file on the target branch of the code management tool through an interface of the code management tool, wherein the latest image file is the target image file;
if the name of the target branch input by the user is not received within the first preset time period, extracting and storing the latest image file on the main branch of the code management tool through the interface of the code management tool;
and sending the latest image file to the container arrangement management tool, wherein the container arrangement management tool is used for restarting the script task to be processed according to the latest image file.
Optionally, after the first prompt message is sent, the method further includes:
and if the first selection instruction is not received within a second preset time period, sending first notification information to the container arrangement management tool, wherein the first notification information is used for indicating that the image file corresponding to the script task to be processed is not changed.
Optionally, after sending the latest image file to the container arrangement management tool, or if the first selection instruction is not received within a second preset time period, sending first notification information to the container arrangement management tool, the method further includes:
sending out second prompt information, wherein the second prompt information is used for prompting the user to determine whether to change the container configuration corresponding to the script task to be processed;
receiving a second selection instruction of the user, wherein the second selection instruction is used for indicating to change the container configuration;
receiving the name of the target branch input by the user according to the second selection instruction, wherein the target branch stores target container configuration;
extracting and storing the latest container configuration on the target branch of the code management tool through an interface of the code management tool, wherein the latest container configuration is the target container configuration;
if the name of the target branch input by the user is not received within a third preset time period, extracting and storing the latest container configuration on the main branch of the code management tool through the interface of the code management tool;
and sending the latest container configuration to the container arrangement management tool, wherein the container arrangement management tool is used for restarting the script task to be processed according to the latest container configuration.
Optionally, after sending the second prompt message, the method further includes:
and if the second selection instruction is not received within a fourth preset time period, sending second notification information to the container arrangement management tool, wherein the second notification information is used for indicating that the container configuration corresponding to the script task to be processed is not changed.
Optionally, after the container orchestration management tool restarts the script task to be processed according to the latest container configuration, the method further comprises:
checking the state of the script task and testing the script task to generate a test result;
and generating a test report according to the test result.
In a second aspect, an embodiment of the present invention provides an apparatus for managing script tasks based on a container orchestration management tool, the apparatus comprising:
the receiving module is used for receiving script task acquisition instructions input by a user;
the execution module is used for acquiring list information of all script tasks currently running on the container arrangement management tool according to the script task acquisition instruction;
the receiving module is further used for receiving a to-be-processed script task selection instruction input by a user, and determining a to-be-processed script task from the list information according to the to-be-processed script task selection instruction;
the execution module is further configured to send out first prompt information, where the first prompt information is used to prompt the user to determine whether to replace an image file corresponding to the script task to be processed;
the receiving module is further configured to receive a first selection instruction of the user, where the first selection instruction is used to indicate to replace the image file;
the execution module is further configured to determine, according to the first selection instruction, whether a name of the target branch input by the user is received in a first preset time period, where the target branch stores a target image file;
if the name of the target branch input by the user is received in the first preset time period, extracting and storing a latest image file on the target branch of the code management tool through an interface of the code management tool, wherein the latest image file is the target image file;
if the name of the target branch input by the user is not received within the first preset time period, extracting and storing the latest image file on the main branch of the code management tool through the interface of the code management tool;
and sending the latest image file to the container arrangement management tool, wherein the container arrangement management tool is used for restarting the script task to be processed according to the latest image file.
Optionally, the execution module is further configured to send first notification information to the container arrangement management tool if the first selection instruction is not received within a second preset time period after the first prompt information is sent, where the first notification information is used to indicate that an image file corresponding to the script task to be processed is not changed.
Optionally, the execution module is further configured to send, after sending the latest image file to the container arrangement management tool, or if the first selection instruction is not received within a second preset period of time, send first notification information to the container arrangement management tool, and send second prompt information, where the second prompt information is used to prompt the user to determine whether to change a container configuration corresponding to the script task to be processed;
the receiving module is further configured to receive a second selection instruction of the user, where the second selection instruction is used to instruct to change the container configuration; receiving the name of the target branch input by the user according to the second selection instruction, wherein the target branch stores target container configuration;
the execution module is further configured to extract and save, through an interface of the code management tool, a latest container configuration on the target branch of the code management tool, where the latest container configuration is the target container configuration;
if the name of the target branch input by the user is not received within a third preset time period, extracting and storing the latest container configuration on the main branch of the code management tool through the interface of the code management tool;
and sending the latest container configuration to the container arrangement management tool, wherein the container arrangement management tool is used for restarting the script task to be processed according to the latest container configuration.
Optionally, the execution module is further configured to send second notification information to the container arrangement management tool if the second selection instruction is not received within a fourth preset time period after the second prompt information is sent, where the second notification information is used to indicate that the container configuration corresponding to the script task to be processed is not changed.
Optionally, the execution module is further configured to check a state of the script task and test the script task after the container arrangement management tool restarts the script task to be processed according to the latest container configuration, so as to generate a test result; and generating a test report according to the test result.
In a third aspect, an embodiment of the present invention provides an electronic device, including: a processor, a memory and a program stored on the memory and executable on the processor, which when executed by the processor performs the steps of a method of managing script tasks based on a container orchestration management tool according to the first aspect.
In a fourth aspect, embodiments of the present invention provide a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of a method of managing script tasks based on a container orchestration management tool according to the first aspect.
In a fifth aspect, embodiments of the present invention provide a computer program product comprising computer instructions which, when executed by a processor, implement the steps of a method of managing script tasks based on a container orchestration management tool according to the first aspect.
Therefore, the method disclosed by the embodiment of the invention can be applied to a self-research and development system, a series of input frames and prompt frames are configured on an operation interface of the self-research and development system, the self-research and development system is connected with a container arrangement management tool (such as Kubernetes) and also connected with a code management tool (such as Gitleab), and therefore, through a series of configurations, operations such as restarting a script, changing an image file, editing the configuration of the script container and the like can be performed on a Kubernetes script container by one-key automatic operation, the testing working efficiency can be improved, and the manual intervention is reduced.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to designate like parts throughout the figures. In the drawings:
FIG. 1 is a flow chart of a method for managing script tasks based on a container orchestration management tool according to an embodiment of the present invention;
FIG. 2 is a flow chart of a method for managing script tasks based on a container orchestration management tool according to an embodiment of the present invention;
FIG. 3 is a flow chart of a method for managing script tasks based on a container orchestration management tool according to an embodiment of the present invention;
FIG. 4 is a block diagram of an apparatus for managing script tasks based on a container orchestration management tool according to an embodiment of the present invention;
fig. 5 is a block diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all embodiments of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
FIG. 1 illustrates a method for managing script tasks based on a container orchestration management tool according to an embodiment of the present invention, where as shown in FIG. 1, the method includes:
step S101, receiving a script task acquisition instruction input by a user;
step S102, acquiring list information of all script tasks currently running on a container arrangement management tool according to a script task acquisition instruction;
step S103, receiving a to-be-processed script task selection instruction input by a user, and determining a to-be-processed script task from list information according to the to-be-processed script task selection instruction;
step S104, sending out first prompt information;
the first prompt message is used for prompting a user to determine whether to replace an image file corresponding to the script task to be processed;
step S105, receiving a first selection instruction of a user;
the first selection instruction is used for indicating to replace the image file;
step S106, judging whether the name of the target branch input by the user is received or not in a first preset time period;
the target branch is stored with a target image file;
step S107, if the name of the target branch input by the user is received within a first preset time period, extracting and storing the latest image file on the target branch of the code management tool through the interface of the code management tool;
wherein the latest image file is a target image file;
step S108, if the name of the target branch input by the user is not received in the first preset time period, extracting and storing the latest image file on the main branch of the code management tool through the interface of the code management tool;
step S109, the latest image file is sent to a container arrangement management tool;
the container arrangement management tool is used for restarting the script task to be processed according to the latest image file.
Firstly, the method shown in fig. 1 may be applied to a self-developing system, in a specific application scenario, the self-developing system may call a container arrangement management tool (e.g. Kubernetes) and a code management tool (e.g. Gitlab), the self-developing system may utilize the code management tool to replace an image file and configure a container configuration file (e.g. the method shown in fig. 2), so as to assist the container arrangement management tool to restart a script task, and a user may interact with the self-developing system through an interaction interface of the self-developing system, send an instruction, etc.
The input mode of the various instructions (such as the acquisition instruction and the selection instruction) in fig. 1 can be various, not limited to characters, codes and the like, but also voice, images, gestures and the like. For voice input instructions, voice recognition techniques may be used to convert the user's voice to text; for gesture input instructions, gesture actions of a user may be converted into instructions using gesture recognition techniques. The configuration may be set according to actual requirements, and the embodiment of the present invention is not limited thereto.
It should be noted that, firstly, the system needs to receive a script task obtaining instruction input by a user, obtain list information of all script tasks currently running on the container arrangement management tool, and the user can manually select a script task to be processed from the obtained list information, and then, the system can send out first prompt information (not limited to voice prompt, text prompt and the like) through a display interface so as to prompt the user to determine whether to replace an image file corresponding to the script task to be processed. After that, it can be divided into two cases.
In the first case, if the user determines replacement, it is further judged whether the name of the target branch input by the user is received within a first preset period of time (which may be set to 30 seconds); the target branch is stored with a target image file; if so, the code management tool can be called, namely, the latest image file on the target branch of the code management tool is extracted and stored through the interface of the code management tool; wherein the latest image file is a target image file; if not, the latest image file on the main branch of the code management tool is extracted and saved through the interface of the code management tool, and one optional implementation manner is as follows: and extracting and storing the latest image file on the default branch of the code management tool, wherein the default branch corresponds to the script task to be processed, and then, sending the latest image file to the container arrangement management tool, wherein the container arrangement management tool is used for restarting the script task to be processed according to the latest image file.
In the second case, if the first selection instruction is not received within a second preset time period (which may be set to 40 seconds), the first notification information is sent to the container arrangement management tool, where the first notification information is used to indicate that the image file corresponding to the script task to be processed is not changed. That is, in the case that the user does not need to change the image file corresponding to the script task, notification information may be sent to the container arrangement management tool to notify that the image file corresponding to the script task to be processed has not been changed. Alternatively, the user may issue a selection instruction indicating that the image file need not be replaced.
In one possible implementation, after sending the latest image file to the container arrangement management tool, or if the first selection instruction is not received within the second preset period of time, sending the first notification information to the container arrangement management tool, as shown in fig. 2, the method further includes:
step S201, sending out second prompt information;
the second prompt information is used for prompting a user to determine whether to change the container configuration corresponding to the script task to be processed;
step S202, receiving a second selection instruction of a user;
wherein the second selection instruction is for indicating to change the container configuration;
step S203, receiving the name of the target branch input by the user according to the second selection instruction;
wherein the target branch stores a target container configuration;
step S204, extracting and storing the latest container configuration on the target branch of the code management tool through the interface of the code management tool;
wherein the latest container configuration is the target container configuration;
step S205, if the name of the target branch input by the user is not received in the third preset time period, extracting and storing the latest container configuration on the main branch of the code management tool through the interface of the code management tool;
step S206, the latest container configuration is sent to a container arrangement management tool;
the container arrangement management tool is used for restarting the script task to be processed according to the latest container configuration.
In one possible implementation, after the second prompt message is sent, the method further includes: if the second selection instruction is not received within the fourth preset time period, sending second notification information to the container arrangement management tool, wherein the second notification information is used for indicating that the container configuration corresponding to the script task to be processed is not changed.
It should be noted that, after the method embodiment shown in fig. 1 is executed and the image file is replaced or the last image file is used, it is further required to determine whether to modify the container configuration, and according to actual needs, modify the container configuration by using the Gitlab, or use the last container configuration, so that after the image file and the container configuration of the script task to be processed are confirmed, the container arrangement management tool may process the script task to be processed, for example: restarting the script task to be processed.
In one possible implementation, after the container orchestration management tool restarts the pending script task according to the latest container configuration, the method further comprises: checking the state of the script task and testing the script task to generate a test result; and generating a test report according to the test result.
Therefore, after restarting, the state of the script task can be automatically detected, whether the script task is completed, whether the script task is healthy, whether obvious errors are contained or not, and meanwhile, logs are produced for testing staff to check the problems. Wherein the apparent error may be: the log obviously contains error reporting information, kubernetes service timeout is not started, service termination, downtime and the like appear in the log.
Therefore, the embodiment of the invention can be applied to a self-research and development system, a series of input frames and prompt frames are configured on an operation interface of the self-research and development system, and the self-research and development system is connected with a container arrangement management tool (such as Kubernetes) and a code management tool (such as Gitleab), so that operations such as restarting script, changing image files, editing script container configuration and the like can be performed on a Kubernetes script container through a series of configurations, the testing work efficiency can be improved, and manual intervention is reduced.
In practical application, it is found that, by applying the method described in the background section, each time the image file is replaced, the configuration of the container is re-edited, and then the script is restarted, the set of process needs multiple manual operations, at least 1 minute, while the automation process configured in the embodiment of the invention can perform operations such as restarting the script, replacing the image file, editing the configuration of the script container, and the like, for the Kubernetes script container, and only 1 second is needed to realize all steps of the process. By applying the method disclosed by the embodiment of the invention, the operations of restarting the script, replacing the image file, editing the script container configuration and the like can be rapidly performed based on the Kubernetes container service framework, so that the manual intervention can be reduced, and the working efficiency can be improved.
The scheme of the embodiment of the present invention can be summarized as follows, and the general flow chart can refer to fig. 3.
(1) Obtaining all script tasks currently served by k8s from system
(2) Selecting script tasks to restart
(3) The image file needs to be replaced, then the option can be selected:
a: the mirror image needs to be replaced: if a branch of the image file to be replaced is input, the default branch (default branch, for example, the default branch may be the main branch) is extracted by default, and the system may extract the latest image file of the branch through a code management tool (for example, a Gitlab) open API (Application Programming Interface ) for saving.
b: there is no need to replace the mirror: the code management tool interface can not be called, and the last mirror image file is used, so that the efficiency can be saved, and the times of calling the interface can be reduced.
(4) Whether or not container configuration needs to be modified
a: the container configuration needs to be changed: and inputting the modified container configuration, and modifying the container configuration file through a code management tool interface.
b: no change to the container configuration is required: without invoking code management tool interface, use last container configuration
(5) The script task is automatically restarted, and a new image file and a new configuration file can be automatically loaded.
(6) After restarting the script, a tester can be provided to test the script task.
(7) After restarting, automatically detecting the state of the script task, whether the script task is completed or not, whether the script task is healthy or not, whether obvious errors are contained or not, and outputting logs for testing staff to check the problems.
Therefore, by applying the method disclosed by the embodiment of the invention, operations such as restarting the script, replacing the image file, editing the script container configuration and the like can be rapidly performed based on the Kubernetes container service framework, so that manual intervention can be reduced, and the working efficiency can be improved.
An embodiment of the present invention provides an apparatus for managing script tasks based on a container arrangement management tool, as shown in fig. 4, an apparatus 40 includes:
the receiving module 401 is configured to receive a script task acquiring instruction input by a user;
an execution module 402, configured to obtain list information of all script tasks currently running on the container arrangement management tool according to the script task obtaining instruction;
the receiving module 401 is further configured to receive a to-be-processed script task selection instruction input by a user, and determine a to-be-processed script task from the list information according to the to-be-processed script task selection instruction;
the execution module 402 is further configured to send out first prompt information, where the first prompt information is used to prompt a user to determine whether to replace an image file corresponding to a script task to be processed;
the receiving module 401 is further configured to receive a first selection instruction of a user, where the first selection instruction is used to indicate to replace an image file;
the execution module 402 is further configured to determine, according to the first selection instruction, whether a name of a target branch input by a user is received in a first preset period of time, where the target branch stores a target image file;
if the name of the target branch input by the user is received in the first preset time period, extracting and storing the latest image file on the target branch of the code management tool through an interface of the code management tool, wherein the latest image file is the target image file;
if the name of the target branch input by the user is not received within the first preset time period, extracting and storing the latest image file on the main branch of the code management tool through the interface of the code management tool;
and sending the latest image file to a container arrangement management tool, wherein the container arrangement management tool is used for restarting the script task to be processed according to the latest image file.
In a possible implementation manner, the execution module 402 is further configured to send, after sending the first prompt message, if the first selection instruction is not received within the second preset time period, first notification information to the container arrangement management tool, where the first notification information is used to indicate that the image file corresponding to the script task to be processed is not changed.
In a possible implementation manner, the execution module 402 is further configured to send, after sending the latest image file to the container arrangement management tool, or if the first selection instruction is not received within the second preset period of time, send first notification information to the container arrangement management tool, and send second prompt information, where the second prompt information is used to prompt a user to determine whether to change a container configuration corresponding to the script task to be processed;
the receiving module 401 is further configured to receive a second selection instruction of the user, where the second selection instruction is used to instruct to change the container configuration; receiving a name of a target branch input by a user according to a second selection instruction, wherein the target branch stores target container configuration;
the execution module 402 is further configured to extract and save, through an interface of the code management tool, a latest container configuration on a target branch of the code management tool, where the latest container configuration is a target container configuration;
if the name of the target branch input by the user is not received within the third preset time period, extracting and storing the latest container configuration on the main branch of the code management tool through the interface of the code management tool;
the latest container configuration is sent to a container orchestration management tool, wherein the container orchestration management tool is used for restarting the script task to be processed according to the latest container configuration.
In a possible implementation manner, the execution module 402 is further configured to send, after sending the second prompt message, second notification information to the container arrangement management tool if the second selection instruction is not received within a fourth preset period of time, where the second notification information is used to indicate that the container configuration corresponding to the script task to be processed is not changed.
In a possible implementation manner, the execution module 402 is further configured to, after the container arrangement management tool restarts the script task to be processed according to the latest container configuration, check the state of the script task and test the script task to generate a test result; and generating a test report according to the test result.
Therefore, the embodiment of the invention can be applied to a self-research and development system, a series of input frames and prompt frames are configured on an operation interface of the self-research and development system, and the self-research and development system is connected with a container arrangement management tool (such as Kubernetes) and a code management tool (such as Gitleab), so that operations such as restarting script, changing image files, editing script container configuration and the like can be performed on a Kubernetes script container through a series of configurations, the testing work efficiency can be improved, and manual intervention is reduced.
In practical application, it is found that, by applying the method described in the background section, each time the image file is replaced, the configuration of the container is re-edited, and then the script is restarted, the set of process needs multiple manual operations, at least 1 minute, while the automation process configured in the embodiment of the invention can perform operations such as restarting the script, replacing the image file, editing the configuration of the script container, and the like, for the Kubernetes script container, and only 1 second is needed to realize all steps of the process. By applying the method disclosed by the embodiment of the invention, the operations of restarting the script, replacing the image file, editing the script container configuration and the like can be rapidly performed based on the Kubernetes container service framework, so that the manual intervention can be reduced, and the working efficiency can be improved.
The embodiment of the invention also provides an electronic device 50, as shown in fig. 5, including: the processor 501, the memory 502 and a program stored in the memory 502 and executable on the processor 501, which when executed by the processor, implement the steps of a method of managing script tasks based on a container orchestration management tool as described in the above method embodiments.
The embodiment of the invention also provides a computer readable storage medium, on which a computer program is stored, which when executed by a processor, implements the steps of a method for managing script tasks based on a container arrangement management tool as shown in the above method embodiment, and can achieve the same technical effects, and in order to avoid repetition, the description is omitted here. Wherein the computer readable storage medium is selected from Read-Only Memory (ROM), random access Memory (Random Access Memory, RAM), magnetic disk or optical disk.
The embodiments of the present application further provide a computer program product, which includes computer instructions, where the computer instructions, when executed by a processor, implement each process of the method embodiments shown in fig. 1, fig. 2, or fig. 3, and achieve the same technical effects, and are not described herein again for avoiding repetition.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) comprising instructions for causing a terminal (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the method according to the embodiments of the present invention.
The embodiments of the present invention have been described above with reference to the accompanying drawings, but the present invention is not limited to the above-described embodiments, which are merely illustrative and not restrictive, and many forms may be made by those having ordinary skill in the art without departing from the spirit of the present invention and the scope of the claims, which are to be protected by the present invention.

Claims (10)

1. A method of managing script tasks based on a container orchestration management tool, the method comprising:
receiving a script task acquisition instruction input by a user;
acquiring list information of all script tasks currently running on the container arrangement management tool according to the script task acquisition instruction;
receiving a to-be-processed script task selection instruction input by a user, and determining a to-be-processed script task from the list information according to the to-be-processed script task selection instruction;
sending out first prompt information, wherein the first prompt information is used for prompting the user to determine whether to replace an image file corresponding to the script task to be processed;
receiving a first selection instruction of the user, wherein the first selection instruction is used for indicating to replace the image file;
judging whether the name of the target branch input by the user is received in a first preset time period according to the first selection instruction, wherein the target branch stores a target image file;
if the name of the target branch input by the user is received in the first preset time period, extracting and storing a latest image file on the target branch of the code management tool through an interface of the code management tool, wherein the latest image file is the target image file;
if the name of the target branch input by the user is not received within the first preset time period, extracting and storing the latest image file on the main branch of the code management tool through the interface of the code management tool;
and sending the latest image file to the container arrangement management tool, wherein the container arrangement management tool is used for restarting the script task to be processed according to the latest image file.
2. The method of claim 1, wherein after issuing the first alert message, the method further comprises:
and if the first selection instruction is not received within a second preset time period, sending first notification information to the container arrangement management tool, wherein the first notification information is used for indicating that the image file corresponding to the script task to be processed is not changed.
3. The method according to claim 1 or 2, wherein after sending the latest image file to the container arrangement management tool, or if the first selection instruction is not received within a second preset period of time, the method further comprises:
sending out second prompt information, wherein the second prompt information is used for prompting the user to determine whether to change the container configuration corresponding to the script task to be processed;
receiving a second selection instruction of the user, wherein the second selection instruction is used for indicating to change the container configuration;
receiving the name of the target branch input by the user according to the second selection instruction, wherein the target branch stores target container configuration;
extracting and storing the latest container configuration on the target branch of the code management tool through an interface of the code management tool, wherein the latest container configuration is the target container configuration;
if the name of the target branch input by the user is not received within a third preset time period, extracting and storing the latest container configuration on the main branch of the code management tool through the interface of the code management tool;
and sending the latest container configuration to the container arrangement management tool, wherein the container arrangement management tool is used for restarting the script task to be processed according to the latest container configuration.
4. A method according to claim 3, wherein after issuing the second alert message, the method further comprises:
and if the second selection instruction is not received within a fourth preset time period, sending second notification information to the container arrangement management tool, wherein the second notification information is used for indicating that the container configuration corresponding to the script task to be processed is not changed.
5. A method according to claim 3, wherein after the restarting of the pending script task by the container orchestration management tool according to the latest container configuration, the method further comprises:
checking the state of the script task and testing the script task to generate a test result;
and generating a test report according to the test result.
6. An apparatus for managing script tasks based on a container orchestration management tool, the apparatus comprising:
the receiving module is used for receiving script task acquisition instructions input by a user;
the execution module is used for acquiring list information of all script tasks currently running on the container arrangement management tool according to the script task acquisition instruction;
the receiving module is further used for receiving a to-be-processed script task selection instruction input by a user, and determining a to-be-processed script task from the list information according to the to-be-processed script task selection instruction;
the execution module is further configured to send out first prompt information, where the first prompt information is used to prompt the user to determine whether to replace an image file corresponding to the script task to be processed;
the receiving module is further configured to receive a first selection instruction of the user, where the first selection instruction is used to indicate to replace the image file;
the execution module is further configured to determine, according to the first selection instruction, whether a name of the target branch input by the user is received in a first preset time period, where the target branch stores a target image file;
if the name of the target branch input by the user is received in the first preset time period, extracting and storing a latest image file on the target branch of the code management tool through an interface of the code management tool, wherein the latest image file is the target image file;
if the name of the target branch input by the user is not received within the first preset time period, extracting and storing the latest image file on the main branch of the code management tool through the interface of the code management tool;
and sending the latest image file to the container arrangement management tool, wherein the container arrangement management tool is used for restarting the script task to be processed according to the latest image file.
7. The apparatus of claim 6, wherein the device comprises a plurality of sensors,
the execution module is further configured to send first notification information to the container arrangement management tool if the first selection instruction is not received within a second preset time period after the first prompt information is sent, where the first notification information is used to indicate that an image file corresponding to the script task to be processed is not changed.
8. An electronic device, comprising: a processor, a memory and a program stored on the memory and executable on the processor, which when executed by the processor performs the steps of the method of managing script tasks based on a container orchestration management tool according to any one of claims 1 to 5.
9. A computer readable storage medium, having stored thereon a computer program which, when executed by a processor, implements the steps of the method of managing script tasks based on a container orchestration management tool according to any one of claims 1 to 5.
10. A computer program product comprising computer instructions which, when executed by a processor, implement the steps of the method of managing script tasks based on a container orchestration management tool according to any one of claims 1 to 5.
CN202410166518.6A 2024-02-06 2024-02-06 Method and device for managing script tasks based on container arrangement management tool Active CN117707609B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410166518.6A CN117707609B (en) 2024-02-06 2024-02-06 Method and device for managing script tasks based on container arrangement management tool

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410166518.6A CN117707609B (en) 2024-02-06 2024-02-06 Method and device for managing script tasks based on container arrangement management tool

Publications (2)

Publication Number Publication Date
CN117707609A true CN117707609A (en) 2024-03-15
CN117707609B CN117707609B (en) 2024-04-30

Family

ID=90155678

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410166518.6A Active CN117707609B (en) 2024-02-06 2024-02-06 Method and device for managing script tasks based on container arrangement management tool

Country Status (1)

Country Link
CN (1) CN117707609B (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110333877A (en) * 2019-07-09 2019-10-15 西安点告网络科技有限公司 Visualized container configuring management method, apparatus and system based on application
CN111090495A (en) * 2019-12-02 2020-05-01 中兴通讯股份有限公司 Node management method, device, equipment, storage medium and system
CN111930388A (en) * 2020-07-13 2020-11-13 银盛支付服务股份有限公司 Continuous integration method and system based on k8s and docker container
CN112799716A (en) * 2021-02-09 2021-05-14 广州锦行网络科技有限公司 Code management method and system
CN114064213A (en) * 2021-11-16 2022-02-18 四川启睿克科技有限公司 Kubernets container environment-based rapid arranging service method and system
US20220091826A1 (en) * 2020-09-18 2022-03-24 Arganteal, Corp. Automation and orchestration platform for software development and deployment
CN114296871A (en) * 2021-12-22 2022-04-08 华人运通(上海)云计算科技有限公司 Container-based continuous integration method, device and system, working node and medium
CN115729679A (en) * 2022-12-02 2023-03-03 广州博冠信息科技有限公司 Task processing method and device, computer readable storage medium and electronic device
CN116339749A (en) * 2023-03-21 2023-06-27 中国—东盟信息港股份有限公司 Containerized DevOps method, system and equipment capable of performing task scheduling

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110333877A (en) * 2019-07-09 2019-10-15 西安点告网络科技有限公司 Visualized container configuring management method, apparatus and system based on application
CN111090495A (en) * 2019-12-02 2020-05-01 中兴通讯股份有限公司 Node management method, device, equipment, storage medium and system
CN111930388A (en) * 2020-07-13 2020-11-13 银盛支付服务股份有限公司 Continuous integration method and system based on k8s and docker container
US20220091826A1 (en) * 2020-09-18 2022-03-24 Arganteal, Corp. Automation and orchestration platform for software development and deployment
CN112799716A (en) * 2021-02-09 2021-05-14 广州锦行网络科技有限公司 Code management method and system
CN114064213A (en) * 2021-11-16 2022-02-18 四川启睿克科技有限公司 Kubernets container environment-based rapid arranging service method and system
CN114296871A (en) * 2021-12-22 2022-04-08 华人运通(上海)云计算科技有限公司 Container-based continuous integration method, device and system, working node and medium
CN115729679A (en) * 2022-12-02 2023-03-03 广州博冠信息科技有限公司 Task processing method and device, computer readable storage medium and electronic device
CN116339749A (en) * 2023-03-21 2023-06-27 中国—东盟信息港股份有限公司 Containerized DevOps method, system and equipment capable of performing task scheduling

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
917书院GIS学堂: "如何在K8S环境中升级镜像", Retrieved from the Internet <URL:https://www.bilibili.com/video/BV1He411R7Fk/> *

Also Published As

Publication number Publication date
CN117707609B (en) 2024-04-30

Similar Documents

Publication Publication Date Title
CN100419684C (en) Method for setting up short-cut of programe module in software and starting method therefor
JP4880376B2 (en) Support apparatus, program, information processing system, and support method
CN111506318A (en) Circuit board chip burning method, device, terminal and computer readable storage medium
CN111475161B (en) Method, device and equipment for accessing component
CN110598868A (en) Machine learning model building method and device and related equipment
CN111475401A (en) Test method and related equipment
CN110908702A (en) Version switching method, version switching device, computer equipment and storage medium
CN113254331A (en) Model test method, device, storage medium and program product
CN111371645B (en) Method, system, computer equipment and storage medium for testing service connectivity
CN115617780A (en) Data import method, device, equipment and storage medium
CN113760611B (en) System site switching method and device, electronic equipment and storage medium
CN111078506A (en) Business data batch running task monitoring method and device
CN117707609B (en) Method and device for managing script tasks based on container arrangement management tool
CN111488731B (en) File generation method, device, computer equipment and storage medium
CN110837500B (en) Data screening method and device based on socal embedded window and computer equipment
CN111159028A (en) Webpage testing method and device
CN106874004B (en) Method for enabling low-version software to be compatible with high-version file, client and server
CN113518146B (en) Method and device for acquiring mobile terminal information
CN114489999A (en) Method and device for processing pipeline task, processor and electronic equipment
CN113342553A (en) Data acquisition method and device, electronic equipment and storage medium
CN111400245B (en) Art resource migration method and device
CN114610446A (en) Method, device and system for automatically injecting probe
CN114764335A (en) Method, device, terminal and storage medium for generating mirror image
CN112506487A (en) Micro-service development method and device
CN109284097B (en) Method, device, system and storage medium for realizing complex data analysis

Legal Events

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