Skip to content

Commit e29100e

Browse files
petercrockerclaude
andcommitted
Update CLAUDE.md with accurate repository information
- Add quick reference section with common commands at the top - Fix incorrect invoke task references (create-pc, restart, validate) - Remove non-existent files (menu-demo-dc.yml, shell scripts, MERMAID_SETUP.md) - Update Python version to 3.10+ (was incorrectly 3.11+) - Add missing bootstrap file (20_network_services.yml) - Expand templates, transforms, and checks listings with all files - Add invoke tasks reference table - Fix documentation reference paths 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 9cde949 commit e29100e

File tree

1 file changed

+84
-30
lines changed

1 file changed

+84
-30
lines changed

CLAUDE.md

Lines changed: 84 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,41 @@
22

33
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
44

5+
## Quick Reference
6+
7+
```bash
8+
# First-time setup
9+
uv sync # Install dependencies
10+
uv run invoke start # Start Infrahub containers
11+
uv run invoke bootstrap # Load schemas, menu, and data
12+
13+
# Full reset and initialization
14+
uv run invoke init # destroy + start + bootstrap + demo
15+
16+
# Demo workflows
17+
uv run invoke demo-dc-arista # Create Arista DC demo (branch: add-dc3)
18+
uv run invoke demo-dc-cisco # Create Cisco DC demo (branch: add-dc2)
19+
uv run invoke demo-dc-juniper # Create Juniper DC demo (branch: add-dc5)
20+
21+
# Development
22+
uv run pytest # Run tests
23+
uv run invoke lint # Run all linters (ruff, mypy)
24+
uv run infrahubctl transform <name> --branch <branch> device=<device> # Test transform
25+
26+
# Container management
27+
uv run invoke stop # Stop containers
28+
uv run invoke restart-containers # Restart without data loss
29+
uv run invoke destroy # Remove containers and volumes
30+
```
31+
532
## Project Overview
633

734
This is **bundle-dc**, a comprehensive demonstration of design-driven network automation using [InfraHub](https://docs.infrahub.app). The project showcases composable data center and POP topology generation, configuration management, validation checks, and infrastructure-as-code patterns.
835

936
## Package Manager & Environment
1037

1138
- **Package Manager**: `uv` (required for all dependency operations)
12-
- **Python Version**: 3.11 or 3.12
39+
- **Python Version**: 3.10, 3.11, or 3.12 (3.10+ required, <3.13)
1340
- **Setup**: `uv sync` to install all dependencies
1441

1542
## Common Commands
@@ -26,8 +53,9 @@ uv run invoke stop
2653
# Destroy containers (removes volumes)
2754
uv run invoke destroy
2855

29-
# Restart specific component
30-
uv run invoke restart <component>
56+
# Restart specific container (or all if no component specified)
57+
uv run invoke restart-containers
58+
uv run invoke restart-containers infrahub-server-1
3159
```
3260

3361
### Schema and Data Loading
@@ -64,7 +92,6 @@ uv run infrahubctl branch create <branch-name>
6492
uv run infrahubctl object load objects/dc/dc-arista-s.yml --branch <branch-name>
6593

6694
# Create a proposed change for a branch
67-
uv run invoke create-pc --branch <branch-name>
6895
uv run python scripts/create_proposed_change.py --branch <branch-name>
6996
```
7097

@@ -84,7 +111,7 @@ uv run pytest tests/unit/test_cloud_security_mock.py
84111
uv run pytest tests/integration/
85112

86113
# Run all quality checks (ruff, mypy, pytest)
87-
uv run invoke validate
114+
uv run invoke lint
88115
```
89116

90117
### Code Quality
@@ -97,7 +124,7 @@ uv run ruff check . --fix
97124
uv run mypy .
98125

99126
# Full validation suite
100-
uv run invoke validate
127+
uv run invoke lint
101128
```
102129

103130
### Bootstrap and Demo Workflows
@@ -139,7 +166,7 @@ This project follows InfraHub's SDK pattern with five core component types:
139166
4. **Checks** (`checks/`) - Validate configurations and connectivity
140167
- Inherit from `InfrahubCheck`
141168
- Run validation logic and log errors/warnings
142-
- Examples: `spine.py`, `leaf.py`, `edge.py`
169+
- Examples: `spine.py`, `leaf.py`, `edge.py`, `firewall.py`, `loadbalancer.py`
143170

144171
5. **Templates** (`templates/`) - Jinja2 templates for device configurations
145172
- Used by transforms to generate final configs
@@ -442,8 +469,8 @@ The project includes a Streamlit-based service catalog application:
442469

443470
## Project Structure Details
444471

445-
- `checks/` - Validation checks for spine, leaf, edge, loadbalancer devices
446-
- `objects/bootstrap/` - Initial data (18 files including locations, platforms, roles, devices, docs)
472+
- `checks/` - Validation checks for spine, leaf, edge, firewall, loadbalancer devices
473+
- `objects/bootstrap/` - Initial data (19 files including locations, platforms, roles, devices, docs)
447474
- `00_groups.yml` - User groups and permissions
448475
- `01_locations.yml` - Geographic locations (metros, buildings)
449476
- `02_providers.yml` - Service providers
@@ -462,6 +489,7 @@ The project includes a Streamlit-based service catalog application:
462489
- `17_ip_prefix_pools.yml` - IP prefix pools
463490
- `18_devices.yml` - Pre-configured devices (corp-firewall, cisco-switch-01, etc.)
464491
- `19_docs.yml` - Documentation links
492+
- `20_network_services.yml` - Network services definitions
465493
- `objects/dc/` - Data center demo scenario files (Arista, Cisco, Juniper, SONiC)
466494
- `objects/git-repo/` - Repository configuration objects
467495
- `github.yml` - GitHub repository configuration (default)
@@ -475,7 +503,6 @@ The project includes a Streamlit-based service catalog application:
475503
- `generators/schema_protocols.py` - Type protocols for schemas
476504
- `menus/` - InfraHub menu definitions
477505
- `menu-full.yml` - Complete menu with all navigation options
478-
- `menu-demo-dc.yml` - Simplified menu for datacenter demos (excludes Documentation, Security Management, Routing Management, LB Management)
479506
- `queries/config/` - Configuration queries (leaf_config, spine_config, etc.)
480507
- `queries/topology/` - Topology queries
481508
- `queries/validation/` - Validation queries
@@ -484,32 +511,60 @@ The project includes a Streamlit-based service catalog application:
484511
- `scripts/` - User-facing automation scripts:
485512
- `bootstrap.py` - Python bootstrap script with Rich UI and progress tracking
486513
- `create_proposed_change.py` - Create Infrahub Proposed Changes
514+
- `create_users_roles.py` - Create users and assign roles in Infrahub
487515
- `get_configs.py` - Extract device configs and topologies from artifacts
488-
- `populate_security_relationships.py` - Populate security zone relationships
489-
- `clab.sh` - Containerlab operations
490-
- `demo.sh` - Demo scenario runner
491-
- `generate.sh` - Generator helper script
492-
- `render.sh` - Template rendering helper
493-
- `repo.sh` - Repository management helper
494-
- `transform.sh` - Transform execution helper
495-
- `validate.sh` - Validation helper
496516
- `scripts/debug/` - Debug scripts (excluded from git tracking)
497517
- `service_catalog/` - Streamlit-based service catalog application
498518
- `Home.py` - Main landing page
499519
- `pages/` - Additional pages
500520
- `utils/` - Utility functions and API client
501521
- `assets/` - Static assets (logos, images)
502522
- `templates/` - Jinja2 configuration templates
503-
- `templates/configs/leafs/` - Leaf device templates (arista_eos.j2, dell_sonic.j2, etc.)
504-
- `templates/configs/spines/` - Spine device templates (arista_eos.j2, dell_sonic.j2, etc.)
523+
- `clab_topology.j2` - Containerlab topology template
524+
- `templates/configs/leafs/` - Leaf device templates (arista_eos.j2, cisco_nxos.j2, dell_sonic.j2, juniper_junos.j2, sonic.j2)
525+
- `templates/configs/spines/` - Spine device templates (arista_eos.j2, cisco_nxos.j2, dell_sonic.j2, edgecore_sonic.j2, juniper_junos.j2, sonic.j2)
526+
- `templates/configs/edges/` - Edge device templates (cisco_ios.j2, cisco_nxos.j2)
527+
- `templates/configs/loadbalancers/` - Load balancer templates (f5_networks_linux.j2, haproxy_technologies_linux.j2)
528+
- `templates/configs/peering/` - Peering templates (arista_eos_bgp.j2, cisco_nxos_bgp.j2, cisco_nxos_ospf.j2)
529+
- `templates/configs/equinix/` - Equinix POP templates (virtual_pop.j2)
530+
- `templates/configs/juniper_firewall.j2` - Juniper firewall template
505531
- `transforms/` - Python transform implementations
506-
- `transforms/common.py` - Shared utilities (get_interface_roles, get_loopbacks, HTML decoding, etc.)
507-
- `transforms/leaf.py` - Leaf device configuration transform
508-
- `transforms/spine.py` - Spine device configuration transform
509-
- `tests/conftest.py` - Pytest fixtures and configuration
510-
- `tests/unit/` - Unit tests
511-
- `tests/integration/` - Integration tests
512-
- `tasks.py` - Invoke task definitions (bootstrap, demo-dc-arista, etc.)
532+
- `common.py` - Shared utilities (get_interface_roles, get_loopbacks, HTML decoding, etc.)
533+
- `leaf.py` - Leaf device configuration transform
534+
- `spine.py` - Spine device configuration transform
535+
- `edge.py` - Edge device configuration transform
536+
- `loadbalancer.py` - Load balancer configuration transform
537+
- `juniper_firewall.py` - Juniper firewall configuration transform
538+
- `equinix_pop.py` - Equinix POP configuration transform
539+
- `openconfig_leaf.py` - OpenConfig leaf configuration transform
540+
- `topology_cabling.py` - Topology cabling matrix transform
541+
- `tests/` - Test suite
542+
- `conftest.py` - Root pytest fixtures and configuration
543+
- `unit/` - Unit tests (test_cloud_security_mock.py)
544+
- `integration/` - Integration tests (test_workflow.py)
545+
- `tasks.py` - Invoke task definitions
546+
547+
## Available Invoke Tasks
548+
549+
Run `uv run invoke --list` to see all tasks. Key tasks:
550+
551+
| Task | Description |
552+
|------|-------------|
553+
| `bootstrap` | Run the complete bootstrap process (schemas, menu, data, repo) |
554+
| `start` | Start all containers (use `--rebuild` to force rebuild images) |
555+
| `stop` | Stop all containers |
556+
| `destroy` | Destroy all containers and volumes |
557+
| `restart-containers` | Restart Docker containers without destroying data |
558+
| `init` | Full initialization: destroy, start, bootstrap, and load demo DC |
559+
| `demo-dc-arista` | Create branch and load Arista DC demo topology |
560+
| `demo-dc-cisco` | Create branch and load Cisco DC demo topology |
561+
| `demo-dc-juniper` | Create branch and load Juniper DC demo topology |
562+
| `containerlab` | Generate configs and deploy containerlab topology |
563+
| `lint` | Run all linters (ruff, mypy, markdown, yaml) |
564+
| `run-tests` | Run all tests |
565+
| `docs` | Build documentation website |
566+
| `info` | Show current Infrahub configuration |
567+
| `list` | List all available invoke tasks |
513568

514569
## GraphQL Query Patterns
515570

@@ -646,7 +701,6 @@ The Docusaurus documentation site supports [Mermaid diagrams](https://mermaid.js
646701

647702
- Mermaid theme is configured in `docs/docusaurus.config.ts`
648703
- `@docusaurus/theme-mermaid` package is installed
649-
- See `docs/MERMAID_SETUP.md` for installation and troubleshooting
650704

651705
**Usage in MDX files:**
652706

@@ -750,8 +804,8 @@ vale $(find ./docs/docs -type f \( -name "*.mdx" -o -name "*.md" \) )
750804

751805
**Reference Files:**
752806

753-
- Documentation guidelines: `docs/docs/development/docs.mdx`
754-
- Vale styles: `.vale/styles/`
807+
- Vale styles: `.vale/styles/Infrahub/`
808+
- Spelling exceptions: `.vale/styles/spelling-exceptions.txt`
755809
- Markdown linting: `.markdownlint.yaml`
756810

757811
### Document Structure Patterns (Following Diataxis)

0 commit comments

Comments
 (0)