Skip to content

Commit 37f2bae

Browse files
committed
update
1 parent c9b7aad commit 37f2bae

File tree

5 files changed

+224
-4
lines changed

5 files changed

+224
-4
lines changed

docs/docs/enterprise.mdx

Lines changed: 200 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,200 @@
1+
---
2+
title: Using Infrahub Enterprise
3+
---
4+
5+
This guide explains how to configure the demo environment to use Infrahub Enterprise edition instead of the Community edition. Enterprise edition provides additional features including increased performance, enhanced security, and enterprise support.
6+
7+
## Understanding the editions
8+
9+
Infrahub is available in two editions:
10+
11+
- **Community edition** - The standard open-source version with core functionality
12+
- **Enterprise edition** - The commercial version with additional enterprise features
13+
14+
The demo environment supports both editions and can be switched between them using a simple configuration change.
15+
16+
## Configuration
17+
18+
Edition selection is controlled by environment variables in the `.env` file at the root of the demo repository. The key variable is `INFRAHUB_ENTERPRISE`:
19+
20+
```bash
21+
# Community edition (default)
22+
export INFRAHUB_ENTERPRISE="false"
23+
24+
# Enterprise edition
25+
export INFRAHUB_ENTERPRISE="true"
26+
```
27+
28+
### Environment variables reference
29+
30+
| Variable | Default | Description |
31+
|----------|---------|-------------|
32+
| `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`) |
34+
| `INFRAHUB_ADDRESS` | `http://localhost:8000` | Infrahub API address |
35+
| `INFRAHUB_API_TOKEN` | (demo token) | API authentication token |
36+
37+
## Switching to Enterprise edition
38+
39+
To switch from Community to Enterprise edition:
40+
41+
### Step 1: update the configuration
42+
43+
Edit the `.env` file in the root of the demo repository:
44+
45+
```bash
46+
# Change this line from "false" to "true"
47+
export INFRAHUB_ENTERPRISE="true"
48+
```
49+
50+
### Step 2: source the environment file
51+
52+
For the changes to take effect, source the environment file:
53+
54+
```bash
55+
source .env
56+
```
57+
58+
### Step 3: verify the configuration
59+
60+
Check that the Enterprise edition will be used:
61+
62+
```bash
63+
uv run invoke info
64+
```
65+
66+
You should see output similar to:
67+
68+
```bash
69+
Infrahub Edition: Enterprise
70+
Version: 1.5.0b1
71+
Command: curl -s https://infrahub.opsmill.io/enterprise/1.5.0b1 | ...
72+
```
73+
74+
### Step 4: restart Infrahub
75+
76+
To apply the change, destroy the existing environment and start fresh:
77+
78+
```bash
79+
# Stop and remove all containers and volumes
80+
uv run invoke destroy
81+
82+
# Start with Enterprise edition
83+
uv run invoke start
84+
```
85+
86+
:::tip
87+
The `destroy` command removes all containers and data volumes. If you have data you want to preserve, consider exporting it first using `infrahubctl`.
88+
:::
89+
90+
### Step 5: reload your data
91+
92+
After switching editions, you'll need to reload your schemas and data:
93+
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 script:
106+
107+
```bash
108+
./scripts/bootstrap.sh
109+
```
110+
111+
## Switching back to Community edition
112+
113+
To switch from Enterprise back to Community edition, follow the same process but set `INFRAHUB_ENTERPRISE="false"`:
114+
115+
```bash
116+
# Edit .env and change to "false"
117+
source .env
118+
119+
# Verify configuration
120+
uv run invoke info
121+
122+
# Restart
123+
uv run invoke destroy
124+
uv run invoke start
125+
```
126+
127+
## How it works
128+
129+
When you run `uv run invoke start`, the system constructs the appropriate Docker Compose command based on your configuration:
130+
131+
**Community edition URL pattern:**
132+
133+
```bash
134+
https://infrahub.opsmill.io/{VERSION}
135+
```
136+
137+
**Enterprise edition URL pattern:**
138+
139+
```bash
140+
https://infrahub.opsmill.io/enterprise/{VERSION}
141+
```
142+
143+
The invoke tasks in `tasks.py` automatically detect the `INFRAHUB_ENTERPRISE` setting and use the correct URL to download the appropriate Docker Compose configuration.
144+
145+
## Checking your current edition
146+
147+
At any time, you can check which edition you're configured to use:
148+
149+
```bash
150+
source .env && uv run invoke info
151+
```
152+
153+
This displays:
154+
155+
- The edition (Community or Enterprise)
156+
- The version being used
157+
- The full Docker Compose command
158+
159+
## Enterprise features
160+
161+
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).
162+
163+
:::info
164+
Enterprise edition may require valid licensing credentials or enterprise authentication. Contact OpsMill for enterprise licensing information.
165+
:::
166+
167+
## Troubleshooting
168+
169+
### Changes not taking effect
170+
171+
If you change the `INFRAHUB_ENTERPRISE` setting but the wrong edition starts:
172+
173+
1. Ensure you sourced the `.env` file: `source .env`
174+
2. Verify the setting with `uv run invoke info`
175+
3. Make sure you destroyed the old environment before starting: `uv run invoke destroy`
176+
177+
### Environment file not found
178+
179+
If you get errors about missing environment variables:
180+
181+
1. Ensure the `.env` file exists in the root of the demo repository
182+
2. Make sure you're running commands from the demo repository root
183+
3. Source the file explicitly: `source .env`
184+
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+
189+
## Best practices
190+
191+
- **Use explicit versions** - Instead of `stable`, specify exact versions like `1.5.0b1` for reproducible environments
192+
- **Document your choice** - Note which edition you're using in project documentation
193+
- **Test on Community first** - Validate your schemas and generators on Community edition before deploying to Enterprise
194+
- **Keep configurations in sync** - If working in a team, ensure everyone uses the same edition for consistency
195+
196+
## Additional resources
197+
198+
- [Infrahub documentation](https://docs.infrahub.app)
199+
- [OpsMill website](https://opsmill.com)
200+
- [Enterprise edition details](https://opsmill.com/pricing)

docs/docs/readme.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ This documentation is organized following the [Diataxis framework](https://diata
3131
| Page | Purpose |
3232
|------|---------|
3333
| **[Developer guide](./developer-guide.mdx)** | Technical deep-dive into how the demo works under the hood. Covers schema architecture, bootstrap scripts, generators, transforms, checks, and testing. Use this when extending functionality, troubleshooting issues, or understanding implementation details. |
34+
| **[Using Infrahub Enterprise](./enterprise.mdx)** | Instructions for configuring the demo environment to use Infrahub Enterprise edition. Learn how to switch between Community and Enterprise editions, configure environment variables, and understand the differences between editions. |
3435

3536
### Topics
3637

docs/sidebars.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ const sidebars: SidebarsConfig = {
2222
label: 'Guides',
2323
items: [
2424
'developer-guide',
25+
'enterprise',
2526
],
2627
},
2728
{

scripts/bootstrap.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ uv run infrahubctl object load objects/security/ --branch $BRANCH
1616
echo "Add demo repository"
1717
uv run infrahubctl repository add DEMO https://github.com/opsmill/infrahub-demo.git --ref main --read-only
1818

19-
echo "Wait for repo sync - let's sleep for 90 seconds"
20-
sleep 90
19+
echo "Wait for repo sync - let's sleep for 120 seconds"
20+
sleep 120
2121

2222
echo "Add event actions"
2323
uv run infrahubctl object load objects/events/ --branch $BRANCH

tasks.py

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,42 @@
77

88

99
INFRAHUB_VERSION = os.getenv("INFRAHUB_VERSION", "stable")
10+
INFRAHUB_ENTERPRISE = os.getenv("INFRAHUB_ENTERPRISE", "false").lower() == "true"
1011
MAIN_DIRECTORY_PATH = Path(__file__).parent
1112

1213
# Download compose file and use with override
1314
def get_compose_command() -> str:
1415
"""Generate docker compose command with override support."""
16+
# Determine the base URL based on edition
17+
if INFRAHUB_ENTERPRISE:
18+
base_url = f"https://infrahub.opsmill.io/enterprise/{INFRAHUB_VERSION}"
19+
else:
20+
base_url = f"https://infrahub.opsmill.io/{INFRAHUB_VERSION}"
21+
1522
override_file = MAIN_DIRECTORY_PATH / "docker-compose.override.yml"
1623
if override_file.exists():
17-
return f"curl -s https://infrahub.opsmill.io/{INFRAHUB_VERSION} | docker compose -p infrahub -f - -f {override_file}"
18-
return f"curl -s https://infrahub.opsmill.io/{INFRAHUB_VERSION} | docker compose -p infrahub -f -"
24+
return f"curl -s {base_url} | docker compose -p infrahub -f - -f {override_file}"
25+
return f"curl -s {base_url} | docker compose -p infrahub -f -"
1926

2027
COMPOSE_COMMAND = get_compose_command()
2128
CURRENT_DIRECTORY = Path(__file__).resolve()
2229
DOCUMENTATION_DIRECTORY = CURRENT_DIRECTORY.parent / "docs"
2330

2431

32+
@task
33+
def info(context: Context) -> None:
34+
"""Show current Infrahub configuration."""
35+
edition = "Enterprise" if INFRAHUB_ENTERPRISE else "Community"
36+
print(f"Infrahub Edition: {edition}")
37+
print(f"Version: {INFRAHUB_VERSION}")
38+
print(f"Command: {COMPOSE_COMMAND}")
39+
40+
2541
@task
2642
def start(context: Context) -> None:
2743
"""Start all containers."""
44+
edition = "Enterprise" if INFRAHUB_ENTERPRISE else "Community"
45+
print(f"Starting Infrahub {edition} ({INFRAHUB_VERSION})...")
2846
context.run(f"{COMPOSE_COMMAND} up -d")
2947

3048

0 commit comments

Comments
 (0)