Pixi environments in the home make shared-storage homes slow to move and first-start

Aperta
#25 5 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
aws, docker, go, kubernetes

Direzione di ricerca

Start by reading internal/pixienv and tracing how environment directories and the pixi cache are chosen and installed. The issue describes node-local storage keyed by the environment's sha256, but says the location for Nebi-selected and repository environments still needs design work. Done means environments can be reused per node and home moves can skip the rebuildable environment and cache.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Moving one person's home to shared storage on a NIC cluster on AWS took 24 minutes, and almost all of it was the pi environment, not their files. Their home was nearly empty apart from that.

internal/pixienv installs each app's pixi environment into the owner's home, under ~/.javo/envs/<sha256 of the environment's files>, with pixi's package cache beside it (pixi-cache). On a node-local disk that is fast, and the first start pays for the install once. On network storage it is the slow path every time:

  • Home moves copy it. The move to shared (EFS over NFS 4.1 through csi-driver-nfs) copied 25,959 files and 1.17 GB for one person: 19m22s to copy (16:06:57 to 16:26:19 UTC), then about 4 minutes checking the copy before it switched. The other person, whose agent app had never started, so had no environment installed, was switched under two minutes after the move began. The owner's apps are stopped for the whole move.
  • First starts write it file by file. A new person's first agent app installs tens of thousands of small files onto NFS. I did not time it, but it is the same pattern EFS was slowest at during the copy.

Shared storage is how a person's apps get to run on any node (per-person EBS disks pin all of a person's apps to one node in one zone), so on AWS this cost lands on exactly the setup we need.

Why shared homes on AWS at all: it is CPU on one node, not disk

With per-person homes (perUser, one gp3 volume each) nothing ran out of storage. The disks had room and attached fine. What ran out was CPU on the one node the disks could attach to:

0/2 nodes are available: 1 Insufficient cpu, 1 node(s) didn't match PersistentVolume's node affinity
  • gp3 volumes are created where the first pod lands (WaitForFirstConsumer). Both people's first pods landed on the us-east-1b node, so both homes were created in us-east-1b.
  • An EBS volume attaches to one node at a time and only in its own zone, so every app of both people had to run on that node. The us-east-1a node was idle for them.
  • That node is a t3.xlarge with 3920m CPU to hand out. System pods and one medium pi app (2 CPU) left about 680m, so the next pi app (1 CPU) stayed Pending.

So there are two setups that hold together, and only one of them needs this issue:

Homes Environments Where a person's apps can run
A per-person gp3 (today's perUser) in the home, as now one node, the one holding their disk. Needs nodes added in that zone when it fills: a cluster autoscaler with a node group per zone (NIC)
B shared RWX (EFS over NFS 4.1) per-node cache, this issue any node

A per-person EBS volume for environments alongside shared homes would bring the one-node limit back, since every app of that person would have to run where that volume is attached. EBS multi-attach is io2 block-only and needs a cluster-aware filesystem, so it is not a way around that. The per-node cache proposed below is not per person: one copy per node per environment, shared by everyone on that node who uses it.

Both directories are rebuildable from the pinned pixi.lock: the env folder by pixi install --frozen, the cache by downloading again. Nothing in them is the person's work.

What I think we should do

  • Keep environments off the home. Install them on node-local storage keyed by the same sha256, shared by every pod on that node that uses the same environment, so the first start on a node installs once and later starts on that node reuse it. A read-only image layer or a per-node cache volume would both do it. The marker-file logic in internal/pixienv already handles a half-written folder.
  • Until then, don't copy what can be rebuilt. The home move could skip ~/.javo/envs and the pixi cache and let the next start reinstall them. That cuts a move to the size of the person's own files.

We need to work out where an environment picked from Nebi, or one from an app's repository, should live under the first option, since today they share the same folder.

Lingua principale
Go
Stelle
5
Fork
0
Merge medio
21h 13m
PR unite (30g)
53

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di nebari-dev/tapas

Tutte le issue di nebari-dev/tapas

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.