Skip to content

[WIP] refactor: replace domain heartbeat with endpoint-level health reporting#94

Open
shubham3121 wants to merge 1 commit intomainfrom
refactor/ep-heath-checks
Open

[WIP] refactor: replace domain heartbeat with endpoint-level health reporting#94
shubham3121 wants to merge 1 commit intomainfrom
refactor/ep-heath-checks

Conversation

@shubham3121
Copy link
Member

This pull request refactors and enhances the heartbeat mechanism for SyftHub marketplaces by shifting from domain-level heartbeats to endpoint-level health reporting. The new system periodically checks the health of all published endpoints and reports their status to SyftHub, providing more granular and accurate liveness signals. Key changes include renaming and restructuring the heartbeat manager, introducing endpoint health checking logic, and updating SyftHub client interactions.

Heartbeat Manager Refactor & Endpoint Health Reporting

  • Renamed HeartbeatManager to EndpointHeartbeatManager, moved the file, and updated all references and log messages to reflect endpoint-level health reporting instead of domain-level heartbeats. The manager now checks the health of all published endpoints and reports their status as a liveness signal. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]

Endpoint Health Checking Logic

  • Added the EndpointHealthChecker protocol and implemented get_published_endpoint_health in EndpointHandler, which concurrently checks the health of each endpoint's linked dataset and model, returning a list of health statuses. [1] [2]

SyftHub Client Integration

  • Added update_endpoint_health method to SyftHubClient for sending endpoint health status to SyftHub, replacing the previous heartbeat mechanism and supporting non-destructive updates and domain liveness via TTL.

Dependency Injection & Initialization

  • Updated initialization in main.py and throughout the manager to inject the new EndpointHeartbeatManager and ensure correct usage of the health checker and repositories. [1] [2]

Supporting Types and Imports

  • Added necessary imports and supporting types, such as HealthcheckStatus, to enable endpoint health checking and status reporting. [1] [2]

- Add EndpointHealthChecker Protocol for ISP-based decoupling
- Add get_published_endpoint_health() on EndpointHandler (checks dataset + model healthchecks concurrently with 5s timeout)
- Add update_endpoint_health() on SyftHubClient
- Move manager from shared/ to endpoints/ component
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.

1 participant