Skip to content

Commit 1669316

Browse files
committed
refactor schemas and docs corrections
1 parent fc5419f commit 1669316

26 files changed

+87
-329
lines changed

docs/docs/containerlab-deployment.mdx

Lines changed: 4 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Before starting this tutorial, ensure you have:
2121

2222
- Completed the [installation guide](./install.mdx) and have Infrahub running
2323
- Completed the [user walkthrough](./user-walkthrough.mdx) to understand the basic workflow
24-
- **Docker** installed and running with sufficient resources (at least 8GB RAM recommended)
24+
- **Docker** installed and running with sufficient resources (at least 16GB RAM recommended to support a few cEOS containers)
2525
- **Containerlab** installed ([installation instructions](https://containerlab.dev/install/))
2626
- **sudo access** for running Containerlab (required for network namespace operations)
2727

@@ -253,50 +253,7 @@ ssh admin@<management-ip>
253253

254254
Default credentials are typically `admin` / `admin` for cEOS devices.
255255

256-
## Step 6: Test the fabric
257-
258-
With all devices running, verify the data center fabric is functioning:
259-
260-
### Check underlay connectivity
261-
262-
From any spine, ping the loopback addresses of all leaves:
263-
264-
```bash
265-
sudo containerlab exec --name DC-3 --node dc3-spine1 Cli
266-
267-
# In the EOS CLI
268-
ping <leaf1-loopback-ip>
269-
ping <leaf2-loopback-ip>
270-
```
271-
272-
### Verify BGP convergence
273-
274-
Check that all BGP sessions are established:
275-
276-
```bash
277-
# From a spine
278-
show ip bgp summary
279-
280-
# From a leaf
281-
show ip bgp summary
282-
show bgp evpn summary
283-
```
284-
285-
All neighbors should show state "Established" with non-zero prefix counts.
286-
287-
### Verify the EVPN control plane
288-
289-
On leaf switches, check EVPN VXLAN status:
290-
291-
```bash
292-
show bgp evpn summary
293-
show vxlan vtep
294-
show vxlan vni
295-
```
296-
297-
You should see VXLAN tunnels established between all VTEPs (leaf switches).
298-
299-
## Step 7: Destroy the lab (cleanup)
256+
## Step 6: Destroy the lab (cleanup)
300257

301258
When you're done testing, destroy the lab to free resources:
302259

@@ -336,21 +293,6 @@ Deploy configurations from any branch:
336293
uv run invoke containerlab --branch my-branch --topology DC-3
337294
```
338295

339-
### Customizing the topology
340-
341-
Edit the generated topology file before deployment:
342-
343-
```bash
344-
# Extract configs only (don't deploy yet)
345-
uv run scripts/get_configs.py --branch add-dc3
346-
347-
# Edit the topology file
348-
vim generated-configs/clab/DC-3.clab.yml
349-
350-
# Deploy manually
351-
sudo -E containerlab deploy -t generated-configs/clab/DC-3.clab.yml
352-
```
353-
354296
### Testing configuration changes
355297

356298
Use this workflow to test changes before production:
@@ -362,15 +304,6 @@ Use this workflow to test changes before production:
362304
5. Test in virtual lab
363305
6. If successful, merge to main and deploy to production
364306

365-
### Connecting external tools
366-
367-
Containerlab labs can be accessed by external tools:
368-
369-
- **Ansible** - Use management IPs to configure devices
370-
- **Network monitoring** - Connect SNMP or streaming telemetry collectors
371-
- **Traffic generators** - Inject test traffic using additional containers
372-
- **CI/CD pipelines** - Automate testing with Containerlab in CI
373-
374307
## Troubleshooting
375308

376309
### Deployment fails with "permission denied"
@@ -401,15 +334,6 @@ docker logs clab-DC-3-dc3-spine1
401334

402335
Look for configuration syntax errors or boot failures.
403336

404-
### BGP sessions don't establish
405-
406-
Verify:
407-
408-
1. All containers are running (`docker ps`)
409-
2. Device configurations were loaded correctly (check `show running-config`)
410-
3. Interface states are up (`show ip interface brief`)
411-
4. No IP address conflicts
412-
413337
### Out of memory errors
414338

415339
Containerlab labs can be resource-intensive. For DC-3 with 8 devices:
@@ -422,16 +346,8 @@ Reduce device count or increase Docker's memory allocation if needed.
422346

423347
## Next steps
424348

425-
Now that you can deploy virtual labs, you can:
426-
427-
- **Test other vendor designs** - Deploy DC-2 (Cisco), DC-4 (SONiC), or DC-5 (Juniper) topologies
428-
- **Experiment with changes** - Modify designs in Infrahub, regenerate, and test in Containerlab
429-
- **Automate testing** - Write scripts that deploy, test, and validate configurations automatically
430-
- **Integrate with CI/CD** - Add Containerlab deployment to your pipeline for automated validation
431-
- **Learn device CLIs** - Practice configuring Arista EOS in a safe virtual environment
432-
433349
For deeper understanding:
434350

435-
- **[Understanding the concepts](./concepts.mdx)** - Learn about design-driven automation
436-
- **[Developer guide](./developer-guide.mdx)** - Understand how generators and transforms work
351+
- **[Understanding the concepts](./concepts.mdx)** - Learn about this design-driven automation demo
352+
- **[Developer guide](./developer-guide.mdx)** - Understand how generators and transformations work
437353
- **[Containerlab documentation](https://containerlab.dev/)** - Explore advanced Containerlab features

docs/docs/developer-guide.mdx

Lines changed: 1 addition & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -760,67 +760,6 @@ config = template.render(hostname="spine1", interfaces=[...])
760760
print(config)
761761
```
762762

763-
## Troubleshooting
764-
765-
### Generator fails
766-
767-
1. Check task logs in Infrahub UI (System → Tasks)
768-
2. Look for Python exceptions in generator code
769-
3. Verify input data matches expected structure
770-
4. Add debug logging to narrow down issue
771-
772-
### Transform produces incorrect output
773-
774-
1. Examine GraphQL query results
775-
2. Print context data before rendering
776-
3. Test template with sample data
777-
4. Check for Jinja2 syntax errors
778-
779-
### Check fails unexpectedly
780-
781-
1. Review check query and data
782-
2. Verify validation logic
783-
3. Check for missing relationships or attributes
784-
4. Test with minimal dataset
785-
786-
### Schema conflicts
787-
788-
1. Check for naming conflicts
789-
2. Verify relationship peer nodes exist
790-
3. Ensure proper inheritance
791-
4. Review schema validation errors
792-
793-
## Best practices
794-
795-
### Code organization
796-
797-
- Keep generators focused on single topology type
798-
- Separate common logic into utilities (`common.py`)
799-
- Use type hints throughout
800-
- Write docstrings for classes and methods
801-
802-
### Testing
803-
804-
- Write tests before implementing features (TDD)
805-
- Cover both success and failure cases
806-
- Use mocks for external dependencies
807-
- Maintain high test coverage
808-
809-
### Documentation
810-
811-
- Document complex generator logic
812-
- Add inline comments for non-obvious code
813-
- Update this guide when adding features
814-
- Keep README.md current
815-
816-
### Performance
817-
818-
- Use batch operations for creating many objects
819-
- Leverage async/await for concurrent operations
820-
- Profile generators for large topologies
821-
- Optimize GraphQL queries to fetch only needed data
822-
823763
## Additional resources
824764

825-
- **Infrahub SDK documentation**: [docs.infrahub.app/python-sdk/](https://docs.infrahub.app/python-sdk/)
826-
- **Infrahub schema guide**: [docs.infrahub.app/topics/schema/](https://docs.infrahub.app/topics/schema/)
765+
- **Infrahub documentation**: [docs.infrahub.app/](https://docs.infrahub.app/)

docs/docs/enterprise.mdx

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export INFRAHUB_ENTERPRISE="true"
3030
| Variable | Default | Description |
3131
|----------|---------|-------------|
3232
| `INFRAHUB_ENTERPRISE` | `false` | Set to `true` to use Enterprise edition |
33-
| `INFRAHUB_VERSION` | `stable` | Infrahub version to use (for example, `1.5.0b1`, `stable`, `develop`) |
33+
| `INFRAHUB_VERSION` | `stable` | Infrahub version to use (for example, `1.5.0`, `stable`, `develop`) |
3434
| `INFRAHUB_ADDRESS` | `http://localhost:8000` | Infrahub API address |
3535
| `INFRAHUB_API_TOKEN` | (demo token) | API authentication token |
3636

@@ -67,8 +67,8 @@ You should see output similar to:
6767

6868
```bash
6969
Infrahub Edition: Enterprise
70-
Version: 1.5.0b1
71-
Command: curl -s https://infrahub.opsmill.io/enterprise/1.5.0b1 | ...
70+
Version: 1.5.0
71+
Command: curl -s https://infrahub.opsmill.io/enterprise/1.5.0 | ...
7272
```
7373

7474
### Step 4: restart Infrahub
@@ -91,19 +91,6 @@ The `destroy` command removes all containers and data volumes. If you have data
9191

9292
After switching editions, you'll need to reload your schemas and data:
9393

94-
```bash
95-
# Load schemas
96-
uv run infrahubctl schema load schemas
97-
98-
# Load menu definitions
99-
uv run infrahubctl menu load menu
100-
101-
# Load bootstrap data
102-
uv run infrahubctl object load objects/bootstrap
103-
```
104-
105-
Or use the bootstrap command:
106-
10794
```bash
10895
uv run invoke bootstrap
10996
```
@@ -161,7 +148,7 @@ This displays:
161148
Enterprise edition includes additional capabilities not available in Community edition. For details on specific enterprise features, refer to the [Infrahub documentation](https://docs.infrahub.app).
162149

163150
:::info
164-
Enterprise edition may require valid licensing credentials or enterprise authentication. Contact OpsMill for enterprise licensing information.
151+
Enterprise edition requires valid licensing for production usage. Contact OpsMill for enterprise licensing information.
165152
:::
166153

167154
## Troubleshooting
@@ -182,13 +169,9 @@ If you get errors about missing environment variables:
182169
2. Make sure you're running commands from the demo repository root
183170
3. Source the file explicitly: `source .env`
184171

185-
### Version compatibility
186-
187-
Ensure your `INFRAHUB_VERSION` setting is compatible with Enterprise edition. Some development or beta versions may not have Enterprise builds available.
188-
189172
## Best practices
190173

191-
- **Use explicit versions** - Instead of `stable`, specify exact versions like `1.5.0b1` for reproducible environments
174+
- **Use explicit versions** - Instead of `stable`, specify exact versions like `1.5.0` for reproducible environments
192175
- **Document your choice** - Note which edition you're using in project documentation
193176
- **Test on Community first** - Validate your schemas and generators on Community edition before deploying to Enterprise
194177
- **Keep configurations in sync** - If working in a team, ensure everyone uses the same edition for consistency

docs/docs/security-management.mdx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,13 @@ Before starting this tutorial, ensure you have:
2828
The security data is loaded as part of the bootstrap process. If you haven't loaded it yet, run `uv run infrahubctl object load objects/security/` followed by `uv run python scripts/populate_security_relationships.py` to populate the many-to-many relationships.
2929
:::
3030

31-
## Understanding the security schema
31+
## Understanding the demo security schema
3232

33-
Infrahub's security management schema provides a comprehensive data model for firewall policies, zones, services, and applications. The schema is organized into several categories of security objects that work together to define complete security policies.
33+
The demo security management schema in this repository provides an example data model for firewall policies, zones, services, and applications. The schema is organized into several categories of security objects that work together to define complete security policies.
34+
35+
:::info
36+
As Infrahub provides the user a flexible schema, this specific security schema implementation serves as an example of what is possible, not a finished solution. The value of Infrahub is the ability to create a specific schema to the needs of your organization.
37+
:::
3438

3539
### Security schema architecture
3640

@@ -505,5 +509,5 @@ Now that you understand security management in Infrahub, you can:
505509
For deeper understanding:
506510

507511
- **[Understanding the concepts](./concepts.mdx)** - Learn about schema-driven data modeling
508-
- **[Developer guide](./developer-guide.mdx)** - Understand how transforms and templates work
512+
- **[Developer guide](./developer-guide.mdx)** - Understand how transformations and templates work
509513
- **[Infrahub security schema](https://github.com/opsmill/infrahub-demo/blob/main/schemas/extensions/security/security.yml)** - Review the complete schema definition

docs/docs/user-walkthrough.mdx

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ To explore Arista EOS configurations, you can use the automated demo command:
126126
uv run invoke demo-dc-arista
127127
```
128128

129-
This command creates a branch, loads the Arista design, and waits for generator completion.
129+
This command creates a branch, loads the Arista design, waits for generator completion, then creates a proposed change.
130130

131131
For other vendors, load the design files directly:
132132

@@ -375,23 +375,3 @@ If you encounter merge conflicts:
375375
1. Review the conflicting objects
376376
2. Resolve conflicts manually if needed
377377
3. You may need to rebase your branch or create a new branch
378-
379-
## Using the CLI for the workflow
380-
381-
You can also perform this entire workflow from the command line. Here's the abbreviated version:
382-
383-
```bash
384-
# Create branch
385-
uv run infrahubctl branch create add-dc3
386-
387-
# Load design (this automatically triggers the generator)
388-
uv run infrahubctl object load objects/dc/dc-arista-s.yml --branch add-dc3
389-
390-
# Monitor generator progress in the web interface (System → Tasks)
391-
# Create proposed change (easier via web interface)
392-
393-
# After merge, verify on main
394-
uv run infrahubctl branch list
395-
```
396-
397-
For complex workflows involving proposed changes and monitoring generator execution, the web interface provides a better experience with visual feedback and real-time status updates.

schemas/base/dcim.yml

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ generics:
1212
- name__value
1313
order_by:
1414
- name__value
15-
display_labels:
16-
- name__value
15+
display_label: "{{ name__value }}"
1716
attributes:
1817
- name: name
1918
kind: Text
@@ -172,8 +171,7 @@ generics:
172171
human_friendly_id:
173172
- device__name__value
174173
- name__value
175-
display_labels:
176-
- name__value
174+
display_label: "{{ name__value }}"
177175
attributes:
178176
- name: name
179177
kind: Text
@@ -323,8 +321,7 @@ nodes:
323321
icon: mdi:poll
324322
human_friendly_id:
325323
- name__value
326-
display_labels:
327-
- name__value
324+
display_label: "{{ name__value }}"
328325
order_by:
329326
- manufacturer__name__value
330327
- name__value
@@ -386,8 +383,7 @@ nodes:
386383
icon: mdi:application-cog-outline
387384
human_friendly_id:
388385
- name__value
389-
display_labels:
390-
- name__value
386+
display_label: "{{ name__value }}"
391387
order_by:
392388
- manufacturer__name__value
393389
- name__value
@@ -514,8 +510,7 @@ nodes:
514510
- DcimEndpoint
515511
- DcimSubInterface
516512
include_in_menu: false
517-
display_labels:
518-
- name__value
513+
display_label: "{{ name__value }}"
519514

520515
attributes:
521516
- name: interface_type
@@ -604,8 +599,7 @@ nodes:
604599
- DcimInterface
605600
# - DcimSubInterface # Depending if you want your virtual interfaces to have sub interface
606601
include_in_menu: false
607-
display_labels:
608-
- name__value
602+
display_label: "{{ name__value }}"
609603
# human_friendly_id:
610604
# - device__name__value
611605
# - name__value

0 commit comments

Comments
 (0)