CN116820493A - Mirror image file deployment method, system, equipment and storage medium - Google Patents

Mirror image file deployment method, system, equipment and storage medium Download PDF

Info

Publication number
CN116820493A
CN116820493A CN202310593798.4A CN202310593798A CN116820493A CN 116820493 A CN116820493 A CN 116820493A CN 202310593798 A CN202310593798 A CN 202310593798A CN 116820493 A CN116820493 A CN 116820493A
Authority
CN
China
Prior art keywords
deployment
deployed
image file
preset
configuration file
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310593798.4A
Other languages
Chinese (zh)
Inventor
周祥龙
魏子重
李锐
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shandong Inspur Science Research Institute Co Ltd
Original Assignee
Shandong Inspur Science Research Institute 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 Shandong Inspur Science Research Institute Co Ltd filed Critical Shandong Inspur Science Research Institute Co Ltd
Priority to CN202310593798.4A priority Critical patent/CN116820493A/en
Publication of CN116820493A publication Critical patent/CN116820493A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • G06F8/63Image based installation; Cloning; Build to order
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • G06F8/62Uninstallation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Stored Programmes (AREA)

Abstract

The application discloses a mirror image file deployment method, a system, equipment and a storage medium, which relate to the field of software development and comprise the following steps: acquiring an initial code, compiling by using a continuous integrated pipeline, and constructing a software package based on the compiled initial code; making an image file to be deployed based on the software package, and determining a deployment configuration file to update deployment state information of the deployment configuration file; monitoring the deployment state information, if the deployment state information is monitored to be deployed, acquiring an image file to be deployed, and deploying the image file to be deployed into a kubernetes cluster by using a preset continuous delivery controller; the preset continuous delivery controller is used for monitoring the deployment process of the image files to be deployed. The deployment process of the image files to be deployed can be monitored in real time through the continuous delivery controller, so that the deployment result of the image files can be acquired in real time, the image files can be retracted when the image files are failed to be deployed, and the stability of the software development and production environment can be improved.

Description

Mirror image file deployment method, system, equipment and storage medium
Technical Field
The present application relates to the field of software development, and in particular, to a method, a system, an apparatus, and a storage medium for deploying an image file.
Background
Software delivery is the process by which developers deploy the latest version of software to a production environment. The software delivery process is that after the development personnel finishes the code development, the source code containing the new function is pushed to a code warehouse, the script command is manually executed to compile and construct the source code, a software package is formed, the development personnel delivers the software package to the operation and maintenance personnel, and the operation and maintenance personnel installs the latest version of the software package in the production environment. The above procedure is too much, and the depended personnel manually execute various commands in each link, which is inefficient and easy to generate various errors. However, with the continuous development of information technology, the iteration speed of the software version is faster and faster, so how to improve the efficiency of software development and delivery, and push new functions and repairs to the production environment more quickly, so that better response to the client demands and market changes becomes a problem.
With the adoption of the combination words of Development and Operations, which are a set of process, method and system, the cloud native environment and the popularity of various continuous integration and continuous delivery tools, the Development and delivery efficiency is greatly improved, the problem of software delivery by manually executing various commands is solved, but new problems are brought. Conventional persistent delivery is to configure kubernetes (an open-source container orchestration engine supporting automated deployment) cluster access keys of a production environment in a persistent delivery pipeline, which deploys the latest version of a software image into the production environment by accessing key-linked kubernetes api (a resource-based programming interface provided by a hypertext transfer protocol) of the production environment. However, this delivery method may risk leakage of the key of the user production environment kubernetes, and may also present some management difficulties if the user owns multiple kubernetes cluster environments. In the traditional continuous delivery flow, the installed operation is installed by the controllers of the kubernetes cluster, and when the mirror image is failed to be installed, the continuous delivery flow line cannot carry out rollback operation on the result of the installation failure, so that the stability of the production environment of a user is affected. Thus, how to improve environmental stability during image file deployment is a problem to be solved in the art.
Disclosure of Invention
In view of the above, the present application is to provide a method, a system, an apparatus, and a storage medium for image file deployment, which can monitor the deployment process of an image file to be deployed in real time through a persistent delivery controller, and is helpful to obtain the deployment result of the image file in real time, so as to rollback when the image file deployment fails, and improve the stability of a software development and production environment. The specific scheme is as follows:
in a first aspect, the present application provides a method for deploying an image file, including:
acquiring an initial code, compiling the initial code by using a preset continuous integrated pipeline, and constructing a software package based on the compiled initial code;
creating an image file to be deployed based on the software package, and determining a deployment configuration file corresponding to the image file to be deployed from a preset configuration file library so as to update deployment state information of the deployment configuration file;
continuously monitoring deployment state information of the deployment configuration file, if the deployment state information of the deployment configuration file is monitored to be deployed, acquiring an image file to be deployed according to the deployment configuration file, and calling an image deployment interface of a preset kubernetes cluster by using a preset continuous delivery controller to deploy the image file to be deployed into the preset kubernetes cluster; the preset continuous delivery controller is used for monitoring the deployment process of the image file to be deployed.
Optionally, the obtaining the initial code, compiling the initial code by using a preset continuous integrated pipeline to construct a software package based on the compiled initial code, and further includes:
and if the initial code is detected to change, calling a preset continuous integration tool interface of the preset continuous integration pipeline to acquire a changed target code through a webhook callback mode, and compiling the target code.
Optionally, after the image file to be deployed is made based on the software package, the method further includes:
storing the image file to be deployed into a preset image file library;
correspondingly, the obtaining the image file to be deployed according to the deployment configuration file includes:
and acquiring the image file to be deployed from the preset image file library according to the deployment configuration file.
Optionally, the determining, from a preset configuration file library, a deployment configuration file corresponding to the image file to be deployed, so as to update deployment status information of the deployment configuration file includes:
determining a deployment configuration file corresponding to the image file to be deployed from a preset configuration file library, updating the deployment state information of the deployment configuration file to be deployed, and updating an image file version number corresponding to the deployment configuration file.
Optionally, the deploying the image file to be deployed into the preset kubernetes cluster further includes:
if the deployment configuration file is monitored to be changed in the deployment process of the image file to be deployed, determining a changed deployment configuration file from the preset configuration file library, and determining a corresponding target image file to be deployed according to the changed deployment configuration file so as to deploy the target image file to be deployed into the preset kubernetes cluster.
Optionally, the deploying the image file to be deployed into the preset kubernetes cluster includes:
monitoring the deployment process of the mirror image file to be deployed by using the preset continuous delivery controller;
if the deployment failure of the image file to be deployed is monitored, updating the deployment state information of the image file to be deployed into the deployment failure by using the preset continuous delivery controller.
Optionally, the continuously monitoring the deployment status information of the deployment configuration file includes:
if the deployment state information of the mirror image file to be deployed is monitored to be the deployment failure, determining that the last deployment state information is a target deployment configuration file which is successfully deployed from the preset configuration file library, and repeating the deployment process of the target deployment configuration file.
In a second aspect, the present application provides an image file deployment system, comprising:
the code version management module is used for acquiring an initial code, compiling the initial code by utilizing a preset continuous integrated pipeline, and constructing a software package based on the compiled initial code;
the continuous integration module is used for manufacturing an image file to be deployed based on the software package, and determining a deployment configuration file corresponding to the image file to be deployed from a preset configuration file library so as to update deployment state information of the deployment configuration file;
the state synchronization monitoring module is used for continuously monitoring the deployment state information of the deployment configuration file, and if the deployment state information of the deployment configuration file is monitored to be deployed, acquiring an image file to be deployed according to the deployment configuration file;
the continuous delivery controller module is used for calling a mirror image deployment interface of a preset kubernetes cluster by using a preset continuous delivery controller to deploy the mirror image file to be deployed into the preset kubernetes cluster; the preset continuous delivery controller is used for monitoring the deployment process of the image file to be deployed.
In a third aspect, the present application provides an electronic device, wherein the electronic device comprises a processor and a memory; wherein the memory is for storing a computer program that is loaded and executed by the processor to implement the image file deployment method of any of claims 1 to 7.
In a fourth aspect, the present application provides a computer readable storage medium for storing a computer program which, when executed by a processor, implements the image file deployment method according to any one of claims 1 to 7.
The method comprises the steps of obtaining an initial code, compiling the initial code by utilizing a preset continuous integrated pipeline, and constructing a software package based on the compiled initial code; creating an image file to be deployed based on the software package, and determining a deployment configuration file corresponding to the image file to be deployed from a preset configuration file library so as to update deployment state information of the deployment configuration file; continuously monitoring deployment state information of the deployment configuration file, if the deployment state information of the deployment configuration file is monitored to be deployed, acquiring an image file to be deployed according to the deployment configuration file, and calling an image deployment interface of a preset kubernetes cluster by using a preset continuous delivery controller to deploy the image file to be deployed into the preset kubernetes cluster; the preset continuous delivery controller is used for monitoring the deployment process of the image file to be deployed. In this way, the application can monitor the deployment process of the mirror image file to be deployed in real time through the continuous delivery controller, thereby being beneficial to acquiring the deployment result of the mirror image file in real time so as to rollback when the deployment of the mirror image file fails, avoiding the situation that the result and failure information of the mirror image installation cannot be acquired when the mirror image installation fails due to the installation of the controllers of the kubernetes cluster.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are required to be used in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are only embodiments of the present application, and that other drawings can be obtained according to the provided drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flowchart of an image file deployment method provided by the present application;
FIG. 2 is a flowchart of a specific image file deployment method provided by the present application;
FIG. 3 is a schematic diagram of a mirror image file deployment device according to the present application;
fig. 4 is a block diagram of an electronic device according to the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
The traditional image file continuous delivery is realized by configuring a kubernetes cluster access key of a production environment in a continuous delivery pipeline, connecting the kubernetes api of the production environment through the access key, deploying the latest version of software image file into the production environment, easily generating leakage risk of the user production environment key, and installing by a controller of the kubernetes cluster in the traditional continuous delivery flow, wherein the result and failure information of image installation cannot be obtained. The application discloses a mirror image file deployment method and a system, which are used for continuously delivering a mirror image file in a kubernetes cluster environment. The deployment process of the mirror image file to be deployed can be monitored in real time through the continuous delivery controller, the deployment result of the mirror image file can be acquired in real time, and the stability of the software development and production environment can be improved.
Referring to fig. 1, an embodiment of the present application discloses a method for deploying an image file, which is characterized by comprising:
and S11, acquiring an initial code, and compiling the initial code by using a preset continuous integrated pipeline to construct a software package based on the compiled initial code.
In this embodiment, an initial code is first obtained, then the initial code is compiled by using a preset continuous integration pipeline, and a software package is built based on the compiled initial code. After a code developer finishes the development of the code, a code version management module in the mirror image file deployment system can acquire the code pushed by the code developer as an initial code, and then the code version management module can trigger a preset continuous integration pipeline to compile and construct the initial code to form an executable software package. It can be understood that the preset continuous integration pipeline is a preset software development practice, and after a developer submits a code, the pipeline can be triggered to execute corresponding steps.
It should be noted that, in this embodiment, if the code version management module detects that the initial code changes, a preset continuous integration tool (Jenkins) interface of a preset continuous integration pipeline is called to obtain the changed target code through a webhook (a callback interface based on HTTP) callback mode, and the target code is compiled to construct an executable software package. Therefore, when the initial code changes, a new software package can be constructed in time for compiling, and image file deployment errors are prevented.
Step S12, making an image file to be deployed based on the software package, and determining a deployment configuration file corresponding to the image file to be deployed from a preset configuration file library so as to update deployment state information of the deployment configuration file.
In this embodiment, an image file to be deployed is made based on the software package, and a deployment configuration file corresponding to the image file to be deployed is determined from a preset configuration file library, so as to update deployment status information of the deployment configuration file. It can be understood that the preset profile library is used for storing the deployment profile, and the preset profile library is located in the deployment configuration management module. And after the image file to be deployed is manufactured based on the software package, the image file to be deployed can be saved in a preset image file library. It can be understood that the preset image file library is used for storing the image files to be deployed, and the preset image file library is located in the image warehouse module.
In this embodiment, the continuous integration pipeline module makes the software package into the image file, pushes the image file to the image warehouse module, and updates the deployment configuration file information in the deployment configuration management module, updates the state of the deployment configuration file corresponding to the image file to be deployed, and updates the image version number of the configuration file to complete the continuous integration process. It can be understood that the deployment configuration management module is responsible for storing configuration files related to deployment, such as image version number, image warehouse module address, image name, address information of an environment to be deployed, image configuration information and other non-mutual configuration file information.
Step S13, continuously monitoring deployment state information of the deployment configuration file, if the deployment state information of the deployment configuration file is monitored to be deployed, acquiring an image file to be deployed according to the deployment configuration file, and calling an image deployment interface of a preset kubernetes cluster by using a preset continuous delivery controller to deploy the image file to be deployed into the preset kubernetes cluster; the preset continuous delivery controller is used for monitoring the deployment process of the image file to be deployed.
In this embodiment, the state synchronization monitoring module continuously monitors deployment state information of all deployment configuration files in the deployment configuration management module in real time, if the deployment state information of the deployment configuration files is monitored to be deployed, the state synchronization monitoring module pulls the to-be-deployed image files from a preset image file library in the image warehouse module according to the deployment configuration files, and sends the to-be-deployed image files and the deployment configuration files to the continuous delivery controller module, so that after the continuous delivery controller module receives the to-be-deployed image files and the deployment configuration files, the to-be-deployed image files are deployed into the preset kubenetes cluster by calling an image deployment interface of the preset kubenetes cluster through the preset continuous delivery controller. It will be appreciated that the persistent delivery controller module operates in a production environment of a user and is responsible for performing deployment work of image files and status monitoring work during deployment, and that the persistent delivery controller is not a kubernetes cluster-based controller. In this way, the continuous delivery controller in the continuous delivery controller module is used for monitoring the image file deployment process, so that the image file deployment result can be acquired in real time, the image file deployment state can be acquired in real time, the management is easy, and the fault tolerance rate of the image file deployment process can be improved.
Through the technical scheme, the method and the device acquire the initial code, compile the initial code by using the preset continuous integrated pipeline, and construct the software package based on the compiled initial code. And making an image file to be deployed based on the software package, and determining a corresponding deployment configuration file to update deployment state information of the deployment configuration file. And continuously monitoring the deployment state information of the deployment configuration file, if the deployment state information of the deployment configuration file is monitored to be deployed, acquiring an image file to be deployed according to the deployment configuration file, and calling an image deployment interface of a preset kubernetes cluster by using a preset continuous delivery controller to deploy the image file to be deployed into the preset kubernetes cluster. In this way, the deployment state information of the deployment configuration file can be continuously monitored in real time by using the state synchronization monitoring module, and the deployment process of the image file to be deployed is monitored in real time by the continuous delivery controller, so that the deployment state and the deployment result of the image file can be obtained in real time, and the stability of the software development and production environment can be improved.
Based on the above embodiment, the present application can utilize the preset persistent delivery controller to call the image deployment interface to deploy the image file to be deployed into the preset kubernetes cluster, and then the deployment process of the image file to be deployed will be described in detail in this embodiment. Referring to fig. 2, the embodiment of the application discloses a specific image file deployment method, which includes:
step S21, continuously monitoring deployment state information of a deployment configuration file by using a preset continuous delivery controller, if the deployment state information of the deployment configuration file is monitored to be deployed, acquiring an image file to be deployed according to the deployment configuration file, and calling an image deployment interface of a preset kubernetes cluster by using the preset continuous delivery controller to deploy the image file to be deployed into the preset kubernetes cluster.
Step S22, monitoring the deployment process of the image file to be deployed by using the preset continuous delivery controller, and if the image file to be deployed is monitored to fail in deployment, updating the deployment state information of the image file to be deployed by using the preset continuous delivery controller to be failed in deployment.
In this embodiment, the persistent delivery controller module monitors the deployment process of the image file to be deployed by using the preset persistent delivery controller, and if the deployment failure of the image file to be deployed is monitored, updates the deployment status information of the image file to be deployed to the deployment failure by using the preset persistent delivery controller.
Step S23, if the deployment state information of the mirror image file to be deployed is monitored to be the deployment failure, determining that the last deployment state information is a target deployment configuration file which is successfully deployed from a preset configuration file library, and repeating the deployment process of the target deployment configuration file.
In this embodiment, if the state synchronization monitoring module monitors that the deployment state information of the mirror image file to be deployed of a certain persistent delivery controller module is a deployment failure, the last deployment state information is determined to be a target deployment configuration file which is successfully deployed from the preset configuration file library in the deployment configuration management module, and the deployment process of the target deployment configuration file which is successfully deployed is repeated, so that rollback of the deployment process can be realized, stability of kubernetes production environment clusters is ensured, and the persistent delivery process is completed.
It should be noted that, if the deployment configuration file is monitored to be changed in the deployment process of the image file to be deployed, the changed deployment configuration file is determined from the preset configuration file library, and the corresponding target image file to be deployed is determined according to the changed deployment configuration file, so that the target image file to be deployed is deployed in the preset kubernetes cluster.
For more specific processing in step S21, reference may be made to the corresponding content disclosed in the foregoing embodiment, and no further description is given here.
Through the technical scheme, the deployment state information of the deployment configuration file is continuously monitored by the preset continuous delivery controller, and if the deployment state information is monitored to be deployed, the image file to be deployed is obtained and deployed into the preset kubernetes cluster. And then monitoring the deployment process of the image file to be deployed by using a preset continuous delivery controller, and if the image file to be deployed is monitored to fail to be deployed, updating the deployment state information of the image file to be deployed by using the preset continuous delivery controller to be deployed failure. If the deployment state information of the mirror image file to be deployed is monitored to be the deployment failure, determining that the last deployment state information is the target deployment configuration file which is successfully deployed from a preset configuration file library, and repeating the deployment process of the target deployment configuration file. By repeating the deployment process of the target deployment configuration file which is successfully deployed, the rollback of the deployment process can be realized, the stability of kubernetes production environment clusters is ensured, the continuous delivery process is completed, the continuous delivery assembly line can acquire the image file installation result and failure information, the rollback operation is further carried out on the installation failure result, and the stability of the user production environment is improved.
The embodiment of the application also discloses a specific image file continuous delivery method in a kubernetes cluster environment based on a plurality of servers by taking Java language code development process as an example, comprising the following steps:
in this embodiment, first, deployment of an image file system for persistent delivery of an image file on a server is performed, which specifically includes: deploying a code version management module on a server, wherein it can be understood that the code version management module is based on a Git (an open-source distributed version control system) version control system and is used for storing source code files of users, and the version control system library can use systems such as a Gitlab, a GitHub and the like; a continuous integrated pipeline module is deployed on a server, wherein the continuous integrated pipeline module can be a continuous integrated pipeline tool such as Jenkins (a continuous integrated tool based on Java development), a Gitlab CI (a continuous integrated server provided for the Gitlab) and the like, and is used for compiling and constructing source codes of users, packaging the compiled and constructed codes into mirror files and pushing the mirror files to a mirror warehouse module, and the continuous integrated pipeline module is connected with a code version management module through an API (Application Programming Interface, application program interface), and the code version management module can call an interface of a pipeline through Webhook; a mirror image warehouse module is deployed on a server, wherein the mirror image warehouse module can be a Harbor mirror image warehouse (an open-source enterprise-level document Registry project) which is responsible for storing mirror image files and description information of the mirror image files, such as file names, version numbers, unique identifiers and the like; a configuration management module is deployed on a server, wherein the configuration management module is based on a Git version control system and is used for storing a deployment configuration file of a user, and the version control system can use systems such as a Gitlab system, a Github system and the like; the state synchronization monitoring module is used for monitoring the change and the deployment state of the deployment configuration file of the configuration management module in real time and continuously delivering the deployment process state in the controller module. When the deployment configuration file is found to be changed or the deployment process fails, the state synchronization monitoring module performs new mirror image deployment or deployment rollback operation.
After the module deployment is completed, installing a persistent delivery controller module in the kubernetes cluster generation environment of the user, wherein the persistent delivery controller module is a web service, and the service stores an API key of the kubernetes cluster of the user, so that the user can interact with an API of the kubernetes cluster of the user, the persistent delivery controller module can complete the installation of the mirror image files by calling the API of the kubernetes cluster, and the state in the installation process of each mirror image file is simultaneously maintained through the persistent delivery controller module.
In the deployment process of the image file, a developer performs new version code development work of software on a personal computer, after the development work of the latest version software code is completed, all source codes are submitted to a code version management module, namely a Gitlab code warehouse, then the new codes are combined to a main branch, and the fact that after the code version management module detects that the codes of the main branch change, a webhook callback mode is adopted to call an interface of a continuous integration pipeline module Jenkins, and the continuous integration pipeline module pulls up the latest codes from the code version management module, compiles and constructs the codes to form an executable software package. And then continuously integrating the pipeline module to pack the software package into an image file, and issuing the image file into an image warehouse Harbor. And the continuous integration pipeline updates the latest mirror image version number and deployment configuration information of the software package into a mirror image configuration file corresponding to the deployment configuration management module, and updates the state of the mirror image deployment configuration file to be deployed.
When the deployment configuration management module finds that a certain deployment configuration file changes, the latest deployment configuration file is pushed to the state synchronization module through the API interface of the webhook calling state synchronization module, so that the state synchronization module pulls the corresponding image file of the latest version from the image warehouse module according to the content in the deployment configuration file, and pushes the image file and the corresponding deployment configuration information to the continuous delivery controller module. And if the persistent delivery controller module acquires the image file and the configuration file required for deploying the image, calling a kubernetes cluster API according to the content in the configuration file through a kubernetes cluster key pre-stored in the persistent delivery controller module, and installing the image file of the latest version into the kubernetes cluster environment.
It can be understood that, in the process of monitoring the installation of the image file of the latest version in real time by the continuous delivery controller, if the installation of the image of the new version fails, the image deployment state of the corresponding version is updated to be the deployment failure. And the state synchronization module acquires the mirror image installation state by calling an API of the continuous delivery controller, and if the installation failure state is found, calling an API interface of the deployment configuration management module to rollback the corresponding deployment configuration file to the last version, wherein the rollback function is a file version rollback command executed through the Git command. If the deployment configuration module detects that the configuration file is changed, repeating the steps of calling the API interface of the state synchronization module through webhook after the deployment configuration management module finds that a certain deployment configuration file is changed, and recovering the kubernetes cluster of the production environment to the state before deployment because the configuration file of the last version is the successfully deployed version. The repeated process only carries out version rollback of the configuration file once, the rolled-back version is the version successfully deployed last time, and if the redeployment fails, repeated operation is not carried out, so that the configuration file is prevented from being rolled back to a premature version. If the continuous delivery controller monitors that the kubernetes cluster successfully installs the image file of the latest version, the state of the corresponding image is updated to be successfully deployed, so that the continuous delivery process of the software from the source code to the image and finally installing the image to the user to produce the kubernetes cluster is completed.
Referring to fig. 3, the embodiment of the application also discloses an image file deployment system, which comprises:
the code version management module 11 is used for acquiring an initial code, compiling the initial code by utilizing a preset continuous integrated pipeline, and constructing a software package based on the compiled initial code;
the persistent integration module 12 is configured to make an image file to be deployed based on the software package, and determine a deployment configuration file corresponding to the image file to be deployed from a preset configuration file library, so as to update deployment state information of the deployment configuration file;
the state synchronization monitoring module 13 is configured to continuously monitor deployment state information of the deployment configuration file, and if the deployment state information of the deployment configuration file is monitored to be deployed, acquire an image file to be deployed according to the deployment configuration file;
the persistent delivery controller module 14 is configured to invoke a mirror deployment interface of a preset kubernetes cluster by using a preset persistent delivery controller to deploy the mirror file to be deployed into the preset kubernetes cluster; the preset continuous delivery controller is used for monitoring the deployment process of the image file to be deployed.
According to the method, the initial code can be obtained, and the initial code is compiled by utilizing a preset continuous integrated pipeline so as to construct a software package based on the compiled initial code; creating an image file to be deployed based on the software package, and determining a deployment configuration file corresponding to the image file to be deployed from a preset configuration file library so as to update deployment state information of the deployment configuration file; continuously monitoring deployment state information of the deployment configuration file, if the deployment state information of the deployment configuration file is monitored to be deployed, acquiring an image file to be deployed according to the deployment configuration file, and calling an image deployment interface of a preset kubernetes cluster by using a preset continuous delivery controller to deploy the image file to be deployed into the preset kubernetes cluster; the preset continuous delivery controller is used for monitoring the deployment process of the image file to be deployed. Through the technical scheme, the embodiment of the application can monitor the deployment process of the mirror image file to be deployed in real time through the continuous delivery controller, thereby being beneficial to acquiring the deployment result of the mirror image file in real time, so as to carry out rollback when the deployment of the mirror image file fails, and improving the stability of the software development and production environment.
In some specific embodiments, the code version management module 11 further includes:
and the code compiling unit is used for calling a preset continuous integration tool interface of the preset continuous integration pipeline to obtain a changed target code through a webhook callback mode if the initial code is detected to be changed, and compiling the target code.
In some embodiments, the keep alive module 12 further comprises:
the file storage unit is used for storing the image files to be deployed into a preset image file library;
correspondingly, the state synchronization monitoring module 13 specifically includes:
the file acquisition unit is used for acquiring the image file to be deployed from the preset image file library according to the deployment configuration file.
In some embodiments, the persistent integration module 12 specifically includes:
the first state updating unit is used for determining a deployment configuration file corresponding to the image file to be deployed from a preset configuration file library, updating the deployment state information of the deployment configuration file to be deployed, and updating an image file version number corresponding to the deployment configuration file.
In some embodiments, the continuous delivery controller module 14 further comprises:
the file deployment unit is used for determining a changed deployment configuration file from the preset configuration file library if the deployment configuration file is monitored to be changed in the deployment image file deployment process, and determining a corresponding target image file to be deployed according to the changed deployment configuration file so as to deploy the target image file to be deployed into the preset kubernetes cluster.
In some embodiments, the continuous delivery controller module 14 specifically includes:
the process monitoring unit is used for monitoring the deployment process of the mirror image file to be deployed by utilizing the preset continuous delivery controller;
and the second state updating unit is used for updating the deployment state information of the image file to be deployed into deployment failure by using the preset continuous delivery controller if the deployment failure of the image file to be deployed is monitored.
In some embodiments, the continuous delivery controller module 14 specifically includes:
and the configuration file determining unit is used for determining that the last deployment state information is a target deployment configuration file successfully deployed from the preset configuration file library and repeating the deployment process of the target deployment configuration file if the deployment state information of the mirror image file to be deployed is monitored to be the deployment failure.
Further, the embodiment of the present application further discloses an electronic device, and fig. 4 is a block diagram of an electronic device 20 according to an exemplary embodiment, where the content of the diagram is not to be considered as any limitation on the scope of use of the present application.
Fig. 4 is a schematic structural diagram of an electronic device 20 according to an embodiment of the present application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input output interface 25, and a communication bus 26. The memory 22 is configured to store a computer program, where the computer program is loaded and executed by the processor 21 to implement relevant steps in the image file deployment method disclosed in any of the foregoing embodiments. In addition, the electronic device 20 in the present embodiment may be specifically an electronic computer.
In this embodiment, the power supply 23 is configured to provide an operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and an external device, and the communication protocol to be followed is any communication protocol applicable to the technical solution of the present application, which is not specifically limited herein; the input/output interface 25 is used for acquiring external input data or outputting external output data, and the specific interface type thereof may be selected according to the specific application requirement, which is not limited herein.
The memory 22 may be a carrier for storing resources, such as a read-only memory, a random access memory, a magnetic disk, or an optical disk, and the resources stored thereon may include an operating system 221, a computer program 222, and the like, and the storage may be temporary storage or permanent storage.
The operating system 221 is used for managing and controlling various hardware devices on the electronic device 20 and computer programs 222, which may be Windows Server, netware, unix, linux, etc. The computer program 222 may further include a computer program that can be used to perform other specific tasks in addition to the computer program that can be used to perform the image file deployment method performed by the electronic device 20 disclosed in any of the previous embodiments.
Further, the application also discloses a computer readable storage medium for storing a computer program; the method for deploying the image files comprises the steps of enabling the computer program to be executed by a processor. For specific steps of the method, reference may be made to the corresponding contents disclosed in the foregoing embodiments, and no further description is given here.
In this specification, each embodiment is described in a progressive manner, and each embodiment is mainly described in a different point from other embodiments, so that the same or similar parts between the embodiments are referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant points refer to the description of the method section.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative elements and steps are described above generally in terms of functionality in order to clearly illustrate the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. The software modules may be disposed in Random Access Memory (RAM), memory, read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
Finally, it is further noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, 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.
The foregoing has outlined rather broadly the more detailed description of the application in order that the detailed description of the application that follows may be better understood, and in order that the present principles and embodiments may be better understood; meanwhile, as those skilled in the art will have variations in the specific embodiments and application scope in accordance with the ideas of the present application, the present description should not be construed as limiting the present application in view of the above.

Claims (10)

1. An image file deployment method, comprising:
acquiring an initial code, compiling the initial code by using a preset continuous integrated pipeline, and constructing a software package based on the compiled initial code;
creating an image file to be deployed based on the software package, and determining a deployment configuration file corresponding to the image file to be deployed from a preset configuration file library so as to update deployment state information of the deployment configuration file;
continuously monitoring deployment state information of the deployment configuration file, if the deployment state information of the deployment configuration file is monitored to be deployed, acquiring an image file to be deployed according to the deployment configuration file, and calling an image deployment interface of a preset kubernetes cluster by using a preset continuous delivery controller to deploy the image file to be deployed into the preset kubernetes cluster; the preset continuous delivery controller is used for monitoring the deployment process of the image file to be deployed.
2. The image file continuous delivery method according to claim 1, wherein the acquiring the initial code, compiling the initial code by using a preset continuous integration pipeline to construct a software package based on the compiled initial code, further comprises:
and if the initial code is detected to change, calling a preset continuous integration tool interface of the preset continuous integration pipeline to acquire a changed target code through a webhook callback mode, and compiling the target code.
3. The image file continuous delivery method according to claim 1, wherein after the image file to be deployed is made based on the software package, the method further comprises:
storing the image file to be deployed into a preset image file library;
correspondingly, the obtaining the image file to be deployed according to the deployment configuration file includes:
and acquiring the image file to be deployed from the preset image file library according to the deployment configuration file.
4. The image persistent delivery method according to claim 1, wherein determining, from a preset configuration file library, a deployment configuration file corresponding to the image file to be deployed, so as to update deployment status information of the deployment configuration file, includes:
determining a deployment configuration file corresponding to the image file to be deployed from a preset configuration file library, updating the deployment state information of the deployment configuration file to be deployed, and updating an image file version number corresponding to the deployment configuration file.
5. The image file continuous delivery method according to claim 1, wherein the deploying the image file to be deployed into the preset kubernetes cluster further comprises:
if the deployment configuration file is monitored to be changed in the deployment process of the image file to be deployed, determining a changed deployment configuration file from the preset configuration file library, and determining a corresponding target image file to be deployed according to the changed deployment configuration file so as to deploy the target image file to be deployed into the preset kubernetes cluster.
6. The image persistent delivery method according to any one of claims 1 to 5, wherein the deploying the image to be deployed into the preset kubernetes cluster includes:
monitoring the deployment process of the mirror image file to be deployed by using the preset continuous delivery controller;
if the deployment failure of the image file to be deployed is monitored, updating the deployment state information of the image file to be deployed into the deployment failure by using the preset continuous delivery controller.
7. The image file continuous delivery method according to claim 6, wherein continuously monitoring the deployment status information of the deployment configuration file comprises:
if the deployment state information of the mirror image file to be deployed is monitored to be the deployment failure, determining that the last deployment state information is a target deployment configuration file which is successfully deployed from the preset configuration file library, and repeating the deployment process of the target deployment configuration file.
8. An image file deployment system, comprising:
the code version management module is used for acquiring an initial code, compiling the initial code by utilizing a preset continuous integrated pipeline, and constructing a software package based on the compiled initial code;
the continuous integration module is used for manufacturing an image file to be deployed based on the software package, and determining a deployment configuration file corresponding to the image file to be deployed from a preset configuration file library so as to update deployment state information of the deployment configuration file;
the state synchronization monitoring module is used for continuously monitoring the deployment state information of the deployment configuration file, and if the deployment state information of the deployment configuration file is monitored to be deployed, acquiring an image file to be deployed according to the deployment configuration file;
the continuous delivery controller module is used for calling a mirror image deployment interface of a preset kubernetes cluster by using a preset continuous delivery controller to deploy the mirror image file to be deployed into the preset kubernetes cluster; the preset continuous delivery controller is used for monitoring the deployment process of the image file to be deployed.
9. An electronic device comprising a processor and a memory; wherein the memory is for storing a computer program that is loaded and executed by the processor to implement the image file deployment method of any of claims 1 to 7.
10. A computer readable storage medium for storing a computer program which when executed by a processor implements the image file deployment method of any of claims 1 to 7.
CN202310593798.4A 2023-05-23 2023-05-23 Mirror image file deployment method, system, equipment and storage medium Pending CN116820493A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310593798.4A CN116820493A (en) 2023-05-23 2023-05-23 Mirror image file deployment method, system, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310593798.4A CN116820493A (en) 2023-05-23 2023-05-23 Mirror image file deployment method, system, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116820493A true CN116820493A (en) 2023-09-29

Family

ID=88119490

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310593798.4A Pending CN116820493A (en) 2023-05-23 2023-05-23 Mirror image file deployment method, system, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116820493A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117008958A (en) * 2023-10-08 2023-11-07 富钛字节车载软件(长春)有限公司 GitOps-based OTA cloud continuous delivery method, system, equipment and storage medium
CN117472397A (en) * 2023-12-27 2024-01-30 柏科数据技术(深圳)股份有限公司 Data mirror image control method, device, terminal and storage medium

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117008958A (en) * 2023-10-08 2023-11-07 富钛字节车载软件(长春)有限公司 GitOps-based OTA cloud continuous delivery method, system, equipment and storage medium
CN117472397A (en) * 2023-12-27 2024-01-30 柏科数据技术(深圳)股份有限公司 Data mirror image control method, device, terminal and storage medium
CN117472397B (en) * 2023-12-27 2024-04-05 柏科数据技术(深圳)股份有限公司 Data mirror image control method, device, terminal and storage medium

Similar Documents

Publication Publication Date Title
CN110768833B (en) Application arrangement and deployment method and device based on kubernets
CN109814879B (en) Automatic CI/CD project deployment method and storage medium
CN116820493A (en) Mirror image file deployment method, system, equipment and storage medium
US7698391B2 (en) Performing a provisioning operation associated with a software application on a subset of the nodes on which the software application is to operate
US20220147367A1 (en) Method and System for Automation Tool Set for Server Maintenance Actions
CN108170448B (en) System for automatically and efficiently releasing software update version
US9250672B2 (en) Cloning target machines in a software provisioning environment
CN106371881B (en) Method and system for updating program version in server
WO2011069730A1 (en) A method and system for managing configurations of system management agents in a distributed environment
CN107408046B (en) System and method for provisioning cloud services across heterogeneous computing environments
US20100312879A1 (en) Plug-in provisioning integration in a clustered environment
CN111562950B (en) Distributed application parameter dynamic release system and method
CN111506322A (en) Automatic integrated construction development deployment platform and method
CN105893545A (en) Efficient Hadoop cluster deployment method
CN109308184B (en) Middleware installation and update method, device and computer readable storage medium
EP2805233B1 (en) Installation engine and package format for parallelizable, reliable installations
CN112286636B (en) Implementation method of unified configuration center based on Docker and SVN
CN113342387A (en) Automatic software upgrading method, updating client and updating server
CN114003312A (en) Big data service component management method, computer device and storage medium
US9952953B2 (en) Non-monotonic eventual convergence for desired state configuration
CN112702195A (en) Gateway configuration method, electronic device and computer readable storage medium
CN112860251A (en) Method and system for constructing website front end
CN110795105A (en) Automatic compiling and deploying method and system for power distribution automation master station system
CN112379934B (en) Deployment method and device of cloud computing platform and storage medium
US9207928B2 (en) Computer-readable medium, apparatus, and methods of automatic capability installation

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