- Python 3.10, 3.11, or 3.12
- uv for dependency management
- Docker (for containerlab and some integration tests)
- Design-driven network automation demo using InfraHub
- Example data, schemas, and menu for rapid onboarding
- Scripts for bootstrapping, demo use cases, and CI integration
- Modular structure for easy extension and experimentation
checks/
– Custom validation logicdata/
– Example data for bootstrappinggenerators/
– Topology and config generatorsmenu/
– Example menu definitionqueries/
– GraphQL queries for InfraHubschemas/
– Base and extension schemasscripts/
– Helper scripts for automationtemplates/
– Jinja2 templates for device configstests/
– Unit, integration, and smoke teststransforms/
– Python transforms for InfraHub
uv sync
uv run invoke start
export INFRAHUB_ADDRESS="http://localhost:8000"
export INFRAHUB_API_TOKEN="06438eb2-8019-4776-878c-0941b1f1d1ec"
Load schemas
uv run infrahubctl schema load schemas
Load menu
uv run infrahubctl menu load menu
Load demo data
uv run infrahubctl object load data/bootstrap
Load sample security data
uv run infrahubctl object load data/security/
Add demo repository
uv run infrahubctl repository add DEMO https://github.com/t0m3kz/infrahub-demo.git --read-only
Add event actions (optional)
uv run infrahubctl object load data/events/
You can also use the script to execute all previous steps:
./scripts/bootstrap.sh
In this demo, configuration is generated for a composable data center.
./scripts/demo.sh design dc-2
If you would like to process all steps manually, follow these steps:
- Create branch
uv run infrahubctl branch create my-branch
- Load example design data stored in data/dc-2 file:
You can review designs in Design Patterns and in Design Elements. New deployment should be added into Services -> Topology Deployments -> Data center
uv run infrahubctl object load data/ --branch my-branch
- Change branch to design
- Go to Actions -> Generator Definitions -> create_dc
- Select Run -> Selected Targets, select DC-3 and click Run Generator
- Wait until task is completed
- Go to the devices and see the generated hosts
- Go to Propose Changes -> New Proposed change
- Select design as source branch, add name and Create proposed change
- Wait until all tasks are completed and check the artifacts/data
If you added event actions steps 4, 5 will be executed automatically.
This project uses GitHub Actions for continuous integration. All pushes and pull requests are tested for lint, type checks, and unit tests.
- Do not commit real API tokens. Use
.env
or GitHub secrets for sensitive data in production. - Example tokens in this README are for demo purposes only.
- If you encounter port conflicts, ensure no other service is running on port 8000.
- For dependency issues, run
uv sync
again. - For Docker/infrahub issues, ensure Docker is running and you have the correct permissions.
Run all tests using:
uv run pytest
Or run specific test scripts in the tests/
directory.
Contributions, questions, and feedback are welcome! Please use GitHub Discussions.
This project is licensed under the MIT License. See LICENSE for details.