Skip to content

Add resource and workspace mount controls - #26

Open
abhishek-anand wants to merge 5 commits into
mainfrom
configure-resources-and-mounts
Open

Add resource and workspace mount controls#26
abhishek-anand wants to merge 5 commits into
mainfrom
configure-resources-and-mounts

Conversation

@abhishek-anand

Copy link
Copy Markdown
Collaborator

Summary

  • add validated CPU and memory options with environment variable overrides
  • add explicit host directory mounts scoped to /workspace
  • make additional mounts read-only by default with an explicit :rw opt-in
  • persist normalized creation settings and refuse mismatched resume attempts
  • keep default behavior at 8 CPUs, 4 GB memory, and no additional mounts

Testing

  • verified 3 CPU and 2 GB limits with Apple container 1.2.2
  • verified read-only mounts reject writes
  • verified read-write mounts persist files to the host
  • verified identical settings resume successfully and changed settings fail closed
  • verified default resource values and zero additional workspace mounts

Copilot AI lite review requested due to automatic review settings August 12, 2026 00:04
@cursor

cursor Bot commented Aug 12, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

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.

Pull request overview

Adds configurable resource limits and controlled host workspace mounts to the coderunner installer workflow, with persisted creation settings to prevent resuming a container under different constraints.

Changes:

  • Added --cpus, --memory, and --mount options (plus env var defaults) with validation and /workspace-scoped mount enforcement.
  • Added read-only-by-default mount behavior with explicit :rw opt-in and persisted container creation settings via ~/.coderunner/container-config.
  • Documented resource limit and workspace mount usage in README.md.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
README.md Documents CPU/memory flags/env vars and /workspace mount rules (ro default, :rw opt-in).
install.sh Implements resource/mount parsing + validation, applies settings to container run, and persists/validates creation config for safe resume.
Suppressed comments (1)

install.sh:246

  • If container start coderunner fails but the container still exists (e.g., corrupted/unhealthy), this path proceeds to container run --name coderunner, which will typically fail due to the existing name. Add a guard here to fail closed and instruct the user to delete/recreate the container instead of attempting a new run.
echo "Starting coderunner with $CPUS CPUs and $MEMORY memory..."
if container run \
  --volume "$ASSETS_SRC/skills/user:/app/uploads/skills/user" \
  --volume "$ASSETS_SRC/outputs:/app/uploads/outputs" \
  "${VOLUME_ARGS[@]}" \
  --name coderunner \
  --detach \
  --cpus "$CPUS" \
  --memory "$MEMORY" \

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread install.sh
Comment thread install.sh
Comment thread install.sh Outdated
mkagenius and others added 4 commits August 12, 2026 10:51
macOS ships bash 3.2, where expanding an empty array under 'set -u' is a
fatal 'unbound variable' error. MOUNT_SPECS, NORMALIZED_MOUNTS and
VOLUME_ARGS are all empty when no --mount is passed, which breaks once
this branch is combined with the 'set -u' added in #24.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.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.

3 participants