Skip to content

feat(tenant): manage long-lived GPU tenant containers (#78) - #79

Merged
entelecheia merged 6 commits into
mainfrom
feat/tenant-containers
Oct 20, 2026
Merged

entelecheia merged 6 commits into
mainfrom
feat/tenant-containers

Conversation

@entelecheia

Copy link
Copy Markdown
Member

Implements #78: rootfiles tenant plus an opt-in tenant host-prep module.

What it adds

  • rootfiles tenant create|apply|status|list|user add|passwd|reset|gpu|image|port|volume resize|restart|logs|import|ops|sync
  • Per-tenant volume: sparse image, mkfs, systemd .mount unit (loop,discard,nodev,nosuid, before docker), online growth, offline ext4 shrink, overcommit report
  • Image-agnostic boot contract (/etc/tenant-system/init.sh): accounts, stored hashes for fresh accounts, host keys, sshd, autostart
  • Recreate on image/GPU/port change with password sync, writable-layer warning, -prev rollback copy and automatic rollback after a failed sshd/host-key/GPU check
  • Temporary passwords on stdin only, expired at once, hashes stored root-only
  • GPU ledger: tenant:<t> owners in gpu-allocations.json, overlaps with users and other tenants rejected; the gpu module ignores tenant entries
  • Host prep: GPU device guard timer (the dgx02-verified script), daily password sync timer, fstrim, %ops_group sudoers rule for tenant ops (no flags, no ROOTFILES_* env), mount units
  • Audit: /var/log/rootfiles-tenant.jsonl
  • tenant import from a running hand-made container with size/free-space refusal and dry-run plan
  • Spec promoted to docs/specs/2026-10-20-tenant-containers-design.md with implementation notes; guide docs/tenant.md

Verification

  • Unit: spec validation, digest, unit escaping, docker args, password never in argv/log (AC7), dry-run changes nothing (AC10), ledger conflicts (AC5), module check, operator authorization
  • New CI job tenant-scenario runs the real lifecycle on the runner's Docker + systemd: AC1, AC2, AC3, AC6, AC7, AC8, AC9, AC10
  • Not covered in CI: AC4 (needs a GPU host; relies on the nvidia runtime behavior verified on dgx02 2026-10-20)

Closes #78

🤖 Generated with Claude Code

https://claude.ai/code/session_0177Zk7to4EYohgM59v4Fcj7

Add `rootfiles tenant` (create, apply, status, list, user add, passwd,
reset, gpu, image, port, volume resize, restart, logs, import, ops, sync)
and an opt-in `tenant` host-prep module.

Each tenant gets one container on the nvidia runtime, a size-capped
volume on a loop-mounted image mounted before docker, accounts and host
keys kept outside the container, temporary passwords that must be
changed at first login, recreate with automatic rollback, GPUs in the
shared allocation ledger under a tenant:<t> owner, limited operator
delegation through one sudoers rule, and a JSONL audit log.

Closes #78

Claude-Session: https://claude.ai/code/session_0177Zk7to4EYohgM59v4Fcj7
Copilot AI balanced review requested due to automatic review settings October 19, 2026 23:58

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-20T00:02:46.119650Z ac82cff PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ac82cff93b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/tenant/manager.go
Comment thread internal/tenant/assets.go
Comment thread internal/tenant/spec.go
@entelecheia
entelecheia merged commit e317f60 into main Oct 20, 2026
55 checks passed
@entelecheia
entelecheia deleted the feat/tenant-containers branch October 20, 2026 00:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(tenant): manage long-lived GPU tenant containers with volume quota, accounts and limited delegation

2 participants