Skip to content

Commit 66cd748

Browse files
authored
Issue #1002: fix advisor demo compose build (sync package-lock, re-enable advisor services) (#1003)
##### Description of Change **Problem:** `docker-compose up --build` in `deployments/advisor-demo-docker/` fails to build `lif-advisor-app`: ``` npm error `npm ci` can only install packages when your package.json and package-lock.json ... are in sync. npm error Missing: esbuild@0.28.1 from lock file (+ 25 @esbuild/<platform> packages) ``` Compose aborts the batch, so `lif-advisor-api` is cancelled too and the advisor demo never comes up. **Root cause:** #978 (Issue #972) added `vitest@^4.1.8` to `frontends/lif_advisor_app/package.json` without regenerating `package-lock.json`. `vitest@4.1.8` pulls a nested `vite@8` whose peer dep is `esbuild@^0.27 || ^0.28`; that tree was never written to the lock (which only had `esbuild@0.21.5`). Local `npm install` (loose) reconciled silently; the Dockerfile's `npm ci` (strict) does not — so it only broke in compose. **Solution:** - Regenerated `package-lock.json` **with npm 10.8.2 inside `node:20-alpine`** (the build image). Regenerating with npm 11 produces no diff and does not fix the container, so the version match matters. - Re-enabled (uncommented) `lif-advisor-api` / `lif-advisor-app` in `deployments/advisor-demo-docker/docker-compose.yml` — they had been commented out during the LDE work (#906/#958) — so the demo runs end-to-end again. **Side effects / limitations:** none expected; change is confined to the advisor-demo deployment and the advisor-app lockfile. No application source changed. **How to test:** see Testing below. ##### Related Issues Closes #1002 ##### Type of Change - [x] Bug fix (non-breaking change which fixes an issue) - [x] Infrastructure/deployment change ##### Project Area(s) Affected - [x] frontends/ - [x] deployments/ --- ##### Checklist - [x] commit message follows commit guidelines (see commitlint.config.mjs) - [x] configuration changes: relevant folder README updated — n/a (no README change needed; usage unchanged) ##### Testing - [x] Manual testing performed In `node:20-alpine` (the Dockerfile base): - `npm ci` succeeds with the regenerated lock. - `npm run build` (vite) produces `dist/` cleanly. Full stack via `docker compose up --build`: - 29 services up; advisor UI `http://localhost:5174/` → 200, advisor API `http://localhost:8004/health` → 200, plus MDR UI/API, GraphQL, Dagster all 200. ##### Additional Notes The lockfile must be regenerated with the same npm major as the Docker build image. To avoid recurrence, a CI smoke build of the compose stack (see #584) would catch lock drift before merge. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
2 parents e2febfd + c68f79f commit 66cd748

2 files changed

Lines changed: 551 additions & 69 deletions

File tree

deployments/advisor-demo-docker/docker-compose.yml

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -410,45 +410,45 @@ services:
410410
start_period: 10s
411411

412412

413-
# lif-advisor-api:
414-
# build:
415-
# context: ../../
416-
# dockerfile: projects/lif_advisor_api/Dockerfile2
417-
# container_name: lif-advisor-api
418-
# environment:
419-
# LIF_SEMANTIC_SEARCH_MCP_SERVER_URL: ${LIF_SEMANTIC_SEARCH_MCP_SERVER_URL:-http://lif-semantic-search-mcp-server:8003/mcp}
420-
# LIF_GRAPHQL_API_URL: ${LIF_GRAPHQL_API_URL:-http://lif-graphql-api-org1:8000/graphql}
421-
# LIF_ADVISOR_AGENT_TASKS: ${LIF_ADVISOR_AGENT_TASKS:-load_profile,continue_conversation,save_interaction_summary}
422-
# LIF_ADVISOR_LLM_MODEL_NAME: ${LANGCHAIN_LLM_MODEL_NAME:-gpt-4.1-mini}
423-
# LIF_ADVISOR_MESSAGES_TO_KEEP: ${LIF_ADVISOR_MESSAGES_TO_KEEP:-4}
424-
# LIF_ADVISOR_TRIMMED_MESSAGES_SIZE: ${LIF_ADVISOR_TRIMMED_MESSAGES_SIZE:-384}
425-
# LIF_ADVISOR_MAX_CONVERSATION_SIZE: ${LIF_ADVISOR_MAX_CONVERSATION_SIZE:-2048}
426-
# LIF_ADVISOR_MAX_SUMMARY_SIZE: ${LIF_ADVISOR_MAX_SUMMARY_SIZE:-1024}
427-
# OPENAI_API_KEY: ${OPENAI_API_KEY}
428-
# LIF_DEMO_USER_PASSWORD: ${LIF_DEMO_USER_PASSWORD:-changeme}
429-
# CONFIG_KEY_STORE: ${CONFIG_KEY_STORE:-/etc/keys}
430-
# ports:
431-
# - "8004:8004"
432-
# networks:
433-
# - lif-net-org1
434-
# depends_on:
435-
# lif-graphql-api-org1:
436-
# condition: service_started
437-
# lif-semantic-search-mcp-server:
438-
# condition: service_healthy
439-
440-
# lif-advisor-app:
441-
# build:
442-
# context: ../../frontends/lif_advisor_app
443-
# args:
444-
# LIF_ADVISOR_API_URL: ${LIF_ADVISOR_API_URL:-http://localhost:8004} # Web client needs to access the API outside the container
445-
# container_name: lif-advisor-app
446-
# ports:
447-
# - "5174:80"
448-
# networks:
449-
# - lif-net-org1
450-
# depends_on:
451-
# - lif-advisor-api
413+
lif-advisor-api:
414+
build:
415+
context: ../../
416+
dockerfile: projects/lif_advisor_api/Dockerfile2
417+
container_name: lif-advisor-api
418+
environment:
419+
LIF_SEMANTIC_SEARCH_MCP_SERVER_URL: ${LIF_SEMANTIC_SEARCH_MCP_SERVER_URL:-http://lif-semantic-search-mcp-server:8003/mcp}
420+
LIF_GRAPHQL_API_URL: ${LIF_GRAPHQL_API_URL:-http://lif-graphql-api-org1:8000/graphql}
421+
LIF_ADVISOR_AGENT_TASKS: ${LIF_ADVISOR_AGENT_TASKS:-load_profile,continue_conversation,save_interaction_summary}
422+
LIF_ADVISOR_LLM_MODEL_NAME: ${LANGCHAIN_LLM_MODEL_NAME:-gpt-4.1-mini}
423+
LIF_ADVISOR_MESSAGES_TO_KEEP: ${LIF_ADVISOR_MESSAGES_TO_KEEP:-4}
424+
LIF_ADVISOR_TRIMMED_MESSAGES_SIZE: ${LIF_ADVISOR_TRIMMED_MESSAGES_SIZE:-384}
425+
LIF_ADVISOR_MAX_CONVERSATION_SIZE: ${LIF_ADVISOR_MAX_CONVERSATION_SIZE:-2048}
426+
LIF_ADVISOR_MAX_SUMMARY_SIZE: ${LIF_ADVISOR_MAX_SUMMARY_SIZE:-1024}
427+
OPENAI_API_KEY: ${OPENAI_API_KEY}
428+
LIF_DEMO_USER_PASSWORD: ${LIF_DEMO_USER_PASSWORD:-changeme}
429+
CONFIG_KEY_STORE: ${CONFIG_KEY_STORE:-/etc/keys}
430+
ports:
431+
- "8004:8004"
432+
networks:
433+
- lif-net-org1
434+
depends_on:
435+
lif-graphql-api-org1:
436+
condition: service_started
437+
lif-semantic-search-mcp-server:
438+
condition: service_healthy
439+
440+
lif-advisor-app:
441+
build:
442+
context: ../../frontends/lif_advisor_app
443+
args:
444+
LIF_ADVISOR_API_URL: ${LIF_ADVISOR_API_URL:-http://localhost:8004} # Web client needs to access the API outside the container
445+
container_name: lif-advisor-app
446+
ports:
447+
- "5174:80"
448+
networks:
449+
- lif-net-org1
450+
depends_on:
451+
- lif-advisor-api
452452

453453
lif-mdr-database:
454454
image: postgres

0 commit comments

Comments
 (0)