CN113031971B - Software deployment method, system and computer storage medium - Google Patents

Software deployment method, system and computer storage medium Download PDF

Info

Publication number
CN113031971B
CN113031971B CN201911360388.5A CN201911360388A CN113031971B CN 113031971 B CN113031971 B CN 113031971B CN 201911360388 A CN201911360388 A CN 201911360388A CN 113031971 B CN113031971 B CN 113031971B
Authority
CN
China
Prior art keywords
software
deployment
installation
dependent
installation mode
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201911360388.5A
Other languages
Chinese (zh)
Other versions
CN113031971A (en
Inventor
赵明
田科
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Century TAL Education Technology Co Ltd
Original Assignee
Beijing Century TAL Education Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Century TAL Education Technology Co Ltd filed Critical Beijing Century TAL Education Technology Co Ltd
Priority to CN201911360388.5A priority Critical patent/CN113031971B/en
Publication of CN113031971A publication Critical patent/CN113031971A/en
Application granted granted Critical
Publication of CN113031971B publication Critical patent/CN113031971B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • G06F8/63Image based installation; Cloning; Build to order
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45562Creating, deleting, cloning virtual machine instances

Landscapes

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

Abstract

A software deployment method, system and computer storage medium, the said method includes editing deployment description file including basic mirror image description information, installation mode priority information, and dependent software information, reading basic mirror image description information to obtain basic mirror image file, reading dependent software information to obtain deployed software, and according to the installation mode priority information selecting one of the installation modes in order to install the deployed software into the basic mirror image file, dynamically obtaining dependent software of the dependent installation of the deployed software in the installation process of the deployed software, and according to the dependent software information and the installation mode priority information installing dependent software, and when the dependent software fails to install, according to the installation mode priority information selecting the next installation mode to install the deployed software in order, thereby, can improve the success rate of software deployment and installation, and can help software developers to realize agile development of software.

Description

Software deployment method, system and computer storage medium
Technical Field
The embodiment of the invention relates to the technical field of computers, in particular to a software deployment method, a software deployment system and a computer storage medium.
Background
Docker is an open source application container engine, so that developers can pack their applications and software-dependent resource packages into a portable image and then distribute the image to any popular Linux or Windows machine, and can also realize virtualization. By using Docker, specific images suitable for different environments can be developed to provide test, operation and maintenance and use for developers.
The advantage of using Docker is that the software can be continuously deployed and tested. However, in the lifecycle from software development to release, there can be subtle differences in the different execution environments, which can be due to the versions of different software installation packages and dependent installation relationships. However, Docker may address this issue by ensuring consistency throughout the process environment from software development to product release. Specifically, the Docker container is configured in a related manner to keep all configuration and dependency installation relationships inside the container unchanged all the time, so that the same container is used in the whole process from software development to product release, and any difference or manual intervention is avoided.
Through inspection, chinese patent No. CN108897527A provides an automated dynamic building method for a Docker image, which can automatically generate a Docker file for building a remote sensing dedicated image. However, the invention has the following disadvantages: when executing software deployment operation based on the image file, only the software installation package stored in the database can be deployed and installed, and if the software installation package is not pre-stored in the database, the deployment and installation of the corresponding software installation package cannot be executed, and finally the failure of the whole software deployment and installation operation is caused.
Disclosure of Invention
In view of this, one of the technical problems solved by the embodiments of the present invention is to provide a software deployment method, system and computer storage medium, which can improve the success rate of software deployment operations and help software developers to realize agile development.
According to a first aspect of the embodiments of the present invention, there is provided a software deployment method, including: editing a deployment description file, wherein the deployment description file comprises basic mirror image description information, installation mode priority information containing at least two installation modes, and dependent software information containing at least one piece of deployment software; reading the basic mirror image description information to obtain a basic mirror image file; reading the dependent software information to obtain the deployment software, and sequentially selecting one installation mode according to the installation mode priority information to install the deployment software into the basic image file; in the installation process of the deployment software, dynamically obtaining the dependent software dependently installed by the deployment software, and sequentially selecting one installation mode to install the dependent software according to the dependent software information and/or the installation mode priority information; and when the installation of the dependent software fails, sequentially selecting the next installation mode to install the deployment software according to the installation mode priority information.
According to a second aspect of the embodiments of the present invention, there is provided a computer storage medium having stored therein instructions for executing the steps of the software deploying method according to the first aspect of the present invention.
According to a third aspect of the embodiments of the present invention, there is provided a software deploying apparatus, including: the editing module is used for editing a deployment description file, and the deployment description file comprises basic mirror image description information, installation mode priority information containing at least two installation modes, and dependent software information containing at least one piece of deployment software; and the deployment execution module is used for reading the basic image description information to obtain a basic image file, reading the dependent software information to obtain the deployment software, sequentially selecting one installation mode according to the installation mode priority information to install the deployment software into the basic image file, dynamically obtaining the dependent software dependently installed by the deployment software in the installation process of the deployment software, installing the dependent software according to the dependent software information and the installation mode priority information, and sequentially selecting the next installation mode according to the installation mode priority information to install the deployment software when the dependent software fails to be installed.
According to the technical scheme, the software deployment technology provided by the embodiments of the invention can dynamically check whether the dependent software which depends on installation exists in the process of installing the deployment software, and install the dependent software according to the installation mode provided by the dependent software information and the installation mode priority information until all the dependent software is successfully installed.
Drawings
Some specific embodiments of the present application will be described in detail hereinafter by way of illustration and not limitation with reference to the accompanying drawings. The same reference numbers in the drawings identify the same or similar elements or components. Those skilled in the art will appreciate that the drawings are not necessarily drawn to scale. In the drawings:
fig. 1A is a basic flowchart of a software deployment method according to a first embodiment of the present invention;
fig. 1B, fig. 2 to fig. 4 are schematic flowcharts of different embodiments of a software deployment method according to a first embodiment of the present invention;
fig. 5A and 5B are application example diagrams of the software deployment method according to the first embodiment of the present invention, where fig. 5A is a diagram showing an example of a deployment description file, and fig. 5B is a diagram showing a dependency relationship between dependent software; and
fig. 6 is a schematic diagram of a basic architecture of a software deployment apparatus according to a third embodiment of the present invention.
Detailed Description
In order to make those skilled in the art better understand the technical solutions in the embodiments of the present invention, the technical solutions in the embodiments of the present invention will be described clearly and completely with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all embodiments. All other embodiments obtained by a person skilled in the art based on the embodiments of the present invention shall fall within the scope of the protection of the embodiments of the present invention.
The following further describes specific implementation of the embodiments of the present invention with reference to the drawings.
Fig. 1A shows a basic flow diagram of a software deployment method according to a first embodiment of the present invention. As shown in the figure, the software deployment method of the present invention mainly includes the following steps:
and step S11, editing deployment description files, wherein the edited deployment description files comprise basic mirror image description information, installation mode priority information containing at least two installation modes, and dependent software information.
Optionally, the edited deployment description file may be presented in the form of a web page, for example, a Confluence page. However, the present invention is not limited to the above-mentioned method, and other file formats may be used for presentation.
Optionally, the basic image description information is used to provide the basic image file to be obtained, for example, by defining storage address information of the basic image file, so as to obtain the corresponding basic image file by reading the basic image description information.
Optionally, the installation method priority information is used to set a priority order of at least two installation methods.
In this embodiment, the installation manner includes, but is not limited to, at least two manners of a source code manner, an apt-get manner, an yum manner, a pip3 manner, and a brew manner.
In addition, through the selected installation mode, a software resource package corresponding to the software to be installed (for example, deployment software) can be obtained for executing the installation operation of the software to be installed.
Optionally, the dependent software information includes at least one piece of deployment software, that is, software information to be deployed and installed when executing software deployment operation.
Referring to fig. 5A and 5B, in the embodiment, three deployment software are defined in the dependent software information, which are respectively the first deployment software presented in the source code manner
http:// nginx.org/download/nginx-1.14.2.tar.gz, second deployment software python3-pip, and third deployment software psycopg 2.
Optionally, the dependent software information further includes a dependent configuration corresponding to the dependent software (e.g., a level one dependent software), for example, a software version corresponding to the dependent software is defined, for example, in "dependent software information" shown in fig. 5A, "python 3 ═ 3.5" is used to define that a software version corresponding to the dependent software named "python 3" is 3.5.
Optionally, the dependent software may include first-level dependent software for deploying software dependent installation, and in other embodiments, the dependent software may further include second-level dependent software for deploying software dependent installation, and so on, which is not described herein again.
In the embodiment shown in FIGS. 5A and 5B, the first deployed software depends on the installed level one dependent software, such as libpcre 3-dev. The second deployment software python3-pip relies on the installed level one dependent software, for example, python 3; the third deployment software, psypog 2, relies on installed level one dependent software such as libpq-dev and psypog 2-binary. The primary dependent software, libpcre3-dev dependent secondary dependent software is, for example, libpcre 3.
In the invention, the first-level dependent software depended and installed by each deploying software can be dynamically obtained in the process of installing the software resource package corresponding to each deploying software. Similarly, the second-level dependent software dependently installed by the first dependent software can be dynamically obtained in the process of installing the software resource package corresponding to the first dependent software.
In step S12, the basic image description information is read to obtain the basic image file.
Optionally, the base image file is obtained from the corresponding storage address by reading the storage address corresponding to the base image file defined in the base image description information.
Step S13, reading the dependent software information to obtain the deployment software, and sequentially selecting one of the installation manners according to the installation manner priority information to install the deployment software into the basic image file.
Specifically, one or more pieces of deployment software to be deployed may be sequentially read according to a description order in the dependency software information, and then, an installation manner may be sequentially selected according to an installation manner priority order defined in the installation manner priority information to perform installation operation of the currently read deployment software.
In the embodiment of the present invention, the set installation manners include three manners, namely, a "source code manner", an "apt-get manner", and a "pip 3 manner", where "the apt-get manner" is prior to "the pip3 manner" in the column of "installation manner priority information", but it should be noted that, if a field with http:// is included in the deployment software described in the software information, the default installation manner of the deployment software is considered to be the source code manner (i.e., the "source code manner" is prior to the "apt-get manner"). For example, the first deployment software shown in FIG. 5A is http:// nginx.org/download/nginx-1.14.2.tar.gz, i.e., the default installation mode of the deployment software is considered to be the source mode.
Step S14, in the installation process of the deployment software, dynamically obtaining the dependent software dependently installed by the deployment software, and sequentially selecting one installation mode to install the dependent software according to the dependent software information and/or the installation mode priority information.
Optionally, during the process of executing the software resource package corresponding to the deployment software, whether the deployment software has dependent software that depends on installation may be dynamically checked, and when finding that there is dependent software that is not installed, one installation method is sequentially selected according to the dependent software information and/or according to the installation method priority information to install the dependent software (detailed in fig. 3 later).
And step S15, when the installation of the dependent software fails, sequentially selecting the next installation mode to install and deploy the software according to the installation mode priority information.
When the installation of the dependent software fails according to the dependent software information and/or various installation modes provided in the installation mode priority information provided in the deployment description file, a next installation mode is sequentially selected according to the installation mode priority information, and the deployment software is reinstalled in a mode of obtaining another resource software package of the deployment software (please refer to details in fig. 2).
In an optional embodiment, the software deployment method of the present invention may further include the steps of:
step S16, in the installation process of the deployment software, synchronously recording the installation mode and the installation order of the successfully installed deployment software or the dependent software, and generating a deployment log.
Alternatively, the generated deployment log may be presented in the form of a temporary file, that is, the generated deployment log may be deleted after the software deployment operation is completed. However, the present invention is not limited to the above embodiments, and in other embodiments, the generated deployment log may also be retained after the software deployment operation is completed.
And step S17, generating a deployment image file according to the deployment log.
In an optional embodiment, the edited dependent software information includes a plurality of deployment software, and the method further includes: and sequentially reading each deployment software in the dependent software information, and sequentially installing each deployment software into the basic image file according to the installation mode provided by the installation mode priority information until all the deployment software is successfully installed.
Referring to fig. 5A and 5B, in this embodiment, according to the dependent software information in the deployment description file, three deployment software are sequentially obtained, and according to the description sequence of the dependent software information, the first deployment software http:// nginx.org/download/nginx-1.14.2.tar.gz located in the head row is installed first, whereas the second deployment software python3-pip and the third deployment software psycopg2 are installed sequentially until all three deployment software are installed successfully.
Therefore, the invention can dynamically obtain the dependent software dependently installed by the deployment software in the installation process of the deployment software, and automatically install the lacking dependent software according to the installation mode provided by the dependent software information and the installation mode priority information until the dependent installation of all the dependent software is successful, thereby improving the success rate and the efficiency of software deployment operation.
In addition, the invention can also generate corresponding deployment image files according to the actual installation process of the deployment software and the dependent software (for example, according to the actual installation mode and the actual installation sequence adopted by the deployment software and the dependent software), and the generated deployment image files can be shared by other users for use, thereby helping software developers to realize the agile development of the software.
Optionally, as shown in fig. 2, the step of installing the deployment software according to the installation method provided by the installation method priority information further includes:
in step S21, one of the installation methods is sequentially selected according to the installation method priority information, and then step S22 is performed.
Optionally, one piece of deployment software may be obtained by reading the dependent software information, and one installation mode is sequentially selected to install the obtained deployment software according to the installation mode priority information.
As shown in FIG. 5A, in one embodiment of the present invention, it is defined that the apt-get mode takes precedence over the pip3 mode.
Step S22, the first software resource package corresponding to the deployment software is obtained by using the selected installation mode, and then step S23 is performed.
In this embodiment, taking the first deployment software as an example, if it is found that the first deployment software described in the dependent software list has a field with http:// so as to determine that the preferred installation mode of the first deployment software is the source code mode, the software resource package corresponding to the first deployment software is automatically downloaded from the network according to the provided link address information http:// nginx.org/download/nginx-1.14.2. tar.gz.
Step S23, the obtained first software resource package is run to execute the installation operation of the deployment software, and the dependent installation of the deployment software is dynamically checked during the installation process, and then step S24 is performed.
And step S24, judging whether the deployment software depends on the installed primary dependent software, if so, performing step S25, and if not, performing step S27.
In step S25, the first level dependent software is installed according to the installation method provided by the dependent software information and the installation method priority information, and then step S26 is performed.
Step S26, judging whether the primary dependent software is successfully installed, and if the judgment result is that the primary dependent software is unsuccessfully installed, performing step S21 to select the next installation mode to install the deployment software again, namely, acquiring another first software resource package corresponding to the deployment software by using the next installation mode, and installing the deployment software again by operating the other first software resource package; and step S29 is performed when the determination result is that the installation of the primary dependent software is successful.
And step S27, judging whether the installation of the deployment software is successful, if so, executing step S28, and if not, executing step S21 to select the next installation mode to reinstall the deployment software.
Step S28, recording the installation mode and the installation order actually adopted by the successfully installed deployment software, and updating the deployment log accordingly.
And step S29, recording the installation mode and the installation sequence actually adopted by the successfully installed primary dependent software, updating the deployment log according to the installation mode and the installation sequence, continuing to execute step S23, and continuing to run the first software resource package so as to continue to install the deployment software.
Alternatively, when the dependent software information includes two or more deployment software, the steps shown in fig. 2 may be repeatedly executed until all the deployment software is successfully installed.
Optionally, as shown in fig. 3, the step of installing the primary dependent software according to the installation method provided by the dependent software information and the installation method priority information (i.e., step S25) further includes the following processing steps:
in step S31, the dependent software information in the deployment description file is queried, and then step S32 is performed.
And step S32, judging whether the dependent software information contains the dependent configuration corresponding to the primary dependent software to be installed currently, if so, executing step S33, and if not, executing step S35.
Step S33, acquiring the software version corresponding to the primary dependent software according to the dependent configuration corresponding to the primary dependent software, installing the software version corresponding to the primary dependent software according to the installation mode provided by the installation mode priority information, and then performing step S34.
And step S34, determining whether the software version corresponding to the primary dependent software is successfully installed, if so, performing step S23 in fig. 2, and if not, performing step S35.
Step S35, installing the primary dependent software according to the installation method provided by the installation method priority information, and then proceeding to step S26 of fig. 2 to determine whether the installation of the primary dependent software is successful.
In this embodiment, the step of installing the first-level dependent software according to the installation manner provided by the installation manner priority information is the same as the step of installing the deployment software according to the installation manner provided by the installation manner priority information, which is specifically referred to fig. 2 and will not be described herein again.
Referring to fig. 4, in an alternative embodiment, the software deployment method may be executed based on a Docker container, and specifically, the method of the present invention further includes the following processing steps:
and step S41, operating the first software resource package corresponding to the deployment software or the second software resource package corresponding to the primary dependent software by using the Docker container to execute the simulated installation of the deployment software or the primary dependent software.
Step S42, recording the installation mode and the installation order actually adopted by the successfully installed deployment software and the first-level dependent software, and generating a deployment log accordingly.
And step S43, optimizing the deployment log, adding the deployment software and the primary dependent software which are installed in the same type of installation mode to the same layer according to the installation mode and the installation sequence actually adopted by the deployment software or the primary dependent software recorded in the deployment log, and generating a Docker file.
Step S44, executing a command in the Docker file through the Docker build to generate a Docker image file, and pushing the generated Docker image file to a Docker warehouse for storage.
Optionally, the method may further include step S45, generating deployment image description information corresponding to the Docker image file (for example, "harbor. ailab.100al. com/base/python-base: v 0.1" in fig. 5A), and saving the generated deployment image description information in the deployment description file, so that other users may obtain the Docker image file stored in the Docker repository according to the deployment image description information in the deployment description file.
In order to make the technical features of the present invention more obvious to those skilled in the art, the software deployment of the present invention will be described below by way of example with reference to fig. 5A and 5B, and it should be noted that the following embodiments are only for illustrative purposes and are not intended to limit the present invention.
Step S51, editing the deployment description file, as shown in fig. 5A, where the edited deployment description file includes "basic image description information", "dependent software information", "installation priority information", and "deployment image description information".
Specifically, the "basic image description information" includes description information for acquiring a basic image file; the 'dependent software information' comprises the information of the deployment software to be installed and the dependent configuration information of the dependent software; the "installation method priority information" includes an installation priority order of at least two installation methods, and in the present embodiment, the "apt-get method" is set to be prioritized over the "pip 3 method".
In this embodiment, the deployment description file may be presented in a form of a web page, and the edited deployment description file is, for example, a read-only file.
Step S52, reading field information "harbor. ailab.100tal. com/base/ubuntu: 16.04" in the "basic image description information", obtaining a corresponding basic image file, and starting a Docker container by using the obtained basic image file to perform a deployment operation.
In this embodiment, the base image file may be pre-stored in the Docker warehouse.
Step S53-1, reading 'dependent software information' in the deployment description file to obtain first deployment software, performing simulated installation of the first deployment software in a Docker container, finding that the first deployment software has a field of 'http://' according to the description content of the 'dependent software information', judging that the default installation mode of the first deployment software is source code installation, automatically downloading a first software resource package corresponding to the first deployment software from the network according to the field of 'http:// nginx.org/download/nginx-1.14.2. tar.gz', and automatically decompressing the first software resource package after downloading is completed.
And step S53-2, operating the decompressed first software resource package to execute the installation of the first deployment software, and dynamically checking the first-level dependency software of the first deployment software in the installation process. In this embodiment, a first-level dependent software "PCRE library" dependently installed by a first piece of deployment software is dynamically obtained in an installation process, and after checking that a dependency configuration of the "PCRE library" is not recorded in the dependent software information of the deployment description file, the installation modes provided in the "installation mode priority information" are sequentially selected to execute the installation operation of the first-level dependent software "PCRE library", and after an attempt, it is found that the first-level dependent software "PCRE library" cannot be successfully installed by using various installation modes (i.e., "apt-get mode" and "pip 3 mode") in the "installation mode priority information", and then the first piece of deployment software is selected to be attempted to be installed by using the "apt-get mode" according to the "installation mode priority information".
Step S53-3, another first software resource package of the first deployment software is obtained in an 'apt-get' mode, and another first software resource package is operated to execute the installation operation of the first deployment software, during the installation process of the first deployment software at this time, the first level dependent software 'libpcre 3-dev' which is dependently installed by the first deployment software is dynamically obtained, then the 'apt-get' mode is firstly used to obtain the second software resource package corresponding to the first level dependent software 'libpcre 3-dev', the obtained second software resource package is operated to install the first level dependent software 'libpcre 3-dev', during the installation process of the first level dependent software 'libpcre 3-dev', the first level dependent software 'libpc 3-dev' is dynamically obtained, the second level dependent software 'libpc 3' which is dependently installed, then the 'apt-get the third software resource package corresponding to the second level dependent software 3' libpc 3 'in the' apt-get 'mode', and in the process of operating the third software resource package to install the secondary dependent software 'libpcre 3', dynamically checking whether the secondary dependent software 'libpcre 3' has tertiary dependent software which depends on the installation, continuously judging whether the installation of the secondary dependent software 'libpcre 3' is successful if the tertiary dependent software 'libpcre 3' does not depend on the installed tertiary dependent software, and recording the installation mode and the installation sequence adopted by the secondary dependent software 'libpcre 3' in a deployment log if the installation of the secondary dependent software 'libpcre 3' is successful.
And step S53-4, continuing to run a second software resource package of the primary dependent software 'libpcre 3-dev', and recording the installation sequence of the primary dependent software 'libpcre 3-dev' and the adopted installation mode thereof in a deployment log after the primary dependent software 'libpcre 3-dev' is successfully installed.
And step S53-5, continuously executing the installation operation of the first deployment software, dynamically checking whether the first deployment software has other first-level dependent software which depends on the installation, judging whether the installation of the first deployment software is successful if the first deployment software does not have other first-level dependent software, and recording the installation sequence of the first deployment software and the installation mode adopted by the installation sequence in a deployment log after the first deployment software is successfully installed.
Step S54-1, traversing the 'dependent software information' in the deployment description file to obtain a second deployment software 'python 3-pip', firstly using an 'apt-get mode' to obtain a first software resource package of the second deployment software 'python 3-pip', and checking the dependent installation of the second deployment software 'python 3-pip' according to the obtained first software resource package to find a level-one dependent software 'python 3' dependent on the installation.
Step 54-2, according to the "dependent software information" in the deployment description file, finding that the dependent configuration information "python 3 ═ 3.5" of the primary dependent software "python 3" exists, then executing the installation operation of the 3.5 version according to the dependent configuration information, and after the installation is successful, recording the installation sequence of "python 3" and the installation mode adopted in the deployment log. Then, the installation operation of the second deployment software "python 3-pip" is continuously executed, and after the second deployment software "python 3-pip" is successfully installed, the corresponding installation sequence and the installation mode adopted by the installation sequence are recorded in the deployment log.
Step S45-1, traversing the "dependent software information" in the deployment description file to obtain a third deployment software "psycpg 2", similarly, first obtaining and installing a first software resource package of the third deployment software "psycpg 2" in an "apt-get manner", and finding that the third deployment software "psycpg 2" cannot be installed successfully.
Step S45-2, by reading the "installation mode priority information", selecting to obtain another first software resource package of the third deployment software "psychopg 2" using the "pip 3 mode", and attempting to install the third deployment software "psychopg 2" again, in the installation process of the third deployment software "psychopg 2", dynamically obtaining the first level dependent software "libpq-dev" which the third deployment software "psychopg 2" depends on and is installed, and after checking that the first level dependent software "libpq-dev" is not installed yet, according to the "installation mode priority information", first installing the first level dependent software "libpq-dev" using the "apt-get mode", and after successful installation, recording the installation order of the first level dependent software "libpq-dev" and the installation mode adopted in the deployment log.
And step S45-3, continuing to run another first software resource package of the third deployment software 'psypg 2' to continue installation, dynamically obtaining a second level-one dependent software 'psypg 2-bind' of which the third deployment software 'psypg 2' depends on installation in the installation process, then trying to install the second level-one dependent software 'psypg 2-bind' in an 'apt-get mode' as before, trying to install in a 'pip 3 mode' after the installation fails, and recording the installation sequence of the second level-one dependent software 'psypg 2-bind' and the installation mode adopted by the second level-one dependent software 'psypog 2-bind' in a deployment log after the installation is successful.
And step S45-3, continuing to run another first software resource package of the third deployment software 'psypg 2' to continue to execute installation until the third deployment software 'psypg 2' is successfully installed, and recording the installation sequence of the third deployment software 'psypg 2' and the installation mode adopted by the installation sequence in the deployment log.
Step S46, traversing "dependent software information" in the deployment description file, finding that there is no deployment software to be installed, indicating that all the deployment software have been installed, then completing the software deployment operation, and generating a deployment log of a final version for subsequently generating a corresponding deployment image file according to the deployment log.
A second embodiment of the present invention provides a computer storage medium, in which instructions for executing the steps of the software deployment method in the first embodiment are stored.
Referring to fig. 6, a third embodiment of the present invention provides a software deploying apparatus 100, which mainly includes an editing module 110, a deploying execution module 120, a recording module 130, and a generating module 140.
The editing module 110 is configured to edit a deployment description file, where the deployment description file includes basic image description information, installation mode priority information including at least two installation modes, and dependent software information including at least one deployment software.
The deployment execution module 120 is configured to read the basic image description information to obtain a basic image file, read the dependent software information to obtain deployment software, install the deployment software into the basic image file according to the installation manner provided by the installation manner priority information, dynamically check whether the deployment software has dependent software that depends on installation in the installation process, and install the dependent software according to the dependent software information and the installation manner provided by the installation manner priority information.
Optionally, the installing the deployment software by the deployment execution module 120 according to the installation manner provided by the installation manner priority information further includes: according to the installation mode priority information, sequentially selecting one installation mode, and obtaining a first software resource package corresponding to the deployment software by using the selected installation mode; running the first software resource package to install the deployment software, and dynamically checking whether the deployment software has first-level dependent software which depends on the installation in the installation process; when the first-level dependent software which depends on installation exists in the deployment software, installing the first-level dependent software according to the dependent software information and the installation mode provided by the installation mode priority information; and after the first-level dependent software is successfully installed, recording the installation mode and the installation sequence actually adopted by the first-level dependent software to update the deployment log, and continuously running the first software resource package to continue the installation of the deployment software.
Optionally, the deployment execution module 120 is further configured to, when the installation of the first-level dependent software is unsuccessful, sequentially select a next installation manner to install the deployment software again by obtaining another first software resource package corresponding to the deployment software until the deployment software is successfully installed; and when the deployment software is successfully installed, recording the installation mode and the installation sequence actually adopted by the deployment software, and updating the deployment log according to the installation mode and the installation sequence.
Optionally, the deployment execution module 120 is further configured to, when it is checked that the deployment software does not have the first-level dependent software that depends on the installation, and the installation of the deployment software using the currently selected installation manner is unsuccessful, sequentially select a next installation manner to install the deployment software again by obtaining another first software resource package corresponding to the deployment software until the deployment software is successfully installed; and when the deployment software is successfully installed, recording the installation mode and the installation sequence actually adopted by the deployment software, and updating the deployment log according to the installation mode and the installation sequence.
Optionally, the deploying and executing module 120 installs the first-level dependent software according to the dependent software information and the installation manner provided by the installation manner priority information, further includes querying the dependent software information, and determining whether the dependent software information includes a dependent configuration corresponding to the first-level dependent software; if the dependency configuration corresponding to the first-level dependent software exists, acquiring a software version corresponding to the first-level dependent software according to the dependency configuration, and installing the software version corresponding to the first-level dependent software according to an installation mode provided by the installation mode priority information; if the dependency configuration corresponding to the first-level dependent software does not exist or the software version corresponding to the first-level dependent software is not successfully installed, installing the first-level dependent software according to the installation mode provided by the installation mode priority information; the step of installing the first-level dependent software according to the installation mode provided by the installation mode priority information is the same as the step of installing the deployment software according to the installation mode provided by the installation mode priority information.
Optionally, the software deploying apparatus 100 of the present invention may further include:
the recording module 130 is configured to, during the installation process of the deployment software, synchronously record the actual installation mode and installation order of the successfully installed deployment software or the dependent software, and generate a deployment log; .
The generating module 140 is configured to generate a deployment image file of the deployment software based on the deployment log.
In addition, the software deploying apparatus 100 of this embodiment may also be used to implement other steps in the software deploying method described in the foregoing first embodiment, and has the beneficial effects of the corresponding method step embodiments, which are not described herein again.
By means of the method, when errors of related dependent installation are found in the installation process of the software deployment, the installation mode and the installation sequence of the software deployment are adjusted according to the captured exceptions, and accordingly the success rate of software deployment operation is improved. In addition, a corresponding deployment image file can be generated according to the actual installation process of the deployment software, and the generated deployment image file can assist software developers to realize agile development of the software.
It should be noted that, according to the implementation requirement, each component/step described in the embodiment of the present invention may be divided into more components/steps, and two or more components/steps or partial operations of the components/steps may also be combined into a new component/step to achieve the purpose of the embodiment of the present invention.
The above-described method according to an embodiment of the present invention may be implemented in hardware, firmware, or as software or computer code storable in a recording medium such as a CD ROM, a RAM, a floppy disk, a hard disk, or a magneto-optical disk, or as computer code originally stored in a remote recording medium or a non-transitory machine-readable medium downloaded through a network and to be stored in a local recording medium, so that the method described herein may be stored in such software processing on a recording medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware such as an ASIC or FPGA. It will be appreciated that the computer, processor, microprocessor controller or programmable hardware includes memory components (e.g., RAM, ROM, flash memory, etc.) that can store or receive software or computer code that, when accessed and executed by the computer, processor or hardware, implements the software deployment methods described herein. Further, when a general-purpose computer accesses code for implementing the software deployment methods shown herein, execution of the code transforms the general-purpose computer into a special-purpose computer for performing the software deployment methods shown herein.
Those of ordinary skill in the art will appreciate that the various illustrative elements and method steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present embodiments.
The above embodiments are only for illustrating the embodiments of the present invention and not for limiting the embodiments of the present invention, and those skilled in the art can make various changes and modifications without departing from the spirit and scope of the embodiments of the present invention, so that all equivalent technical solutions also belong to the scope of the embodiments of the present invention, and the scope of patent protection of the embodiments of the present invention should be defined by the claims.

Claims (10)

1. A method for deploying software, the method comprising:
editing a deployment description file, wherein the deployment description file comprises basic mirror image description information, installation mode priority information containing at least two installation modes, and dependent software information containing at least one piece of deployment software;
reading the basic mirror image description information to obtain a basic mirror image file;
reading the dependent software information to obtain the deployment software, and sequentially selecting one installation mode according to the installation mode priority information to install the deployment software into the basic image file;
in the installation process of the deployment software, dynamically obtaining the dependent software dependently installed by the deployment software, and sequentially selecting one installation mode to install the dependent software according to the dependent software information and/or the installation mode priority information; and
when the installation of the dependent software fails, sequentially selecting the next installation mode to install the deployment software according to the installation mode priority information;
in the installation process of the deployment software, the installation mode and the installation sequence of the successfully installed deployment software or the dependency software are synchronously recorded, and a deployment log is generated.
2. The software deployment method of claim 1, further comprising:
and generating a deployment image file according to the deployment log.
3. The software deployment method according to claim 2, wherein the dependent software includes a first level dependent software dependently installed by the deployment software, and the step of sequentially selecting one of the installation methods to install the deployment software according to the installation method priority information further comprises:
sequentially selecting one installation mode according to the installation mode priority information, and obtaining a first software resource package corresponding to the deployment software by using the selected installation mode;
running the first software resource package to install the deployment software, and dynamically checking whether the deployment software has the first-level dependent software which is dependent on the installation in the installation process;
when the deployment software is checked to have the first-level dependent software which is depended on installation, sequentially selecting one installation mode to install the dependent software according to the dependent software information and/or the installation mode priority information; and
continuing to run the first software resource package to continue installation of the deployment software.
4. The software deployment method of claim 3, further comprising:
when the installation mode is selected in sequence according to the dependent software information and/or the installation mode priority information and the installation mode is not successful in installing the dependent software, the next installation mode is selected in sequence according to the installation mode priority information so as to install the deployment software again by obtaining another first software resource package corresponding to the deployment software until the deployment software is installed successfully.
5. The software deployment method of claim 3, further comprising:
when the deployment software is checked to have no first-level dependent software which is depended on installation, and the installation of the deployment software by using the currently selected installation mode is unsuccessful, sequentially selecting the next installation mode according to the priority information of the installation modes to re-install the deployment software by acquiring another first software resource package corresponding to the deployment software until the deployment software is successfully installed.
6. The software deploying method according to claim 3, wherein the dependent software information further includes a dependent configuration of the dependent software, and the step of sequentially selecting one of the installation methods to install the dependent software according to the dependent software information and/or according to the installation method priority information further includes:
inquiring the dependent software information, and judging whether the dependent software information contains dependent configuration corresponding to the primary dependent software;
if the dependency configuration corresponding to the first-level dependent software exists, acquiring a software version corresponding to the first-level dependent software according to the dependency configuration, and sequentially selecting one installation mode to install the software version corresponding to the first-level dependent software according to the installation mode priority information; and
if the dependency configuration corresponding to the first-level dependent software does not exist or the installation mode is selected in sequence according to the installation mode priority information, and the software version corresponding to the first-level dependent software is not successfully installed, directly selecting one installation mode in sequence according to the installation mode priority information to install the first-level dependent software; wherein the content of the first and second substances,
the step of sequentially selecting one installation mode to install the primary dependent software according to the installation mode priority information is the same as the step of sequentially selecting one installation mode to install the deployment software according to the installation mode priority information.
7. The software deployment method of claim 2, wherein the method is performed based on a Docker container, and further comprising:
performing a simulated installation of the deployment software or the dependent software using a Docker container;
recording the actual installation mode and the actual installation sequence of the successfully installed deployment software and the dependence software respectively to generate a deployment log, and generating a Docker file according to the deployment log;
executing a command in the Docker file through the Docker build to generate a Docker mirror image file; and
and pushing the Docker image file to a Docker warehouse for storage.
8. The software deployment method of claim 7, wherein the generating a Docker file from the deployment log further comprises:
optimizing the deployment log so as to add the deployment software and the dependent software which are installed by adopting the same type of installation mode to the same layer according to the installation mode and the installation sequence recorded by the deployment log and generate the Docker file; and
and generating deployment mirror image description information corresponding to the Docker mirror image file, and storing the deployment mirror image description information into the deployment description file.
9. A computer storage medium having stored therein instructions for carrying out each of the steps of the software deployment method according to any one of claims 1 to 8.
10. A software deploying apparatus, characterized in that the apparatus comprises:
the editing module is used for editing a deployment description file, and the deployment description file comprises basic mirror image description information, installation mode priority information containing at least two installation modes, and dependent software information containing at least one piece of deployment software; and
the deployment execution module is used for reading the basic image description information to obtain a basic image file, reading the dependent software information to obtain the deployment software, sequentially selecting one installation mode according to the installation mode priority information to install the deployment software into the basic image file, dynamically obtaining the dependent software dependently installed by the deployment software in the installation process of the deployment software, installing the dependent software according to the dependent software information and the installation mode priority information, and sequentially selecting the next installation mode to install the deployment software according to the installation mode priority information when the dependent software fails to be installed;
and the recording module is used for synchronously recording the installation modes and the installation sequences of the successfully installed deployment software or the successfully installed dependent software in the installation process of the deployment software and generating a deployment log.
CN201911360388.5A 2019-12-25 2019-12-25 Software deployment method, system and computer storage medium Active CN113031971B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911360388.5A CN113031971B (en) 2019-12-25 2019-12-25 Software deployment method, system and computer storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911360388.5A CN113031971B (en) 2019-12-25 2019-12-25 Software deployment method, system and computer storage medium

Publications (2)

Publication Number Publication Date
CN113031971A CN113031971A (en) 2021-06-25
CN113031971B true CN113031971B (en) 2022-04-29

Family

ID=76458948

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911360388.5A Active CN113031971B (en) 2019-12-25 2019-12-25 Software deployment method, system and computer storage medium

Country Status (1)

Country Link
CN (1) CN113031971B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11960870B2 (en) * 2022-02-23 2024-04-16 International Business Machines Corporation Container image management

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107769949A (en) * 2016-08-19 2018-03-06 华为技术有限公司 A kind of application component dispositions method and deployment node
CN107766050A (en) * 2017-10-31 2018-03-06 新华三云计算技术有限公司 The dispositions method and device of a kind of heterogeneous applications
CN109491763A (en) * 2018-11-14 2019-03-19 北京奇艺世纪科技有限公司 A kind of system deployment method, apparatus and electronic equipment
CN109597626A (en) * 2017-09-30 2019-04-09 北京国双科技有限公司 A kind of deployment of components method and apparatus

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4924514B2 (en) * 2008-03-31 2012-04-25 富士通株式会社 Virtual machine management program, management server device, and virtual machine management method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107769949A (en) * 2016-08-19 2018-03-06 华为技术有限公司 A kind of application component dispositions method and deployment node
CN109597626A (en) * 2017-09-30 2019-04-09 北京国双科技有限公司 A kind of deployment of components method and apparatus
CN107766050A (en) * 2017-10-31 2018-03-06 新华三云计算技术有限公司 The dispositions method and device of a kind of heterogeneous applications
CN109491763A (en) * 2018-11-14 2019-03-19 北京奇艺世纪科技有限公司 A kind of system deployment method, apparatus and electronic equipment

Also Published As

Publication number Publication date
CN113031971A (en) 2021-06-25

Similar Documents

Publication Publication Date Title
US8108456B2 (en) Method and apparatus for migrating the system environment on which the applications depend
US9152521B2 (en) Systems and methods for testing content of mobile communication devices
US10489591B2 (en) Detection system and method thereof
CN109783388B (en) UI (user interface) automatic testing method and device and electronic equipment
JP5213671B2 (en) Test case selection method and selection system
CN114270306A (en) Application program development and deployment method, device and computer readable medium
CN105975311B (en) Application starting method and device
CN110750288A (en) Native engineering configuration method and device, electronic equipment and storage medium
CN111538523A (en) Differential upgrading method, device and storage medium
CN113031971B (en) Software deployment method, system and computer storage medium
CN113642004A (en) Container mirror image security scanning and repairing method, device and equipment
US11422917B2 (en) Deriving software application dependency trees for white-box testing
CN111258614B (en) Method, system, equipment and storage medium for detecting upgrade exception of project third-party library
CN112685105A (en) Front-end component sharing method and device, computer equipment and storage medium
CN108694049B (en) Method and equipment for updating software
US20090217259A1 (en) Building Operating System Images Based on Applications
CN111782511A (en) Firmware file analysis method, equipment and storage medium
CN114546819A (en) Code processing method and device, electronic equipment and readable medium
CN107291436B (en) SDK packet generation method, device and terminal
US11249749B2 (en) Automatic generation of configuration files
CN106547700B (en) A kind of method and device of program debugging
CN115794220A (en) Software source migration method, device and system, computing device and readable storage medium
CN115604307A (en) Processing method and device for upgrading log, terminal equipment and computer medium
JP2004326337A (en) Code analysis program, code analysis automation program and automated code analysis system
JP6097231B2 (en) Program generating apparatus and method

Legal Events

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