Skip to content

Nodes, job queues and GPU

explanationinfrastructure-contract-jobs

Know which nodes, job queues and GPU nodes Platforma expects for the Backend and its jobs.

The BackendBackend — The server program of Platforma. It keeps the projects, runs the Blocks and starts jobs. Glossary runs each BlockBlock — A small application for one step of an analysis, for example the import of reads or clustering. It can combine several tools. Glossary step as a jobjob — One run of a tool on data. The Backend starts jobs on the server where it runs, or in a Kubernetes cluster. Glossary in the cluster. Each job must start quickly and must not stop in the middle. For this, Platforma expects separate nodes for the Backend and the jobs, a job queue with quotas that match these nodes, and, when Blocks use them, GPU nodes. This page says what Platforma expects; for how to set the values, see Jobs and resources.

Node pools

Platforma expects these pools of nodes. A pool is a set of nodes that have the same label and taint:

Pool Necessity Runs
System Required The components of the cluster: DNS, controllers, storage drivers. The nodes of this pool do not have taints
backend Recommended The Backend pod only
ui Recommended The short tasks that the Desktop AppDesktop App — The program that each user installs on their own computer to work with Platforma. It is a client of the Backend. Glossary waits for, for example the rendering of results
batch Recommended The batch jobs: the long computations of the Blocks
gpu Optional The jobs that use a GPU

By default, the nodes of each Platforma pool have the label platforma.bio/pool=<pool> and the taint platforma.bio/pool=<pool>:NoSchedule. Platforma also supports other labels and taints: the modules take them as inputs. Each node of a job pool also has the label platforma.bio/node-group=<name>, the name of its node group. Platforma also supports one shared pool for all, but MiLaboratories does not recommend it. Jobs on the node of the Backend make the Backend slow. The Backend next to the components of the cluster (for example KueueKueue — A Kubernetes add-on that holds jobs in a queue until the cluster has free CPU, memory and GPU for them. Glossary) can make them slow.

Platforma expects:

  • For the Backend: a node that gives the Backend pod at least 7 CPUsCPUs — The compute units of a node or of the server, as Kubernetes and the operating system count them. A job asks for a number of CPUs. The cloud quotas call them vCPUs. Glossary and 24 GiB of memory. A node of 8 CPUs and 32 GiB fits: after the reservations of KubernetesKubernetes — A system that runs programs on a group of machines (a cluster). Platforma can run in a Kubernetes cluster. Glossary, it gives a pod about 7.2 CPUs and 26 to 27 GiB. With more than 30 users at the same time, a node of 16 CPUs and 64 GiB. The Backend uses much disk and network, so it does not share its node with other services that do the same.
  • The resources of the Backend pod: its request is equal to its limit. With the Terraform modules, the default is the allocatable of the Backend node (cluster_config.cloud_values.backend.allocatable, output of the infrastructure module), so a larger node gives the Backend more. The modules refuse a node that gives less than 7 CPUs and 24 GiB. They also refuse explicit values in backend_service.backend.resources that are larger than the allocatable. With the Helm chart alone, the default of resources is 8 CPUs and 32 GiB, and the node must give at least this much. So use a larger node or set smaller values, down to 7 CPUs and 24 GiB.
  • For the jobs: amd64 nodes only. The soft limit of open files in a job pod is at least 500 000, because some tools of the Blocks open very many files and fail with a lower limit.
  • Several node shapes in each job pool: small, medium and large nodes. The jobs ask for very different CPU and memory, and each job then runs on a node near its size, so it does not start a large node for a small job.
  • Several availability zones for the job pools, where the infrastructure has them. When one zone does not have free nodes of a shape, an autoscaler (when the cluster has one) adds the node in another zone. The Backend stays in the zone of its database volume.

Job limits

The largest job fits on one node: its CPU and its memory together. Platforma expects the size of one batch node as the job limit (jobs.max_request): its CPUs as a whole number and its memory, both from the same node group. When a Block asks for more, the Backend makes the request smaller, down to this limit, so that each job can start. With GPU nodes, the limit also has the VRAM, the CPU and the memory of one GPU node.

The limit is the allocatable of the node: the part that a pod can use, minus the requests of the DaemonSets. It is not the size of the machine. A value that is too large lets jobs into the queue that cannot start on any node (see Job runtime). The limit does not have a default, because a wrong default fails only when users start to work. The operatoroperator — The person who installs and runs Platforma in your company, for example an IT engineer or a bioinformatician. Glossary or platforma-tf-services-cluster provides it in infrastructure.jobs.max_request.

Quotas

Kueue starts a job only when the quota of its queue has room for it. The quota of each queue must match the capacity of the nodes of its pool. Platforma supports two kinds of cluster, with different rules:

A quota larger than the capacity lets in jobs that cannot start. A quota smaller than the capacity keeps jobs in the queue while nodes are free.

With an autoscaler

This is the usual case in a cloud: a cluster autoscaler adds and removes the nodes of the job pools between the minimum and the maximum size of each node group. The quota is the maximum size of each node group multiplied by the allocatable of one of its nodes. Platforma expects the allocatable of each node group as an input. The cloud-specific Terraform modulescloud-specific Terraform modules — The Terraform modules platforma-tf-cloud-base and platforma-tf-cloud-cluster. There is one pair for each cloud, AWS and Google Cloud. The roots cloud and cluster apply them. They make the network, the Kubernetes cluster, the storage, the cloud identities and the registry caches. They give the hand-off file cluster_config to the cloud-agnostic Terraform modules. Glossary always use an autoscaler.

The autoscaler must add the node shape that leaves the least free CPU and memory (for example the expander least-waste), and it must not remove a node while a job runs on it. Each job pod has the annotations cluster-autoscaler.kubernetes.io/safe-to-evict: "false" and karpenter.sh/do-not-disrupt: "true" for this.

Without an autoscaler

For a cluster on bare metal, or a cluster with a fixed number of nodes, Platforma supports two ways to get the quota of each job pool:

  • the inputs give the quota and the allocatable of each node group;
  • the module reads the nodes of the pool that are ready and gives them a margin for the DaemonSets. Then the pool must be only for Platforma, and each node must have the label of its node group.

ProvisioningRequest

With an autoscaler, Kueue can also ask the autoscaler for all nodes of a job before it starts the job. This is ProvisioningRequest, and it is optional. CPU jobs and GPU jobs each have their own setting (cpu and gpu in cluster_config.autoscaling.provisioning_request): off, or a provisioning class. When the setting is off, Kueue starts jobs by quota only. A class needs an autoscaler that supports it, and some classes need special node pools. For the classes and how to choose one, see Jobs and resources.

Kueue and AppWrapper

The Backend wraps all Kubernetes objects of one job in one AppWrapperAppWrapper — A Kubernetes add-on that wraps the pods of one job into a single unit, so that Kueue admits and starts them together. Glossary and sends it through Kueue. Platforma expects:

  • Kueue 0.16.1 or later, with the AppWrapper integration on. The module installs Kueue 0.16.9. The Backend does not change the configuration of Kueue.
  • AppWrapper 1.2.3 or later, in the build that MiLaboratories patches and updates from time to time. The upstream controller can fail correct jobs at random, and users then see jobs that fail with exit code -1. The build of MiLaboratories has the fix.
  • No admission webhooks of AppWrapper. Platforma does not need them: only the Backend creates AppWrappers. The chart appwrapper and the module install the controller with the webhooks off (components.appwrapper.webhooks_enabled = false). Turn them on only in a cluster where other users or tools also create AppWrappers: then the validating webhook stops a user who puts objects into an AppWrapper that the user cannot create directly. Without the chart, set webhooksEnabled: false in the ConfigMap appwrapper-operator-config, and let the readiness probe of the controller use /healthz, not /readyz: without the webhook certificate, a request to /readyz stops the controller.

By default, the module platforma-tf-services-cluster installs Kueue and AppWrapper at pinned versions and creates the queues, the resource flavors and the priorities; this needs cluster admin rights. When the cluster already has Kueue, AppWrapper or the queues, each component can be off in components, and the module then checks before the change that the component is there. The cluster must then give two ClusterQueues and four WorkloadPriorityClasses, with the names that components.kueue.cluster_queues and components.kueue.priority_classes give. Without the module, the team that runs the cluster creates them with the same rules.

Queues and priorities

The Backend uses two ClusterQueues, and both admit jobs only from the namespaces of Platforma:

  • The UI queue for the UI tasks. All UI tasks have one priority, and it is higher than the priority of all batch jobs.
  • The batch queue for the batch jobs, with three priorities: low, normal and high. The Backend gives one of them to each job.

By default, when the UI quota is full, the UI queue can borrow the free quota of the batch queue, so the users of the Desktop App do not wait while batch nodes are free. The UI queue does not lend its own quota, and the batch queue does not borrow. Platforma also supports queues without this sharing.

The Backend can show the load of its queues in the Desktop App. For this, the Backend needs read rights on its two ClusterQueues. Without these rights, everything works, but the Desktop App does not show the queue statistics.

Job runtime

A job fails at its first disruption, so the cluster must not stop a running job pod: no node drain, no consolidation, no spot reclaim, no eviction. For this reason, automatic node upgrades, for example the upgrades of a cloud, stay away from the Platforma pools as far as the infrastructure allows. For node upgrades, see Upgrade Platforma. When the pods of a job are not ready 30 minutes (by default) after Kueue admits the job, the job fails.

GPU nodes

GPU jobs are optional. When the cluster has GPU nodes, Platforma expects that each GPU node:

  • has the resource nvidia.com/gpu, for example from the NVIDIA device plugin or the NVIDIA GPU Operator;
  • has the label platforma.bio/gpu-memory-gib: the VRAM of one GPU in GiB, a whole number. The Backend selects the node by this label;
  • has the label and the taint of the pool gpu;
  • is ready for the autoscaler only after it shows nvidia.com/gpu.

A GPU job asks for one GPU. When a GPU job does not get a GPU node in 10 minutes, it fails, and a Block that has a CPU variant of the job runs that variant.

For the names of the pools, queues and priorities and how to change them, see Default names.

Next