This page gives a brief overview of the code structure that implements Congress.
The main source of information is the Congress wiki. There are two separate codebases that implement Congress: the server and the python client bindings.
The structure of the client code is the same as that for other recent OpenStack python clients. The bulk of the Congress code is contained within the server. The remainder of this page describes the layout of the server code.
Here are the most important components of the code, described by how they are laid out in the repository.
First is a description of the files and folders in congress/datalog. These files implement Datalog: the language Congress uses for describing policies.
Second is a brief overview of the fundamental datastructures used to represent individual policy statements.
Third is an overview of the datastructures used to represent entire policies. There are several different kinds of policies that you can choose from when creating a new policy. Each makes different tradeoffs in terms of time/space or in terms of the kind of policy statements that are permitted. Internally these are called ‘theories’.
The congress/policy_engines directory contains implementations and wrappers for policy engines. At the time of writing, there are 2 policy engines in this directory: the domain-agnostic policy engine (agnostic.py) and the skeleton of a policy engine specialized for VM-placement (vm_placement.py). We detail only the domain-agnostic policy engine.
Source code found in congress/policy_engines/agnostic.py.
Below we give a list of the top-level entry points to the domain-agnostic Runtime class—the top-level class for the domain agnostic policy engine.