Skip to main content

Clusters

A cluster is several workspaces run as the nodes of one, for work that spans machines: MPI, distributed training, a database with replicas. Clusters are made on the Clusters page.

A cluster​

A cluster is 2 to 16 nodes (the cluster settings' max_size, at most 64), each a workspace of the same template with the same resources, on one worker. It is created, started, stopped and deleted as a whole:

  • All or none. It is admitted whole: every node counts against the team's quota, and its worker must have room for all of them at once, besides what its running workspaces request, with a node large enough for one. The cluster's scheduler then holds every node's pod back until all of them exist, and lets them go together.
  • In time, or not at all. A cluster whose nodes do not all run within start_timeout_s (5 minutes by default), because something else took the room in the meantime, is stopped whole and shows Unschedulable.
  • Idle together. A cluster stops once none of its nodes has been used for its idle timeout, the platform's default for workspaces unless set. Its nodes have none of their own. Whoever made a cluster is told when it is stopped for want of room, by email too, or for idleness, once for the cluster and not for each node.
  • One by one, never. Nothing that would set a node apart from the others is done to it alone: starting, stopping, changing, remounting or deleting it, its variables, its network rules, growing its home. The API refuses each with workspace_managed (volume_managed for the home), and the workspaces list and panel mark the node with its cluster and offer none of it. When the platform stops a node by itself, for instance when its team runs out of credit, the whole cluster stops.

Changing one​

Edit, in a cluster's row or panel, changes everything of it a workspace's form does, of every node alike: its name, after which its nodes are named, its description, what each node runs with (device class and devices, CPU, memory, shared memory), the volumes every node mounts, its idle timeout and whether its nodes take the template's latest revision when it starts. Nodes that run restart, together, for what they run with or mount; the rest applies without a restart.

The panel sets the cluster's variables and network rules on every node alike. They apply as they do to a workspace, without a restart: variables to the shells and SSH sessions opened afterwards, rules within a minute.

Its size​

The number of nodes changes too, between 2 and max_size, whether the cluster runs or not, and the nodes that stay go on as they are: their pods are not made anew.

  • Growing, the nodes added are made like node-0: of its template revision, even when the template has since published another or was disabled, with its resources, worker, shared volumes, variables, network rules and what plugins were asked when the cluster was made, and a home of the same size and class. A running cluster starts them at once, admitted whole like a new cluster: the team's quota and the worker's room must allow all of them, or nothing changes. The new nodes are held back until all of them exist, then go together; the cluster's start timeout applies to them as it does at a start.
  • Shrinking removes the last nodes, by rank, with their homes, after the form asks. Shared volumes are kept.

The other nodes learn of the change while they run: IDEKUBE_CLUSTER_SIZE, IDEKUBE_CLUSTER_NODES, the hostfile and the ssh aliases below follow within seconds. A process that read them when it started, an MPI job say, keeps what it read: growing or shrinking a cluster is for the next job, not the one that runs.

What the nodes know​

Each node is node-<rank>, from node-0, and gets:

VariableValue
IDEKUBE_CLUSTER_IDThe cluster's ID.
IDEKUBE_CLUSTER_RANKThis node's rank.
IDEKUBE_CLUSTER_SIZEHow many nodes it has now.
IDEKUBE_CLUSTER_NODESEvery node's DNS name, by rank, separated by commas, e.g. the address of rank 0 for torchrun.

The sidecar serves all four like the variables of a workspace, so that shells, SSH sessions and the template's tasks get them as they are when they start, the size and nodes as the cluster grows or shrinks. The services the image starts by itself get the first two only, which never change. /run/idekube/ssh/hosts lists the nodes' aliases, node-0 to the last, one per line, as an MPI hostfile.

The names resolve within the worker's workspaces namespace while the nodes start, before they are ready.

Every node accepts the cluster's own SSH key, and its ssh client reaches the others as node-0, node-1 and so on: ssh node-2 hostname works as the workspace's user, without a password or a known-hosts prompt. The images' sshd must listen on port 22, as those of the idekube-container family do; the template needs no SSH endpoint for it.

Shared volumes​

A cluster may mount volumes on every node, for the data they work on together, each at a path of your choice and read-only if you like. They must be of a shared class, on the cluster's worker or on none yet; where the platform offers no such class, a cluster is made without any. They can be added, replaced or removed later, as the cluster is edited.

Network​

The nodes of a cluster reach each other on every port, whatever the network rules say: a cluster is useless otherwise. They are reached by other workspaces only as the rules allow, the cluster's own among them, which its panel sets for every node.

Administration​

  • Each node is an ordinary workspace for quotas, billing and the audit log; the cluster's own actions are audited as cluster.create, cluster.update (with size_from and size_to when its size changed), cluster.start, cluster.stop and cluster.delete. A cluster stopped for lack of room publishes cluster.unschedulable, which its creator is told of.
  • The worker's agent needs to patch pods and to create Services in the workspaces namespace; the chart grants both.
  • Gang scheduling here is the platform's own, so it works on any Kubernetes. Room is checked against what the worker reports, not against other pods of its cluster: under contention some nodes may be scheduled while others wait, until the timeout stops them all.