Storage
Which file systems, volumes and buckets does Platforma expect and support?
Platforma keeps each kind of data on the storage that fits it best. The jobsjob — One run of a tool on data. The Backend starts jobs on the server where it runs, or in a Kubernetes cluster. Glossary work in a fast workspaceworkspace — The storage where the Backend and all jobs keep the working files of running jobs. The Backend and the jobs use it at the same time. In Kubernetes, it is a network file system; in Single Server mode, it is a folder on the server. Glossary, and the BackendBackend — The server program of Platforma. It keeps the projects, runs the Blocks and starts jobs. Glossary keeps its database on a block volume. The results go to a bucket that is cheap to keep and 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 downloads from directly. Platforma expects these parts:
- Workspace: a file system that all jobs share, required.
- Database volume: block volume, retained.
- Logs volume: block volume, can be new.
- Scratch volumes: temporary job disks, optional.
- Primary storage: the bucket for results.
- Data libraries: input data, optional.
The Backend finds the volumes through StorageClasses. By default, their names are
platforma-workspace, platforma-database, platforma-logs and platforma-scratch; to use other
names, see Default names. For how to set the storage, see
Storage.
Workspace
The workspace is one file system that the Backend and all jobs share. The Backend puts the input files of a job into its working directory, and the job writes its results there for the Backend. Platforma expects from the workspace:
- ReadWriteMany: the Backend pod and all job pods, on all node pools and in all zones, mount it at the same time.
- Close-to-open consistency: when a job closes a file, the Backend reads the full file at
once, also when its node saw before that the file did not exist. A cache of absent names, such
as the NFS option
lookupcache=all, breaks this. - POSIX semantics: hard links, inode numbers that do not change, atomic rename, and
chmodby the owner. - Programs can run: the jobs run programs from the workspace, so the mount does not have the
noexecoption. - The same owner on all nodes: the file system keeps the user and the group of the Backend
and the jobs (see Identity)
on the files from each side, or maps all users to them. A squash to another user, such as
nobody, breaks the jobs. - Persistence: the data of the workspace does not depend on the pods. The reclaim policy is
Retain.
The directory of each instance belongs to the user and the group of the Backend, with the mode
770. One file system can serve several instances: each instance then has its own directory and
its own PersistentVolume for it, and two instances never share one directory.
Platforma supports three sources of the workspace: a StorageClass, an existing PersistentVolume or an existing PersistentVolumeClaim.
Database volume
The Backend keeps its database on a block volume with the access mode ReadWriteOnce. A network file system, such as NFS or CephFS, is not a block volume and does not fit. The StorageClass must have:
volumeBindingMode: WaitForFirstConsumer, so that the volume is made in the zone of the Backend pod;reclaimPolicy: Retain, so that the volume does not depend on its claim.
To keep the database safe, also back it up: see Backup and restore.
Logs volume
The Backend writes its logs on a second block volume with the access mode ReadWriteOnce. Its StorageClass binds at the first consumer, like the database, and the reclaim policy can be any. The logs volume does not need to stay: the Backend works the same with a new, empty logs volume.
Scratch volumes
A job can get its own temporary disk: a scratch volume. Scratch is optional, but recommended: in most clouds, the jobs then do much less input and output on the workspace, so the bill and the run time of the jobs go down. Without scratch, the temporary directory of a job is on the workspace.
A scratch volume is an ephemeral volume of the job pod, with the access mode ReadWriteOnce. Its StorageClass must have:
reclaimPolicy: Delete, so that the volume goes with the pod and does not fill the storage;volumeBindingMode: WaitForFirstConsumerwhere the infrastructure has zones, for example in a cloud, so that the volume is made in the zone of the job pod;allowVolumeExpansion: false: the Backend sets the size of each volume one time.
Platforma also needs the smallest and the largest size that the StorageClass can make, and the company chooses the disk type, the speed and the encryption. For the sizes and the recommended speed, see Scratch volumes.
Primary storage
The Backend keeps all results and uploaded files in one bucket: the primary storageprimary storage — The bucket (Amazon S3 or Google Cloud Storage) or folder where Platforma keeps all results and uploaded files. Glossary. Platforma supports three kinds of bucket:
- Amazon S3, in AWS;
- any storage with an S3-compatible interface, in a cloud or in the data center of your company, with static access keys from a Secret;
- Google Cloud Storage, in Google Cloud.
Object storage other than S3, S3-compatible storage and Google Cloud Storage is not supported.
For all of them:
- The Backend reads and writes the bucket with its cloud identitycloud identity — The identity that the cloud gives to the Platforma pod (IAM roles for service accounts on AWS, Workload Identity on Google Cloud). With it, Platforma needs no access keys. Glossary or with static access keys that it gets from a Secret. See Identity.
- The storage must support presigned URLs. The Desktop App uploads and downloads the files directly from the bucket, with links that the Backend signs. The computers of the users must reach the bucket over the network. A bucket policy that allows only the internal network of the company or of the cloud stops the uploads and the downloads.
- Only the Backend removes objects. A lifecycle rule must not delete, move or change the storage class of objects. A rule that removes incomplete multipart uploads after 7 days is recommended, because it does not touch the objects.
- When the bucket is lost, the results of all projects are lost. For what stays when Platforma is removed, see Uninstall Platforma.
Amazon S3 and compatible storage
The Backend uses the AWS SDK for Go v2. Storage with an S3-compatible interface must support the S3 API as this SDK uses it:
- Presigned URLs. The Desktop App uploads and downloads the files directly. A signed link is valid for 60 s.
- Multipart uploads: up to 10000 parts, with parts of 5 MiB or more, and listing of multipart uploads and of their parts.
- ListObjectsV2 and range reads.
- Conditional writes:
If-None-MatchandIf-MatchonPutObjectandCompleteMultipartUpload. Without them, the Backend does not start. - Checksums on upload:
x-amz-checksum-sha256with a streaming trailer. A service that does not support them, such as Ceph or an older MinIO, needs the checks off:data_integrity_checks = false.
The Backend creates the bucket when it does not exist. MiLaboratories tests Platforma with Ceph RGW in its CI.
Platforma takes these values for the bucket (the inputs infrastructure.primary_storage.s3 of the
Terraform module platforma-tf-services, and primaryStorage.s3 in the Helm chart):
bucket,regionandprefix;endpoint: the address of an S3-compatible service, for example MinIO. A custom endpoint uses path-style addressing automatically; there is no option for it;external_endpoint(externalEndpoint): the address for the Desktop App, when it is not the same asendpoint. The computers of the users must reach it;data_integrity_checks(dataIntegrityChecks):trueby default;secret.access_keyandsecret.secret_key(secret.accessKey,secret.secretKey): the name and the key of an existing Secret. When they are empty, the Backend uses the cloud identity.
Without a cloud, the Backend gets access to the primary storage only with static access keys. There is no STS or web-identity option for it. When the endpoint uses a certificate of a private CA, add the CA to the CA bundleCA bundle — One PEM file with the certificate authorities that a program trusts. In Kubernetes, Platforma can give the Backend and all jobs one bundle with the public and the corporate certificate authorities. Glossary of the chart: see Proxy and custom CA.
Google Cloud Storage
The Google service account of the Backend must be able to sign blobs, for example with the role Service Account Token Creator on itself: without it, each download fails. A signed link is valid for 1 h. For the full list of rights, see Storage rights of the Backend.
Data libraries
Data librariesdata library — A folder or bucket with input data of the company. Users select files from it in the Desktop App. Platforma only reads it. Glossary are optional, read-only sources of input data. A data library is an Amazon S3 or compatible bucket, a Google Cloud Storage bucket, or a file system. A file system is a PersistentVolumeClaim in the namespace, which only the Backend pod mounts, read-only. Only the Backend reads them, and the Desktop App downloads from a bucket directly, with the same network and signing rules as the primary storage. See Data libraries.