|Publication number||US7539976 B1|
|Application number||US 10/715,974|
|Publication date||May 26, 2009|
|Filing date||Nov 17, 2003|
|Priority date||Mar 25, 2003|
|Publication number||10715974, 715974, US 7539976 B1, US 7539976B1, US-B1-7539976, US7539976 B1, US7539976B1|
|Inventors||John Ousterhout, Sven Delmas, John Eric Melski, Scott Stanton, Sandeep Tamhankar|
|Original Assignee||Electric Cloud, Inc.|
|Export Citation||BiBTeX, EndNote, RefMan|
|Patent Citations (23), Non-Patent Citations (5), Referenced by (39), Classifications (6), Legal Events (1)|
|External Links: USPTO, USPTO Assignment, Espacenet|
This application is a continuation-in-part of the following applications:
U.S. application Ser. No. 10/397,995, filed Mar. 25, 2003, entitled Architecture and Method for Executing Program Builds;
U.S. application Ser. No. 10/397,573, filed Mar. 25, 2003, now U.S. Pat. No. 7,263,695 entitled System and Method for Processing Recursive Invocations Within a Program Build;
U.S. application Ser. No. 10/397,139, filed Mar. 25, 2003, now U.S. Pat. No. 7,086,063 entitled System and Method for File Caching Within a Distributed Program Build Environment;
U.S. application Ser. No. 10/397,690, filed Mar. 25, 2003, entitled Conflict Detection and Correction in a Program Build Environment; and
U.S. application Ser. No. 10/397,880, filed Mar. 25, 2003, now U.S. Pat. No. 7,168,064 entitled System and Method for Supplementing Program Builds With File Usage Information.
1. Field of the Invention
This invention relates generally to the field of computer aided software engineering. More particularly, the invention relates to an improved architecture for performing distributed software builds.
2. Description of the Related Art
Computer programs are typically built from of a set of source files and “include” files, which require linking with any number of software libraries. During the program creation process, modifying any one of the source files requires recompilation of that part of the program followed by relinking. This process may be automated with software engineering tools such as the “Make” utility designed by Stuart Feldman in the mid 1970's. The Make utility works off of a file called the “Makefile” which indicates in a structured manner which source and object files depend on other files. It also defines the commands required to compile and link the files. Each file to build, or step to perform, is called a “target.” Each entry in the Makefile is a rule expressing a target's dependencies and the commands needed to build or make that object. The specific structure of a rule in the Makefile is:
<target file>: list of dependencies
TAB commands to build target
A tree structure indicating dependencies for a series of exemplary source and object files is illustrated in
The Makefile used to specify the hierarchical relationship illustrated in
a.out: foo.o bar.o
foo.o: foo.cc foo.h
bar.o: bar.cc foo.h
Typical software projects are far more complex than that represented in
As mentioned above, Make operates incrementally: it only regenerates a target file if one of its dependent files has changed since the last time the target was generated. Thus, in principle it should be possible to rebuild a very large project quickly if only a few source files have changed. In practice, though, there are many times when large projects must be completely rebuilt. The most important of these times is the “nightly” build: most development projects rebuild from scratch every night (a clean build) to make sure the system is still consistent and to generate production versions for testing and release. In principle, nightly builds could be incremental, but in practice the dependency information in Makefiles isn't perfect, so the only way to guarantee consistency between the sources and the compiled version is to build from scratch. Thus, nightly builds are virtually always clean builds. Engineering builds (those for the personal use of individual developers) are often incremental, but if a widely-used header file is modified then most of the project may need to be recompiled. Furthermore, integration points (where developers update their personal workspaces with all the recent changes to the shared repository) typically result in massive recompilation.
Because of the size of modern software projects, clean builds can take a long time. Out of 30 commercial software development teams recently surveyed, only 5 had clean build times of less than two hours. More than half had build times in the 5-10 hour range, and a few reported build times of 40 hours or more. Furthermore, most organizations support multiple platforms and versions, which adds a multiplicative factor to the above times.
Long build times have a high cost for companies where software development is mission-critical. They affect not only engineering productivity and release schedules, but also software quality and overall corporate agility. When a developer makes a change to source code it typically takes at least a full day (one nightly build) before the developer can tell whether the change caused a problem.
There have been numerous attempts to improve the performance of Make over the last two decades. They fall into two general classes: “faster” approaches that execute pieces of the build in parallel, and “smarter” approaches that avoid work entirely.
The -j switch in Gmake is an example of the “faster” approach. When this switch is specified, Gmake uses the dependency information in the Makefiles to identify jobs that don't depend on each other and runs several of them concurrently. For example, “-j 4” asks Gmake to keep 4 separate jobs (pieces of the build) running at any given time. Even on a uniprocessor this provides a modest performance improvement by overlapping computation in one job with I/O in another; when run on multiprocessor machines, additional speedup can be obtained. The parallel approach offers a high potential for performance improvement because there are relatively few dependencies between files in a build. In principle, almost every source file in a project could be compiled simultaneously.
Unfortunately, the dependency information in Makefiles is rarely perfect, especially in large projects with hierarchical Makefiles. As a result, parallel builds tend to reorder the build steps in ways that break the build. For example, a library might be used to link an application before the library has been regenerated, so the resulting application does not accurately reflect the state of the library's sources. Bugs like these are very difficult to track down (the source looks good, but the application doesn't behave correctly). Some organizations have attempted to maintain enough dependency information in Makefiles to enable robust parallel builds, but most do their production builds sequentially to be safe.
In addition to out-of-order problems, multiprocessor scalability limits parallel build speed. Multiprocessor servers typically have only 2-8 CPUs, which limits the potential speedup. Larger-scale multiprocessors may have as many as 32 or 64 CPUs, but these machines are quite expensive ($30K per CPU or more, compared to $1-2K per CPU for workstations and small servers). In addition, bottlenecks within the operating system may prevent an application from taking full advantage of large-scale multiprocessors.
A variation of the parallel build approach is distributed builds, where builds are run in parallel using a cluster of independent machines instead of a multiprocessor. This approach solves the scalability and cost issues with a multiprocessor, but still suffers from out-of-order issues. In addition, distributed builds can be impacted by a variety of distributed-system issues including, for example, high overheads for invoking tasks on remote machines which can limit performance; clocks on each of the machines must be carefully synchronized or file timestamps won't be consistent and future builds may fail (a target may appear to be up-to-date even when it isn't); reliability drops as the cluster size increases due to the lack of recovery mechanisms; and cluster nodes typically use a network file system to access files, which can be considerably slower than accessing files locally on a single build machine. Furthermore, reliability issues in the network file system can affect build reliability.
The second general approach for improving build performance is to reduce the amount of work that must be done, either by doing better incremental builds or by sharing results between independent builds. One example of this approach is the “wink-in” facility in Rational Software's ClearMake™ product. In ClearMake, generated files such as object files are stored in a version control system, along with information about how they were generated. When a build requires a new version of a generated file, ClearMake checks to see if that version has already been generated by some other build; if so, the existing file is used instead of creating a new version. This approach can potentially provide significant improvements when several developers each update their private workspaces with the latest sources from the central repository, or in nightly builds where little has changed.
However, ClearMake depends on the system's ability to capture every piece of state that could possibly affect the contents of a generated file. This includes the versions of files that the target file depends on, the exact commands used to generate the target, environment variables that supply additional arguments to the command, system header files, and so on. All of these pieces of state must be considered when deciding whether a previously-generated file can be used instead of regenerating the file. Even something as subtle as the user ID or the time of day could potentially influence the value of a generated file. If a significant factor is not considered, the system will use an incorrect substitute file. In our discussions with software development organizations, we found several groups that have considered the ClearMake approach, but none that are using it for production builds.
In summary, each of the approaches described above offers the potential for speeding up builds, but each makes the build process more brittle by increasing the risk that a build will fail or that it will be inconsistent with the sources. Of the 30 commercial software development teams surveyed, none had been able to achieve more than a 5-10× speedup in a reliable enough way to use for production builds, and only a very few have achieved even a 5× speedup. Most organizations run their builds completely sequentially or with only a small speedup, in order to keep the process as reliable as possible.
A better understanding of the present invention can be obtained from the following detailed description in conjunction with the following drawings, in which:
In the following description, for the purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the present invention. It will be apparent, however, to one skilled in the art that the present invention may be practiced without some of these specific details. In other instances, well-known structures and devices are shown in block diagram form to avoid obscuring the underlying principles of the present invention.
The assignee of the present application has developed a distributed build system which employs sophisticated techniques for monitoring and analysis during the program build process to enable high levels of parallelism. Many of these techniques are described in the co-pending applications entitled Architecture and Method For Executing Program Builds, Filed Mar. 25, 2003, Ser. No. 10/397,995. Certain aspects of the distributed build system will now be described followed by a description of a system and method for intelligently distributing and managing source files within the distributed build system.
A network architecture for processing program builds according to one embodiment of the invention is illustrated generally in
Details of one embodiment of the build machine 200 are illustrated in
At step 300 of
In one embodiment, the central build module 400 appears to the user to be identical to other versions of Make such as Gmake and Nmake, and/or integrated development environments such as Visual Studio™ from Microsoft. In addition, in one embodiment, the central build module 400 is capable of interpreting Makefiles in several different formats, including those supported by both Gmake and Nmake. Moreover, the central build module 400 may be invoked anywhere that other software build utilities such as Make may be invoked (e.g., engineering workstations or dedicated build machines) and may be invoked interactively or as part of a build script. As used herein, the “build machine” refers to any machine from which the build process is invoked.
The cluster manager 202 allocates nodes to build machines for individual builds. Thus, at step 301 of
The node status module 602 continually monitors the status of each of the nodes and maintains a list of those nodes which are operating properly and those which are not. In one embodiment, the node status module 602 employs a network management protocol such as the Simple Network Management Protocol (“SNMP”) (either the original SNMP standard or SNMP 2). More advanced network management tools such as Hewlett Packard® OpenView®, IBM Tivoli® or LANDesk® management from Landesk Software, Inc., may also be implemented within the cluster manager 202.
The node status module 602 may also evaluate the “health” of each node based on the node's performance during the course of one or more program builds. For example, if a particular node fails during a build on multiple occasions, the node status module 602 may designate the node as inoperative (or otherwise “unhealthy”) until it is checked by a system administrator. Similarly, if a particular node is running jobs significantly more slowly than other nodes, then the node status module 602 may flag that node as requiring maintenance. Of course, the underlying principles of the invention are not limited to any particular network management protocol or policy.
In addition, in one embodiment, the cluster manager 202 includes a node management interface 606, allowing system administrators to control the node allocation policy. For example, during the day, the node allocation module 604 may be configured to allow multiple build machines to access the nodes 210-215 for individual builds. By contrast, during the “nightly build” (i.e., in which the entire project is rebuilt), the node allocation module 604 may be configured to lock out all build machines except the build machine from which the nightly build is executed.
In one embodiment, the node allocation module 604 dynamically allocates the nodes 210-215 to requesting build machines. For example, if only one build machine 200 is requesting a set of nodes at given point in time, then the node allocation module 604 may allocate all of the available nodes to the first build machine until a second build machine requests a set of nodes. When the request from the second build machine is received, the node allocation module 604 may then reallocate nodes from the first build machine to the second build machine (i.e., after waiting for the current jobs at those nodes to complete). Various different node allocation policies may be programmed within the node allocation module 604 while still complying with the underlying principles of the invention.
As used herein, the term “job” refers to any individual portion of a program build. As described in detail below, in one embodiment, jobs are executed across a plurality of nodes under the control of the build machine 200. In one particular embodiment, each job is directed to the creation of a single target file. Each job is typically comprised of a series of “operations” required to reproduce the target file (e.g., reading from a file, writing to a file, deleting a file, renaming a file, compiling a source file, linking an object file, . . . etc).
As illustrated in
Referring now to
At step 305 of
module.a: a.o b.o
In this example, the targets a.o and b.o can be regenerated simultaneously, but module.a cannot be generated until both a.o and b.o are complete. The commands that regenerate the target files (i.e., ar, ranlib, and g++) execute on the allocated nodes 210-215 rather than the build machine 200. In the above example, the jobs for a.o and b.o have only a single command, while the job for module.a has two commands. In one embodiment, a node operates on only a single job at a time. However, multiple jobs may be concurrently executed on each node while still complying with the underlying principles of the invention.
Jobs which may be executed in parallel are placed together within a work queue 408 from which they are farmed out to the nodes 210-215 (until a conflict is detected, as described in detail below). Specifically, at 307 of FIG. 3 a, in one embodiment, the job executor modules 456 read the jobs from the work queue 408 and coordinate with the nodes 210-215 to execute the jobs. In one embodiment, each executor module 456 coordinates with a single node at a time to complete a single job (although the specific node used by the executor module 456 may change from job to job). However, the underlying principles of the invention are not limited to any particular pairing of executor modules, nodes and jobs.
In addition, in order to accelerate the build process and to reduce data traffic between the build machine 200 and the nodes 210-215, a file preload module 452, illustrated in
If a particular job requires a source file which has not been preloaded to the node 210 on which the job is executing, as described above, the node 210 may request the file from the executor module 456 on the build machine 200 during the execution of the job. The executor module 456 will then retrieve the file via the versioning file system 407 and provide the file to the requesting node 210.
Returning again to the overall build process set out in
In one embodiment, the processes 502 and 504 invoked by the agent 500 access files such as source files and headers using standard function calls to the OS kernel 530. Thus, standard build applications such as gcc, ar, ranlib, and g++ may be employed on each of the nodes without modification. In one embodiment, the node file system 510 manages a specified portion of the file system (e.g., a specified directory and set of subdirectories within the file system hierarchy). The kernel 530 is aware of the portion of the file system managed by the node file system 510 and forwards any function calls directed to this portion of the file system to the node file system 510 (e.g., function calls associated with file usage). The node file system 510 then supplies the requested files to the processes 502 and 504. In one embodiment, to improve performance, the node file system 510 stores file information entirely in main memory; it doesn't use the local mass storage device for the files of the build.
When a process 502, 504 requests information not present in the node file system's 510's kernel-level cache 512 (e.g., because the file was not preloaded or cached as described above), the node file system 510 issues a request to the user-level agent 500. The agent 500 then relays the request to the central build module 400 using, in one embodiment, a simple TCP-based protocol. In one embodiment, the agent 500 maintains an open TCP socket connection with the build machine 200 throughout the course of the build. As mentioned above, the central build module 400 acts as a central file server for the nodes, reading files via the versioning file system 407 and passing the files to the nodes. The agent 500 receives the file data, forwards it into the OS kernel 530, and notifies node file system 510, which then completes the original request.
In one embodiment, to enable efficient file queries, the node file system 510 provides a virtual image of a particular directory from the build machine, plus an image of all of the files and directories that lie underneath it. The root directory of this subtree may be specified as an argument to the central build module 400 or as an environment variable. In one embodiment, the central build module 400 automatically determines the scope of the virtual directory image based on anticipated file usage. For example, the construction rules 460 contain an indication of the directories of all files required during the build process. As such, the central build module 400 analyzes the construction rules 460 to determine the lowest common ancestor of all directories referenced during the build. Based on its analysis, the central build module 400 provides a virtual image of the lowest common ancestor and all subdirectories beneath the lowest common ancestor to the node file system 510, thereby ensuring that a virtual image is provided for any directory referenced during the build.
In one embodiment, the virtual directory image is chosen to include all of the build-specific files used in the build, but not system files such as shared headers and libraries which may be replicated across the nodes statically. However, a virtual image containing shared headers and libraries may be provided as well in accordance with the underlying principles of the invention. In one embodiment, the virtual image provided by the node file system 510 lasts only for a single build; all cached information is flushed at the end of each build, and different builds may have different roots for the node file system image.
In one embodiment, the node file system 510 implements a usage tracking module 511 which collects file usage data during the course of a build and provides the file usage data to the central build module 400 for analysis, as indicated at 308 and 309, respectively, of
In one embodiment, the node file system 510 or the agent 500 compresses the usage data prior to transmitting it to the central build module 400. For example, if a particular file was read 10 times, then written to, and then deleted, the only relevant information with respect to the central build module 400 is that the file was read at least once and deleted. Similarly, if a particular file was written to 10 times, only the last write to the file is relevant to the central build module 400. As such, only a single “write” operation will be provided as part of the file usage data. Various additional types of file operations may be collapsed down in this manner while still complying with the underlying principles of the invention.
It should be noted that the various functional modules illustrated in
As illustrated in
Once the source files have been transmitted to the nodes, either through preloading or through on-demand fetches, at step 310 in
In one embodiment, the caching policy provided by the caching module 453 indicates that certain types of source files should be cached across jobs. For example, during the build process, certain types of files such as header files (typically identified by the extension ‘.h’) are used frequently across multiple jobs but rarely modified. Accordingly, in one embodiment, the cache management module 451 instructs the nodes to cache these files across multiple jobs. By contrast, other types of files such as object files (typically identified by the ‘.o’ extension) are written once and not frequently used across different jobs. Thus, in one embodiment, the cache management module 451 instructs the nodes 210-215 to flush these files from cache 512 following each job.
In one embodiment, the caching module 453 analyzes the Makefile, supplemental usage data, construction rules 460 and/or the job graph 461 generated by the scheduler 457 to determine precisely which files will be needed at the nodes throughout the course of a build. Assuming that the dependency information and/or job schedule is accurate, this analysis will provide the caching module 453 with an indication of which files are used across multiple jobs and which files are not. Various additional types of data may be factored into the cache management policy implemented by the caching module 453 while still complying with the underlying principles of the invention (e.g., the supplemental usage data provided by the nodes; the size of each file with relatively large files being flushed more frequently to conserve space; whether the files are listed on a prerequisites list, . . . etc).
In one particular embodiment, files are divided into two groups: “shared” and “volatile.” Each of the nodes 210 is configured to cache shared files across jobs and to flush volatile files from the cache 512 after each job. In one embodiment, all files are initially tagged as volatile. If the cache management module 451 identifies more than one reference to a file then it moves the file to the shared group. In one embodiment, if a file in the shared group is modified, the caching module 453 returns the file to the volatile group and it can never be shared again. Furthermore, if a shared file is modified then every node must flush its shared group at the end of the current job (i.e., to ensure that a cached, out-of-date version of the file is not used at a job). With this approach, shared files such as header files are cached, while source files and object files may be flushed after each job.
The foregoing two-group approach for cache management yields a simple yet effective implementation where the caching module 453 doesn't need to continually keep track of which nodes cache which files. The caching module 453 simply identifies to the agent 500 which group a file is in. Then at the end of each job, the caching module 453 identifies to the agent 500 which groups must be flushed. In one embodiment, the agent 500 segregates files in different groups to make the flushing operation operate more efficiently.
Of course, the underlying principles are not limited to a two-group caching approach. For example, as mentioned above, in one embodiment, other variables such as file size may be factored into caching decisions. For example, if a file in the “shared” group is above a certain size, then the caching module 453 may instruct the nodes to flush the file to conserve space, notwithstanding its “shared” designation. Alternatively, files above a certain threshold size may simply be marked as “volatile,” and therefore automatically flushed by the nodes.
In one embodiment, the cache management module 451 does not flush a file during a job; rather, only after the job completes. Alternatively, files may be flushed during the execution of each job. This is one consequence of the technique of freezing the file system state for each job when it begins (as described below).
Following the execution of jobs, the central build module invokes a “terminator” module 402 shown in
In one embodiment, the conflict detection module 404 uses two measures of time/order to detect conflicts. The first measure is clock time, which reflects the actual order in which events occur. Each job has a start time and a stop time, both of which are clock times. Several jobs can have the same start time, but exactly one job has a given stop time. The file versions seen by a job are determined by its start time: once a job has started, file modifications made by other jobs will not be visible to the job. Conversely, no modifications made by a job are made available to other jobs until the job completes. Moreover, in one embodiment, file updates to the central file repository 410 are atomic: either all of a job's modifications are made available to other jobs, or none of them. This approach requires the versioning file system 407 to maintain multiple versions of each file and pass different versions to different jobs. The mechanism used by the versioning file system 407 for tracking file versions is described below.
The second measure used by the conflict detection module 404 is sequential order, the order in which jobs would execute in a sequential build. The conflict detection module 404 uses the sequential order along with file versions maintained by the versioning file manager 407 to define correctness: a parallel build is correct if the file versions used by each job are the same as those that would be used if the build were executed in sequential order. If a build uses different versions than this, then a conflict has occurred.
This concept is illustrated graphically in
As indicated in
Once the correct file versions have been identified, the conflict resolution module 406 must re-execute the job which resulted in the conflict. Thus, at 322 in
In one embodiment, the versioning file system 407 stores the different file versions used throughout the build process within a back end file store 411. In one embodiment, the back end file store 411 is implemented entirely within a high speed memory (e.g., DDR SDRAM) to accelerate file access. However, depending on the size of the program build and/or the capabilities of the build machine 200, the back end file store 411 may be comprised of both a high speed memory component and a mass storage component (e.g., a hard drive). In one embodiment, files are split between the high speed memory and mass storage memory based on factors such as the probability that the different file versions will be required again during the course of the build. For example, object files (“.o” files) will typically be required in a linking step at some point during the program build. As such, it may make sense to store these files within the high speed memory. By contrast, executable files, which typically represent a final result of a build operation, will not typically be required later in the build process and may therefore be stored within the mass storage memory. Various other factors may be evaluated to determine which files to store within the high speed memory and which files to store within the mass storage memory.
A conflict typically indicates that the information contained within the Makefile is incomplete or inaccurate. For example, if the Makefile used for the build illustrated in
In one embodiment, the supplemental usage data stored on the build machine does not merely indicate missed dependencies which result in a conflict, as described above. The usage information also identifies redundant dependencies within the Makefile—i.e., objects listed as being dependent which are not. As such, in subsequent builds, the job scheduler 457 may use this information to run jobs in parallel which would not have been run in parallel using the Makefile alone. Conversely, the usage data may also identify data objects which are dependent but which did not result in a conflict (e.g., because the jobs were simply executed in the correct order by chance). In sum, because each file utilized during the build process is monitored by the node file system 510, the central build module 400 is provided with complete and accurate file dependency information for future builds, thereby significantly enhancing the speed and efficiency of the build process.
Moreover, in one embodiment, the supplemental usage data is not merely used to schedule jobs. Rather, the preload module 452 analyzes the supplemental usage data (in lieu of or in addition to Makefile) to precisely identify the source files needed at each node prior to start of each job. As such, groups of files may be streamed between the central build module 400 and the agents 500, thereby eliminating virtually all of the on-demand fetches that would be required otherwise. As previously mentioned, preloading files in this manner is significantly more efficient than a collection of synchronous agent requests to satisfy cache misses. This architecture not only speeds up the build process but also increases the scalability of the overall system architecture.
In one embodiment, the supplemental usage data includes the amount of time each job takes to complete in addition to the file dependency information. This information is then used by the job scheduler 457 in subsequent program builds to schedule jobs more efficiently. As described above, during the course of a program build, numerous jobs may be identified as independent of one another and may therefore be placed together in the work queue. By way of example, and not limitation,
By contrast, in the example shown in
In addition, in one embodiment, the supplemental usage data identifies the processing capabilities of each of the nodes in the cluster. The scheduler module 457 may then analyze this information to pair up relatively low powered nodes with the relatively smaller jobs and relatively higher powered nodes with relatively larger jobs (e.g., such as Job 11 in
In one embodiment, the processing capabilities of each node may be measured by running periodic benchmark testing. For example, every day, week, month, etc., the cluster manager 202 and/or build machine 200 may automatically invoke benchmark testing of the processing capabilities of each of the current set of nodes. Moreover, each of the nodes may be configured to conduct benchmark testing on its own and report back to the cluster manager 202 and/or build machine 200 periodically. Alternatively, in one embodiment, at the end of a build, the average time it took for each node complete each of its assigned jobs may be calculated. Assuming that the jobs were randomly distributed to each of the nodes, the average time may provide an accurate indication of the relative processing capabilities of each machine.
As described above, in one embodiment, the versioning file system 407 caches multiple versions of files during the build process so that, if a conflict is detected, if can identify the appropriate file version and re-execute the job which created the conflict. In one embodiment, to track file versions, the versioning file system 407 employs a unique file management architecture designed to keep track of two entities over time: file contents and file names. For each regular file there is a content object that describes the attributes and data for the file. The file's data may be cached in memory or stored on disk in the local file system. A name object is a reference to a content object and corresponds to a directory entry. As in operating systems such as Unix that provide hard links, multiple names may exist which refer to the same content. For each directory there is a content object that contains the directory's attributes and a hash table that maps from string file names to name objects.
These concepts are illustrated in
A second example is illustrated in
As illustrated by the foregoing examples, each name object and content object contains a chain of versions. When a file is modified without first being deleted a new version is added to the content object for the file. When a file is deleted and then re-created, a new version is added to the name for the file; it refers to a new content object for the new file data. In one embodiment, each version identifies the job that created it which, in turn, provides timing information about when the version came into existence. Name version chains also include null versions corresponding to periods of time when the object didn't exist.
In one embodiment of the invention, a directory content object does not contain multiple versions for its content. Instead, it keeps multiple versions for its attributes, plus a hash table with entries for all of the names ever referenced in the directory. The name objects referenced in the hash table have their own version chains which can be analyzed to determine whether they exist at any given point in time.
In one embodiment, the nodes 210-215 are not aware of the different versions used for file names and contents. Rather, at any given time, a node is dedicated to a single job, so it only works with the appropriate file versions for that job. In one embodiment, nodes refer to file names and contents using unique identifiers that correspond to the name objects and content objects. The central build module 400 maps these to its internal data structures and then uses the appropriate version for the node's current job.
In one embodiment, to locate the correct file version, the versioning file system 407 supports two principal query operations: file lookup and data access. The file lookup operation is provided with the content object for the directory, the name of a file within that directory, and the job that requested the lookup. The versioning file system 407 must then return the appropriate content object (i.e., the data) associated with the name. To do so, it first looks up the file name in the directory's hash table and then scans the chain of versions for that name. It examines the job that created each version and ignores all versions created by jobs later in sequential order than the current job, as well as versions created by jobs that completed after the current job started. Of the name versions that remain, the latest one in sequential order is used. The file manager returns the content object referred to by that name version.
The data access operation is provided with the identified content object and the job that requested the lookup. Using this information, it scans the version list for the content object, using the same selection criteria as for names. It ignores all versions created by jobs later in sequential order and versions created by jobs that completed after the current job started. Of the content versions that remain, the latest one in sequential order is used.
In one embodiment, the conflict detection module 404 detects conflicts using the same lookup operations described above, except that it uses the current time instead of the job's start time. It then compares this version with the one actually used. In other words, it determines whether the same versions of files would be used if the job were to be executed after all previous jobs in sequential order have finished. If not, then a conflict has occurred.
Almost all software projects contain multiple modules, each with its own Makefile (or other data object containing file dependency information). The Makefiles are typically structured hierarchically, with top-level Makefiles invoking lower-level Makefiles recursively, so that the entire project can be built at once starting with the topmost Makefile. A different Makefile is often used within each subdirectory. The Makefile in a particular directory contains dependency information for the files in that directory alone. During the program build, the Make utility is recursively called to process the Makefiles in each individual subdirectory. Large projects can contain hundreds or even thousands of Makefiles.
Hierarchical Makefiles create unique challenges for parallel builds. Because an independent sequential invocation of Make is made for each Makefile it is difficult to manage concurrency and dependencies across Makefiles. That is, each invocation of Make is a separate process which does not share dependency information with other Make processes. A typical target for invoking lower-level Makes might look something like this:
Unfortunately this will run the lower-level Makes sequentially, reducing the efficiency of the parallel build. The target could be redefined to expose more concurrency, as follows:
all: all-dir1 all-dir2 all-dir3
However, it is difficult to share the nodes of the cluster among the lower-level Makes to optimize overall performance. In addition, most of the problems with incomplete dependency information result from interactions between Makefiles. It is difficult to detect these interactions when each Makefile is managed by a different process.
For example, if this approach were employed within the distributed architecture illustrated in
One embodiment of the invention solves these problems by coalescing all of the nested Makes into one large build handled by the original central build module 400. As illustrated in
In one embodiment, the recursive Make redirector 900 does not notify the agent directly that a recursive Make invocation has occurred. Rather, the recursive Make redirector 900 stores or modifies a file on the node 210 indicating that a recursive Make invocation has occurred. After the process 902 terminates, the agent 500 searches for the file and identifies the recursive Make invocation by the existence of the file (or the modification of the file). Moreover, in one embodiment, the recursive Make redirector is programmed directly within the agent 500 itself. As such, in this embodiment, “notification” of the agent 500 is not required.
As indicated in
In one embodiment, the versioning file system 407 manages all of the file versions for each of the recursive Make invocations. Moreover, the central build module 400 relies on the conflict detection and resolution techniques described above to detect and correct missed dependencies between recursive Make invocations. Because a single sequential order exists for all of the jobs in all of the Makefiles, the conflict detection module 404 is able to compare the file versions used in each job with the correct file versions (i.e., those which would have been used in a sequential build).
Another benefit of coalescing Makefiles in this manner is that it reduces file traffic between the central build module 400 and the central file repository 410. For example, if a separate instance of Make is invoked for each Makefile, each instance must read its own file information (such as timestamps) even though many of the same files are referenced across multiple Makefiles. Using the caching techniques described above, file information is cached and shared across all of the Makefiles, thereby reducing node file requests and speeding up the build process.
In some cases, a job with a recursive Make invocation may include a command following the recursive Make invocation in the job script which depends on the results of the recursive Make invocation. Because the Make invocation is not executed directly on the node, as described above with respect to
In this example, the subsequent command cat foo depends on foo which is the result of the recursive Make invocation. Because the recursive Make invocation was not actually executed on the node, the result foo will not be available and the command cat foo will create a conflict.
To solve this problem, in one embodiment of the invention, the recursive Make redirector 900 (or the agent 500) freezes the job script as soon as a recursive Make instance is encountered. The agent 500 then transmits the remaining portion of the script back to the central build module where it is scheduled as a separate job which is dependent on the recursive Make instance. For example, it may be parsed by the parser 450 and included as a construction rule 460 indicating the dependency on the recursive Make instance. Based on the new construction rule, the scheduler 457 schedules the remaining portion of the script to run only after the recursive Make instance has completed.
Alternatively, in one embodiment, the script is split into two separate jobs prior to being run on the node. For example, prior to execution, the scheduler 457 may analyze each script with a recursive Make instance to determine if any subsequent commands within the script depend on the results of the recursive Make instance. If so, then the scheduler 457 separates the script into two discrete jobs within the job graph 461, one which includes the recursive Make instance, and one which depends on the results of the recursive Make instance.
The underlying principles of the invention are not limited to any particular hardware or networking configuration for the nodes 210-215, the build machine 200 and/or the cluster manager 202. However, in one embodiment, the nodes 210-215 are a plurality of relatively inexpensive rack-mount servers such as Dell PowerEdge™ servers having 1 GHz Processors, 512 Mbytes of double data rate (DDR) random access memory and 40 Gbyte hard drives. In one embodiment, the nodes are coupled together and/or to the cluster manager 202 and build machine 200 via a fast Ethernet switch such as a Dell PowerConnect™ Ethernet switch.
Any desktop computer system communicatively coupled to the nodes 210-215, and capable of executing an instance of the central build module 400 may be used as the build machine 200. Similarly, the cluster manager 202 may be implemented using any workstation or server communicatively coupled to the network. However, for large program builds (e.g., such as the “nightly” build), the build machine is preferably a relatively high powered workstation or server. For example, in one embodiment, the build machine 200 is equipped with two or more Intel® Xeon™ processors operating at 2.80 GHz; 4 Gytes of dual channel DDR 266 MHz SDRAM memory; and a 600 or more Gbytes SCSI hard drive. Ideally, for large program builds, the build machine should be directly coupled to the same Ethernet switch as the nodes 210-215. Of course, the required hardware specifications for each of the system components will vary, depending on the size of the program builds being executed.
Even if caching policies are employed to preload source files to cluster nodes and to retain the source file at the cluster nodes across multiple jobs (as described above) all source files must still be provided to the cluster nodes 210-215 from the build machine 200 (at least initially). Moreover, the target files, file usage data and other build information must be provided to the build machine 200 following the completion of each job. As such, the communication channel coupling the build machine 200 to the rest of the build system will typically represent a major performance bottleneck. Accordingly, to reduce the amount of data transmitted between the build machine and the rest of the system (e.g., over the link between the Ethernet switch and the build machine, if an Ethernet configuration is used), one embodiment of the invention employs a file distribution mechanism which allows peer-to-peer communication of data files between the cluster nodes 210-215.
If the source file is stored on another cluster node then, at 1204, the file tracking module 1100 transmits an indication of the cluster node(s) where the source file is located to Node A (Node B in the example). In one embodiment, the file transfer module 1100 does not merely provide an indication of a single node on which the source file is stored. Rather, the file transfer module 1100 provides a prioritized list of cluster nodes on which the source file is stored. At 1206, Node A requests the source file from the highest priority node on the list, i.e., Node B in the example.
The list of nodes may be prioritized in a variety of ways while complying with the underlying principles of the invention. For example, in one embodiment, nodes which requested the source file more recently are placed relatively higher up on the list. Thus, in the foregoing example, Node A would be placed higher up on the list than Node B. Accordingly, if another node—e.g., Node C—subsequently requested the same file, it would be redirected to Node A. Node A would then provide the file to Node C, assuming that it was not busy servicing another node, as described below. Alternatively, or in addition, in one embodiment, the file tracking module 1100 include load balancing logic which generates the prioritized list based on the current processing and/or communications load on each of the cluster nodes. For example, if Node B in the foregoing example is currently working on a large, processor-intensive job, or is currently transmitting a file to another node, then the file tracking module 1100 may place Node B relatively lower on the prioritized list than other nodes which are relatively less busy. In one embodiment, the file tracking module 1100 analyzes the supplemental usage data collected from previous builds (e.g., including the amount of time it took for each job to complete) when generating the prioritized list. In this manner, the file tracking module 1100 can schedule the peer-to-peer transfer of files between nodes in the most efficient manner possible.
Returning to the flowchart illustrated in
If Node B is busy providing another file to another cluster node, or does not have the source file for some reason (e.g., the file was deleted from Node B, Node B temporarily dropped out of the cluster, . . . etc), then at 1210, alternate locations of the source file are identified. For example, Node A may select the next node from the prioritized list of nodes (i.e., the node with the next-highest priority below Node B). Alternatively, if no additional nodes are included on the list, then Node A may retrieve the source file directly from the file tracking module 1100. Regardless of how the source file is provided to Node A, at 1214, the file tracking module 1100 updates the file location data 1101 to include Node A in the list of nodes which contain the source file.
In one embodiment, each time a requesting node receives a source file from a peer node, the identity of the peer node is stored on the requesting node. Thus, if an alternate location for the file is required (e.g., because a node is busy), the alternate location may be provided directly from the peer node to the requesting node (i.e., rather than merely from the file tracking module 1100). For example, if Node A requests the source file from Node B and Node B is busy, as described above, in one embodiment of the invention, Node B may transmit an indication of the node from which it received the source file, e.g., Node C, to Node A. Node A may then attempt to retrieve the source file directly from Node C. Reallocating file requests in this manner ensures that a particular node does not become overloaded providing multiple source file to multiple cluster nodes at the same time.
Throughout the build process, the same file may be requested at substantially the same time by a plurality of nodes. For example, it is not uncommon for the same header file to be needed at the same time by multiple jobs. Using the techniques described above, the required file may be concurrently streamed from one node to the next, before it is fully received by any individual node, thereby significantly reducing the bandwidth between the build machine 200 and the rest of the system, and the and the delay for the file upload to subsequent nodes. In one embodiment, the last requesting node will only be N+1 data packets behind with it's download, where N represents the number of nodes in the chain of nodes requesting that particular file.
One example of this operation is illustrated in
As illustrated in
Embodiments of the invention may include various steps as set forth above. The steps may be embodied in machine-executable instructions. The instructions can be used to cause a general-purpose or special-purpose processor to perform certain steps. Alternatively, these steps may be performed by specific hardware components that contain hardwired logic for performing the steps, or by any combination of programmed computer components and custom hardware components.
Elements of the present invention may also be provided as a machine-readable medium for storing the machine-executable instructions. The machine-readable medium may include, but is not limited to, floppy diskettes, optical disks, CD-ROMs, and magneto-optical disks, ROMs, RAMs, EPROMs, EEPROMs, magnetic or optical cards, propagation media or other type of media/machine-readable medium suitable for storing electronic instructions. For example, the present invention may be downloaded as a computer program which may be transferred from a remote computer (e.g., a server) to a requesting computer (e.g., a client) by way of data signals embodied in a carrier wave or other propagation medium via a communication link (e.g., a modem or network connection).
In the foregoing description, for the purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the present invention. It will be apparent, however, to one skilled in the art that the present invention may be practiced without some of these specific details. For example, while the embodiments described above focus specifically on “Makefiles” and the “Make” utility, the underlying principles of the invention may be employed within the context of virtually any program build environment. By way of example, and not limitation, the same principles may employed within the context of the “Vesta” system developed by the Systems Research Center of Digital Equipment Corporation (DEC) (Vesta uses a “model file” analogous to the Makefile) and/or Microsoft's Visual Studio.
In addition, the method illustrated in
In other instances set forth above, well-known structures and devices are shown in block diagram form to avoid obscuring the underlying principles of the present invention.
Accordingly, the scope and spirit of the invention should be judged in terms of the claims which follow.
|Cited Patent||Filing date||Publication date||Applicant||Title|
|US5325533||Jun 28, 1993||Jun 28, 1994||Taligent, Inc.||Engineering system for modeling computer programs|
|US5442791||May 12, 1994||Aug 15, 1995||Aggregate Computing, Inc.||Integrated remote execution system for a heterogenous computer network environment|
|US5500881||Jul 12, 1993||Mar 19, 1996||Digital Equipment Corporation||Language scoping for modular, flexible, concise, configuration descriptions|
|US5574898||Jan 8, 1993||Nov 12, 1996||Atria Software, Inc.||Dynamic software version auditor which monitors a process to provide a list of objects that are accessed|
|US5692193||Mar 31, 1994||Nov 25, 1997||Nec Research Institute, Inc.||Software architecture for control of highly parallel computer systems|
|US5742778||Feb 16, 1996||Apr 21, 1998||Hewlett-Packard Company||Method and apparatus to sense and multicast window events to a plurality of existing applications for concurrent execution|
|US6026413||Aug 1, 1997||Feb 15, 2000||International Business Machines Corporation||Determining how changes to underlying data affect cached objects|
|US6094528||Oct 24, 1996||Jul 25, 2000||Sun Microsystems, Inc.||Method and apparatus for system building with a transactional interpreter|
|US6237143||Sep 17, 1998||May 22, 2001||Unisys Corp.||Method and system for monitoring and capturing all file usage of a software tool|
|US6457170||Aug 13, 1999||Sep 24, 2002||Intrinsity, Inc.||Software system build method and apparatus that supports multiple users in a software development environment|
|US6938252||Dec 14, 2000||Aug 30, 2005||International Business Machines Corporation||Hardware-assisted method for scheduling threads using data cache locality|
|US6948163||Jan 29, 2002||Sep 20, 2005||International Business Machines Corporation||Remote electronic file builder|
|US6988139||Apr 26, 2002||Jan 17, 2006||Microsoft Corporation||Distributed computing of a job corresponding to a plurality of predefined tasks|
|US7003759||Jun 21, 2001||Feb 21, 2006||Codefast, Inc.||Collection makefile generator|
|US7055128||Dec 4, 2000||May 30, 2006||Microsoft Corporation||System and method to communicate, collect and distribute generated shared files|
|US7197547 *||May 10, 2000||Mar 27, 2007||Andrew Karl Miller||Load balancing technique implemented in a data network device utilizing a data cache|
|US20020147855||Mar 7, 2002||Oct 10, 2002||International Business Machines Corporation||Method and system for cross platform, parallel processing|
|US20020199170||Jun 21, 2001||Dec 26, 2002||Jameson Kevin Wade||Collection makefile generator|
|US20030126118 *||Jan 2, 2002||Jul 3, 2003||International Business Machines Corporation||Method, system and program for direct client file access in a data management system|
|US20030126194 *||Jan 7, 2003||Jul 3, 2003||Kabushiki Kaisha Toshiba||Agent system and information processing method for such system|
|US20030163799 *||Feb 22, 2002||Aug 28, 2003||Vasilik Kenneth Eric||Iterative software development environment with prioritized build rules|
|US20040073904||Oct 15, 2002||Apr 15, 2004||Nokia Corporation||Method and apparatus for accelerating program execution in platform-independent virtual machines|
|EP0859314A2||Dec 18, 1997||Aug 19, 1998||Sun Microsystems, Inc.||Distributed make methods, apparatus, and computer program products|
|1||Final Office Action for U.S. Appl. No. 10/397,995, mailed Sep. 3, 2008.|
|2||Free Software Foundation: "GNU Make Manual" Online, Jul. 8, 2002, XP002343577-Retrieved from the Internet on Sep. 5, 2005, URL: http://www.gnu.org/software/make/manual/html-mono/make.html (11 pgs. two-sided).|
|3||J., Knutson, "IBM* Technical Disclosure Bulletin", vol. 39, No. 6, Jun. 1996, pp. 63-68.|
|4||Martin Pool: "distcc User Manual", Chapter 2: ;Using DISTCC, Online, Dec. 1, 2002, XP002343569-Retrieved from the Internet on Sep. 5, 2005, URL: http://web.archive.org/web/20021201095253/distcc.samba.org/manual/html/distcc-2.html (4 pgs. two-sided).|
|5||Non-Final Office Action for U.S. Appl. No. 10/397,995, mailed Dec. 17, 2008.|
|Citing Patent||Filing date||Publication date||Applicant||Title|
|US7610355 *||Aug 2, 2007||Oct 27, 2009||International Business Machines Corporation||Transferring web contents|
|US7886270 *||Nov 28, 2006||Feb 8, 2011||International Business Machines Corporation||Methods, systems, and computer program products for file version control management|
|US8010937 *||Sep 24, 2007||Aug 30, 2011||Apple Inc.||Method and apparatus for application building using build styles|
|US8015427||Apr 23, 2007||Sep 6, 2011||Netapp, Inc.||System and method for prioritization of clock rates in a multi-core processor|
|US8099571||Aug 6, 2008||Jan 17, 2012||Netapp, Inc.||Logical block replication with deduplication|
|US8150800 *||Mar 28, 2007||Apr 3, 2012||Netapp, Inc.||Advanced clock synchronization technique|
|US8245192 *||Nov 18, 2008||Aug 14, 2012||Sprint Communications Company L.P.||Independent software development zones|
|US8321380||Apr 30, 2009||Nov 27, 2012||Netapp, Inc.||Unordered idempotent replication operations|
|US8458661 *||Jun 4, 2013||Ebay Inc.||Distributed parallel build system|
|US8473690||Oct 30, 2009||Jun 25, 2013||Netapp, Inc.||Using logical block addresses with generation numbers as data fingerprints to provide cache coherency|
|US8527937||Aug 1, 2011||Sep 3, 2013||Apple Inc.||Method and apparatus for application building using build styles|
|US8655848||Feb 26, 2010||Feb 18, 2014||Netapp, Inc.||Unordered idempotent logical replication operations|
|US8671072||Sep 14, 2009||Mar 11, 2014||Netapp, Inc.||System and method for hijacking inodes based on replication operations received in an arbitrary order|
|US8799367||Oct 30, 2009||Aug 5, 2014||Netapp, Inc.||Using logical block addresses with generation numbers as data fingerprints for network deduplication|
|US8849888 *||Dec 8, 2012||Sep 30, 2014||International Business Machines Corporation||Candidate set solver with user advice|
|US8862644 *||Nov 28, 2012||Oct 14, 2014||Translattice, Inc.||Data distribution system|
|US8868963||Dec 11, 2012||Oct 21, 2014||International Business Machines Corporation||Dynamically configurable placement engine|
|US8874751 *||Dec 1, 2011||Oct 28, 2014||International Business Machines Corporation||Candidate set solver with user advice|
|US8898505||Dec 1, 2011||Nov 25, 2014||International Business Machines Corporation||Dynamically configureable placement engine|
|US8972937||May 28, 2013||Mar 3, 2015||Ebay Inc.||Distributed parallel build system|
|US9043430||Aug 12, 2013||May 26, 2015||Netapp, Inc.||Using logical block addresses with generation numbers as data fingerprints for network deduplication|
|US9081646 *||Jan 22, 2010||Jul 14, 2015||Red Hat, Inc.||Building packages of functionally different programs from source code of a single program|
|US9158579||Nov 10, 2008||Oct 13, 2015||Netapp, Inc.||System having operation queues corresponding to operation execution time|
|US9244679 *||Sep 12, 2013||Jan 26, 2016||Symantec Corporation||Systems and methods for automatically identifying changes in deliverable files|
|US20070234320 *||Sep 25, 2006||Oct 4, 2007||Ebay Inc.||Distributed parallel build system|
|US20070245323 *||Apr 13, 2006||Oct 18, 2007||Apple Computer, Inc.||Sharing compiled versions of files|
|US20080040448 *||Aug 2, 2007||Feb 14, 2008||International Business Machines Corporation||Transferring web contents|
|US20080077908 *||Sep 24, 2007||Mar 27, 2008||Anders Bertelrud||Method and apparatus for application building using build styles|
|US20080126440 *||Nov 28, 2006||May 29, 2008||International Business Machines Corporation||Methods, systems, and computer program products for file version control management|
|US20080243950 *||Mar 28, 2007||Oct 2, 2008||Erez Webman||Advanced clock synchronization technique|
|US20080263384 *||Apr 23, 2007||Oct 23, 2008||Miller Steven C||System and method for prioritization of clock rates in a multi-core processor|
|US20090070750 *||Sep 25, 2006||Mar 12, 2009||Ebay Inc.||Distributed parallel build system|
|US20090292994 *||May 23, 2008||Nov 26, 2009||International Business Machines Corporation||Automated content tracking and conversion|
|US20110185352 *||Jul 28, 2011||Glauber Costa||Building packages of functionally different programs from source code of a single program|
|US20110239195 *||Sep 29, 2011||Microsoft Corporation||Dependence-based software builds|
|US20130144931 *||Dec 8, 2012||Jun 6, 2013||International Business Machines Corporation||Candidate set solver with user advice|
|US20130145032 *||Dec 1, 2011||Jun 6, 2013||International Business Machines Corporation||Candidate set solver with user advice|
|US20130159366 *||Nov 28, 2012||Jun 20, 2013||Translattice, Inc.||Data distribution system|
|US20150324178 *||May 9, 2014||Nov 12, 2015||Gerald Arnold||Hash-based change tracking for software make tools|
|U.S. Classification||717/120, 717/122, 717/121|