Skip to content

[agent] Add blue/green host daemon binary rollout with systemd recovery fallback#53

Draft
Copilot wants to merge 3 commits intomainfrom
copilot/agent-blue-green-update
Draft

[agent] Add blue/green host daemon binary rollout with systemd recovery fallback#53
Copilot wants to merge 3 commits intomainfrom
copilot/agent-blue-green-update

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 17, 2026

This change adds a resilient host-agent upgrade path: keep a last-known-good binary on-host and recover automatically if the daemon fails after an update. The daemon now runs through stable symlinks so rollout and rollback are atomic.

  • Blue/green host binary slots + stable pointers

    • unbounded-agent-install.sh now alternates installs between:
      • /usr/local/bin/unbounded-agent-blue
      • /usr/local/bin/unbounded-agent-green
    • Maintains:
      • /usr/local/bin/unbounded-agent-current (active target)
      • /usr/local/bin/unbounded-agent-last-good (rollback target)
    • Improved archive download/extract error handling for upgrade failures.
  • Daemon unit switched to indirection + failure hook

    • unbounded-agent-daemon.service now executes:
      • /usr/local/bin/unbounded-agent-current daemon
    • Adds:
      • OnFailure=unbounded-agent-daemon-recovery.service
  • Systemd recovery path for self-healing rollback

    • New recovery unit + script:
      • unbounded-agent-daemon-recovery.service
      • unbounded-agent-daemon-recovery.sh
    • Recovery behavior:
      • repoint unbounded-agent-current to unbounded-agent-last-good
      • systemctl reset-failed unbounded-agent-daemon.service
      • restart daemon
  • Lifecycle cleanup alignment

    • Reset/uninstall now removes/disables:
      • recovery unit
      • recovery script
      • blue/green/current/last-good binary artifacts
    • Added constants for recovery unit/script paths and wired host phase to install all daemon recovery assets.
  • Script contract updates

    • Provision script tests updated to assert blue/green/current/last-good and recovery artifact expectations.
# unbounded-agent-daemon.service
[Service]
ExecStart=/usr/local/bin/unbounded-agent-current daemon
OnFailure=unbounded-agent-daemon-recovery.service

Copilot AI changed the title [WIP] Implement blue-green update for host daemon systemd unit [agent] Add blue/green host daemon binary rollout with systemd recovery fallback Apr 17, 2026
Copilot AI requested a review from bcho April 17, 2026 17:16
Copilot finished work on behalf of bcho April 17, 2026 17:16
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.

[agent] blue-green update for the host daemon systemd unit

2 participants