Repository navigation
chore: improve healthchecks - #90
Conversation
📝 WalkthroughWalkthroughChangesContainer auto-healing
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
infra/docker-compose.yml (1)
252-252: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valuePin the
autohealimage to a specific version.Using the
:latesttag for infrastructure services can lead to unpredictable behavior or unexpected breakages if the upstream image introduces incompatible changes. Consider pinning to a specific version (e.g.,willfarrell/autoheal:1.2.0).♻️ Proposed fix
autoheal: - image: willfarrell/autoheal:latest + image: willfarrell/autoheal:1.2.0🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@infra/docker-compose.yml` at line 252, Replace the floating :latest tag in the autoheal service image declaration with a specific stable version tag, such as willfarrell/autoheal:1.2.0, to ensure deterministic deployments.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@infra/docker-compose.yml`:
- Line 156: Add Docker healthcheck blocks for both chat at
infra/docker-compose.yml:156-156 and genai at infra/docker-compose.yml:186-186,
using their respective health endpoints on ports 8083 and 8084 and matching the
existing catalog healthcheck pattern.
- Line 212: Update the web-client healthcheck command near the test definition
to use a probe executable available in the nginx:1.27-alpine runtime image, or
ensure curl is installed in that image before the healthcheck runs. Preserve the
existing root-URL availability check and failure behavior.
---
Nitpick comments:
In `@infra/docker-compose.yml`:
- Line 252: Replace the floating :latest tag in the autoheal service image
declaration with a specific stable version tag, such as
willfarrell/autoheal:1.2.0, to ensure deterministic deployments.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 879785ba-7a68-4243-8c38-6775462cd116
📒 Files selected for processing (1)
infra/docker-compose.yml
There was a problem hiding this comment.
Pull request overview
This PR updates the Docker Compose configurations (local and Azure overlay) to improve container resiliency by adding restart policies, introducing an auto-healing sidecar, and expanding healthcheck coverage so unhealthy services can be detected and restarted.
Changes:
- Add
restart: unless-stoppedto multiple services for automatic restart behavior. - Introduce an
autohealservice and label selected containers for auto-healing restarts. - Add/extend healthchecks (notably for
web-clientand Azure Spring services).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| infra/docker-compose.yml | Adds restart policies, introduces autoheal sidecar, labels services for autoheal, and adds a web-client healthcheck. |
| infra/docker-compose.azure.yml | Adds restart policies, introduces autoheal sidecar, labels services for autoheal, and adds healthchecks for Azure-deployed services. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
genai has no healthcheck, and autoheal only restarts containers Docker reports as unhealthy, so the label did nothing. restart: unless-stopped still covers crashes.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@infra/docker-compose.yml`:
- Line 181: Add the missing autoheal=true entry to the chat service’s existing
labels block, and add its healthcheck alongside restart using the specified
actuator health command and timing values. Keep the existing Traefik labels and
restart behavior unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 2d4ba773-4193-4caa-bc12-f4cdf170072a
📒 Files selected for processing (2)
infra/docker-compose.azure.ymlinfra/docker-compose.yml
| SPRING_FLYWAY_BASELINE_ON_MIGRATE: "true" | ||
| SPRING_FLYWAY_BASELINE_VERSION: "0" | ||
| GENAI_BASE_URL: http://genai:8084 | ||
| restart: unless-stopped |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
Add the missing healthcheck and autoheal label to the chat service.
The PR adds a healthcheck and autoheal=true label for the chat service in the Azure compose configuration (infra/docker-compose.azure.yml), but these are missing here in the local docker-compose.yml.
Please add the healthcheck block and the autoheal=true label to ensure the chat service is also monitored and auto-healed in the local environment, maintaining consistency across deployments.
🛠️ Recommended additions for `chat`
Add the autoheal=true label to the existing labels block, and define the healthcheck alongside the restart configuration:
labels:
- autoheal=true
# ... keep existing traefik labels ...
healthcheck:
test: ["CMD-SHELL", "curl -fsS http://localhost:8083/actuator/health | grep -q '\"status\":\"UP\"'"]
interval: 5s
timeout: 5s
retries: 12
start_period: 60s
restart: unless-stopped🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@infra/docker-compose.yml` at line 181, Add the missing autoheal=true entry to
the chat service’s existing labels block, and add its healthcheck alongside
restart using the specified actuator health command and timing values. Keep the
existing Traefik labels and restart behavior unchanged.
Ran it on local stack, autohelaing works and restart unehalthy containers.
After meging please check azure deployment
Summary by CodeRabbit
Bug Fixes
New Features