Skip to content

Commit 9db8133

Browse files
authored
Documentation rework (#51)
* Cleanup metadata * Cleanup tasks * Generate reference using template * Add more context to doc * Reshuffle doc * Cleanup * Set the right title * Set title * Various fixes * Various fixes for lint * Cleanup schemas.start from CI * Cleanup * Further cleanup * Fix path to metadata * Found why links were broken * Ignore reference file from vale * Cleanup * Cleanup * Fix issues around vale * for vale to ignore reference folder * Create a per page ref doc + many improvements * Lint on metadata * Cleanup contributing * Cleanuo * Deactivate vale for TOC * Vale off * Pin sdk version and further cleanup * Round 140 of cleanup * Add link to dependencies
1 parent ccabf79 commit 9db8133

File tree

117 files changed

+11707
-9984
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

117 files changed

+11707
-9984
lines changed

.github/workflows/ci.yml

Lines changed: 10 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ jobs:
4848
steps:
4949
- name: "Check out repository code"
5050
uses: "actions/checkout@v4"
51-
5251
- name: "Set up Python ${{ matrix.python-version }}"
5352
uses: "actions/setup-python@v5"
5453
with:
@@ -66,7 +65,6 @@ jobs:
6665
poetry env use ${{ matrix.python-version }}
6766
- name: "Install dependencies"
6867
run: "poetry install --no-interaction --no-ansi --with dev"
69-
7068
- name: "Linting: ruff check"
7169
run: "poetry run ruff check ."
7270
- name: "Linting: ruff format"
@@ -100,7 +98,6 @@ jobs:
10098
!contains(needs.*.result, 'failure') &&
10199
!contains(needs.*.result, 'cancelled') &&
102100
needs.files-changed.outputs.yaml == 'true'
103-
104101
runs-on:
105102
group: huge-runners
106103
env:
@@ -110,39 +107,29 @@ jobs:
110107
uses: actions/checkout@v4
111108
with:
112109
submodules: true
113-
114110
- name: Set up Python
115111
uses: actions/setup-python@v5
116112
with:
117113
python-version: "3.12"
118-
119114
- name: Install Invoke
120-
run: |
121-
pip install toml invoke infrahub-sdk["all"]
122-
115+
run: poetry install --no-interaction --no-ansi --with dev
123116
- name: Set job name
124117
run: echo JOB_NAME="$GITHUB_JOB" >> $GITHUB_ENV
125-
126118
- name: "Set environment variable INFRAHUB_BUILD_NAME"
127119
run: echo INFRAHUB_BUILD_NAME=infrahub-${{ runner.name }} >> $GITHUB_ENV
128-
129120
- name: Initialize Infrahub
130-
run: invoke schemas.start
131-
121+
run: poetry run invoke start
132122
- name: Set infrahub address
133123
run: |
134124
PORT=$(docker compose -p $INFRAHUB_BUILD_NAME port infrahub-server 8000 | cut -d: -f2)
135125
echo "INFRAHUB_ADDRESS=http://localhost:${PORT}" >> $GITHUB_ENV
136-
137126
- name: "Store start time"
138127
run: echo TEST_START_TIME=$(date +%s)000 >> $GITHUB_ENV
139-
140128
- name: Load all schemas files
141-
run: invoke schemas.load-all-schemas
142-
129+
run: poetry run invoke schemas.load-all-schemas
143130
- name: "Clear docker environment and force vmagent to stop"
144131
if: always()
145-
run: docker compose -p $INFRAHUB_BUILD_NAME down -v --remove-orphans --rmi local
132+
run: poetry run invoke destroy
146133

147134
documentation:
148135
defaults:
@@ -167,15 +154,15 @@ jobs:
167154
node-version: 20
168155
cache: 'npm'
169156
cache-dependency-path: docs/package-lock.json
170-
- name: "Install dependencies"
171-
run: npm install
172157
- name: "Setup Python environment"
173158
run: "pip install invoke toml"
174-
- name: "Create schema docs"
175-
run: "invoke schemas.build"
159+
- name: "Install dependencies"
160+
run: "invoke docs.install"
161+
- name: "Generate reference documentation"
162+
run: "invoke docs.generate"
176163
working-directory: ./
177164
- name: "Build docs website"
178-
run: "invoke docusaurus.docs"
165+
run: "invoke docs.build"
179166

180167
validate-documentation-style:
181168
if: |
@@ -201,4 +188,4 @@ jobs:
201188
env:
202189
VALE_VERSION: ${{ env.VALE_VERSION }}
203190
- name: "Validate documentation style"
204-
run: ./vale --config=.vale.ini --glob='!{docs/docs/schema-library.*}' ./docs/docs $(find ./docs/docs -type f \( -name "*.mdx" -o -name "*.md" \) )
191+
run: ./vale --config=.vale.ini $(find ./docs -type f \( -name "*.mdx" -o -name "*.md" \) -not -path "./docs/node_modules/*" -not -path "./docs/docs/reference/*")

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
.envrc
33
.env
44
test.sh
5+
__pycache__

.metadata.yml

Lines changed: 43 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,27 @@
22
# yamllint disable rule:line-length
33
base/dcim:
44
description:
5-
Basic DCIM schema to capture devices, racks, interfaces, and related information.
5+
Basic DCIM schema to capture devices, racks, interfaces, and related
6+
information.
67
name: DCIM
78
base/ipam:
8-
description:
9-
Basic IPAM schema to capture IP addresses, subnets, and related information.
9+
description: Basic IPAM schema to capture IP addresses, subnets, and related information.
1010
name: IPAM
1111
base/location:
12-
description:
13-
Basic Location schema to capture locations, sites, and related information.
12+
description: Basic Location schema to capture locations, sites, and related information.
1413
name: Locations
1514
base/organization:
1615
description:
17-
Basic Organization schema to capture organizations, vendors, and related information.
16+
Basic Organization schema to capture organizations, vendors, and related
17+
information.
1818
name: Organization
19+
extensions/cable:
20+
dependencies:
21+
- base
22+
description:
23+
This schema extension contains a basic Cable model allowing you to
24+
connect two endpoints.
25+
name: Cable
1926
experimental/azure:
2027
attribution: "[Rowan Coleman](https://www.linkedin.com/in/rowan-coleman-6a147156/)"
2128
dependencies:
@@ -51,18 +58,18 @@ experimental/modules_linecards:
5158
- extensions/modules
5259
description:
5360
This schema extension allows you to capture Linecard related information
54-
like the version. You can insert the Linecard into a Dcim Physical Device
55-
and leverage the Linecard type model. The Linecard can accept PIC to help
56-
configure PORT information like breakout-capabilities and configurations.
61+
like the version. You can insert the Linecard into a Dcim Physical Device and
62+
leverage the Linecard type model. The Linecard can accept PIC to help configure
63+
PORT information like breakout-capabilities and configurations.
5764
name: Modules Linecards
5865
experimental/modules_routing_engine:
5966
dependencies:
6067
- base
6168
- extensions/modules
6269
description:
63-
This schema extension allows you to capture Routing Engine related information
64-
like the version. You can insert the Routing Engine into a Dcim Physical Device
65-
and leverage the Routing Engine type model.
70+
This schema extension allows you to capture Routing Engine related
71+
information like the version. You can insert the Routing Engine into a Dcim Physical
72+
Device and leverage the Routing Engine type model.
6673
name: Modules Routing Engine
6774
experimental/qos:
6875
dependencies:
@@ -96,13 +103,6 @@ experimental/vlan-translation:
96103
This schema extension is based on Juniper VLAN MAP, and not yet test
97104
out for other vendors.
98105
name: VLAN Translation
99-
extensions/cable:
100-
dependencies:
101-
- base
102-
description:
103-
This schema extension contains a basic Cable model allowing you to
104-
connect two endpoints.
105-
name: Cable
106106
extensions/circuit:
107107
dependencies:
108108
- base
@@ -121,22 +121,6 @@ extensions/cluster:
121121
With this one in place you can unlock various clusters flavors (hosting cluster
122122
able to host VMs, firewall clusters built with specific appliances ...)
123123
name: Cluster
124-
extensions/lag:
125-
dependencies:
126-
- base
127-
description:
128-
This schema extension includes models for Link Aggregation Groups (LAGs),
129-
enabling you to link physical interfaces as building blocs of your LAG interface.
130-
It can be used in standard networking environments as well as in compute scenarios,
131-
such as capturing bond interfaces.
132-
name: Lag
133-
extensions/interface_breakout:
134-
dependencies:
135-
- base
136-
description:
137-
This schema extension introduces relationships to support breakout interfaces,
138-
enabling you to document the breakout of a physical interface into smaller physical interfaces.
139-
name: Interface Breakout
140124
extensions/compute:
141125
dependencies:
142126
- base
@@ -182,6 +166,23 @@ extensions/hosting_cluster:
182166
A rather generic cluster built with compute units (e.g. servers) and
183167
able to host VMs.
184168
name: Hosting Cluster
169+
extensions/interface_breakout:
170+
dependencies:
171+
- base
172+
description:
173+
This schema extension introduces relationships to support breakout
174+
interfaces, enabling you to document the breakout of a physical interface into
175+
smaller physical interfaces.
176+
name: Interface Breakout
177+
extensions/lag:
178+
dependencies:
179+
- base
180+
description:
181+
This schema extension includes models for Link Aggregation Groups (LAGs),
182+
enabling you to link physical interfaces as building blocs of your LAG interface.
183+
It can be used in standard networking environments as well as in compute scenarios,
184+
such as capturing bond interfaces.
185+
name: Lag
185186
extensions/location_minimal:
186187
dependencies:
187188
- base
@@ -212,7 +213,8 @@ extensions/peering_ixp:
212213
- extensions/routing_bgp
213214
- extensions/routing_bgp_community
214215
description:
215-
This schema extension contains all you need to model anything revolving around internet peering (Exchange points ...)!
216+
This schema extension contains all you need to model anything revolving
217+
around internet peering (Exchange points ...)!
216218
name: Peering IXP
217219
extensions/physical_disk:
218220
dependencies:
@@ -227,7 +229,8 @@ extensions/qinq:
227229
- base
228230
- extensions/vlan
229231
description:
230-
This schema extension brings extensions to VLAN model in order to support QinQ.
232+
This schema extension brings extensions to VLAN model in order to support
233+
QinQ.
231234
name: QinQ
232235
extensions/routing:
233236
dependencies:
@@ -284,7 +287,9 @@ extensions/routing_pim:
284287
extensions/routing_policies:
285288
dependencies:
286289
- base
287-
description: This schema extension contains a generic to create Routing Policies. This Generic can be extend for each Routing Protocols you may want to use.
290+
description:
291+
This schema extension contains a generic to create Routing Policies.
292+
This Generic can be extend for each Routing Protocols you may want to use.
288293
name: Routing Policies
289294
extensions/routing_policies_aggregate:
290295
dependencies:

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ Welcome to the Schema Library for Infrahub! This repository offers a collection
55
> [!WARNING]
66
> This project is currently a collection of examples intended to serve as inspiration. Please note that it is in an experimental phase and may undergo significant changes.
77
8-
## Using the schema library
8+
## Use case
99

10-
Documentation for using the Schema Library is available in the [Schema Library docs](https://docs.infrahub.app/schema-library) site.
10+
Infrahub ships without built-in schemas, giving you complete freedom to define your own. However, starting from scratch can be overwhelming, especially when many infrastructures share common models. That's where the [Schema Library](https://github.com/opsmill/schema-library), maintained by OpsMill and the community, comes in.
11+
12+
**The library provides a curated collection of practical, ready-to-use schemas designed to reflect real-world infrastructure needs. Use them out of the box, or treat them as a foundation: copy, adapt, and extend each schema to align precisely with your organization.**
13+
14+
## Getting started
15+
16+
Interested about the project and want to get started? Check out the [Schema Library documentation](https://docs.infrahub.app/schema-library) for more information.

0 commit comments

Comments
 (0)