Getting started with Infrahub
This tutorial doesn't require any prior knowledge, but knowledge of Git, GraphQL, and Python will make things easier to understand.
This tutorial will get you started with using Infrahub and it will help you get familiar with some of the main components and concepts behind Infrahub. To do this we'll use a sample dataset that represents a small network with 6 devices. This tutorial will teach you:
- How to manage branches and query any branches.
- How to integrate a Git repository within Infrahub.
- How to generate Jinja2 template.
- How to expose a new Data Transformation endpoint.
- How to validate data within the CI/CD pipeline.
- How to extend the current schema.
- How to query data via the GraphQL interface.
- How to modify data via the REST API.
- How to query for past state via the GraphQL interface.
The tutorial is meant to be executed in order, as we'll be making some changes along the way that might be required later.
Prepare the demo environment
Pre-requisites
The system that you want to use to run the demo environment has to meet the hardware requirements. Alternatively you can run Infrahub in GitHub codespaces.
In order to run the demo environment, the following packages or applications must be installed on the systems:
On a Laptop, both Docker & Docker Compose can be installed by installing Docker Desktop.
Download Infrahub
Refer to the Installation Documentation.
First utilization
Initialize the database and start the application
invoke demo.start
Control the local environment
invoke demo.start
: Start all the containers in detached mode.invoke demo.stop
: Stop All the containersinvoke demo.destroy
: Destroy all containers and volumes.
Accounts available for the tutorial
At this stage only one login account exists on Infrahub: admin
.
The default token for the Admin account is 06438eb2-8019-4776-878c-0941b1f1d1ec
While using the API the Authentication Token must be provided in a header named X-INFRAHUB-KEY
More accounts will be loaded with the demo data.
Refer to User management page for more information regarding the possible rights.
To follow the tutorial you should use the admin
account but you can try the other accounts too to see how the interface behaves with different permission levels.
name | username | password | group |
---|---|---|---|
Administrator | admin | infrahub | Super Administrators |
Sue Dough | sudo | Password123 | Administrators |
Chloe O'Brian | cobrian | Password123 | Engineering Team |
Sofia Hernandez | shernandez | Password123 | Engineering Team |
Ryan Patel | rpatel | Password123 | Engineering Team |
Jack Bauer | jbauer | Password123 | Operations Team |
Emily Lawson | elawson | Password123 | Operations Team |
Jacob Thompson | jthompson | Password123 | Operations Team |
David Palmer | dpalmer | Password123 | Architecture Team |
Olivia Carter | ocarter | Password123 | Architecture Team |
Access the Infrahub interfaces
Confirm access to the Infrahub web interface and the GraphQL interface by visiting the following links:
Access the Web interfacehttp://localhost:8000 Access the GraphQL interfacehttp://localhost:8000/graphql