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

未关闭
#25 5 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
35/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃
技术栈
aws, docker, go, kubernetes

调研方向

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.

由索引模型根据 Issue 内容生成。

描述

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.

主要语言
Go
星标
5
派生
0
平均合并
21 小时 13 分钟
30 天内合并 PR
53

环境准备

  • 提供 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

nebari-dev/tapas 的其他 Issue

查看 nebari-dev/tapas 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。