The present disclosure generally relates to configuring a computer-based application on one or more computer systems. More specifically, the present disclosure relates to methods, systems and computer program products for compiling a configuration file for an application based on an application definition.
Companies rely on applications operating on computer-based infrastructures to provide external services and to facilitate internal operations (e.g., execution of internal business processes, facilitate electronic communication, and the like). In some cases, these applications may span multiple computer-based infrastructure environments. The multiple infrastructure environments may include a data center environment, a cloud computing environment, or any other environment that incorporates computer, network, storage, operating system, application, and other resources. The applications deployed on the infrastructure may use these resources to accomplish various business objectives. The services themselves may span multiple infrastructure environments over the course of a development lifecycle.
In many cases, configuration files may be used to set values needed to deploy or otherwise setup an application in an infrastructure. For example, a configuration file may include an attribute that specifies a cache size needed by the application. However, in some cases, an improper configuration value may lead to bad results. For example, in some cases, the configuration file may specify a cache size that results in unacceptable behavior. When this happens, a stakeholder may attempt to debug or otherwise trouble shoot the issue when the unacceptable behavior is detected.
Some embodiments of the technology are illustrated by way of example and not limitation in the figures of the accompanying drawings.
The present disclosure describes, among other things, methods, systems, and computer program products, which individually provide functionality for generating or otherwise compiling configuration files. In the following description, for purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the various aspects of different embodiments of the present invention. It will be evident, however, to one skilled in the art, that the present invention may be practiced without all of the specific details.
Example embodiments may include systems and methods to configure an application (or applications) deployed on an operational infrastructure based on an application definition and a configuration source. On the one hand, a configuration source may be data (e.g., a file) that specifies one or more configuration properties (key/value pairs) that are to be included in a compiled configuration file. On the other hand, an application definition, as used herein, may refer to data or logic that characterize attributes of a configuration property (or configuration properties) that an application consumes to configure an operational environment in which the application runs on. In a way, the application definition may act as a contract for the data that an application expects in a configuration file. In some embodiments, an application definition may characterize a configuration property by assigning the configuration property a data type. Assigning the configuration property a data type may in some cases provide type safety protection when a configuration file is compiled.
Accordingly, in some embodiments, a configuration compiler may receive a configuration source to compile. In some embodiments, a configuration source may be data that includes one or more configuration properties that are to be included in a compiled configuration file. The configuration compiler may then obtain an application definition related to the configuration source. The application definition may include a property definition that may in turn include a name attribute and a type attribute. The configuration compiler may then inspect the property definition and search the configuration source for a value for the property definition. In some cases, the value may be specified by the configuration source. In other cases, the value may be specified by the application definition. The value found is then type checked against the type attribute of the first property definition. Based on a valid type check, the configuration compiler may record the value in a key value pair in a compiled configuration file. Otherwise, the configuration compiler may generate an error.
In some cases, the configuration compiler may repeat the process of inspecting other property definitions within the application definition and type checking values associated with those application definitions.
Utilizing a configuration compiler in a manner consistent with some of the example embodiments described herein may find many practical applications. For example, a system utilizing application definitions may force stake holders of an application (e.g., developers, designers, operation groups, testers, and the like) to discuss the types of properties that may be configurable, the permissible values of those properties, the impact the property has on the operational infrastructure, and the resources required by the operational infrastructure to support the application, to say the least. Other advantages and aspects of the inventive subject matter will be readily apparent from the description of the figures that follows.
As shown in
The configuration compiler 102 may be a computer-implemented module configured to generate compiled configuration files based on a configuration source and an application definition. Compiling a configuration file may be a process for determining whether a configuration source has been properly defined a configuration property that is consistent with an application definition in which the configuration source is compiled against. An example where a configuration property may not be consistent with an application definition is where the application definition specifies that a property named “cache size” is to have an integer value and the configuration source sets a string value to the “cache size” configuration property. In this example, some embodiments of the configuration compiler 102 may generate an error when the configuration source is compiled.
The fabrics 104a-c may each be an operational environment that may execute an application. Each of the fabrics may include a topology of computer resources, such as webservers, databases, load balancers, web-caches, and the like. Although this disclosure may refer to these computer resources as physical computer resources, it is to be appreciated that these computer resources may also be embodied as virtual resources deployed on physical nodes of a cloud system. In some cases, the fabrics may correspond to a topology of computer resources usable during a stage of the development of the application. For example, the fabric 104a may be the computer environment for testing applications, the fabric 104b may be the computer environment for developing applications, and the fabric 104c may be the computer environment for production.
The configuration repository 106 may be a data store (e.g., one or more databases) that stores, among other things, a compiled configuration file 112 (or configuration files), an application definition 114 (or application definitions), and a configuration source 116. The compiled configuration file 112 may include configuration data that specifies the properties and corresponding values that are to be used to configure an application deployed on one of the fabrics 104a-c. In some cases, the configuration data may specify the properties and corresponding value through key value pairs. The key value pairs are determined by the configuration compiler 102 when the configuration compiler 102 compiles the configuration source.
The application definition 114 is data (e.g., a file) that includes configuration definition data. Configuration definition data may include one or more property definitions that specify configuration properties that may be included in a configuration file. Generally, a property definition is a tuple that includes a name attribute. The name attribute may name a configuration property in the configuration file 112. In addition to the name attribute, an application definition may include other types of attributes. For example, in some cases, a property definition may specify a default value for a configuration property via a default value attribute. In some cases, a property definition may be a pure virtual property definition. A pure virtual property definition may be a property definition that lacks a value and indicates that another application should override the pure virtual property definition with a value. If an application definition includes a pure virtual property definition that is not overridden with a value by a configuration source, example embodiments may generate an error message for an end-user trying to configure an application.
In some embodiments, in addition or in the alternative to including default values and pure virtual property definitions, a property definition may include a type attribute. A type attribute may be data usable to verify that the values specified by a configuration source, or an application definition, is valid. For example, the type attribute for a property definition may specify that the value for a named configuration property is an integer. When this is the case, if any configuration source uses a value that corresponds to a string data type, the configuration compiler 102 may then generate an error indicating that the value in the configuration source 116 is improper or otherwise invalid. By way of example and not limitation, a data type may include integers, strings, floating point, set, map, list, uniform resource locators (“URL”), or any other suitable data format.
The configuration source 116 may be data or logic that the configuration compiler 102 compiles to generate the compiled configuration 112. The configuration source 116, and the corresponding application definition 114, specify the configuration properties that will be included in the compiled configuration.
As described above, an application definition 114 may operate, at least conceptually in some embodiments, as a contract defining the types of configurations and possibly values that may be used in a configuration file for an application operating in one of the fabrics 104a-c. The format of the application definition is now described in greater detail. For example,
As shown in
Within the application definition component 202, a number of property definitions 204a-c are listed. Each of the property definitions 204a-c may specify aspects or attributes of a configuration property that is to be recorded in a configuration file. For example, a property definition may, among other things, specify a name of a configuration property that is to be included in a configuration file, a default value for a configuration property, a type classifier for a configuration property, expression constraint, and any other aspect. In some cases, the property definition may be specified as a pure virtual property definition. As described above, a pure virtual property definition may be a property definition that lacks a value and, as a result, signals that a configuration source is to specify the value for the corresponding configuration property. These attributes of property definitions are illustrated in
The default value attribute 224 may be an optional property definition attribute that specifies a default value for a configuration property that is recorded in the compiled configuration file. The use of default value attributes may in some cases simplify the authoring of configuration sources. For example, if the configuration compiler 102 detects that a value is not specified for a configuration property named by a property definition, the configuration compiler may use the default value specified by the property definition. Of course, the author of a configuration source can override the value specified by the default value attribute by providing another value for the configuration property.
The type attribute 226 may be an optional attribute that specifies a type classifier for a configuration property corresponding to the name attribute. For example, the type attribute 226 specifies that the “cache_size” is an integer type. Accordingly, the configuration compiler 102 may verify any value associated with the property definition 204a as being consistent with an integer. For example, the deployment manger 102 may verify that the default value (e.g., 32) is an integer. Although the type attribute 226 specifies an “INT,” or integer, type, it is to be appreciated that other types are contemplated by this disclosure. For example a type attribute may specify a float, string, URL, map, set, list, or any other data type.
The property definition 204b includes the name attribute 242 to name another configuration property (e.g., “MEMCACHES”) that is to be included in the compiled configuration file. The type attribute 244 may specify that the value for the configuration property corresponding to the name attribute 242 is a list and, thus, must follow the syntax of a list data type. As
The property definition 204c includes the name attribute 262 to name another configuration property (e.g., “DB_URL”) that is to be included in the compiled configuration file. It is worth noting that the property definition 204c may be considered a pure virtual property definition in that the property definition 204c lacks a value attribute. For example, the property definition 204c lacks a default value attribute, as was defined for the property definition 204a. Further, the property definition 204c also lacks an explicit value, as was defined for the property definition 204b. In being a pure virtual property definition, the configuration compiler 202 may generate an error if it compiles a configuration source that doesn't define a value for the property definition 204a.
Although the property definition 204c lacks a default value, the property definition 204c may still include, although not necessarily, a type attribute 264. The type attribute 264 may specify a type that the configuration compiler 102 will check when the configuration source defines the value for the property definition 204c.
It is to be appreciated that the application definition 200 and the configuration source 300 shown in
Example embodiments may use the application definition 200 and the configuration source 300 shown in
Each of the configuration properties 404a-c may specify a configuration value for a configurable aspect of the application or the operational environment of the fabric which executes the application. In some cases, a configuration property may specify the configuration value for the configurable aspect through a key value pair. For example, the configuration property 404a includes a name attribute 422 (e.g., the key) and a value attribute 424 (e.g., the value). The configuration compiler 102 may generate the configuration property 404a based on the property definition 204c specified by the application definition 200 of
With continued reference to
Still further, with continued reference to
The operation of the configuration compiler 102 is now described in greater detail.
The method 500 may begin at operation 502 when the configuration compiler 102 accesses an application definition (e.g., the application definition 200 of
At operation 504, the configuration compiler 102 may identify a property definition from the application definition 200 that includes a name attribute and a type attribute. In some cases, the deployment manger 102 may perform operation 504 by parsing the application definition to identify tokens matching the syntax of a name attribute (and corresponding name value) and tokens matching the syntax of a type attribute (and corresponding type value).
At operation 506, the configuration compiler 102 may search the configuration source 300 for a property source with a name attribute matching the property definition. In some cases, a property source with a name attribute matching the name attribute of the property definition may be found in the configuration source and in some cases it will not. For example, in the case of a pure virtual property definition, the configuration source may include a source property specifying a value for the pure virtual property definition. On the other hand, in the case of default values, the configuration source may lack a property source that corresponds to the property definition.
If a property source with a name attribute matching the property definition is found in the configuration source 300, the value specified by the configuration source is selected for type checking. This is shown as operation 508. By way of example and not limitation, if the property definition 204c is identified at operation 504 and the configuration source 300 of
If the value for the property definition is not found in the configuration source 300, the configuration compiler 102 may determine, at operation 510, whether the property definition 200 specifies a default value. If the property definition 200 specifies a default value for the identified property definition, the default value is selected for type checking. This is shown as operation 512. It should be noted that in the case of the property definitions 204a-b, the default value attributes 224 and 246 may be selected as the configuration source 300 of
If the property definition 200 does not specify a default value for the identified property definition, the configuration compiler 102 may generate an error at operation 514.
At operation 516, the configuration compiler 102 may then perform a type check on the selected value. Type checking the selected value may involve the configuration compiler 102 comparing the selected value with the value of the type attribute. For example, where the type attribute specifies an integer, the configuration compiler 102 may verify that the selected value of the value attribute is a valid integer. In the case of values for complex data types, or values dependent on the values of other configuration properties, type checking may involve building up the value to check against the type attribute specified by the application definition.
If the type check fails, the configuration compiler 102 may generate an error message. This is shown as operation 518. In some cases, generating an error message ends the method 500. In other cases, the method 500 may continue despite encountering an error.
The method 500 continues to operation 520 if the type check determines that the value attribute is a valid type. Operation 520 may include the configuration compiler 102 recording a configuration property in the compiled configuration file based on the name specified by the name attribute of the property definition and the value of the selected value attribute.
As
Thus far, this disclosure has focused on generating configuration data based on application definitions that may include type safety checks. However, other example embodiments may additionally or alternatively include any number of validity checks on the value attributes specified by the application definitions used to generate configuration data. For example,
It is possible that example embodiments may be used to provide many practical advantages in configuring applications running on computational environments. For example, rather than authoring configuration data directly, stakeholders of an application may discuss the computational needs of the application prior to deployment to develop application definitions. The application definitions are then used to generate configuration data. In generating the configuration data, the configuration compiler is able to detect errors that violate the property definitions specified by one or more of the application definitions (e.g., an application definition specifies data in an incorrect format, for example). In many cases, errors detecting during the compilation of application definitions is less consuming than bug finding in a deployed application.
The various operations of example methods described herein may be performed, at least partially, by one or more processors that are temporarily configured (e.g., by software) or permanently configured to perform the relevant operations. Whether temporarily or permanently configured, such processors may constitute processor-implemented modules, engines, objects or devices that operate to perform one or more operations or functions. The modules, engines, objects and devices referred to herein may, in some example embodiments, comprise processor-implemented modules, engines, objects and/or devices.
Similarly, the methods described herein may be at least partially processor-implemented. For example, at least some of the operations of a method may be performed by one or more processors or processor-implemented modules. The performance of certain operations may be distributed among the one or more processors, not only residing within a single machine or computer, but deployed across a number of machines or computers. In some example embodiments, the processor or processors may be located in a single location (e.g., within a home environment, an office environment or at a server farm), while in other embodiments the processors may be distributed across a number of locations.
The example computer system 700 includes a processor 702 (e.g., a central processing unit (CPU), a graphics processing unit (GPU) or both), a main memory 704 and a static memory 706, which communicate with each other via a bus 708. The computer system 700 may further include a display unit 710, an alphanumeric input device 712 (e.g., a keyboard), and a user interface (UI) navigation device 714 (e.g., a mouse). In one embodiment, the display, input device and cursor control device are a touch screen display. The computer system 700 may additionally include a storage device 716 (e.g., drive unit), a signal generation device 718 (e.g., a speaker), a network interface device 720, and one or more sensors, such as a global positioning system sensor, compass, accelerometer, or other sensor.
The drive unit 716 includes a machine-readable medium 722 on which is stored one or more sets of instructions and data structures (e.g., software 724) embodying or utilized by any one or more of the methodologies or functions described herein. The software 724 may also reside, completely or at least partially, within the main memory 704 and/or within the processor 702 during execution thereof by the computer system 700, the main memory 704 and the processor 702 also constituting machine-readable media.
While the machine-readable medium 722 is illustrated in an example embodiment to be a single medium, the term “machine-readable medium” may include a single medium or multiple media (e.g., a centralized or distributed database, and/or associated caches and servers) that store the one or more instructions. The term “machine-readable medium” shall also be taken to include any tangible medium that is capable of storing, encoding or carrying instructions for execution by the machine and that cause the machine to perform any one or more of the methodologies of the present invention, or that is capable of storing, encoding or carrying data structures utilized by or associated with such instructions. The term “machine-readable medium” shall accordingly be taken to include, but not be limited to, solid-state memories, and optical and magnetic media. Specific examples of machine-readable media include non-volatile memory, including by way of example semiconductor memory devices, e.g., EPROM, EEPROM, and flash memory devices; magnetic disks such as internal hard disks and removable disks; magneto-optical disks; and CD-ROM and DVD-ROM disks.
The software 724 may further be transmitted or received over a communications network 726 using a transmission medium via the network interface device 720 utilizing any one of a number of well-known transfer protocols (e.g., HTTP). Examples of communication networks include a local area network (“LAN”), a wide area network (“WAN”), the Internet, mobile telephone networks, Plain Old Telephone (POTS) networks, and wireless data networks (e.g., Wi-Fi® and WiMax® networks). The term “transmission medium” shall be taken to include any intangible medium that is capable of storing, encoding or carrying instructions for execution by the machine, and includes digital or analog communications signals or other intangible medium to facilitate communication of such software.
Although some embodiments has been described with reference to specific example embodiments, it will be evident that various modifications and changes may be made to these embodiments without departing from the broader spirit and scope of the invention. Accordingly, the specification and drawings are to be regarded in an illustrative rather than a restrictive sense. The accompanying drawings that form a part hereof, show by way of illustration, and not of limitation, specific embodiments in which the subject matter may be practiced. The embodiments illustrated are described in sufficient detail to enable those skilled in the art to practice the teachings disclosed herein. Other embodiments may be utilized and derived therefrom, such that structural and logical substitutions and changes may be made without departing from the scope of this disclosure. This Detailed Description, therefore, is not to be taken in a limiting sense, and the scope of various embodiments is defined only by the appended claims, along with the full range of equivalents to which such claims are entitled.
This application claims the benefit of priority to U.S. Pat. App. No. 61/898,193, filed Oct. 31, 2013 and titled “GENERATING CONFIGURATION DATA BASED ON APPLICATION DEFINITIONS,” the disclosure of which is incorporated by reference herein in its entirety.
Number | Date | Country | |
---|---|---|---|
61898193 | Oct 2013 | US |