A WebSocket-based image and software deployment management method in DevOps application scenarios

By adopting WebSocket-based image and software deployment management methods in DevOps application scenarios, the delay, resource utilization and security problems when deploying container images and product packages on Linux hosts are solved, and efficient, stable and secure deployment management is achieved.

CN118466988BActive Publication Date: 2025-03-14SHANGHAI ZHENZHI TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202410615322.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-17
Publication Date
2025-03-14
Estimated Expiration
2044-05-17

AI Technical Summary

Technical Problem

The prior art has problems with deployment delays, resource utilization and security when deploying container images and product packages on Linux hosts.

Method used

DevOps application scenarios based on WebSocket are adopted, and through DevOps module, c7n-agent module, database server, file storage server, nexus server and docker image warehouse, host information maintenance, application and image deployment, data reporting and other functions are realized, and WebSocket is used for real-time data exchange and process control.

Benefits of technology

It significantly reduces time delays during the deployment process, improves the efficiency and stability of the deployment process, enhances the scalability and scalability of the system, and strengthens the security of the deployment process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118466988B_ABST
    Figure CN118466988B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of software development technology, and specifically to a WebSocket-based image and software deployment management method in a DevOps application scenario. A WebSocket-based image and software deployment management method in a DevOps application scenario is characterized by: comprising a DevOps module for providing a front-end interactive interface, deployment management, and command issuance; a c7n-agent module for interacting with DevOps, responsible for executing commands, returning application running status information, and host status information; a database server for storing data information; a file storage server for storing user-uploaded custom software; a nexus server for storing Jar products; a docker image warehouse for storing docker images; compared with the prior art, a WebSocket-based image and software deployment management method in a DevOps application scenario is provided, which incorporates the host into DevOps management, simplifies the deployment process, and enables users to quickly deploy images and software to the host, greatly improving the efficiency of application publishing and deployment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of software development, and in particular to a WebSocket-based image and software deployment management method in a DevOps application scenario. Background Art

[0002] In modern software development practices, continuous integration and continuous deployment (CI / CD) pipelines are key components of the automated software delivery process, ensuring that software can be quickly and reliably integrated into existing systems. As a popular server operating system, Linux is widely used in these pipelines and carries important containerized applications.

[0003] Currently, the deployment of container images and product packages on Linux hosts usually relies on traditional HTTP protocols or SSH communications. These methods have advantages in terms of simple operation and strong versatility, but they also face obvious bottlenecks: 1. Deployment delay. The HTTP request response mode cannot achieve real-time interaction, resulting in significant time delays in the deployment process; 2. Uneven resource utilization. Traditional deployment methods often generate resource peaks at a certain point in time, resulting in uneven resource allocation and affecting other concurrent tasks; 3. Security issues. Old communication protocols may not support the latest security standards, resulting in security vulnerabilities in the data transmission process. Summary of the invention

[0004] In order to overcome the deficiencies of the prior art, the present invention provides an image and software deployment management method based on WebSocket in a DevOps application scenario, which incorporates the host into DevOps management, simplifies the deployment process, and enables users to quickly deploy images and software to the host, greatly improving the efficiency of application publishing and deployment.

[0005] To achieve the above purpose, a WebSocket-based image and software deployment management method in a DevOps application scenario is designed, which is characterized by: including:

[0006] DevOps module, which is used to provide front-end interactive interface, deployment management, and command issuance;

[0007] The c7n-agent module is used to interact with DevOps and is responsible for executing commands and transmitting application running status information and host status information.

[0008] Database server, used to store data information;

[0009] File storage server, used to store custom software uploaded by users;

[0010] Nexus server, used to store Jar products;

[0011] Docker image repository, used to store Docker images;

[0012] The specific steps include:

[0013] Step 1: Maintain host information;

[0014] Step 2: Deploy applications and deployment images;

[0015] Step 3: Data reporting.

[0016] The step 1 comprises the following steps:

[0017] Step 1.1: Maintain the host information and create a host table in the database server to store the created host information;

[0018] Step 1.2: Provide the user with the host installation and activation command, which is executed on the target Linux host, including the following operations:

[0019] Step 1: Download the host.sh installation script;

[0020] Operation 2: Execute the host.sh installation script;

[0021] Step 3: Set the user to run c7n-agent;

[0022] Operation 4: Check and create the working directory and log saving directory required for c7n-agent runtime; save the environment variables required for c7n-agent runtime to the working directory; save the c7n-agent script operation commands to the working directory;

[0023] Step 5: Download the c7n-agent binary executable file from the remote server and decompress it;

[0024] Operation 6: Configure Systemd application information to enable the Linux system to monitor the c7n-agent process and restart the c7n-agent process when it is started and exits abnormally;

[0025] Operation 7: Start c7n-agent through the systemctl command;

[0026] Step 1.3: c7n-agent starts and requests to establish a websocket connection with DevOps. After DevOps passes the authentication, it sends an initialization command to c7n-agent. c7n-agent initializes the listener, monitors the application status, host CPU, host memory, and host storage usage at regular intervals, and reports to DevOps.

[0027] The step 2 comprises the following steps:

[0028] Step 2.1: Create a new host application and configure application information;

[0029] Step 2.2: Request the DevOps service, DevOps builds the parameters required to deploy the application and sends them to c7n-agent via WebSocket;

[0030] Step 2.3: c7n-agent receives the DevOps message through WebSocket, parses the message and executes the command in it, making a judgment based on the type field in the message.

[0031] The parameters required for DevOps to build and deploy applications include jar packages: jar package repository information, working directory, pre-operation, post-operation, deletion operation, startup command, and health check; docker image: image repository information, container information, working directory, startup command; docker-compose: docker-compose file, working directory, startup command; other products: product download address, working directory, pre-operation, post-operation, deletion operation, startup command, and health check.

[0032] The determination according to the type field in the message includes:

[0033] A. operate_instance: deploy Jar packages or other product applications;

[0034] B. deploy_docker: deploy Docker image;

[0035] C. deploy_docker_compose: deploy the docker-compose application.

[0036] The above-mentioned operate_instance: deploys a Jar package or other product application and performs the following steps:

[0037] 1. Create a working directory;

[0038] 2. Write the configuration file;

[0039] 3. Call the sh script to download the application file;

[0040] 4. Perform the pre-configuration operations;

[0041] 5. Execute the configured startup command;

[0042] 6. Perform the post-configuration operations;

[0043] If any of the above six steps fails, then stop the subsequent operations, construct deployment failure information, and return the result to DevOps through WebSocket; if the above six steps are all executed successfully, then write the health probe to the local file, construct deployment success information, and return the result to DevOps through WebSocket.

[0044] The deploy_docker: deploy Docker image, perform the following steps:

[0045] 1. Create a working directory;

[0046] 2. Write the configuration file;

[0047] 3. Log in to the docker image repository;

[0048] 4. Pull the image;

[0049] 5. Run the image;

[0050] 6. Get container information;

[0051] If any of the above six steps fails, then stop the subsequent operations, construct deployment failure information, and return the result to DevOps through WebSocket; if all the above six steps are executed successfully, construct deployment success information and return the result to DevOps through WebSocket.

[0052] The deploy_docker_compose: deploy docker-compose application, perform the following steps:

[0053] 1. Create a working directory;

[0054] 2. Write the configuration file;

[0055] 3. Update the docker-compose.yml file in the working directory;

[0056] 4. Execute the docker-copmosepull command to update the image;

[0057] 5. Execute the startup command;

[0058] 6. Get container information;

[0059] If any of the above six steps fails, then stop the subsequent operations, construct deployment failure information, and return the result to DevOps through WebSocket; if all the above six steps are executed successfully, construct deployment success information and return the result to DevOps through WebSocket.

[0060] The step 3 comprises the following steps:

[0061] Step 3.1: c7n-agent starts the scheduled task;

[0062] Step 3.2: Call the sh script to execute the application health probe to obtain the application runtime status information;

[0063] Step 3.3: Read the / proc / stat and / proc / meminfo files on the host to obtain the host CPU and host memory usage; execute df -h | grep ' / $' | awk '{print$5}' to obtain the hard disk usage;

[0064] Step 3.4: Build the data and return the results to DevOps via WebSocket.

[0065] Compared with the prior art, the present invention provides an image and software deployment management method based on WebSocket in a DevOps application scenario, which incorporates the host into DevOps management, simplifies the deployment process, and enables users to quickly deploy images and software to the host, greatly improving the efficiency of application publishing and deployment. BRIEF DESCRIPTION OF THE DRAWINGS

[0066] Figure 1 It is a connection diagram of the present invention.

[0067] Figure 2 Diagram of DevOps sending the information required for deployment to the Linux host through websocket.

[0068] Figure 3 It is the work flow chart of the present invention.

[0069] Figure 4 Deployment flow chart for Jar packages or other product applications.

[0070] Figure 5 Deployment flow chart for Docker images.

[0071] Figure 6 Deploy flow chart for docker-compose.

[0072] Figure 7 It is a maintenance host information diagram of the present invention in an embodiment.

[0073] Figure 8 This is a diagram of starting c7n-agent on the host of the present invention in an embodiment.

[0074] Fig. 9 It is an application diagram required for creating Jar deployment of the present invention in an embodiment.

[0075] Fig.10 It is a pipeline diagram for creating and building a Jar package of the present invention in an embodiment.

[0076] Fig.11 A Jar package deployment diagram is selected for the host application deployment of the present invention in the embodiment.

[0077] Fig.12 This is a configuration interface diagram of the host application Jar package type of the present invention in an embodiment.

[0078] Fig.13 This is a process information diagram generated after the host application Jar package of the present invention in the embodiment is run on the host.

[0079] Fig.14 It is an application diagram required for creating a Docker image deployment of the present invention in an embodiment.

[0080] Fig.15 A pipeline diagram for creating and building a Docker image for the present invention in an embodiment.

[0081] Fig.16 A Docker image deployment diagram is selected for the host application deployment of the present invention in the embodiment.

[0082] Fig.17 This is a configuration interface diagram of the host application Docker image type of the present invention in an embodiment.

[0083] Fig.18 This is a specific diagram of container information generated after the host application Docker image of the present invention in the embodiment runs on the host. Implementation

[0084] The present invention will be further described below with reference to the accompanying drawings.

[0085] Overall description of the present invention: DevOps generates an identity token and installation command based on the host information configured by the user. After the installation command is executed on the Linux host, c7n-agent is automatically downloaded and started. c7n-agent connects to the DevOps service via websocket, thereby activating the Linux host on DevOps.

[0086] The user clicks on host deployment on the interface and fills in the configuration information. DevOps sends the required deployment information to the corresponding Linux host c7n-agent through websocket, and finally implements the deployment operation.

[0087] c7n-agent enables the timing function to obtain the host CPU, memory, disk, and application runtime information at regular intervals and transmit it to the DevOps service.

[0088] like Figures 1 to 6 As shown, the specific implementation method of the present invention is:

[0089] include:

[0090] DevOps module, which is used to provide front-end interactive interface, deployment management, and command issuance;

[0091] The c7n-agent module is used to interact with DevOps and is responsible for executing commands and transmitting application running status information and host status information.

[0092] Database server, used to store data information;

[0093] File storage server, used to store custom software uploaded by users;

[0094] Nexus server, used to store Jar products;

[0095] Docker image repository, used to store Docker images;

[0096] The following steps are involved:

[0097] Step 1: Maintain host information;

[0098] Step 2: Deploy applications and deployment images;

[0099] Step 3: Data reporting.

[0100] Step 1 specifically includes the following steps:

[0101] Step 1.1: Maintain the host information and create a host table in the database server to store the created host information;

[0102] Step 1.2: Provide the user with the host installation and activation command. Execute it on the target Linux host, including the following operations:

[0103] Step 1: Download the host.sh installation script;

[0104] Operation 2: Execute the host.sh installation script;

[0105] Step 3: Set the user to run c7n-agent;

[0106] Operation 4: Check and create the working directory and log saving directory required for c7n-agent runtime; save the environment variables required for c7n-agent runtime to the working directory; save the c7n-agent script operation commands to the working directory;

[0107] Step 5: Download the c7n-agent binary executable file from the remote server and decompress it;

[0108] Operation 6: Configure Systemd application information to enable the Linux system to monitor the c7n-agent process. Implement the c7n-agent process startup and restart when it exits abnormally;

[0109] Operation 7: Start c7n-agent through the systemctl command;

[0110] Step 1.3: c7n-agent starts. Request to establish a websocket connection with DevOps. After DevOps passes the authentication, it sends an initialization command to c7n-agent. c7n-agent initializes the listener, monitors the application status, host CPU, host memory, and host storage usage at regular intervals, and reports to DevOps.

[0111] Step 2 specifically includes the following steps:

[0112] Step 2.1: Create a new host application and configure application information;

[0113] Step 2.2: Request DevOps service. DevOps builds the parameters required for deploying the application (jar package: jar package warehouse information, working directory, pre-operation, post-operation, deletion operation, startup command, health check; docker image: image warehouse information, container information, working directory, startup command; docker-compose: docker-compose file, working directory, startup command; other products: product download address, working directory, pre-operation, post-operation, deletion operation, startup command, health check) and sends them to c7n-agent through WebSocket;

[0114] Step 2.3: c7n-agent receives the DevOps message through WebSocket, parses the message and executes the command in it. It makes a judgment based on the type field in the message:

[0115] operate_instance: deploys Jar packages or other product applications. There are the following steps:

[0116] 1. Create a working directory;

[0117] 2. Write the configuration file;

[0118] 3. Call the sh script to download the application file;

[0119] 4. Perform the pre-configuration operations;

[0120] 5. Execute the configured startup command;

[0121] 6. Perform the configured post-operation;

[0122] If any of the above six steps fails, then stop the subsequent operations, construct deployment failure information, and return the result to DevOps through WebSocket. If all the above six steps are executed successfully, then write the health probe to the local file, construct deployment success information, and return the result to DevOps through WebSocket.

[0123] deploy_docker: Deploy Docker images. There are the following steps:

[0124] 1. Create a working directory;

[0125] 2. Write the configuration file;

[0126] 3. Log in to the docker image repository;

[0127] 4. Pull the image;

[0128] 5. Run the image;

[0129] 6. Get container information;

[0130] If any of the above six steps fails, then stop the subsequent operations, construct deployment failure information, and return the result to DevOps through WebSocket. If all the above six steps are executed successfully, construct deployment success information and return the result to DevOps through WebSocket.

[0131] deploy_docker_compose: deploy the docker-compose application. There are the following steps:

[0132] 1. Create a working directory;

[0133] 2. Write the configuration file;

[0134] 3. Update the docker-compose.yml file in the working directory;

[0135] 4. Execute the docker-copmosepull command to update the image;

[0136] 5. Execute the startup command;

[0137] 6. Get container information;

[0138] If any of the above six steps fails, then stop the subsequent operations, construct deployment failure information, and return the result to DevOps through WebSocket. If all the above six steps are executed successfully, construct deployment success information and return the result to DevOps through WebSocket.

[0139] Step 3 specifically includes:

[0140] Step 3.1: c7n-agent starts the scheduled task;

[0141] Step 3.2: Call the sh script to execute the application health probe to obtain the application runtime status information;

[0142] Step 3.3: Read the / proc / stat and / proc / meminfo files on the host to obtain the host CPU and host memory usage; execute df -h | grep ' / $' | awk '{print$5}' to obtain the hard disk usage;

[0143] Step 3.4: Build the data and return the results to DevOps via WebSocket.

[0144] The present invention can achieve the following functions:

[0145] 1. Realize real-time data exchange and process control: Through the two-way communication characteristics of WebSocket technology, real-time data exchange and control instruction transmission during the deployment process can be realized, thereby significantly reducing the time delay during the deployment process.

[0146] 2. Improve the efficiency and stability of the deployment process: Existing technologies are prone to peak resource utilization during the deployment process. By optimizing the resource scheduling algorithm, system resource allocation is made more even, avoiding deployment failures caused by resource preemption, and further improving the efficiency and stability of the deployment process.

[0147] 3. Enhance the scalability and extensibility of the system: A system that can dynamically adjust resource allocation according to real-time load to adapt to deployment requirements of different scales, thereby supporting larger-scale service deployment and management.

[0148] 4. Strengthen the security of the deployment process: Through the modern encryption standard of WebSocket, a more secure data transmission channel is provided than traditional HTTP or SSH, ensuring the security of sensitive data during the deployment process.

[0149] 5. Simplify deployment and management operations: Design a user-friendly interface so that non-professionals can easily perform deployment and management of container images and product packages, reducing dependence on professional technicians.

[0150] The present invention can solve the limitations of the prior art in the management of Linux host container images and product packages, and provide users with a more efficient, stable, secure and easy-to-use deployment management system. Example

[0151] First maintain the host information and start c7n-agent on the host, such as Figure 7 , Figure 8 shown.

[0152] (I) Jar package deployment:

[0153] 1. Create application service: application name, application code, such as Fig. 9 shown.

[0154] 2. Create an application pipeline, select Maven to build, generate a jar package and upload it to the Nexus artifact library, such as Fig.10 shown.

[0155] 3. Create a host application and select jar package deployment, such as Fig.11 shown.

[0156] 4. Maintain the information of the jar package: jar package source, host application name, host application code, various operation execution commands of the host application, such as Fig.12 shown.

[0157] 5. Create deployment: After clicking OK, the corresponding host application will run on the target Linux host, such as Fig.13 shown.

[0158] (II) Docker image deployment:

[0159] 1. Create application service: application name, application code, such as Fig.14 shown.

[0160] 2. Create an application pipeline, select image building, generate an image, and upload it to the Docker image repository, such as Fig.15 shown.

[0161] 3. Create a host application and select Docker image deployment, such as Fig.16 shown.

[0162] 4. Maintain Docker image information: Docker image source, host application name, host application code, Docker image startup operation command, such as Fig.17 shown.

[0163] 5. Create deployment: After clicking OK, the corresponding Docker image container will run on the target Linux host, such as Fig.18 shown.

Claims

1. A WebSocket-based image and software deployment management method in a DevOps application scenario, characterized in that: include, DevOps module, which is used to provide front-end interactive interface, deployment management, and command issuance; The c7n-agent module is used to interact with DevOps and is responsible for executing commands and transmitting application running status information and host status information. Database server, used to store data information; File storage server, used to store custom software uploaded by users; Nexus server, used to store Jar products; Docker image repository, used to store Docker images; The specific steps include: Step 1: Maintain host information; Step 2: Deploy applications and deployment images; Step 3: Data reporting; The step 2 comprises the following steps: Step 2.1: Create a new host application and configure application information; Step 2.2: Request the DevOps service, DevOps builds the parameters required to deploy the application and sends them to c7n-agent via WebSocket; Step 2.3: c7n-agent receives the DevOps message through WebSocket, parses the message and executes the command in it, making a judgment based on the type field in the message; The parameters required for DevOps to build and deploy applications include jar package: jar package warehouse information, working directory, pre-operation, post-operation, deletion operation, startup command, and health check; docker image: image warehouse information, container information, working directory, startup command; docker-compose: docker-compose file, working directory, startup command; other products: product download address, working directory, pre-operation, post-operation, deletion operation, startup command, and health check.

2. According to claim 1, a WebSocket-based image and software deployment management method in a DevOps application scenario is characterized in that: The step 1 comprises the following steps: Step 1.1: Maintain the host information and create a host table in the database server to store the created host information; Step 1.2: Provide the user with the host installation and activation command, which is executed on the target Linux host, including the following operations: Operation 1: Download the host.sh installation script; Operation 2: Execute the host.sh installation script; Step 3: Set the user to run c7n-agent; Operation 4: Check and create the working directory and log saving directory required for c7n-agent runtime; save the environment variables required for c7n-agent runtime to the working directory; save the c7n-agent script operation commands to the working directory; Step 5: Download the c7n-agent binary executable file from the remote server and decompress it; Operation 6: Configure Systemd application information to enable the Linux system to monitor the c7n-agent process and restart the c7n-agent process when it is started and exits abnormally; Operation 7: Start c7n-agent through the systemctl command; Step 1.3: c7n-agent starts and requests to establish a websocket connection with DevOps. After DevOps passes the authentication, it sends an initialization command to c7n-agent. c7n-agent initializes the listener, monitors the application status, host CPU, host memory, and host storage usage at regular intervals, and reports to DevOps.

3. According to claim 1, a WebSocket-based image and software deployment management method in a DevOps application scenario is characterized in that: The judgment according to the type field in the message includes A. operate_instance: deploying Jar packages or other product applications; B. deploy_docker: deploy Docker images; C. deploy_docker_compose: deploy the docker-compose application.

4. According to claim 3, a WebSocket-based image and software deployment management method in a DevOps application scenario is characterized in that: The above-mentioned operate_instance: deploys a Jar package or other product application and performs the following steps:

1. Create a working directory; 2. Write the configuration file; 3. Call the sh script to download the application file; 4. Perform the pre-configuration operations; 5. Execute the configured startup command; 6. Perform the configured post-operation; If any of the above six steps fails, stop the subsequent operations, construct deployment failure information, and return the result to DevOps through WebSocket; If the above six steps are executed successfully, the health probe is written to the local file, the deployment success information is constructed, and the results are returned to DevOps through WebSocket.

5. According to claim 3, a WebSocket-based image and software deployment management method in a DevOps application scenario is characterized in that: The deploy_docker: deploy Docker image, perform the following steps:

1. Create a working directory; 2. Write the configuration file; 3. Log in to the docker image repository; 4. Pull the image; 5. Run the image; 6. Get container information; If any of the above six steps fails, then stop the subsequent operations, construct deployment failure information, and return the result to DevOps through WebSocket; if all the above six steps are executed successfully, construct deployment success information and return the result to DevOps through WebSocket.

6. According to claim 3, a WebSocket-based image and software deployment management method in a DevOps application scenario is characterized in that: The deploy_docker_compose: deploy docker-compose application, perform the following steps:

1. Create a working directory; 2. Write the configuration file; 3. Update the docker-compose.yml file in the working directory; 4. Execute the docker-copmosepull command to update the image; 5. Execute the startup command; 6. Get container information; If any of the above six steps fails, then stop the subsequent operations, construct deployment failure information, and return the result to DevOps through WebSocket; if all the above six steps are executed successfully, construct deployment success information and return the result to DevOps through WebSocket.

7. According to claim 1, a WebSocket-based image and software deployment management method in a DevOps application scenario is characterized in that: The step 3 comprises the following steps: Step 3.1: c7n-agent starts the scheduled task; Step 3.2: Call the sh script to execute the application health probe to obtain the application runtime status information; Step 3.3: Read the / proc / stat and / proc / meminfo files on the host to obtain the host CPU and host memory usage; execute df -h | grep ' / $' | awk '{print$5}' to obtain the hard disk usage; Step 3.4: Build the data and return the results to DevOps via WebSocket.

Citation Information

Patent Citations

  • Method and system for automatically deploying distributed data service

    CN116506308A