5.9.7. Architecture Pipeline Execution¶
The Architecture Pipeline is a sequence of actions run as part of the Axivion Continuous Integration. Starting with the intermediate representation (IR) extracted from the source code of the system under analysis, the first pipeline action Architecture-Dependencies creates the RFG representation of the system. Subsequent pipeline actions then process the RFG further. Each pipeline action can transform the RFG in arbitrary ways. A pipeline run can also start from an RFG, in which case the first pipeline action is skipped.
The pipeline is set up by configuring the Architecture group in the project configuration.
The architecture pipeline in the Configuration UI¶
Debugging the architecture pipeline is difficult because there is no easy way to check
the intermediate state of the RFG when the pipeline is executed as part of a Continuous
Integration run. To make debugging easier, Gravis has special support for viewing
and executing the architecture pipeline. To open the pipeline in Gravis, choose
Edit →
Architecture pipeline....
This opens the Pipeline Setup dialog, titled Open Architecture Pipeline.
The architecture pipeline and architecture projects cannot be used at the same time. While an architecture project is open, the menu entries for the pipeline are disabled. Opening an architecture project closes the pipeline window, and no architecture project can be created while the pipeline window is open.
5.9.7.1. The Pipeline Setup dialog¶
The most important task is to set up the pipeline configuration. As usual, this is
defined by a list of configuration files as found in the BAUHAUS_CONFIG
variable. You can either set up the full contents of this variable using the system
path separator to separate multiple entries, or simply enter the name of a single
configuration file. In the latter case, you can use the Browse... button
to select it.
Even if your configuration consists of multiple files, it is sufficient to pick the
file containing the settings for the Architecture
group; alternatively, you may pick an interface layer that includes this file. For
most projects, this file would be called axivion_config.json.
The Pipeline Setup dialog¶
The layout source graph¶
The primary purpose of architecture pipeline execution in Gravis is to examine
intermediate states of the RFG at specific points in the pipeline. When these states are
shown in Gravis, they are loaded from temporary files and, therefore, have no
associated persistent layouts. If you would like
to use the persistent layouts of an existing graph, you can enter the filename of an RFG
file into the Layout source field or click the Browse...
button next to it to select a file. Then, copies of this graph’s persistent layouts are
available when examining the output of pipeline execution runs. If you do not have an
existing graph with persistent layouts, simply leave the field empty.
Environment variables¶
Some configurations reference environment variables. In such cases, these can be set up
by clicking Environment.... This is an optional step.
The Edit Environment window¶
In the Edit Environment window, new variable definitions can be added by clicking
Add. Selected entries can be deleted by clicking Delete.
Clicking Clear removes all entries. Click OK to accept
the entered definitions and return to the Setup dialog. The configuration option
/Tools/Gravis/architecture_pipeline_options/default_env defines the variables that
the dialog initially contains when you open a pipeline.
Finally, click Load pipeline to load the configuration. If there are no
errors, this will open the Architecture Pipeline window.
5.9.7.2. The Architecture Pipeline window¶
The Architecture Pipeline window shows the configured pipeline steps and several buttons to control pipeline execution.
The Architecture Pipeline window¶
This window shows a simple pipeline setup with five steps. The first step
Architecture-Dependencies is always present; the remaining four steps are custom
steps retrieved from the configuration. Each custom step has a checkbox that allows you
to control whether the step is executed. Clicking
All/None enables or disables all custom steps.
Hovering the mouse pointer over an entry opens a tooltip with a summary of the item’s
configuration for quick reference. To get a better view or to edit the configuration,
click the Config... button, which opens the configuration GUI axivion_config.
After editing and saving the configuration in the GUI, Gravis alerts you that the configuration has changed and offers to reload it. This is recommended to avoid looking at outdated information. Pipeline execution will always use the latest state of the configuration files.
After reloading the configuration, newly added pipeline steps are shown with a green background.
You can adapt the pipeline configuration at any point by clicking
Setup..., which opens the Pipeline Setup dialog again, allowing you to
adjust the environment settings or load a completely different pipeline. In this
case, the dialog is titled Setup Architecture Pipeline and the button
Load pipeline reads Reload pipeline.
Note
Changing the pipeline configuration loses any existing execution state and resets the pipeline window.
Pipeline Options¶
Clicking Options... opens the Pipeline Options dialog:
The Pipeline Options dialog¶
By default, the output from pipeline execution is only shown if there is an error. If
you enable Show warnings, warning messages are shown in a separate
window. If you enable Verbose (always show pipeline output), the full
output is shown after each pipeline execution. The initial state of these two options is
set by the configuration options
/Tools/Gravis/architecture_pipeline_options/default_options/warnings and
/Tools/Gravis/architecture_pipeline_options/default_options/verbose.
Loading an IR file¶
There are two ways to execute the architecture pipeline: either starting from an IR file
or starting from an RFG file. Starting from an RFG file is straightforward: simply load
it using File →
Open.... However, a suitable RFG
file is not readily available. While you can download an RFG file from the
Dashboard, this file is the final output from
Continuous Integration and therefore represents the state after executing the Architecture
Pipeline.
To create an RFG file that represents the state at the beginning of the Architecture
Pipeline, download the IR file from the Dashboard, then click the
Open IR file... button in the Architecture Pipeline window and select it.
This executes the first pipeline step Architecture-Dependencies with the
configured options and results in a loaded RFG file suitable as a base RFG
for executing the pipeline. It may be a good idea to save this file.
Executing the Architecture Pipeline¶
Once you have obtained a base RFG by loading either an IR file or an RFG file, you are ready to execute the pipeline.
Clicking Execute records the current state of the RFG as the base
graph for pipeline execution and starts the pipeline. While the pipeline runs, the
button label changes to Abort, which stops the execution.
While executing the pipeline, the step currently being executed is marked with a yellow background, and finished items are marked with a green background. Only items that are checked are executed. There is an initial setup delay before the first item is marked as executing, as it takes time to record the base graph and launch the pipeline process in the background. This is particularly noticeable if the RFG is large, because it involves saving the current state of the RFG in Gravis.
If an error occurs, the item that caused it is marked with a red background, and a window shows the complete output from the execution.
If there is no error, Gravis shows the final state of the RFG at the end of
the pipeline and the Execute button label changes to
Restart (see Restarting the pipeline).
In the View Box, new views added by pipeline steps are highlighted with a green background, and modified views are highlighted with an orange background.
Highlighted views after executing the pipeline.¶
Note
By default, Gravis checks for modified views in a basic way: by
looking at the number of nodes and edges in each view. You can make this more
accurate by setting the configuration option
/Tools/Gravis/architecture_pipeline_options/advanced/view_diff_level to
fingerprint or full_fingerprint, although this results in slower pipeline execution.
Setting breakpoints¶
You can set breakpoints, as in a debugger, by clicking to the left of an item. A red blob appears to indicate the breakpoint. Clicking again clears it. Pipeline execution stops before executing an item with a breakpoint, allowing you to examine the state of the RFG immediately before the item is executed.
When execution is stopped at a breakpoint, the execution pointer ()
indicates the next item to be executed.
Stopped at a breakpoint.¶
In this example, steps Load Base RFG, Add Entry Points, and
Import Base Architecture were executed successfully, and execution stopped just
before executing Import Optical Services Architecture.
Views that were added or changed by completed steps are marked with a colored background as described above.
Clicking Continue resumes execution from the current state of the RFG.
This allows you to modify the RFG before clicking Continue
to test how
different RFG states affect the pipeline.
Restarting the pipeline¶
Clicking the Restart button re-runs the pipeline starting from the base
graph that was recorded when Execute was clicked. This is useful for
revisiting an earlier breakpoint, testing different breakpoints, or applying configuration changes.
Resetting the pipeline¶
To modify the base graph from which pipeline execution starts, click
Reset. This loads the recorded base graph and allows you to modify it.
Clicking the Execute button records the current state as the new base
graph and re-runs the pipeline.
5.9.7.3. Ending a pipeline execution session¶
To end the pipeline execution session, simply close the Architecture Pipeline window.