Skip to content

Commit 21e23f4

Browse files
gmrclaude
andcommitted
Address CodeRabbit review feedback across Helm chart, docs, and entrypoint
- Fix Neo4j service name in _helpers.tpl (use Release.Name, not Release.Name-neo4j) - Add service-mode-aware container port helper and health check probes - Align ANTHROPIC_API_KEY env condition with secret template - Add REQUIRED comment for Neo4j password in values.yaml - Remove Chart.lock from .gitignore to pin subchart versions - Make configuration docs service-aware with per-service required vars - Add POSTGRES_URL to Docker all-in-one example - Add json language identifiers to code fences in blueprints docs - Fix grammar in blueprints docs - Document ui service in IMBI_SERVICE table - Quote printf argument in entrypoint.sh - Change docs-serve port to 8088 to avoid conflict with API Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 806a821 commit 21e23f4

9 files changed

Lines changed: 70 additions & 15 deletions

File tree

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,3 @@ build/
77
dist/
88
docs/site/
99
helm/imbi/charts/
10-
helm/imbi/Chart.lock

docs/docs/admin/blueprints.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ project's metadata is validated against the blueprint's schema.
1111

1212
## Creating a Blueprint
1313

14-
```
14+
```json
1515
POST /api/blueprints
1616
{
1717
"name": "Microservice",
@@ -40,7 +40,7 @@ POST /api/blueprints
4040

4141
When creating a project, specify the blueprint to apply its schema:
4242

43-
```
43+
```json
4444
POST /api/projects
4545
{
4646
"name": "my-service",
@@ -60,5 +60,5 @@ are invalid.
6060
## Updating Blueprints
6161

6262
Blueprint schemas can be updated over time. Existing projects are not
63-
retroactively validated against updated schemas, but new creates and
64-
updates will use the current schema.
63+
retroactively validated against updated schemas, but new project
64+
creations and updates will use the current schema.

docs/docs/deployment/docker.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ By default, the container starts all services behind a Caddy reverse proxy:
1212
docker run -p 8080:8080 \
1313
-e NEO4J_URL=bolt://neo4j:7687 \
1414
-e CLICKHOUSE_URL=http://default:password@clickhouse:8123/imbi \
15+
-e POSTGRES_URL=postgresql://user:pass@postgres/imbi \
1516
-e IMBI_AUTH_JWT_SECRET=your-secret \
1617
-e IMBI_AUTH_ENCRYPTION_KEY=your-key \
1718
ghcr.io/aweber-imbi/imbi:latest

docs/docs/getting-started/configuration.md

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,35 @@ own set of variables from the shared environment.
55

66
## Required Variables
77

8-
These must be set for Imbi to start:
8+
Which variables are required depends on the service being run
9+
(see `IMBI_SERVICE` below). When running `IMBI_SERVICE=all` (the default),
10+
all service-specific variables are required.
11+
12+
### Core (all services)
913

1014
| Variable | Description |
1115
|----------|-------------|
12-
| `NEO4J_URL` | Neo4j Bolt connection URL (e.g. `bolt://neo4j:7687`) |
13-
| `CLICKHOUSE_URL` | ClickHouse HTTP connection URL (e.g. `http://default:password@clickhouse:8123/imbi`) |
1416
| `IMBI_AUTH_JWT_SECRET` | Secret key for signing JWT tokens. Use a random string of at least 32 characters. |
1517
| `IMBI_AUTH_ENCRYPTION_KEY` | Fernet encryption key for encrypting sensitive data at rest. |
1618

19+
### API and Assistant
20+
21+
| Variable | Description |
22+
|----------|-------------|
23+
| `NEO4J_URL` | Neo4j Bolt connection URL (e.g. `bolt://neo4j:7687`) |
24+
25+
### API only
26+
27+
| Variable | Description |
28+
|----------|-------------|
29+
| `CLICKHOUSE_URL` | ClickHouse HTTP connection URL (e.g. `http://default:password@clickhouse:8123/imbi`) |
30+
31+
### Gateway
32+
33+
| Variable | Description |
34+
|----------|-------------|
35+
| `POSTGRES_URL` | PostgreSQL connection URL (e.g. `postgresql://user:pass@host/db`) |
36+
1737
## Neo4j
1838

1939
| Variable | Description | Default |
@@ -104,4 +124,4 @@ When running the Docker image, you can select which service to run:
104124

105125
| Variable | Description | Default |
106126
|----------|-------------|---------|
107-
| `IMBI_SERVICE` | Service to run: `all`, `api`, `assistant`, `gateway`, `mcp` | `all` |
127+
| `IMBI_SERVICE` | Service to run: `all`, `api`, `assistant`, `gateway`, `mcp`, `ui` | `all` |

entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ require_gateway_vars() {
3939
check_errors() {
4040
if [ -n "$errors" ]; then
4141
echo "ERROR: Missing required environment variables for $1:" >&2
42-
printf "$errors" >&2
42+
printf '%b' "$errors" >&2
4343
echo "" >&2
4444
echo "Set the variables above and try again." >&2
4545
exit 1

helm/imbi/templates/_helpers.tpl

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ app.kubernetes.io/instance: {{ .Release.Name }}
3737

3838
{{- define "imbi.neo4jUrl" -}}
3939
{{- if .Values.neo4j.enabled }}
40-
{{- printf "bolt://%s-neo4j:7687" .Release.Name }}
40+
{{- printf "bolt://%s:7687" .Release.Name }}
4141
{{- else }}
4242
{{- .Values.externalNeo4j.url }}
4343
{{- end }}
@@ -51,6 +51,15 @@ app.kubernetes.io/instance: {{ .Release.Name }}
5151
{{- end }}
5252
{{- end }}
5353

54+
{{- define "imbi.containerPort" -}}
55+
{{- if eq .Values.service.mode "api" }}8000
56+
{{- else if eq .Values.service.mode "mcp" }}8001
57+
{{- else if eq .Values.service.mode "assistant" }}8002
58+
{{- else if eq .Values.service.mode "gateway" }}8003
59+
{{- else }}8080
60+
{{- end }}
61+
{{- end }}
62+
5463
{{- define "imbi.postgresUrl" -}}
5564
{{- if .Values.postgresql.enabled }}
5665
{{- printf "postgresql://postgres:%s@%s-postgresql/%s" .Values.postgresql.auth.postgresPassword .Release.Name .Values.postgresql.auth.database }}

helm/imbi/templates/deployment.yaml

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ spec:
2020
imagePullPolicy: {{ .Values.image.pullPolicy }}
2121
ports:
2222
- name: http
23-
containerPort: 8080
23+
containerPort: {{ include "imbi.containerPort" . | trim }}
2424
protocol: TCP
2525
envFrom:
2626
- configMapRef:
@@ -53,7 +53,7 @@ spec:
5353
secretKeyRef:
5454
name: {{ include "imbi.secretName" . }}
5555
key: postgres-url
56-
{{- if .Values.assistant.enabled }}
56+
{{- if and .Values.assistant.enabled .Values.assistant.anthropicApiKey }}
5757
- name: ANTHROPIC_API_KEY
5858
valueFrom:
5959
secretKeyRef:
@@ -72,6 +72,7 @@ spec:
7272
name: {{ include "imbi.secretName" . }}
7373
key: s3-secret-key
7474
{{- end }}
75+
{{- if eq .Values.service.mode "all" }}
7576
livenessProbe:
7677
httpGet:
7778
path: /api/status
@@ -84,5 +85,30 @@ spec:
8485
port: http
8586
initialDelaySeconds: 5
8687
periodSeconds: 10
88+
{{- else if eq .Values.service.mode "api" }}
89+
livenessProbe:
90+
httpGet:
91+
path: /status
92+
port: http
93+
initialDelaySeconds: 10
94+
periodSeconds: 15
95+
readinessProbe:
96+
httpGet:
97+
path: /status
98+
port: http
99+
initialDelaySeconds: 5
100+
periodSeconds: 10
101+
{{- else }}
102+
livenessProbe:
103+
tcpSocket:
104+
port: http
105+
initialDelaySeconds: 10
106+
periodSeconds: 15
107+
readinessProbe:
108+
tcpSocket:
109+
port: http
110+
initialDelaySeconds: 5
111+
periodSeconds: 10
112+
{{- end }}
87113
resources:
88114
{{- toYaml .Values.resources | nindent 12 }}

helm/imbi/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ neo4j:
5050
neo4j:
5151
edition: community
5252
acceptLicenseAgreement: "yes"
53-
password: ""
53+
password: "" # REQUIRED: must be overridden with a secure password
5454

5555
# External Neo4j (when neo4j.enabled is false)
5656
externalNeo4j:

justfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ docs:
4141
[doc("Serve documentation locally for development")]
4242
[group("Docs")]
4343
docs-serve:
44-
docker run --rm -p 8000:8000 -v {{ justfile_directory() }}/docs:/docs squidfunk/mkdocs-material
44+
docker run --rm -p 8088:8000 -v {{ justfile_directory() }}/docs:/docs squidfunk/mkdocs-material
4545

4646
[doc("Remove build artifacts")]
4747
[group("Build")]

0 commit comments

Comments
 (0)