Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Image Removed

...

The profile XML file is used to define how Automatic Interception Interface should handle the various processes involved in a distributed job.

An Example

In this simple example, our goal is to distribute a main process run by MainProcess.exe. Our main process runs several sub-processes (DummySubProcess.exe) and ends with a link step (link.exe).

In this scenario, we would probably only want to distribute execution of sub-processes (DummySubProcess.exe). Distributing execution of the single link.exe task to a remote machine would involve sending a relatively large amount of data (.obj files, etc.) across the network, so it would probably be best to let this task always run on the initiating machine.

Syntax

The following profile.xml file can be used to run Automatic Interception Interface:

<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<Profile FormatVersion="1">
    <Tools>
        <Tool Filename="MainProcess" AllowIntercept="true" />
        <Tool Filename="DummySubProcess" AllowRemote="true" />
        <Tool Filename="link" AllowRemote="false" />
    </Tools>
</Profile>

This command specifies that DummySubProcess.exe is to be executed 10 times:

IBConsole  /command="MainProcess.exe DummySubProcess.exe 10"  /profile="profile.xml"

Explanation

  • "MainProcess.exe" is the main process that is running. Because this process spawns sub-processes whose execution we want IncrediBuild to distribute (DummySubProcess.exe and link.exe), this process is marked with the AllowIntercept attribute set to "True".
  • As we want to distribute execution of "DummySubProcess.exe" to remote machines, "DummySubProcess" is specified with AllowRemote set to "True".
  • As we want "link.exe" to run locally, it is specified with AllowRemote set to "False". Omitting this line from the profile.xml file would have the same effect, as the default for both AllowIntercept and AllowRemote is "False".

Usage

Once your profile.xml file is ready, it can be used with the following tools to distribute the build process using  Automatic Interception Interface:

Samples and Resources

The following is a detailed specification of the Profile XML file format. In addition to the information below, note the following useful resources:

  • Under the IncrediBuild installation folder, you will find a standard .xsd schema file ("Schema for Profile file.xsd") that you can use to validate an existing Profile XML file. .xsd files can be read by MS Visual Studio and many XML-related editors.
  • Several pre-built working samples of projects (including Profile XML files) using Automatic Interception Interface are installed with IncrediBuild. See this section for more details.

Profile XML File Specification

The Profile XML file structure is as follows:

<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<Profile FormatVersion="1">
    <Tools>
        <Tool ATTRIBUTES />
        ...
    </Tools>
</Profile>

  • The Tool element defines the tool or tools that IncrediBuild should handle during the distributed process.
  • Multiple Tool elements may be included under the Tools element.

A Tool element should be added for the following cases:

...

Tool Element Attributes

...

<Tool Filename="cl" AllowRemoteIf="-c,/c" />

...

  • firstparam – will echo the first parameter from the task's command line.
  • lastparam – will echo the last parameter from the task's command line.

...

VCCompiler: When set to True (the default is False), this tool and its sub-processes are handled in the same way as the Visual Studio C/C++ compiler in terms of PDB and PCH handling. Use this property only when attempting to distribute execution of the Visual Studio C/C++ compiler through the IB Interfaces.
The VCCompiler option is only available with the Visual Studio C/C++ Build System extension package.

...

<Tool Filename="gcc" AllowRemote="true" DeriveCaptionFrom="lastparam" AdditionalOutputMask="*.log"/>

Note:

...

Important Notes

  • The main build tool executable should be defined in the profile XML with the AllowIntercept attribute set to "True" (see XML profile files in the sample projects). Note that if you are running IBConsole.exe with the "/COMMAND=" syntax, the tool specified in the /COMMAND argument (or cmd.exe if the tool is a .bat file) is implicitly given the AllowIntercept behavior.
  • If the process to be executed remotely is spawned by a child process of the main build tool, the entire hierarchy of processes starting from the main build tool should be specified with the AllowIntercept attribute set to "True". For example, if the main build tool is "make.exe", which executes "runner.exe", and "runner.exe" executes "MyTool.exe" which is the process whose execution we wish to distribute, then both "make.exe" and "runner.exe" must be specified with the AllowIntercept attribute set to "True".
  • Executables spawned by a tool specified with AllowRemote set to "True" should not be specified with AllowRemote set to "True". Remote child processes will be handled automatically by IncrediBuild.
  • IncrediBuild can distribute custom steps, execute tasks, and special build tools using the profile xml only with Visual Studio 2010 and later. For further information, take a look at the last section in the BuildConsole section.

Automatic Interception Interface XML Schema

This section describes the XML schema that is used to build the configuration file for Automatic Interception Interface. A detailed explanation of the XML schema can be found in the Using XML Interface section .

The XML file defines the behavior of the integration using Interception Interface, including those processes that can be distributed and those that will run locally. The XML file describes a set of rules that apply to tasks being executed by IncrediBuild. A rule applies to all tasks sharing the same name. For example, the XML defines the task "Render" as AllowRemote, A job may include several instances of Render; each will be processed remotely according to the rule. IBConsole uses this XML file as a profile, which defines the way the processes will be handled.

<Tool Filename="SubProcess" AllowRemote="true" DeriveCaptionFrom="lastparam"
         IdentifyTaskOutput="true"/>

Example 1

To specify that a tool named LogMe returns all the .log and .dat files that it generates to the initiating machine, LogMe should be defined as follows in the profile XML:

<Tool Filename="LogMe" AllowRemote="true" DeriveCaptionFrom="lastparam"  
         AdditionalOutputMask="*.log"/>,*.dat

Example 2

Assuming that LogMe returns all kinds of files, but you are only interested in the .log files that it returns. In this case, LogMe should be defined as follows in the profile XML:

<Tool Filename="LogMe" AllowRemote="true" DeriveCaptionFrom="lastparam"  
         OutputFileMasks="*.log"/>
  

Note: Tool is the name of the process to which the rule applies.

...

Attribute

...

Description

...

Values/Notes

...

Filename

...

The name of the tool (filename extension is optional). Note that wildcards (e.g. "TOOL*.exe") are allowed to support a single Tool definition that covers multiple tool names.

...

AllowRemote

...

Execution of Tools with this attribute set to "True" are distributed to remote machines.

...

True/False

...

AllowRemoteIf

...

[Optional]
Conditional Value to determine if a task should be distributed, or marked for execution on the local Agent, based on its commandline. 

If the Value specified with this attribute is found in the tasks commandline, the task will be marked as allowed to be distributed. 

...

Should be used Instead of the AllowRemote” attribute.

Several values can be specified using comma separation.

...

AllowPredictedBatch

...

1)      Two Instances of the executable will not attempt to write to the same file (e.g. output file, log file)

...

Works only for Visual Studio solutions which have a defined profile.xml file. This setting is ignored for regular Dev Tools  build.

...

AllowIntercept

...

Tools with this attribute set to "True" are monitored by Automatic Interception Interface. Any tool responsible for direct or indirect execution of remotely executed Tools (Tools with AllowRemote set to "True") should have AllowIntercept set to "True".

...

True/False

...

SkipIfProjectFailed: associated with the Tool and Task elements

...

[Optional]
Defines the behavior in case a failure occurs. (For example: Skip the Link task if a Compile task failed.)

...

WorkingDir: Project, TaskGroup, and Task elements

...

[Optional]
Defines the working directory used for tasks. The deepest occurrence in the XML definition locally overrides any parent definition. For example: In the demo XML, the filename passed to the application does not contain the full path, but because the Project element defined a WorkingDir, the application can locate the file.

...

DeriveCaption
From

This attribute controls the caption that appears in the task's bar in Monitor Progress View.

...

firstparam – echoes the first parameter from the task's command line.

lastparam – echoes the last parameter from the task's command line.

...

SingleInstance
PerAgent

...

Tools with this attribute set to "True" never run concurrently on a single Agent – even if the Agent has multi-processor or multi-core hardware.
Note that this attribute does not prevent tools from running on different Agents at the same time.

...

True/False

...

AllowRestartOn
Local

...

For tools with this attribute set to "True", the initiating Agent is allowed to apply the "Restart remote processes on local machine when possible" setting for performance optimization.

Important: This attribute should not be set to True for tools that write incrementally to output files: if the local instance of the tool is terminated, an incomplete output file could result.

...

True/False

...

SuccessExitCodes

...

[Optional]
Code(s) that will be considered success exit codes for the tool.

...

Comma-separated list of numerical values.
Ranges may be used (e.g.: '2..19').
Default success exit code: 0

...

WarningExitCodes

...

[Optional]
Code(s) that will be considered warning exit codes for the tool.

Tasks returning this exit code are displayed as a yellow bar in the Execution Monitor Progress page, and are counted as warnings in the Summary page.

...

Comma-separated list of numerical values.
Ranges may be used (e.g.: '2..19').

...

IdentifyTask
Output

...

True/False

...

AutoRecover

...

If any of these strings are found in the tool’s output, IncrediBuild reassigns the task to another Agent and discards the previous output.

...

Comma-separated list of strings.

...

TimeLimit

...

Time limit, in seconds, after which a remote task is automatically canceled and reassigned to a different Agent.

...

1 to 20,000 (Integer)

...

AdditionalOutput
Mask

...

To specify more than one file extension, enter comma-separated values, e.g.: "*.log,*.dat".

...

OutputPrefix / GroupPrefix

...

[Optional]
The text that appears in the Execution Monitor and logs.

...

OutputFileMasks

...

Image Added