Skip to content

feat(docker): expose memory (RAM) limit as an Advanced View field (OS-467)#2673

Open
elibosley wants to merge 1 commit into
masterfrom
feature/os-467-docker-memory-limit
Open

feat(docker): expose memory (RAM) limit as an Advanced View field (OS-467)#2673
elibosley wants to merge 1 commit into
masterfrom
feature/os-467-docker-memory-limit

Conversation

@elibosley

Copy link
Copy Markdown
Member

Summary

Implements OS-467 — exposes the existing docker --memory capability as a first-class Memory limit field in Advanced View, instead of requiring users to hand-write it in Extra Parameters.

Changes

  • include/CreateDocker.php — new contMemory text field in the Advanced View block (after Extra Parameters), with placeholder/pattern/help.
  • include/Helpers.php:
    • postToXML()$xml->Memory = xml_encode(trim($post['contMemory']??'')).
    • xmlToCommand()$cmdMemory = strlen($xml['Memory']??'') ? '--memory='.escapeshellarg($xml['Memory']) : '' and added $cmdMemory to the docker create sprintf (right after --cpuset-cpus). Verified placeholder/arg parity (41 = 41).
  • languages/en_US/helptext.txt:docker_memory_limit_help:.

Behavior

  • Empty field → no --memory flag (unchanged default).
  • Accepts a byte count or b/k/m/g suffix (e.g. 512m, 2g); validated client-side via pattern.
  • Edit-mode autopopulation works via the existing cont+key convention (Settings['Memory']contMemory).
  • If --memory is also present in Extra Parameters, Docker honors the later flag; documented in the help text.

Notes

  • php -l clean on both PHP files.

Testing to do on hardware

  • Set e.g. 512m, create/edit a container, confirm docker inspect shows the memory limit and the value round-trips on re-edit.
  • Empty field → container has no memory limit.

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@elibosley, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 53 minutes and 42 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 3dd5775b-84e2-4e41-86a6-f7cd77c187d0

📥 Commits

Reviewing files that changed from the base of the PR and between 644ab82 and 4d18192.

📒 Files selected for processing (3)
  • emhttp/languages/en_US/helptext.txt
  • emhttp/plugins/dynamix.docker.manager/include/CreateDocker.php
  • emhttp/plugins/dynamix.docker.manager/include/Helpers.php
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/os-467-docker-memory-limit

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

github-actions Bot commented Jun 19, 2026

Copy link
Copy Markdown

🔧 PR Test Plugin Available

A test plugin has been generated for this PR that includes the modified files.

Version: 2026.06.19.1437
Build: View Workflow Run

📥 Installation Instructions:

Install via Unraid Web UI:

  1. Go to Plugins → Install Plugin
  2. Copy and paste this URL:
https://preview.dl.unraid.net/pr-plugins/pr-2673/webgui-pr-2673.plg
  1. Click Install

Alternative: Direct Download

⚠️ Important Notes:

  • Testing only: This plugin is for testing PR changes
  • Backup included: Original files are automatically backed up
  • Easy removal: Files are restored when plugin is removed
  • Conflicts: Remove this plugin before installing production updates
  • Post-merge behavior: This preview stays available after merge until preview storage expires or it is manually cleaned up

📝 Modified Files:

Click to expand file list
emhttp/languages/en_US/helptext.txt
emhttp/plugins/dynamix.docker.manager/include/CreateDocker.php
emhttp/plugins/dynamix.docker.manager/include/Helpers.php

🔄 To Remove:

Navigate to Plugins → Installed Plugins and remove webgui-pr-2673, or run:

plugin remove webgui-pr-2673

🤖 This comment is automatically generated and will be updated with each new push to this PR.

elibosley added a commit that referenced this pull request Jun 19, 2026
…(OS-469) (#2674)

## Summary
Implements
[OS-469](https://linear.app/lime-technology/issue/OS-469/pr-test-plugin-ship-a-diffpatch-so-multiple-pr-plugins-can-stack-on).
The per-PR test plugin used to package changed files as **whole-file
copies**, overwrite them on install, and **abort** if another
`webgui-pr-*` plugin already managed any of the same files — so two PRs
touching one file (e.g.
[#2672](#2672) +
[#2673](#2673), both editing
`CreateDocker.php`) couldn't be tested together.

Now it ships a **unified diff** and `patch`-applies it, so
non-overlapping edits to the same file stack.

## How it works
- **Build** (`pr-plugin-build.yml`): for changed **text** files, stage
base + head versions in system layout and emit `pr.patch` (`diff -ruN`,
paths apply with `patch -p1` at `/`). Changed **binary** files are
copied whole into `binary/` with a `binary_files.txt` list. Both go in
the same tarball.
- **Plugin** (`generate-pr-plugin.sh`): on install, `patch -p1 --dry-run
--forward` first — **abort with a clear message on a real reject**
(overlapping change), otherwise apply and save `applied.patch`. Binaries
are whole-file replaced with a per-binary conflict guard. On remove (and
before update), reverse the patch (`patch -R`) and restore binary
backups.
- **Upload/R2 plumbing unchanged** — still a single tarball with the
same URL/SHA wiring.

## Validation (local simulation)
- Two patches editing the same file at different lines → **both apply,
both changes coexist**.
- Reversing one → **only that change is removed, the other stays**.
- Overlapping edits → **dry-run fails → install aborts** cleanly.
- Generated `.plg` is well-formed XML (all placeholders substituted);
`bash -n` + YAML parse clean.

## Notes / still to verify
- Real validation needs CI + an Unraid box installing two stacked PR
plugins. Conveniently, **this PR touches `.github/**`, so it will itself
build a PR test plugin with the new code** — a live smoke test of the
generator.
- Binary deletions aren't handled (rare); text add/modify/delete are.
- `patch` is present in the Unraid base; uses `--forward`/`--batch` for
non-interactive apply with fuzz.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Chores**
* Improved plugin install/update and uninstall to use a deterministic,
patch-based manifest workflow for safer reversibility.
* Enhanced plugin package generation to build a patch-oriented payload,
distinguishing text changes from full binary replacements.
* Updated the uninstall confirmation flow to reflect the new removal
behavior.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Add a "Memory limit" field to the Docker Add/Edit form (Advanced View)
that maps to docker --memory, instead of requiring users to hand-write
it in Extra Parameters. Empty leaves the container unlimited (unchanged
default). The value round-trips through the container XML template
(<Memory>) and is emitted as --memory=<value> in the docker create
command.

Closes OS-467

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@elibosley elibosley force-pushed the feature/os-467-docker-memory-limit branch from d441925 to 4d18192 Compare June 19, 2026 14:37
elibosley added a commit that referenced this pull request Jun 23, 2026
…rop shared-file edits

- Save mode is now much faster: pipe the single-pass streaming zip
  (scripts/flash_backup) into the destination file instead of appending each
  top-level item to a growing archive (one zip invocation vs many).
- On completion the save job raises an Unraid notification (the tray bell) with a
  click-to-download link, exposes the saved file for download via a docroot
  symlink, and the GUI shows a Download button next to the saved path.
- Revert the helptext.txt and .gitignore edits to base so this PR touches only
  its own files. helptext.txt was the single file shared with other in-flight PR
  test plugins (#2671, #2673), which made the stacked PR-plugin patch fail to
  apply; with it gone, #2677 stacks cleanly.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.

1 participant