[PR #27] [MERGED] fix: best-effort max storage on docker backend #52

Closed
opened 2026-10-18 21:13:49 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/terminals/pull/27
Author: @james-westbrook
Created: 5/24/2026
Status: ✅ Merged
Merged: 6/22/2026
Merged by: @tjbck

Base: main ← Head: fix-docker-storage-limit


📝 Commits (1)

  • c972bac fix: best-effort max storage on docker backend

📊 Changes

2 files changed (+29 additions, -1 deletions)

View changed files

📝 README.md (+3 -0)
📝 terminals/backends/docker.py (+26 -1)

📄 Description

Description

The docker backend silently ignored the storage field. provision() wired up image, memory_limit, cpu_limit, and env, but never read storage — so per-policy storage and TERMINALS_MAX_STORAGE had no effect on Docker (Kubernetes already sized PVCs correctly).

This wires storage into the container via Docker's StorageOpt, capping the writable layer. Because not every storage driver supports quotas (e.g. overlay2-on-ext4), provisioning falls back gracefully. If the daemon rejects the quota, it logs a warning and retries without it instead of failing.

Caveat documented in the README: StorageOpt limits only the container's writable layer, not the bind-mounted /home/user where user files persist (Docker can't quota a bind mount). For hard per-user storage caps, use a Kubernetes backend.

  • terminals/backends/docker.py — apply StorageOpt from storage, with retry-without-quota fallback
  • README.md — note on Docker storage-limit behavior and its limits

Verified end-to-end against a live Docker daemon: quota applied (StorageOpt={'size': ...} confirmed via inspect), absent when unset, and fallback retries cleanly on rejection.

Fixes #23


Contributor License Agreement

Note

Deleting the CLA section will lead to immediate closure of your PR and it will not be merged in.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/open-webui/terminals/pull/27 **Author:** [@james-westbrook](https://github.com/james-westbrook) **Created:** 5/24/2026 **Status:** ✅ Merged **Merged:** 6/22/2026 **Merged by:** [@tjbck](https://github.com/tjbck) **Base:** `main` ← **Head:** `fix-docker-storage-limit` --- ### 📝 Commits (1) - [`c972bac`](https://github.com/open-webui/terminals/commit/c972bac9c957eb6a34b0bc03b48ba14970d12d86) fix: best-effort max storage on docker backend ### 📊 Changes **2 files changed** (+29 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `README.md` (+3 -0) 📝 `terminals/backends/docker.py` (+26 -1) </details> ### 📄 Description ## Description The `docker` backend silently ignored the `storage` field. `provision()` wired up `image`, `memory_limit`, `cpu_limit`, and `env`, but never read `storage` — so per-policy `storage` and `TERMINALS_MAX_STORAGE` had no effect on Docker (Kubernetes already sized PVCs correctly). This wires `storage` into the container via Docker's `StorageOpt`, capping the writable layer. Because not every storage driver supports quotas (e.g. overlay2-on-ext4), provisioning falls back gracefully. If the daemon rejects the quota, it logs a warning and retries without it instead of failing. Caveat documented in the README: `StorageOpt` limits only the container's writable layer, not the bind-mounted `/home/user` where user files persist (Docker can't quota a bind mount). For hard per-user storage caps, use a Kubernetes backend. - `terminals/backends/docker.py` — apply `StorageOpt` from `storage`, with retry-without-quota fallback - `README.md` — note on Docker storage-limit behavior and its limits Verified end-to-end against a live Docker daemon: quota applied (`StorageOpt={'size': ...}` confirmed via inspect), absent when unset, and fallback retries cleanly on rejection. ## Related Issues Fixes #23 --- ## Contributor License Agreement <!-- 🚨 DO NOT DELETE THE TEXT BELOW 🚨 Keep the "Contributor License Agreement" confirmation text intact. Deleting it will trigger the CLA-Bot to INVALIDATE your PR. Your PR will NOT be reviewed or merged until you check the box below confirming that you have read and agree to the terms of the CLA. --> - [x] By submitting this pull request, I confirm that I have read and fully agree to the [Contributor License Agreement (CLA)](./CLA.md), and I am providing my contributions under its terms. > [!NOTE] > Deleting the CLA section will lead to immediate closure of your PR and it will not be merged in. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-18 21:13:49 +00:00
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
open-webui/terminals#52
No description provided.