This repository contains the implementation of the decision engine for the GovernanceDSL. This repository is structured as follows:
docs/: This folder contains the documentation of the decision engine (Work in Progress)governance/: This folder contains the engine implementation and testsengine/: This folder contains the agent logic, events, and parsing helperssemantics/: This folder contains the runtime metamodel implementation and policy enforcement behaviortesting/: This folder contains the mocks, helpers and additional testing hooks to run the engine in test modeframework/: This folder contains the framework to define tests on top of the engine in test mode
tests/: This folder contains the different tests of the engineengine/: This folder contains tests for the different parts of the engine in isolation (WIP)policies/: This folder contains tests for the different types of policies (WIP)kubernetes/: This folder contains tests replicating kubernetes repository pull requestspolicy_examples/: This folder contains the policy definitions for the tests
- Python 3.12
- Recommended: Create a virtual environment
(e.g.
venv <https://docs.python.org/3/library/venv.html>,conda <https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html>) - Clone the GovernanceDSL repository
- Clone this repository
- Install the dependencies (for both repositories) by referencing to the requirements files:
pip install -r requirements.txtRunning the experiment is a two steps process:
- Run the engine in test mode
- Run the
governance/tests/kubernetes/kubernetes_merge_policy.py
To start the engine in test mode, you first need to add the location of the GovernanceDSL folder on you machine to the PYTHONPATH environment variable.
Then, simply run the governance/engine/decision_engine.py script with the -t option
To run the test, simply call pytest on kubernetes_merge_policy.py.
pytest kubernetes_merge_policy.pyNB: The test ar configured with the path to the kubernetes.txt file. By default, you need to start the test while in the governance/tests/kubernetes folder. Alternatively, you can edit the tests to change the path at the beginning of the file