Skip to main content

heartbeat

The compute's own registration with the hub.

Separate from the pod's dataset heartbeat: this carries what identifies the compute -- installation id, cluster and private IP -- and whether each of its children is healthy, and gets back the compute id and domain its TLS certificate is issued for. The hub refreshes the compute's DNS entry when the IP changes, and records when each child last reported healthy.

Module​

Functions​

register_compute​

def register_compute(    hub: BitfountHub,    *,    instance_id: str,    cluster_id: str | None,    children: Mapping[str, ChildHealth],) ‑> ComputeRegistration | None:

Register (create or refresh) this compute with the hub.

Never raises: registration is retried on the next tick, and a failure here must not touch the compute's children.

Arguments

  • hub: The compute's authenticated hub session.
  • instance_id: The installation id.
  • cluster_id: The compute cluster, or None for a compute API key.
  • children: Each child's latest health, by the name the hub knows it by.

Returns The registration, or None if it could not be completed this time -- no private IP could be determined, the hub rejected the request, or the response was not what was expected.

Classes​

ComputeRegistration​

class ComputeRegistration(compute_id: str, domain: str):

What the hub knows this compute as.

Variables​

  • compute_id : str
  • domain : str