CN113296823A - Method, device, equipment and storage medium for generating resource configuration file - Google Patents
Method, device, equipment and storage medium for generating resource configuration file Download PDFInfo
- Publication number
- CN113296823A CN113296823A CN202010108116.2A CN202010108116A CN113296823A CN 113296823 A CN113296823 A CN 113296823A CN 202010108116 A CN202010108116 A CN 202010108116A CN 113296823 A CN113296823 A CN 113296823A
- Authority
- CN
- China
- Prior art keywords
- resource
- target
- user
- resources
- parameters
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 70
- 230000000007 visual effect Effects 0.000 claims abstract description 37
- 238000012545 processing Methods 0.000 claims description 11
- 230000006870 function Effects 0.000 claims description 9
- 230000004048 modification Effects 0.000 claims description 8
- 238000012986 modification Methods 0.000 claims description 8
- 238000012790 confirmation Methods 0.000 claims description 6
- 238000004891 communication Methods 0.000 claims description 3
- 230000008569 process Effects 0.000 abstract description 12
- 238000010586 diagram Methods 0.000 description 10
- 238000004590 computer program Methods 0.000 description 6
- 238000005516 engineering process Methods 0.000 description 5
- 238000012800 visualization Methods 0.000 description 3
- 230000000694 effects Effects 0.000 description 2
- 238000003384 imaging method Methods 0.000 description 2
- 238000002347 injection Methods 0.000 description 2
- 239000007924 injection Substances 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 230000008447 perception Effects 0.000 description 2
- 230000005540 biological transmission Effects 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 230000008520 organization Effects 0.000 description 1
- 230000010076 replication Effects 0.000 description 1
- 239000000243 solution Substances 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/70—Software maintenance or management
- G06F8/71—Version control; Configuration management
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- User Interface Of Digital Computer (AREA)
Abstract
The application discloses a method, a device, equipment and a storage medium for generating a resource configuration file, which comprise the following steps: acquiring a general template file, wherein the general template file comprises a plurality of resources defined in advance; and determining parameters and parameter values corresponding to the target resources according to the operation of the user on the visual configuration page aiming at the target resources in the plurality of resources, so as to generate a resource configuration file for the application based on the universal template file and the parameters and parameter values corresponding to the target resources. Therefore, in the process of generating the resource configuration file, a user only needs to determine the target resource required by the deployment of the application, and the parameter value of the target resource on the visual configuration page, so that the resource configuration file is automatically generated based on the parameter and the parameter value of the target resource in combination with the corresponding general template file, the difficulty of generating the resource configuration file is effectively reduced, and the requirement on the professional degree of the user is also reduced.
Description
Technical Field
The present application relates to the field of resource configuration technologies, and in particular, to a method, an apparatus, a device, and a storage medium for generating a resource configuration file.
Background
With the development of container technology and container arrangement technology in data centers, some mainstream container arrangement systems, such as kubernets (K8 s for short), Docker Swarm, and the like, are widely used. The container arrangement refers to the deployment and organization of containers supporting application programs, and when the number of the containers reaches a certain scale, the containers need to be arranged and managed.
However, when an application is deployed by using a container coding system, it is usually necessary to generate a resource configuration file specified by the container arrangement system in advance, and the existing method for generating a resource configuration file has a high dependence on the expertise of a technician and a high difficulty in generating a resource configuration file.
Disclosure of Invention
The embodiment of the application provides a method, a device, equipment and a storage medium for generating a resource configuration file, so as to reduce the difficulty of generating the resource configuration file and the dependence on the professional degree of technical personnel.
In a first aspect, an embodiment of the present application provides a method for generating a resource configuration file, including:
acquiring a general template file, wherein the general template file comprises configuration information of a plurality of resources defined in advance;
determining parameters and parameter values corresponding to target resources in the multiple resources according to the operation of a user on a visual configuration page aiming at the target resources;
and generating a resource configuration file for deploying the application based on the universal template file, the parameters corresponding to the target resource and the parameter values.
In a possible implementation manner, the determining, according to an operation of a user on a visual configuration page for a target resource in the plurality of resources, a parameter and a parameter value corresponding to the target resource includes:
determining a parameter corresponding to the target resource according to the parameter input operation of the user on the visual configuration page aiming at the target resource;
and determining a parameter value corresponding to the target resource according to the parameter value input operation of the user aiming at the parameter on the visual configuration page.
In a possible implementation manner, the pre-defining, by the common template file, parameters and parameter values of the target resource, and then determining, according to an operation of a user on a visual configuration page for a target resource in the plurality of resources, the parameters and parameter values corresponding to the target resource includes:
and determining the parameters and the parameter values corresponding to the target resources according to the confirmation operation and/or the modification operation of the user on the visual configuration page aiming at the parameters and the parameter values of the target resources.
In one possible embodiment, the method further comprises:
and generating an individualized template file according to the parameters corresponding to the target resources and the general template file.
In a possible implementation manner, the generating a resource configuration file for deploying an application based on the generic template file, the parameter corresponding to the target resource, and the parameter value includes:
and generating a resource configuration file for deploying the application according to the personalized template file and the parameter value corresponding to the target resource.
In one possible embodiment, the method further comprises:
acquiring demand indication information input by a user;
and determining a target parameter value matched with the demand indication information from the parameter values of the target cluster according to the demand indication information, wherein the target parameter value is a parameter value corresponding to an available resource on the target cluster when the application is deployed on the target cluster according to the resource configuration file.
In one possible embodiment, the method further comprises:
acquiring parameters of the cluster to be deployed by the application by using a preset function;
and injecting the parameters of the cluster into the resource configuration file or the application in an environment variable mode.
In a second aspect, an embodiment of the present application further provides an apparatus for generating a resource configuration file, where the apparatus includes:
the system comprises an acquisition module, a storage module and a processing module, wherein the acquisition module is used for acquiring a general template file, and the general template file comprises configuration information of a plurality of resources which are defined in advance;
the determining module is used for determining parameters and parameter values corresponding to target resources in the plurality of resources according to the operation of a user on a visual page aiming at the target resources;
and the first generation module is used for generating a resource configuration file for deploying the application based on the general template file, the parameters corresponding to the target resource and the parameter values.
In a possible embodiment, the apparatus further comprises:
and the second generation module is used for generating a personalized template file corresponding to the application according to the parameters corresponding to the target resources and the general template file.
In one possible implementation, the determining module includes:
the first determining unit is used for determining a parameter corresponding to the target resource according to a parameter input operation aiming at the target resource on the visual configuration page by the user;
and the second determining unit is used for determining the parameter value corresponding to the target resource according to the parameter value input operation of the user aiming at the parameter on the visual configuration page.
In a possible implementation manner, if the general template file defines parameters and parameter values of the target resource in advance, the determining module is specifically configured to:
and determining the parameters and the parameter values corresponding to the target resources according to the confirmation operation and/or the modification operation of the user on the visual configuration page aiming at the parameters and the parameter values of the target resources.
In a possible implementation manner, the first generating module is specifically configured to:
and generating a resource configuration file for deploying the application according to the personalized template file and the parameter value corresponding to the target resource.
In a possible embodiment, the apparatus further comprises:
the information acquisition module is used for acquiring the demand indication information input by the user;
and the target parameter value determining module is used for determining a target parameter value matched with the demand indication information from the parameter values of the target cluster according to the demand indication information, wherein the target parameter value is a parameter value corresponding to the available resource on the target cluster when the application is deployed on the target cluster according to the resource configuration file.
In a possible embodiment, the apparatus further comprises:
the parameter acquisition module is used for acquiring the parameters of the clusters which need to be deployed by the application by using a preset function;
and the injection module is used for injecting the parameters of the cluster into the resource configuration file or the application in an environment variable mode.
In a third aspect, an embodiment of the present application further provides a storage medium, on which a program is stored, where the program, when executed by a processor, implements the method for generating a resource profile as described in any one of the embodiments of the first aspect.
In a fourth aspect, an embodiment of the present application further provides an apparatus, where the apparatus includes at least one processor, and at least one memory and a bus connected to the processor;
the processor and the memory complete mutual communication through the bus;
the processor is configured to call program instructions in the memory to perform a method of generating a resource profile as described in any one of the embodiments of the first aspect.
In the implementation manner of the embodiment of the application, a general template file used for generating a resource configuration file may be obtained first, where the general template file includes configuration information of a plurality of resources defined in advance, and since the application is not necessarily applied to all resources when the application is deployed, a parameter and a parameter value corresponding to a target resource in the plurality of resources may be determined according to an operation of a user on a visual configuration page for the target resource, so that the resource configuration file for the application is generated based on the general template file and the parameter and parameter value corresponding to the target resource. It will be appreciated that, because of the different resource profiles required to deploy different applications, typically the resources required by different applications and the parameters and parameter values defined by the user for the resources, therefore, by defining the configuration information of a plurality of resources in the general template file in advance, this makes it possible to, in the process of generating the resource configuration file, the user (i.e. the aforementioned technician) need only determine the target resource needed to deploy the application and the parameters and parameter values for the target resource on the visualization configuration page, so that a resource profile can be automatically generated based on the parameters and parameter values of the target resource in combination with the corresponding generic template file, compared with the mode that the user writes the resource configuration file based on the bottom programming language, the method has the advantages that the difficulty of generating the resource configuration file is effectively reduced, and the requirement on the professional degree of the user is also reduced.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments described in the present application, and other drawings can be obtained by those skilled in the art according to the drawings.
FIG. 1 is a schematic diagram of an application scenario in an embodiment of the present application;
FIG. 2 is a flowchart illustrating a method for generating a resource configuration file according to an embodiment of the present application;
FIG. 3 is a schematic structural diagram of an apparatus for generating a resource profile according to an embodiment of the present disclosure;
fig. 4 is a schematic hardware structure diagram of an apparatus in an embodiment of the present application.
Detailed Description
Currently, before deploying an application on a cluster by using a container orchestration system, it is usually necessary to generate in advance a resource configuration file required for deploying the application. However, the inventor has found that in practical applications, the resource configuration file is usually composed of a plurality of subfiles, and each subfile may need to define more (e.g. tens of items, etc.) parameters and parameter values for characterizing the resource, and these data definitions about the resource are abstract to the skilled person. Therefore, if a technician writes a resource configuration file based on the underlying programming language to generate the resource configuration file, the technician is required to have a high level of expertise, and the resource configuration file is difficult to generate.
Based on this, the embodiment of the present application provides a method for generating a resource profile, so as to reduce the difficulty of generating the resource profile and the dependency on the professional level of a technician. Specifically, a general template file for generating a resource configuration file may be obtained first, where the general template file includes configuration information of a plurality of predefined resources, and since the general template file is not necessarily applied to all resources when an application is deployed, a parameter and a parameter value corresponding to a target resource in the plurality of resources may be determined according to an operation of a user on a visual configuration page for the target resource, so that the resource configuration file for the application may be generated based on the general template file and the parameter and parameter value corresponding to the target resource. It can be understood that, since different resource configuration files required for deploying different applications are different from one another, and usually resources required for different applications and parameters and parameter values defined by a user for the resources are different, by defining configuration information of a plurality of resources in a common template file in advance, the configuration information can be understood as configuration items for the user to operate to configure parameters of the resources, so that in the process of generating the resource configuration file, the user (i.e. the aforementioned technician) only needs to determine a target resource required for deploying the application and the parameters and parameter values of the target resource on a visual configuration page, so that the resource configuration file can be automatically generated based on the parameters and parameter values of the target resource in combination with the corresponding common template file, compared with the way that the user writes the resource configuration file based on the underlying programming language, the difficulty of generating the resource configuration file is effectively reduced, and the requirement on the professional degree of the user is also reduced.
As an example, the embodiment of the present application may be applied to an exemplary application scenario as shown in fig. 1. In this scenario, a user may deploy an application on a cluster 102 of a plurality of clusters by using a terminal 101, and in a specific implementation, the terminal 101 may obtain a general template file, where the general template file may include configuration information of a plurality of predefined resources; then, the terminal 101 may present a visualized configuration page to the user (for example, the configuration page may be presented to the user in the form of a website), where information (such as a physical meaning description, etc.) related to the multiple resources may be presented on the visualized configuration page, so that the user may select a target resource from the multiple resources according to a requirement of an application to be deployed (that is, a resource required by the application to be deployed), and input a parameter and a parameter value of the target resource on the visualized configuration page; in this way, the terminal 101 may determine the parameters and parameter values of the target resource defined by the user according to the relevant operation of the user for the target resource, and automatically generate a resource configuration file for deploying the application based on the general template file and the parameters and parameter values of the target resource, and then the terminal may deploy the application on the cluster 102 based on the resource configuration file.
It is to be understood that the above scenario is only one example of a scenario provided in the embodiment of the present application, and the embodiment of the present application is not limited to this scenario. For example, in other possible application scenarios, the device executing the method may be a separately configured device, or a control device on a cluster, and the like. In summary, the embodiments of the present application may be applied in any applicable scenario and are not limited to the scenario examples described above.
In order to make the aforementioned objects, features and advantages of the present application more comprehensible, various non-limiting embodiments accompanying the present application examples are described below with reference to the accompanying drawings. It is to be understood that the embodiments described are only a few embodiments of the present application and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Referring to fig. 2, fig. 2 is a flowchart illustrating a method for generating a resource configuration file according to an embodiment of the present application. It should be noted that the method may be applied to the terminal 101 shown in fig. 1, may also be applied to a device that is set separately, may also be applied to a certain control device in a cluster, and the like, and when implemented specifically, the method may be determined according to the needs of actual applications. The method specifically comprises the following steps:
s201: a generic template file is obtained, the generic template file including predefined configuration information for a plurality of resources.
In this embodiment, to simplify operations that a user needs to execute in the process of generating a resource configuration file, a resource concept of a bottom abstraction may be converted into an imaging concept that is convenient for the user to understand, and a general template file is generated according to the imaging concept, where configuration information of a plurality of bottom resources is predefined on the general template file. And subsequently when multiple resources are presented to the user, the user sees what the avatar concepts can be, and each avatar concept has a corresponding underlying resource corresponding to it. In this way, when a user needs to deploy an application, the resources required by the user can be selected from (the configuration information of) a plurality of resources included in the universal template file, and the user does not need to write program codes to realize the definition of the resources. In a possible implementation manner, in order to make the generic template file suitable for a user to deploy any application, configuration information of all resources required by the applications may be predefined on the generic template file, so that when the user deploys any application, the configuration information of the resources required to be defined may be obtained on the generic template file, that is, the resources required to be defined are obtained on the generic template file.
As some examples, when an application is deployed by using the k8s container orchestration system, the configuration information of the plurality of resources defined in the preset generic template file may be, for example, configuration information of a plurality of types of resources including Replication Controller, deployment entities, Service, Ingress, and the like.
S202: and determining parameters and parameter values corresponding to the target resources according to the operation of the user on the visual configuration page aiming at the target resources in the plurality of resources.
It can be understood that in practical applications, the difference between different resource profiles required by a user to deploy different applications generally exists in that there are differences between resources required by the respective applications and parameters and parameter values defined by the resources, for example, there may be differences between mirror addresses used by the different applications, open ports, commands to be executed, and the like. Therefore, the configuration information of each resource in the common template file may be a parameter and a parameter value in the configuration information in which the resource is defined by the user, or may be a parameter (or a parameter and a parameter value of the resource) in the configuration information of the resource that is initially defined in advance, and the user may determine whether to modify the initially defined parameter (or a parameter and a parameter value).
Specifically, a visualized configuration page may be presented to the user, where the visualized configuration page includes configuration information of multiple resources on the common template file, for example, the configuration information of multiple resources may be presented in a form on the configuration page. Further, relevant information corresponding to the resource, such as the name and paraphrase of the resource, is presented on the visualization configuration page for the user to understand. Then, the user can select, according to the application to be deployed, a resource required for deploying the application from the plurality of resources presented (for convenience of description, the resource required for deploying the application is hereinafter referred to as a target resource), and complete the definition of the parameter and the parameter value of the target resource.
In an exemplary embodiment, the parameters and the parameter values in the configuration information of each resource in the common template file may not be defined in advance, so that after the user determines the target resource from the multiple resources on the visual configuration page, the user may continue to define the parameters and the parameter values of the target resource on the visual configuration page. In this way, based on the parameter input operation of the user on the visual configuration page for the target resource, the parameter corresponding to the target resource can be determined. The parameter input operation may be an operation of inputting each character constituting a parameter, for example, a user may sequentially input characters "N", "a", "m", and "e" through a keyboard (including a soft keyboard, a hard keyboard, and the like), so that the input characters constitute the parameter "Name"; certainly, in order to facilitate the user to define the parameter, a plurality of candidate items may also be provided for the user in advance, and the user selects one of the candidate items as the parameter, for example, a plurality of candidate items such as "Name", "ID", "Num" and the like may be provided in advance, and after the user selects one of the candidate items "Name", the candidate item "Name" is the parameter defined by the user. Accordingly, the parameter input operation performed by the user may be the operation of each character constituting the parameter, or the selection operation for the candidate. Similarly, for the parameter value corresponding to the target resource, the parameter value corresponding to the target resource may be determined according to the parameter value input operation of the user on the visual configuration page for the parameter. The parameter value may be a character input operation by the user or a selection operation for a plurality of candidates.
Of course, in another exemplary embodiment, the parameters of some or all of the resources in the common template file may also be defined in advance (i.e., initially defined). In this way, the user can check whether the parameters and parameter values of the selected target resource are appropriate on the visual configuration page, and if the initially defined parameters and/or parameter values of the target resource meet the expectations of the user, the parameters and/or parameter values of the target resource can be confirmed; if the initially defined parameters and/or parameter values of the target resource do not meet the expectations of the user, the parameters and/or parameter values of the target resource can be modified to the parameters and/or parameter values which are desired to be defined by the target resource. In this way, the parameters and parameter values that the target resource is finally defined are determined based on the confirmation operation and/or modification of the parameters and parameter values of the target resource by the user. Further, when the user needs to modify the parameter and/or parameter value of the target resource, a plurality of corresponding candidate items may be provided for the user, and the user selects a candidate item meeting the expectation as the finally determined parameter and/or parameter value, or the user may re-input the parameter and/or parameter value, etc., without being limited herein.
S203: and generating a resource configuration file required by the deployment application based on the universal template file and the determined parameters and parameter values corresponding to the target resource.
In this embodiment, according to the parameters and parameter values of the target resource defined by the user and in combination with a preset general template file, a resource configuration file required by deployment of an application may be automatically generated. Specifically, after determining the parameters and parameter values of the target resources, the target resources understood by the user side may be converted into corresponding underlying resources, and corresponding parameter replacement and parameter value replacement are performed on the underlying resources according to the parameters and parameter values of the target resources, so that corresponding resource configuration files are automatically generated based on the parameters and parameter values of the underlying resources after replacement.
In practical applications, a user may deploy the same application or the same type of application on multiple clusters respectively, where the same application or the same type of application may employ the same resource and the same parameter when deployed on different clusters, but parameter values of the parameter may differ. Therefore, in a further possible implementation manner, personalized template files may also be generated for the same application or the same type of application, and specifically, the personalized template file for deploying the application or the same type of application may be generated according to the parameters corresponding to the target resource and the common template file. In this way, when a user deploys the same application on different clusters (or deploys the same application again), the personalized template file corresponding to the application can be used for generating the resource configuration file without the user performing the process of determining the target resource again, so that the operation of the user can be further simplified, the difficulty of generating the resource configuration file is reduced, and the professional level requirement of the user is lowered. In actual application, different personalized template files can be generated for different applications (or different types of applications), so that when a user deploys an application, a personalized template file corresponding to the application can be selected.
Correspondingly, in the process of generating the resource configuration file, the user may define the parameter value corresponding to the target resource in the corresponding personalized template file, so as to generate the resource configuration file corresponding to the application based on the personalized template file and the parameter value (the parameter is defined in advance). In the specific implementation, the parameter value input by the user may be replaced with the parameter value at the corresponding position of the pre-buried point in the personalized template file, that is, the parameter value at the corresponding position may be replaced with the parameter value input by the user.
In a further possible implementation, after the resource configuration file is generated, the corresponding application may be further deployed on the corresponding cluster according to the resource configuration file. In this embodiment, in order to further simplify operations that need to be performed when a user deploys an application, cluster parameters that are needed to deploy the application on a cluster may be automatically determined for the user. As an example, demand indication information input by a user may be obtained, where the demand indication information represents a demand of the user for the deployed application, for example, the user requires that the deployed application needs to be externally published through a gateway; then, a target parameter value matched with the demand indication information may be determined from parameters of the target cluster according to the demand indication information, where the target parameter value is a parameter value corresponding to an available resource on the target cluster required when the application is deployed on the target cluster according to the resource configuration file, or an available resource on the target cluster may be determined based on the target parameter value, and then the deployment of the application on the target cluster is achieved based on the available resource. The target cluster is a cluster for deploying the application in a plurality of clusters of the data center, and may be specified by a user.
It can be understood that if the user perceives the parameter values corresponding to the available resources on the target cluster, the user may be required to perform a complicated process of determining the parameter values, which increases the difficulty of deploying the application and also reduces the efficiency of deploying the application. Based on this, in this embodiment, after the user specifies the cluster (i.e., the target cluster) that needs to be deployed, the parameter of the cluster that needs to be deployed by the application may be obtained by using a preset function, and the parameter of the cluster is injected into the resource configuration file or the application in a manner of an environment variable. During specific implementation, a controller of the target cluster can be determined by using a preset method function, and a detailed parameter value of the whole target cluster is obtained from the controller, so that a parameter value corresponding to an available resource on the target cluster can be automatically allocated to a user according to the requirement (namely requirement indication information) of the user, and the parameter value can be injected into a resource configuration file in the form of an environment variable, and then the deployment of the application is automatically completed. From the user side, the user only needs to specify the cluster for deploying the application and propose the deployment requirement of the user, and the device side (or the program side) implements corresponding application deployment in the cluster specified by the user based on the requirement of the user. Therefore, perception of cluster parameter values when a user side deploys the application can be shielded, and the user does not need to pay attention to differences among clusters (for example, a part of clusters may be composed of physical machines, other clusters may be composed of virtual machines, and for example, differences exist among gateways, versions of deployed monitoring log collecting programs, IP addresses, ports and the like in the clusters), so that the efficiency of deploying the application by the user can be improved, and the difficulty of deploying the application is further reduced.
In this embodiment, a general template file for generating a resource configuration file may be obtained first, where the general template file includes a configuration file of a plurality of predefined resources, and since the application is not necessarily applied to all resources when the application is deployed, a parameter and a parameter value corresponding to a target resource in the plurality of resources may be determined according to an operation of a user on a visual configuration page for the target resource, so that the resource configuration file for the application is generated based on the general template file and the parameter and parameter value corresponding to the target resource. It can be seen that, by defining configuration files of multiple resources in a general template file in advance, in the process of generating a resource configuration file, a user only needs to determine a target resource required by deploying the application, and parameters and parameter values of the target resource on a visual configuration page, so that the resource configuration file can be automatically generated based on the parameters and parameter values of the target resource in combination with the corresponding general template file, which effectively reduces the difficulty of generating the resource configuration file and also reduces the requirement on the expertise of the user compared with the way that the user writes the resource configuration file based on a bottom-level programming language. In addition, parameter values corresponding to available resources on the target cluster can be automatically allocated according to the requirements of the user, perception of the cluster parameter values when the user side deploys the application can be shielded, the efficiency of deploying the application by the user is improved, and the difficulty of deploying the application can be further reduced.
In addition, the embodiment of the application also provides a device for generating the resource configuration file. Referring to fig. 3, fig. 3 is a schematic structural diagram illustrating an apparatus for generating a resource configuration file according to an embodiment of the present application, where the apparatus 300 includes:
an obtaining module 301, configured to obtain a general template file, where the general template file includes configuration files of a plurality of predefined resources;
a determining module 302, configured to determine, according to an operation of a user on a visualization page for a target resource in the multiple resources, a parameter and a parameter value corresponding to the target resource;
a first generating module 303, configured to generate a resource configuration file for deploying an application based on the general template file and the parameter and parameter value corresponding to the target resource.
In a possible implementation, the apparatus 300 further comprises:
and the second generation module is used for generating a personalized template file corresponding to the application according to the parameters corresponding to the target resources and the general template file.
In a possible implementation, the determining module 302 includes:
the first determining unit is used for determining a parameter corresponding to the target resource according to a parameter input operation aiming at the target resource on the visual configuration page by the user;
and the second determining unit is used for determining the parameter value corresponding to the target resource according to the parameter value input operation of the user aiming at the parameter on the visual configuration page.
In a possible implementation manner, if the general template file defines parameters and parameter values of the target resource in advance, the determining module 302 is specifically configured to:
and determining the parameters and the parameter values corresponding to the target resources according to the confirmation operation and/or the modification operation of the user on the visual configuration page aiming at the parameters and the parameter values of the target resources.
In a possible implementation manner, the first generating module 303 is specifically configured to:
and generating a resource configuration file for deploying the application according to the personalized template file and the parameter value corresponding to the target resource.
In a possible implementation, the apparatus 300 further comprises:
the information acquisition module is used for acquiring the demand indication information input by the user;
and the target parameter value determining module is used for determining a target parameter value matched with the demand indication information from the parameter values of the target cluster according to the demand indication information, wherein the target parameter value is a parameter value corresponding to the available resource on the target cluster when the application is deployed on the target cluster according to the resource configuration file.
In a possible embodiment, the apparatus further comprises:
the parameter acquisition module is used for acquiring the parameters of the clusters which need to be deployed by the application by using a preset function;
and the injection module is used for injecting the parameters of the cluster into the resource configuration file or the application in an environment variable mode.
It should be noted that, because the contents of information interaction, execution processes, and the like between the modules, units, and sub-units of the apparatus belong to the same concept as the method embodiment in the embodiment of the present application, accordingly, the technical effects brought by the contents are the same as the technical effects of the method embodiment in the embodiment of the present application, and specific contents may refer to descriptions of relevant parts in the method embodiment, and are not described herein again.
The device for generating a resource profile may include a processor and a memory, where the obtaining module, the determining module, the first generating module, the second generating module, the information obtaining module, the target parameter value determining module, the first determining unit, the second determining unit, and the like are all stored in the memory as program units, and the processor executes the program units stored in the memory to implement corresponding functions.
The processor comprises a kernel, and the kernel calls the corresponding program unit from the memory. The kernel can be set to be one or more, and the difficulty of generating the resource configuration file and the dependency on the professional degree of a technician are reduced by adjusting the kernel parameters.
An embodiment of the present invention provides a storage medium, on which a program is stored, where the program, when executed by a processor, implements the method for generating a resource profile.
The embodiment of the invention provides a processor, which is used for running a program, wherein the method for generating a resource configuration file is executed when the program runs.
Referring to fig. 4, fig. 4 illustrates an apparatus 40 provided in an embodiment of the present application, where the apparatus 40 includes at least one processor 401, at least one memory 402 connected to the processor 401, and a bus 403; the processor 41 and the memory 402 complete communication with each other through the bus 403; the processor 401 is adapted to call program instructions in the memory 402 to perform the above-described method of generating a resource profile. The device herein may be a server, a PC, a PAD, a mobile phone, etc.
The present application further provides a computer program product adapted to perform a program for initializing the following method steps when executed on a data processing device:
acquiring a general template file, wherein the general template file comprises a plurality of predefined configuration files of resources;
determining parameters and parameter values corresponding to target resources in the multiple resources according to the operation of a user on a visual configuration page aiming at the target resources;
and generating a resource configuration file for deploying the application based on the universal template file, the parameters corresponding to the target resource and the parameter values.
In some possible embodiments, it is suitable, when executed on a data processing device, to carry out in particular a procedure for initializing the following method steps:
determining a parameter corresponding to the target resource according to the parameter input operation of the user on the visual configuration page aiming at the target resource;
and determining a parameter value corresponding to the target resource according to the parameter value input operation of the user aiming at the parameter on the visual configuration page.
In a possible embodiment, the generic template file predefines parameters and parameter values of the target resource, and is then, in some possible embodiments, adapted to specifically perform, when executed on a data processing device, a procedure that initializes the following method steps:
and determining the parameters and the parameter values corresponding to the target resources according to the confirmation operation and/or the modification operation of the user on the visual configuration page aiming at the parameters and the parameter values of the target resources.
In some possible embodiments, the program is adapted to further perform a procedure when executed on a data processing device, the procedure initializing the following method steps:
and generating an individualized template file according to the parameters corresponding to the target resources and the general template file.
In a possible embodiment, the program is adapted to specifically perform, when executed on a data processing device, a procedure of initializing the following method steps:
and generating a resource configuration file for deploying the application according to the personalized template file and the parameter value corresponding to the target resource.
In some possible embodiments, the program is adapted to further perform a procedure when executed on a data processing device, the procedure initializing the following method steps:
acquiring demand indication information input by a user;
and determining a target parameter value matched with the demand indication information from the parameter values of the target cluster according to the demand indication information, wherein the target parameter value is a parameter value corresponding to an available resource on the target cluster when the application is deployed on the target cluster according to the resource configuration file.
In a possible embodiment, the program is adapted to further perform a procedure for initializing the following method steps when executed on a data processing device:
acquiring parameters of the cluster to be deployed by the application by using a preset function;
and injecting the parameters of the cluster into the resource configuration file or the application in an environment variable mode.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus, and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a device includes one or more processors (CPUs), memory, and a bus. The device may also include input/output interfaces, network interfaces, and the like.
The memory may include volatile memory in a computer readable medium, Random Access Memory (RAM) and/or nonvolatile memory such as Read Only Memory (ROM) or flash memory (flash RAM), and the memory includes at least one memory chip. The memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should be noted that "first" in the names of "first generation module", "first determination unit", and the like mentioned in the embodiments of the present application is only used for name identification, and does not represent first in order. The same applies to "second" etc. The terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in the process, method, article, or apparatus that comprises the element.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The above are merely examples of the present application and are not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.
Claims (10)
1. A method of generating a resource profile, the method comprising:
acquiring a general template file, wherein the general template file comprises configuration information of a plurality of resources defined in advance;
determining parameters and parameter values corresponding to target resources in the multiple resources according to the operation of a user on a visual configuration page aiming at the target resources;
and generating a resource configuration file for deploying the application based on the universal template file, the parameters corresponding to the target resource and the parameter values.
2. The method according to claim 1, wherein the determining the parameters and the parameter values corresponding to the target resource in the plurality of resources according to the operation of the user on the visual configuration page for the target resource comprises:
determining a parameter corresponding to the target resource according to the parameter input operation of the user on the visual configuration page aiming at the target resource;
and determining a parameter value corresponding to the target resource according to the parameter value input operation of the user aiming at the parameter on the visual configuration page.
3. The method according to claim 1, wherein the general template file pre-defines parameters and parameter values of the target resource, and the determining the parameters and parameter values corresponding to the target resource according to the operation of the user on the visual configuration page for the target resource in the plurality of resources comprises:
and determining the parameters and the parameter values corresponding to the target resources according to the confirmation operation and/or the modification operation of the user on the visual configuration page aiming at the parameters and the parameter values of the target resources.
4. The method of claim 1, further comprising:
and generating an individualized template file according to the parameters corresponding to the target resources and the general template file.
5. The method of claim 4, wherein generating a resource configuration file for deploying an application based on the common template file, the parameters corresponding to the target resource, and the parameter values comprises:
and generating a resource configuration file for deploying the application according to the personalized template file and the parameter value corresponding to the target resource.
6. The method according to any one of claims 1 to 5, further comprising:
acquiring demand indication information input by a user;
and determining a target parameter value matched with the demand indication information from the parameter values of the target cluster according to the demand indication information, wherein the target parameter value is a parameter value corresponding to an available resource on the target cluster when the application is deployed on the target cluster according to the resource configuration file.
7. The method of claim 1, further comprising:
acquiring parameters of the cluster to be deployed by the application by using a preset function;
and injecting the parameters of the cluster into the resource configuration file or the application in an environment variable mode.
8. An apparatus for generating a resource profile, the apparatus comprising:
the system comprises an acquisition module, a storage module and a processing module, wherein the acquisition module is used for acquiring a general template file, and the general template file comprises configuration information of a plurality of resources which are defined in advance;
the determining module is used for determining parameters and parameter values corresponding to target resources in the plurality of resources according to the operation of a user on a visual page aiming at the target resources;
and the first generation module is used for generating a resource configuration file for deploying the application based on the general template file, the parameters corresponding to the target resource and the parameter values.
9. A storage medium having stored thereon a program which, when executed by a processor, implements the method of generating a resource profile of any of claims 1 to 7.
10. An apparatus comprising at least one processor, and at least one memory, bus connected to the processor;
the processor and the memory complete mutual communication through the bus;
the processor is configured to invoke program instructions in the memory to perform a method of generating a resource profile as claimed in any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010108116.2A CN113296823A (en) | 2020-02-21 | 2020-02-21 | Method, device, equipment and storage medium for generating resource configuration file |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010108116.2A CN113296823A (en) | 2020-02-21 | 2020-02-21 | Method, device, equipment and storage medium for generating resource configuration file |
Publications (1)
Publication Number | Publication Date |
---|---|
CN113296823A true CN113296823A (en) | 2021-08-24 |
Family
ID=77317619
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010108116.2A Pending CN113296823A (en) | 2020-02-21 | 2020-02-21 | Method, device, equipment and storage medium for generating resource configuration file |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113296823A (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114281427A (en) * | 2021-12-22 | 2022-04-05 | 上海云轴信息科技有限公司 | Method and equipment for batch parameter configuration and verification |
CN114448802A (en) * | 2022-01-28 | 2022-05-06 | 北京百度网讯科技有限公司 | Gateway configuration method and device, electronic equipment and storage medium |
CN114860338A (en) * | 2022-05-17 | 2022-08-05 | 西安北方华创微电子装备有限公司 | Parameter configuration method and device for semiconductor equipment |
CN115268993A (en) * | 2022-08-29 | 2022-11-01 | 中国建设银行股份有限公司 | Method, service system, device and storage medium for updating configuration parameters |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105718479A (en) * | 2014-12-04 | 2016-06-29 | 中国电信股份有限公司 | Execution strategy generation method and device under cross-IDC (Internet Data Center) big data processing architecture |
CN107229646A (en) * | 2016-03-24 | 2017-10-03 | 中兴通讯股份有限公司 | Dispositions method, the apparatus and system of data cluster |
WO2018077079A1 (en) * | 2016-10-31 | 2018-05-03 | 阿里巴巴集团控股有限公司 | Application capacity enlargement method, apparatus and system |
CN110275775A (en) * | 2019-05-17 | 2019-09-24 | 平安科技(深圳)有限公司 | Resource allocation method, system and the storage medium of container application |
CN110290189A (en) * | 2019-06-17 | 2019-09-27 | 深圳前海微众银行股份有限公司 | A kind of container cluster management method, apparatus and system |
CN110764864A (en) * | 2019-10-25 | 2020-02-07 | 北京浪潮数据技术有限公司 | Terraform-based visual resource arrangement method |
-
2020
- 2020-02-21 CN CN202010108116.2A patent/CN113296823A/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105718479A (en) * | 2014-12-04 | 2016-06-29 | 中国电信股份有限公司 | Execution strategy generation method and device under cross-IDC (Internet Data Center) big data processing architecture |
CN107229646A (en) * | 2016-03-24 | 2017-10-03 | 中兴通讯股份有限公司 | Dispositions method, the apparatus and system of data cluster |
WO2018077079A1 (en) * | 2016-10-31 | 2018-05-03 | 阿里巴巴集团控股有限公司 | Application capacity enlargement method, apparatus and system |
CN110275775A (en) * | 2019-05-17 | 2019-09-24 | 平安科技(深圳)有限公司 | Resource allocation method, system and the storage medium of container application |
CN110290189A (en) * | 2019-06-17 | 2019-09-27 | 深圳前海微众银行股份有限公司 | A kind of container cluster management method, apparatus and system |
CN110764864A (en) * | 2019-10-25 | 2020-02-07 | 北京浪潮数据技术有限公司 | Terraform-based visual resource arrangement method |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114281427A (en) * | 2021-12-22 | 2022-04-05 | 上海云轴信息科技有限公司 | Method and equipment for batch parameter configuration and verification |
CN114448802A (en) * | 2022-01-28 | 2022-05-06 | 北京百度网讯科技有限公司 | Gateway configuration method and device, electronic equipment and storage medium |
CN114448802B (en) * | 2022-01-28 | 2024-05-14 | 北京百度网讯科技有限公司 | Gateway configuration method, device, electronic equipment and storage medium |
CN114860338A (en) * | 2022-05-17 | 2022-08-05 | 西安北方华创微电子装备有限公司 | Parameter configuration method and device for semiconductor equipment |
CN115268993A (en) * | 2022-08-29 | 2022-11-01 | 中国建设银行股份有限公司 | Method, service system, device and storage medium for updating configuration parameters |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN113296823A (en) | Method, device, equipment and storage medium for generating resource configuration file | |
US10860339B2 (en) | Autonomous creation of new microservices and modification of existing microservices | |
US9760343B2 (en) | Application builder based on metadata | |
US20180101371A1 (en) | Deployment manager | |
KR20200115020A (en) | Hyperledger fabric network creation method, controller and storage medium | |
US20160350081A1 (en) | Automatic container definition | |
US11086767B2 (en) | Intelligent generation of log messages by a SAAS offering in a continuous pipeline | |
US10996997B2 (en) | API-based service command invocation | |
US20220360504A1 (en) | Adapting microservices to multi-platform deployments | |
CN109144511B (en) | Method and system for automatically generating numerical simulation graphical user interface | |
CN111241073A (en) | Data quality inspection method and device | |
CN110750415B (en) | Interface service configuration method, device, medium and computer equipment | |
CN111124871A (en) | Interface test method and device | |
CN111897623A (en) | Cluster management method, device, equipment and storage medium | |
CN115098112A (en) | Method, equipment and medium for deploying financial cloud application resources | |
CN114764296A (en) | Machine learning model training method and device, electronic equipment and storage medium | |
CN113485746B (en) | Method and device for generating application program interface document | |
CN115525545A (en) | Docker-based automatic testing method, system, equipment and medium | |
CN114253845A (en) | Automatic testing method and device for special-shaped architecture integration system | |
CN110969461B (en) | Method and device for processing public number information, storage medium and processor | |
CN114489999A (en) | Method and device for processing pipeline task, processor and electronic equipment | |
CN112749159A (en) | Form generation method and device, electronic equipment and storage medium | |
CN110795207B (en) | Virtual container minimum resource unit mutual trust configuration method and device | |
CN116661767B (en) | File generation method, device, equipment and storage medium | |
CN116909931B (en) | Performance detection system for Fabric block chain |
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 |