liveBook · Manning

Persistent volume

As explained in Distributed Machine Learning Patterns

A PersistentVolume is a Kubernetes storage resource representing durable storage that can be provisioned and mounted independently of an individual workload.

Distributed training workers run in Kubernetes Pods, so their local files disappear when the Pods complete. A PersistentVolume (PV) supplies cluster storage whose lifecycle is independent of those Pods, preserving checkpoints and trained models for later serving. section 9.2.2

A PV may be provisioned by an administrator or dynamically provisioned. A PersistentVolumeClaim (PVC) is the user’s storage request: it specifies capacity and access mode, while Pods consume the resulting storage through a mounted volume. section 9.2.2

A typical machine-learning workflow uses the volume to carry artifacts between isolated execution steps:

  • Reuse the same claim across workflow steps so ingestion can persist a dataset and training can persist the model for selection and serving. section 9.4.1

Distributed training with durable output

Two TFJob worker replicas mount the training claim at /trained_model. The workers write saved models and checkpoints to that path; after the worker Pods finish, those artifacts remain available to downstream model-selection and serving steps. section 9.4.1

How Distributed Machine Learning Patterns covers it

How deep it goes
Defines PV and PVC roles, access modes, mounts, and workflow handoffs without detailing storage-backend internals.
Examples
Uses a 1 GiB ReadWriteOnce claim mounted by two distributed-training workers and reused across ingestion, training, and serving steps.
What it assumes
Assumes Kubernetes Pods and containers, while distinguishing storage claims from the compute resources consumed by Pods.
What you can do after
Operate Kubernetes training workflows that retain datasets, checkpoints, and exported models after worker Pods terminate.
How it connects
Links Kubernetes Pods, PersistentVolumeClaim, volume mounts, TFJob, Argo Workflows, model checkpoints, and model serving.

Also explained in

Compare how 7 books explain persistent volume →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Distributed Machine Learning Patterns. The section links point to the parts of the book it draws on.