Platform automatic deployment updating method and device, equipment and medium
By generating executable programs on independent servers and transferring only necessary files, the problem of large base image size and long transfer time in containerized deployment is solved, deployment efficiency and security are improved, and manual errors are reduced.
Patent Information
- Application Number
- CN202410458189.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-16
- Publication Date
- 2024-08-23
AI Technical Summary
During the deployment process of the software platform, the current containerized deployment method results in a large base image size, long network transmission time, and increased security scanning time, which affects the efficiency of development, deployment, and updates.
By generating executable programs on independent servers and transmitting only necessary program executable files, transmission time is reduced, security scanning efficiency is improved, and predefined scripts or tools are used to automate operations and eliminate manual errors.
It greatly reduces the transmission time, improves the security scanning efficiency, shortens the deployment time, avoids errors caused by manual operations, and speeds up the conversion from code to executable program.
Smart Images

Figure CN118535188A
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of cloud computing and information security technology, and more specifically to a platform automated deployment and update method, device, equipment, medium and program product. Background Art
[0002] Currently, with the continuous advancement of technology, software platforms are also gradually developing and becoming popular. These platforms are widely used in government, enterprise and other fields, so there are more and more cases where they need to be deployed in different environments. In order to isolate the impact of differences in different environments on platform deployment, containerized deployment methods are often used to package platform applications and their dependencies into container images, and then use tools such as Kubernetes and Docker to manage and coordinate the deployment and operation of containers.
[0003] However, in the actual development and deployment process, the following shortcomings have also been exposed: the currently developed software platforms often contain a large number of dependent files, so the size of the basic images used to build application images is also very large; in the actual deployment process, for security reasons, the test environment and production environment of current enterprises or government agencies are isolated from each other, so each time the platform application is deployed in a different environment, the image file needs to be retransmitted, and the network transmission of large amounts of data takes a long time. At the same time, the image file will be scanned for security within the enterprise, and the large number of basic components included also greatly prolongs the scanning time. In today's fast-updated and iterative software development model, the above problems will seriously affect the efficiency of platform development deployment and subsequent updates. Summary of the invention
[0004] In view of the above problems, embodiments of the present disclosure provide a platform automated deployment and update method, apparatus, device, medium, and program product.
[0005] According to a first aspect of the present disclosure, a platform automated deployment and update method is provided, comprising: in response to a request to deploy a platform service in a running environment, transmitting a basic image required for the platform service to a deployment server corresponding to the running environment; creating a project code base on a pre-prepared independent server, and packaging and building the program code of the platform service included in the project code base to generate an executable program; in response to the deployment server starting a deployment script, creating a file subdirectory on the deployment server, and pulling the executable program to the file subdirectory; based on the executable program and the basic image, building an application service image on the deployment server, and adding a version number tag of the current executable program to the application service image; and based on the version number tag of the current executable program, upgrading the basic image to the application service image through the deployment script.
[0006] According to an embodiment of the present disclosure, the project code base is created on a pre-prepared independent server, and the program code of the platform service included in the project code base is packaged and built to generate an executable program, including: deploying a software development platform on the independent server, and creating the project code base on the software development platform; submitting the program code to the project code base, and performing version control using the version control system of the software development platform; and in response to the completion of version control, automatically packaging and building the program code through an automated build script pre-written in the project code base to generate an executable program.
[0007] According to an embodiment of the present disclosure, in response to a request to deploy a platform service in a running environment, transmitting the basic image required by the platform service to a deployment server corresponding to the running environment includes: installing an application container engine on the deployment server; using the application container engine to package the application of the platform service and its dependencies to form the basic image, and migrating the basic image to the deployment server; and using the application container engine on the deployment server to run and manage the basic image.
[0008] According to an embodiment of the present disclosure, the method also includes: performing security checks on the program code and the base image respectively; and in response to the program code and the base image passing the checks, submitting the program code to the project code library, and transmitting the base image to the deployment server.
[0009] According to an embodiment of the present disclosure, upgrading the base image to the application service image through the deployment script based on the version number tag of the current executable program includes: in response to the completion of the construction of the application service image, modifying the container orchestration tool of the deployment server through the deployment script to update the version number tag to the version number tag of the application service image; and restarting the platform service to enable the deployment server to automatically upgrade the base image to the application service image.
[0010] According to an embodiment of the present disclosure, the method also includes: in response to the base image being upgraded to the application service image, determining whether the service status of the platform service and the newly added functional points of the platform service are normal; when the service status of the platform service and the newly added functional points of the platform service are normal, deleting the base image; and when the service status of the platform service and the newly added functional points of the platform service are abnormal, replacing the version number tag back to the version number tag of the base image.
[0011] According to an embodiment of the present disclosure, the method further includes: opening a firewall between the deployment server and the independent server to enable data transmission between the deployment server and the independent server.
[0012] A second aspect of the present disclosure provides a platform automated deployment and update device, the device comprising: an image transmission module, for responding to a request to deploy a platform service in a running environment, transmitting a basic image required by the platform service to a deployment server corresponding to the running environment; a program construction module, for creating a project code base on a pre-prepared independent server, and packaging and building the program code of the platform service included in the project code base to generate an executable program; a program pulling module, for responding to the deployment server starting a deployment script, creating a file subdirectory on the deployment server, and pulling the executable program to the file subdirectory; an image construction module, for building an application service image on the deployment server based on the executable program and the basic image, and adding a version number label of the current executable program to the application service image; and an image upgrade module, for upgrading the basic image to the application service image through the deployment script based on the current version number label of the executable program.
[0013] A third aspect of the present disclosure provides an electronic device, comprising: one or more processors; a storage device for storing one or more computer programs, wherein the one or more processors execute the one or more computer programs to implement the steps of the platform automated deployment and update method.
[0014] The fourth aspect of the present disclosure further provides a computer-readable storage medium having a computer program / instruction stored thereon, which implements the steps of the platform automatic deployment and update method when the computer program / instruction is executed by a processor.
[0015] The fifth aspect of the present disclosure further provides a computer program product, including a computer program / instruction, which implements the steps of the platform automatic deployment and update method when executed by a processor.
[0016] In an embodiment of the present disclosure, an executable program is generated on an independent server and transmitted to a deployment server. Since only necessary program execution files need to be transmitted instead of complete images, transmission time is greatly reduced, while security scanning efficiency is improved, repeated detection of the same components is avoided, and deployment time is effectively shortened. At the same time, the use of pre-defined scripts or tools to complete operations can eliminate many errors that may be caused by manual operations and speed up the conversion from code to executable programs. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The above contents and other objects, features and advantages of the present disclosure will become more apparent through the following description of the embodiments of the present disclosure with reference to the accompanying drawings, in which:
[0018] Figure 1 The application scenario diagram schematically shows the platform automatic deployment and update method, apparatus, device, medium and program product according to the embodiment of the present disclosure;
[0019] Figure 2 A flowchart of a platform automated deployment and update method according to an embodiment of the present disclosure is schematically shown;
[0020] Figure 3 A flowchart of a method for deploying a basic image according to an embodiment of the present disclosure is schematically shown;
[0021] Figure 4 A flowchart of a method for generating an executable program according to an embodiment of the present disclosure is schematically shown;
[0022] Figure 5 A flowchart schematically illustrates a method for submitting program code and a base image according to an embodiment of the present disclosure;
[0023] Figure 6 A flowchart of a method for upgrading a base image according to an embodiment of the present disclosure is schematically shown;
[0024] Figure 7 A flowchart schematically shows a method for determining whether the service status of a platform service and a newly added function point are normal according to an embodiment of the present disclosure;
[0025] Figure 8 A schematic diagram showing a structural block diagram of a platform automatic deployment and updating device according to an embodiment of the present disclosure; and
[0026] Fig. 9 A block diagram of an electronic device suitable for implementing a platform automatic deployment and update method according to an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION
[0027] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present disclosure. In the following detailed description, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present disclosure. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessary confusion of the concepts of the present disclosure.
[0028] The terms used herein are only for describing specific embodiments and are not intended to limit the present disclosure. The terms "comprise", "include", etc. used herein indicate the existence of the features, steps, operations and / or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.
[0029] All terms (including technical and scientific terms) used herein have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification, and should not be interpreted in an idealized or overly rigid manner.
[0030] When using expressions such as "at least one of A, B, and C, etc.", they should generally be interpreted according to the meaning of the expression commonly understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).
[0031] In the technical solution of the present invention, the user information (including but not limited to user personal information, user image information, user device information, such as location information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved are all information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of relevant data comply with relevant laws, regulations and standards, take necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0032] In the scenario of using personal information for automated decision-making, the methods, devices, and systems provided by the embodiments of the present invention provide users with corresponding operation portals for users to choose to agree or reject the automated decision-making results; if the user chooses to reject, the expert decision-making process will be entered. The expression "automated decision-making" here refers to the activity of automatically analyzing and evaluating an individual's behavioral habits, interests and hobbies, or economic, health, credit status, etc. through computer programs, and making decisions. The expression "expert decision-making" here refers to the activity of making decisions by people who specialize in a certain field, have specialized experience, knowledge and skills, and have reached a certain level of professionalism.
[0033] First, the technical terms described in this article are explained and described as follows.
[0034] Docker technology: Docker is an open source application engine. Developers can package their own applications into containers and then migrate them to Docker applications on other machines. This allows for rapid deployment and rapid service recovery through mirroring. Docker allows developers to package their applications and dependent packages into a lightweight, portable container and then publish them to any popular Linux machine. It can also achieve virtualization. Docker can make the delivery of the operating environment like shipping, with the OS as a cargo ship, and each software based on the OS as a container. Users can freely assemble the operating environment through standardized means, and the contents of the container can be customized by users or manufactured by professionals. In this way, the delivery of a software is the delivery of a collection of standardized components, just like Lego blocks. Users only need to choose the appropriate combination of blocks and sign their own name at the top (the last standardized component is the user's app).
[0035] GitLab: GitLab is a version control tool based on Git and a web service built on top of it, designed to provide a comprehensive workflow to help manage code, collaboration, and deployment. Version control refers to the management of changes to various program codes, configuration files, and documentation files during the software development process.
[0036] Embodiments of the present disclosure provide a platform automated deployment and update method, apparatus, device, storage medium, and program product.
[0037] Figure 1 The application scenario diagram of the platform automatic deployment and update method, apparatus, device, medium and program product according to the embodiments of the present disclosure is schematically shown.
[0038] like Figure 1 As shown, the application scenario 100 according to this embodiment may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 is used to provide a medium for a communication link between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0039] Users can use terminal devices 101, 102, 103 to interact with server 105 through network 104 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 101, 102, 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only examples).
[0040] The terminal devices 101 , 102 , and 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers.
[0041] The server 105 may be a server that provides various services, such as a background management server (only an example) that provides support for websites browsed by users using the terminal devices 101, 102, and 103. The background management server may analyze and process the received data such as user requests, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal device.
[0042] It should be noted that the platform automatic deployment and update method provided in the embodiment of the present disclosure can generally be executed by the server 105. Accordingly, the platform automatic deployment and update device provided in the embodiment of the present disclosure can generally be set in the server 105. The platform automatic deployment and update method provided in the embodiment of the present disclosure can also be executed by a server or server cluster that is different from the server 105 and can communicate with the terminal devices 101, 102, 103 and / or the server 105. Accordingly, the platform automatic deployment and update device provided in the embodiment of the present disclosure can also be set in a server or server cluster that is different from the server 105 and can communicate with the terminal devices 101, 102, 103 and / or the server 105.
[0043] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to the implementation requirements.
[0044] The following will be based on Figure 1 The scene described by Figure 2 The platform automatic deployment and updating method of the embodiment of the present disclosure is described in detail.
[0045] Figure 2 The flowchart of the platform automatic deployment and update method according to the embodiment of the present disclosure is schematically shown.
[0046] like Figure 2 As shown, the platform automatic deployment and updating method of this embodiment includes operations S210 to S250.
[0047] In operation S210, in response to a request to deploy a platform service in an operating environment, a basic image required by the platform service is transmitted to a deployment server corresponding to the operating environment.
[0048] In an embodiment of the present disclosure, before the base image required for the platform service is transmitted to the deployment server corresponding to the operating environment, the user's consent or authorization is obtained. For example, before operation S210, a request to obtain the base image required for the platform service is issued to the user. When the user agrees or authorizes that the base image required for the platform service can be obtained, the operation S210 is performed.
[0049] In operation S220, a project code base is created on a pre-prepared independent server, and the program code of the platform service included in the project code base is packaged and constructed to generate an executable program.
[0050] In operation S230, in response to the deployment server starting the deployment script, a file subdirectory is created on the deployment server, and the executable program is pulled into the file subdirectory.
[0051] In the embodiment of the present disclosure, a corresponding operation entry is provided for the user to choose to agree or reject the automated decision result. That is, before the executable program is pulled to the file subdirectory for processing / decision, the user's instruction to agree or reject the processing / decision input through the corresponding operation entry is obtained. If the user agrees to carry out the processing / decision, the executable program is pulled to the file subdirectory for authentication processing / decision, that is, step S230 is executed. If the user refuses to carry out the processing / decision, the expert decision process is entered.
[0052] In operation S240, an application service image is constructed on the deployment server based on the executable program and the base image, and a version number tag of the current executable program is added to the application service image.
[0053] In operation S250, based on the current version number tag of the executable program, the base image is upgraded to the application service image through the deployment script.
[0054] First, determine the target operating environment for deployment, including different environments such as development, testing, and production. Each environment has its own specific configuration and requirements. At the same time, ensure that the deployment server is correctly configured, including necessary software dependencies, network settings, and security configurations.
[0055] In the disclosed embodiment, it is particularly necessary to pre-install the engine on the deployment server of the deployment platform service to provide basic support for the subsequent deployment of the platform container service. Container image is an important concept in container technology. It is a lightweight, read-only template that contains all the content required to run the application, such as code, dependent libraries, configuration files, etc. Through the container image, developers can package the application and its operating environment into a portable unit, and then deploy it to any server with the container engine installed.
[0056] Figure 3 The flowchart of the method for deploying a basic image according to an embodiment of the present disclosure is schematically shown.
[0057] like Figure 3 As shown, in response to the request for deploying the platform service in the operating environment, transmitting the basic image required by the platform service to the deployment server corresponding to the operating environment includes operations S310 to S340.
[0058] In operation S310, an application container engine is installed on the deployment server.
[0059] In operation S320, an application container engine is used to package the application of the platform service and its dependencies to form the basic image.
[0060] In operation S330, the base image is migrated to the deployment server.
[0061] In operation S340 , the base image is run and managed using the application container engine on the deployment server.
[0062] In the disclosed embodiment, the installed application container engine is the Docker engine, which is a popular container engine that uses the kernel of the operating system to isolate and package applications, so that applications can run in different environments without modifying the code. By installing the Docker engine, developers can package their applications and their required dependencies into a container image and run them on different hosts. This lightweight and portable containerization method greatly improves the deployment efficiency and flexibility of applications.
[0063] Furthermore, packaging the platform service application and its dependencies into one or more container images can be done on a deployment server, or in a dedicated build environment, such as a continuous integration server or a build service in a cloud service. Once the base image is built, the base image is pushed to a container image repository, where it can be pulled and deployed to multiple environments, including test environments, pre-production environments, and production environments.
[0064] By installing the application container engine on the deployment server, the platform service applications and their dependencies can be deployed in containers, so that different services can be isolated and run in their own containers without interfering with each other, improving the flexibility and portability of deployment. At the same time, using the application container engine to package the application and its dependencies to form a basic image can ensure that the application has a complete and consistent dependency environment at runtime, simplify the management and deployment of dependencies, and easily migrate between different deployment servers.
[0065] Furthermore, the deployment script is started on the deployment server of the specified operating environment. The deployment script is a series of automated commands used to automate the deployment process. In this process, the deployment script first creates a program file subdirectory under the data storage directory of the server, and pulls the packaged program files from the independent server to the program file subdirectory just created. When the code is pulled to the server, the deployment script executes the docker build-t command to build the application service image. The command uses Dockerfile as input. Dockerfile contains all the instructions and configurations required to build the image. After the build is completed, the application service image will be pushed to a centralized image repository (such as DockerHub, Harbor or other private repositories) for storage and distribution. Other servers or environments can pull images from this repository to deploy the same version of the application. After the image is built and stored, the deployment script uses Docker commands (such as docker run) to start the container and deploy the application service according to the rules and service requirements defined in the configuration file.
[0066] The platform automated deployment and update method provided by the disclosed embodiment reduces the complexity of the original solution process, optimizes the existing technical process, and only needs to transmit the necessary executable program files instead of the complete image, which greatly reduces the transmission time, while improving the security scanning efficiency and avoiding repeated detection of the same components, thereby effectively shortening the deployment time. In addition, the prior art requires manual execution of multiple steps, which may lead to omissions or errors. The disclosed embodiment uses pre-defined scripts or tools to complete the operation, thereby eliminating many errors that may be caused by manual operations, and has strong security and is easy to implement.
[0067] Figure 4 The flowchart of the method for generating an executable program according to an embodiment of the present disclosure is schematically shown.
[0068] like Figure 4 As shown, the project code base is created on a pre-prepared independent server, and the program code of the platform service included in the project code base is packaged and constructed to generate an executable program, including operations S410 to S440.
[0069] In operation S410, a software development platform is deployed on the independent server.
[0070] In operation S420, the project code library is created on the software development platform.
[0071] In operation S430, the program code is submitted to the project code library, and version control is performed using the version control system of the software development platform.
[0072] In operation S440, in response to the completion of version control, the program code is automatically packaged and built using an automated building script pre-written in the project code library to generate an executable program.
[0073] First, in order to provide a stable and efficient software development environment, we choose to deploy the software development platform on an independent server. In the present disclosed embodiment, the community version (open source version) of the GitLab service is selected as our main platform. After the deployment is completed, a platform project code base is created on GitLab, which is the center of developer collaboration and code management. At the same time, in order to achieve automated building and packaging, an automated build script is written in the code base. This automated script defines a series of building and packaging rules and steps. Whenever a developer submits new code and passes the security test into the library, the automated build script will automatically trigger the build process. In the build process, the server automatically executes the predefined build script. For example, for the Java code of the backend service, Maven is used as a build tool to build the code into an executable jar package. This process includes compilation, testing, packaging and other steps to ensure that the final generated jar package is a compliant and executable program.
[0074] Through automated building and packaging, the building process is automatically triggered after code submission or version control is completed, thus significantly improving the efficiency and consistency of software development. This greatly reduces manual building errors, speeds up the conversion from code to executable programs, and uses the version control system of the software development platform to perform detailed version control on program codes, making it easier to track historical changes, roll back to specific versions, and manage branches. At the same time, automated building can also ensure that the environment and steps of each build are consistent, reducing the possibility of human errors and build differences.
[0075] Figure 5 The flowchart of the method for submitting program code and base image according to an embodiment of the present disclosure is schematically shown.
[0076] like Figure 5 As shown, the method for submitting program code and base image includes operations S510 to S530.
[0077] In operation S510, security checks are performed on the program code and the base image respectively.
[0078] In operation S520 , in response to the program code and the base image being detected as passed.
[0079] In operation S530 , the program code is submitted to the project code repository, and the base image is transmitted to the deployment server.
[0080] When performing security checks on program code, you can use automated tools to scan the program code to check whether there are common security vulnerabilities, coding standard issues, and potential logical errors in the code, so as to find potential problems before the code is submitted and avoid bringing problems into the subsequent packaging and building phase of the program code. At the same time, by querying the security vulnerability database or using a dedicated dependency checking tool, check whether there are known security vulnerabilities in the third-party libraries or components that the project depends on. When the program code passes the security check, the program code is submitted to the project code base through the version control system to ensure that the version control and history of the code are maintained.
[0081] When performing security checks on the base image, first check the files, configurations, and pre-installed software packages in the base image to ensure that they do not contain malicious code or unnecessary sensitive information. At the same time, use vulnerability scanning tools to scan the base image to detect whether there are known security vulnerabilities. After the test passes, the base image that has passed the security check is transferred to the corresponding deployment server through containerization technologies such as Docker to ensure that the integrity and security of the base image are not destroyed during the transmission process.
[0082] Security testing of program code can timely discover and fix potential security vulnerabilities, prevent security risks such as malicious code injection or unauthorized access. At the same time, security testing of base images can ensure the reliability of image sources and prevent the use of images containing known vulnerabilities or malware, thereby protecting the security of the deployment environment.
[0083] Figure 6 The flowchart of the method for upgrading a base image according to an embodiment of the present disclosure is schematically shown.
[0084] like Figure 6 As shown, the process of upgrading the basic image to the application service image through the deployment script based on the version number tag of the current executable program includes operations S610 to S630.
[0085] In operation S610, in response to the application service image being built.
[0086] In operation S620, the container orchestration tool of the deployment server is modified by the deployment script to update the version number tag to the version number tag of the application service image.
[0087] In operation S630, the platform service is restarted so that the deployment server automatically upgrades the basic image to the application service image.
[0088] By setting a label corresponding to the program version number for the image, you can easily track, identify and manage different versions of the image, thereby facilitating subsequent deployment, upgrade and rollback operations.
[0089] Specifically, when the application service image is built, the deployment script will automatically intervene and perform a series of operations to update the configuration file. This can be achieved through Docker Compose, a container orchestration tool in the Docker application. The deployment script will first read the currently built application service image and obtain its corresponding program version number. Then, it will use this version number as a new label and apply it to the image just built, thereby ensuring that the image referenced in the docker-compose configuration file is always consistent with the latest program version. The deployment script will then modify the image version number field in the docker-compose configuration file and replace it with the new version number label just set. After the modification is completed, restart the platform service, triggering the server to automatically upgrade the running container to the new image.
[0090] By automatically modifying the configuration in the container orchestration tool through the deployment script, the version number label is updated to the label of the latest built application service image, thereby achieving efficient and reliable image management and deployment process, avoiding errors and delays in manual configuration updates, improving deployment efficiency, and reducing the risk of human errors.
[0091] Figure 7 The flowchart schematically shows a method for judging the service status of a platform service and whether a newly added function point is normal according to an embodiment of the present disclosure.
[0092] like Figure 7 As shown, the method for determining whether the service status of the platform service and the newly added function points are normal includes operation S710 to operation S730.
[0093] In operation S710 , in response to the base image being upgraded to the application service image, it is determined whether the service status of the platform service and the newly added functional points of the platform service are normal.
[0094] In operation S720 , when the service status of the platform service and the newly added function points of the platform service are normal, the basic image is deleted.
[0095] In operation S730 , when the service status of the platform service and the newly added function points of the platform service are abnormal, the version number tag is replaced back to the version number tag of the base image.
[0096] At the final stage of the upgrade process, it is necessary to check whether the service status is normal and verify the new functional points of the platform.
[0097] Specifically, after the upgrade is completed, the deployment script or operation and maintenance personnel start the service status inspection process, which usually includes comprehensive inspections of service startup, process status, port monitoring, log output, and other aspects. Use automated tools or manual methods to ensure that the service has been successfully started and is in normal operation. At the same time, it is also necessary to pay attention to the performance indicators of the service, such as response time and throughput, to ensure that the upgrade has no negative impact on these key indicators. In addition to checking the service status, it is also necessary to verify the new functional points of the platform. In this process, the test team or operation and maintenance personnel will conduct comprehensive tests on the new functions according to the predetermined test plan and use cases, usually including functional correctness verification, boundary condition testing, and performance testing. After verification that there are no abnormalities, the redundant image files of the old version can be deleted; if the function is abnormal and a version rollback is required, modify the docker-compose configuration file, change the image version number in the docker-compose configuration file back to the previous version, and restart the platform service to allow the server to automatically load and run the old version of the image.
[0098] By verifying the service status and new functionalities, as well as the rapid rollback mechanism, the system's robustness and fault tolerance are enhanced, which can better cope with various uncertainties in the upgrade process, ensure the stability and reliability of the service, and make the deployment process more robust and reliable.
[0099] In an embodiment of the present disclosure, the method further includes: opening a firewall between the deployment server and the independent server to enable data transmission between the deployment server and the independent server.
[0100] Open a firewall from the standalone server to the servers deployed in each environment to enable data transmission between servers. In this process, first of all, it is necessary to clarify the network architecture and topology relationship between the standalone server and the servers deployed in each environment, including understanding the basic information such as the server's IP address, port number and network protocol, so that the rules that allow communication can be accurately specified when configuring the firewall. Next, it is necessary to evaluate the needs and security risks of data transmission, determine which data needs to be transmitted between servers, how sensitive the data is, and the security threats that may be faced. According to the evaluation results, formulate corresponding security policies, such as encrypting transmitted data, restricting access rights, etc. When configuring the firewall, it is necessary to set corresponding rules based on the security policy and network architecture. These rules should allow necessary data transmission while preventing unauthorized access and potential attacks. Specifically, the firewall can be configured to allow communication between servers with a specific IP address or IP address range, while limiting or prohibiting other unnecessary communications. Finally, after opening the firewall and configuring the rules, testing and verification are required to ensure smooth and secure data transmission.
[0101] By configuring firewall rules, you can ensure that data can be transmitted only between authorized deployment servers and standalone servers, helping to prevent unauthorized access and data leakage, thereby protecting the security of transmitted data.
[0102] Based on the above platform automatic deployment and update method, the embodiment of the present disclosure also provides a platform automatic deployment and update device. Figure 3 The device is described in detail.
[0103] Figure 8 The structural block diagram of the platform automatic deployment and updating device according to the embodiment of the present disclosure is schematically shown.
[0104] like Figure 8 As shown, the platform automatic deployment and updating device 800 of this embodiment includes an image transmission module 810 , a program construction module 820 , a program pulling module 830 , an image construction module 840 and an image upgrading module 850 .
[0105] The image transmission module 810 is used to respond to the request to deploy the platform service in the operating environment and transmit the basic image required by the platform service to the deployment server corresponding to the operating environment. In one embodiment, the image transmission module 810 can be used to perform the operation S210 described above, which will not be repeated here.
[0106] The program construction module 820 is used to create a project code base on a pre-prepared independent server, and package and construct the program code of the platform service included in the project code base to generate an executable program. In one embodiment, the program construction module 820 can be used to perform the operation S220 described above, which will not be repeated here.
[0107] The program pulling module 830 is used to create a file subdirectory on the deployment server in response to the deployment server starting the deployment script, and pull the executable program to the file subdirectory. In one embodiment, the program pulling module 830 can be used to perform the operation S230 described above, which will not be repeated here.
[0108] The image building module 840 is used to build an application service image on the deployment server based on the executable program and the base image, and add a version number tag of the current executable program to the application service image. In one embodiment, the image building module 840 can be used to perform the operation S240 described above, which will not be repeated here.
[0109] The image upgrade module 850 is used to upgrade the basic image to the application service image through the deployment script based on the version number tag of the current executable program. In one embodiment, the image upgrade module 850 can be used to perform the operation S250 described above, which will not be repeated here.
[0110] In an embodiment of the present disclosure, the program construction module 820 is specifically used to: deploy the software development platform on the independent server and create the project code base on the software development platform; submit the program code to the project code base and perform version control using the version control system of the software development platform; and in response to the completion of version control, automatically package and build the program code using the automated build script pre-written in the project code base to generate an executable program.
[0111] In an embodiment of the present disclosure, the image transfer module 810 is specifically used to: install an application container engine on the deployment server; use the application container engine to package the application of the platform service and its dependencies to form the basic image, and migrate the basic image to the deployment server; and use the application container engine on the deployment server to run and manage the basic image.
[0112] In an embodiment of the present disclosure, the image transmission module 810 can also be used to: perform security checks on the program code and the base image respectively; and in response to the program code and the base image passing the checks, submit the program code to the project code library, and transmit the base image to the deployment server.
[0113] In an embodiment of the present disclosure, the image upgrade module 850 is specifically used to: in response to the completion of the construction of the application service image, modify the container orchestration tool of the deployment server through the deployment script to update the version number tag to the version number tag of the application service image; and restart the platform service to enable the deployment server to automatically upgrade the base image to the application service image.
[0114] In an embodiment of the present disclosure, the image upgrade module 850 can also be used to: in response to the base image being upgraded to the application service image, determine whether the service status of the platform service and the newly added functional points of the platform service are normal; when the service status of the platform service and the newly added functional points of the platform service are normal, delete the base image; and when the service status of the platform service and the newly added functional points of the platform service are abnormal, replace the version number label back to the version number label of the base image.
[0115] In an embodiment of the present disclosure, the program pulling module 830 may also be used to: open a firewall between the deployment server and the independent server to enable data transmission between the deployment server and the independent server.
[0116] According to an embodiment of the present disclosure, any multiple modules in the image transmission module 810, the program construction module 820, the program pull module 830, the image construction module 840 and the image upgrade module 850 can be combined in one module for implementation, or any one of the modules can be split into multiple modules. Alternatively, at least part of the functions of one or more of these modules can be combined with at least part of the functions of other modules and implemented in one module. According to an embodiment of the present disclosure, at least one of the image transmission module 810, the program construction module 820, the program pull module 830, the image construction module 840 and the image upgrade module 850 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application specific integrated circuit (ASIC), or can be implemented by hardware or firmware such as any other reasonable way of integrating or packaging the circuit, or by any one of the three implementation methods of software, hardware and firmware or by a suitable combination of any of them. Alternatively, at least one of the image transmission module 810, the program construction module 820, the program pulling module 830, the image construction module 840 and the image upgrading module 850 may be at least partially implemented as a computer program module, which may perform corresponding functions when executed.
[0117] Fig. 9 A block diagram of an electronic device suitable for implementing a platform automatic deployment and update method according to an embodiment of the present disclosure is schematically shown.
[0118] like Fig. 9 As shown, the electronic device 900 according to an embodiment of the present disclosure includes a processor 901, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 902 or a program loaded from a storage part 908 into a random access memory (RAM) 903. The processor 901 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or a related chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 901 may also include an onboard memory for caching purposes. The processor 901 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present disclosure.
[0119] In RAM 903, various programs and data required for the operation of electronic device 900 are stored. Processor 901, ROM 902 and RAM 903 are connected to each other via bus 904. Processor 901 performs various operations of the method flow according to the embodiment of the present disclosure by executing the program in ROM 902 and / or RAM 903. It should be noted that the program can also be stored in one or more memories other than ROM 902 and RAM 903. Processor 901 can also perform various operations of the method flow according to the embodiment of the present disclosure by executing the program stored in the one or more memories.
[0120] According to an embodiment of the present disclosure, the electronic device 900 may further include an input / output (I / O) interface 905, which is also connected to the bus 904. The electronic device 900 may further include one or more of the following components connected to the I / O interface 905: an input portion 906 including a keyboard, a mouse, etc.; an output portion 907 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage portion 908 including a hard disk, etc.; and a communication portion 909 including a network interface card such as a LAN card, a modem, etc. The communication portion 909 performs communication processing via a network such as the Internet. A drive 910 is also connected to the I / O interface 905 as needed. A removable medium 911, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 910 as needed, so that a computer program read therefrom is installed into the storage portion 908 as needed.
[0121] The present disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or may exist independently without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiment of the present disclosure is implemented.
[0122] According to an embodiment of the present disclosure, a computer-readable storage medium may be a non-volatile computer-readable storage medium, for example, may include but is not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, an apparatus, or a device. For example, according to an embodiment of the present disclosure, a computer-readable storage medium may include the ROM 902 and / or RAM 903 described above and / or one or more memories other than ROM 902 and RAM 903.
[0123] The embodiment of the present disclosure also includes a computer program product, which includes a computer program, and the computer program contains program code for executing the method shown in the flowchart. When the computer program product is run in a computer system, the program code is used to enable the computer system to implement the platform automatic deployment and update method provided by the embodiment of the present disclosure.
[0124] The above functions defined in the system / device of the embodiment of the present disclosure are performed when the computer program is executed by the processor 901. According to the embodiment of the present disclosure, the system, device, module, unit, etc. described above can be implemented by a computer program module.
[0125] In one embodiment, the computer program may be based on a tangible storage medium such as an optical storage device, a magnetic storage device, etc. In another embodiment, the computer program may also be transmitted and distributed in the form of a signal on a network medium, and downloaded and installed through the communication part 909, and / or installed from a removable medium 911. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0126] In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 909, and / or installed from the removable medium 911. When the computer program is executed by the processor 901, the above functions defined in the system of the embodiment of the present disclosure are performed. According to the embodiment of the present disclosure, the system, device, means, module, unit, etc. described above can be implemented by a computer program module.
[0127] According to an embodiment of the present disclosure, the program code for executing the computer program provided by the embodiment of the present disclosure can be written in any combination of one or more programming languages. Specifically, these computing programs can be implemented using high-level process and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, Java, C++, python, "C" language or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on the remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, using an Internet service provider to connect through the Internet).
[0128] The flow charts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0129] It will be appreciated by those skilled in the art that the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways, even if such combinations and / or combinations are not explicitly described in the present disclosure. In particular, the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways without departing from the spirit and teachings of the present disclosure. All of these combinations and / or combinations fall within the scope of the present disclosure.
[0130] The embodiments of the present disclosure are described above. However, these embodiments are only for illustrative purposes and are not intended to limit the scope of the present disclosure. Although the embodiments are described above separately, this does not mean that the measures in the various embodiments cannot be used in combination to advantage. The scope of the present disclosure is defined by the attached claims and their equivalents. Without departing from the scope of the present disclosure, those skilled in the art may make a variety of substitutions and modifications, which should all fall within the scope of the present disclosure.
Claims
1. A platform automated deployment and update method, characterized in that: The method comprises: In response to a request to deploy a platform service in an operating environment, transmitting a base image required by the platform service to a deployment server corresponding to the operating environment; Creating a project code base on a pre-prepared independent server, and packaging and building the program code of the platform service included in the project code base to generate an executable program; In response to the deployment server starting a deployment script, creating a file subdirectory on the deployment server and pulling the executable program into the file subdirectory; Based on the executable program and the base image, building an application service image on the deployment server, and adding a version number label of the current executable program to the application service image; and Based on the version number tag of the current executable program, the basic image is upgraded to the application service image through the deployment script.
2. The method according to claim 1, characterized in that: The step of creating a project code base on a pre-prepared independent server, and packaging and building the program code of the platform service included in the project code base to generate an executable program includes: Deploy a software development platform on the independent server, and create the project code base on the software development platform; Submitting the program code to the project code repository and performing version control using the version control system of the software development platform; and In response to the completion of version control, the program code is automatically packaged and built using an automated build script pre-written in the project code library to generate an executable program.
3. The method according to claim 1, characterized in that In response to the request to deploy the platform service in the operating environment, transmitting the basic image required by the platform service to the deployment server corresponding to the operating environment includes: Installing an application container engine on the deployment server; Using an application container engine to package the application of the platform service and its dependencies to form the base image, and migrating the base image to the deployment server; and The base image is run and managed using the application container engine on the deployment server.
4. The method according to any one of claims 1, 2 and 3, characterized in that The method further comprises: Performing security checks on the program code and the base image respectively; and In response to the program code and the base image passing the detection, the program code is submitted to the project code library, and the base image is transmitted to the deployment server.
5. The method according to claim 1 or 3, characterized in that: The step of upgrading the base image to the application service image by using the deployment script based on the current version number tag of the executable program includes: In response to the completion of the construction of the application service image, modifying the container orchestration tool of the deployment server through the deployment script to update the version number tag to the version number tag of the application service image; and Restart the platform service to enable the deployment server to automatically upgrade the base image to the application service image.
6. The method according to claim 1 or 3, characterized in that: The method further comprises: In response to the base image being upgraded to the application service image, determining whether the service status of the platform service and the newly added functional points of the platform service are normal; When the service status of the platform service and the newly added functional points of the platform service are normal, deleting the basic image; and When the service status of the platform service and the newly added functional points of the platform service are abnormal, the version number tag is replaced back to the version number tag of the basic image.
7. The method according to claim 1, characterized in that The method further comprises: A firewall is opened between the deployment server and the independent server to enable data transmission between the deployment server and the independent server.
8. A platform automatic deployment and update device, characterized in that: The device comprises: An image transmission module, configured to respond to a request to deploy a platform service in an operating environment and transmit a base image required by the platform service to a deployment server corresponding to the operating environment; A program construction module, used to create a project code base on a pre-prepared independent server, and package and construct the program code of the platform service included in the project code base to generate an executable program; A program pulling module, configured to create a file subdirectory on the deployment server in response to the deployment server starting a deployment script, and pull the executable program to the file subdirectory; An image building module, configured to build an application service image on the deployment server based on the executable program and the base image, and to add a version number tag of the current executable program to the application service image; and The image upgrade module is used to upgrade the basic image to the application service image through the deployment script based on the version number label of the current executable program.
9. An electronic device, comprising: one or more processors; a storage device for storing one or more computer programs, It is characterized in that the one or more processors execute the one or more computer programs to implement the steps of the method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
11. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Cited By
Product pushing method and device based on K8S and medium
CN114860269A
Operation and maintenance system, method and equipment of industrial Internet of Things platform and medium
CN119781803A
Operation and Maintenance System, Method, Device and Medium of Industrial Internet of Things Platform
CN119781803B
Automatic publishing and deploying method and system based on Jenkins and Docker
CN119883294A
