Skip to content

chore: improve healthchecks - #90

Merged
atharvamp merged 5 commits into
mainfrom
chore/improve-auto-heal
Jul 16, 2026
Merged

atharvamp merged 5 commits into
mainfrom
chore/improve-auto-heal

Conversation

@leopahl

@leopahl leopahl commented Jul 16, 2026 •

Copy link
Copy Markdown
Collaborator

Ran it on local stack, autohelaing works and restart unehalthy containers.
After meging please check azure deployment

Summary by CodeRabbit

  • Bug Fixes

    • Improved service reliability across local and Azure deployments with automatic restarts after interruptions.
    • Added health monitoring for application and web services to detect unavailable endpoints.
  • New Features

    • Introduced automatic recovery for unhealthy services, helping restore availability without manual intervention.
    • Enhanced resilience during container or host restarts.

@coderabbitai

coderabbitai Bot commented Jul 16, 2026 •

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Changes

Container auto-healing

Layer / File(s) Summary
Service restart and health configuration
infra/docker-compose.yml, infra/docker-compose.azure.yml
Services receive restart: unless-stopped; selected application and database services gain autoheal=true labels and healthchecks.
Autoheal monitoring service
infra/docker-compose.yml, infra/docker-compose.azure.yml
Adds an autoheal sidecar that mounts the Docker socket read-only and monitors labeled containers using configured timing values.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: tejash123-cmd, atharvamp

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning It doesn't follow the required template and lacks Summary, Checklist, and Test plan sections. Rewrite the description using the template and include a clear summary, checklist items, and local verification steps.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly reflects the main change: improved health checks and auto-healing for container services.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/improve-auto-heal

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
infra/docker-compose.yml (1)

252-252: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Pin the autoheal image to a specific version.

Using the :latest tag 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

📥 Commits

Reviewing files that changed from the base of the PR and between ce4bd53 and 063e5dd.

📒 Files selected for processing (1)
  • infra/docker-compose.yml

Comment thread infra/docker-compose.yml Resolved
Comment thread infra/docker-compose.yml Resolved

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-stopped to multiple services for automatic restart behavior.
  • Introduce an autoheal service and label selected containers for auto-healing restarts.
  • Add/extend healthchecks (notably for web-client and 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.

Comment thread infra/docker-compose.yml Resolved
Comment thread infra/docker-compose.azure.yml Resolved
Comment thread infra/docker-compose.yml Resolved
Comment thread infra/docker-compose.azure.yml Resolved
  genai has no healthcheck, and autoheal only restarts containers Docker
  reports as unhealthy, so the label did nothing. restart: unless-stopped
  still covers crashes.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 063e5dd and 6c19784.

📒 Files selected for processing (2)
  • infra/docker-compose.azure.yml
  • infra/docker-compose.yml

Comment thread infra/docker-compose.yml
SPRING_FLYWAY_BASELINE_ON_MIGRATE: "true"
SPRING_FLYWAY_BASELINE_VERSION: "0"
GENAI_BASE_URL: http://genai:8084
restart: unless-stopped

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 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.

@atharvamp
atharvamp merged commit 1473c25 into main Jul 16, 2026
9 checks passed
@atharvamp
atharvamp deleted the chore/improve-auto-heal branch July 16, 2026 21:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants