March 03, 2021

Automatic relay upgrades

Due to protocol versioning, it is highly recommended to keep relays up to date. This release simplifies the process, bringing automatic relay upgrade functionality, including an upgrade supervisor, migration support and update channels.

When auto_upgrade is set to true or not present in the relay config.json, the relay will attempt automatic upgrades whenever it receives an update notification from the directory during heartbeat on the update channel specified in the enrollment config. If an upgrade fails, a best-effort rollback is performed and the affected version is skipped.

The relay update channels supported by the directory and the respective latest version is exposed via the directory’s /info endpoint.

{
    "auto_upgrade": true,
    "contracts": {
        "https://contract1.example.com": {
            "update_channel": "default"
        }
    }
}

Sequence diagram

This sequence diagram shows the high-level flow of a relay upgrade and the behind the scenes interaction it has with other Wireleap components.

sequenceDiagram participant relay participant relay.next participant dir participant releases opt auto upgrade relay->>+dir: heartbeat(data, upgrade_channel) dir->>dir: validation() dir-->>-relay: upgrade_notification(version) end relay->>+releases: GET version/relay{.hash} releases-->>-relay.next: relay{.hash} relay->>+relay.next: verify deactivate relay.next opt rollback on failure relay->>relay.next: start upgrade supervisor activate relay.next Note left of relay.next: migration relay.next->>relay.next: verify() relay.next->>relay: stop() activate relay relay->>+dir: disenroll(request) deactivate relay dir-->>-relay: success relay.next->>relay.next: start() relay.next->>+dir: enroll(request) dir-->>-relay.next: success Note left of relay.next: mv relay relay.prev Note left of relay.next: mv relay.next relay deactivate relay.next end

Changes

relay

  • Improved upgrades with supervisor, migrations and rollback support.
  • Implemented update channels support via directory.
  • Added auto-upgrade functionality (optional).
  • Added 2s start delay for process health verification.

directory

  • Added relay update channel support.
  • Added relay auto-upgrade support via heartbeat responses.
  • Added 2s start delay for process health verification.
  • Fixed goroutine leak from 0.2.0.

client

  • Added 2s start delay for process health verification.

  • UI fixes and improvements:

    • Access keys can now be imported from stdin.
    • Duplicate access keys are skipped with a warning.
    • Don’t hard-fail if relays from whitelist not present in directory.
    • Empty and null whitelist are no longer treated equally.

contract

  • Added 2s start delay for process health verification.

auth

  • Added 2s start delay for process health verification.

ps-dummy

  • Added 2s start delay for process health verification.

ps-stripe

  • Added 2s start delay for process health verification.