Skip to content

shared_with_container and files inside have user permissions instead of root#235

Open
klemen1999 wants to merge 4 commits into
mainfrom
feat/outputs_with_user_permissions
Open

shared_with_container and files inside have user permissions instead of root#235
klemen1999 wants to merge 4 commits into
mainfrom
feat/outputs_with_user_permissions

Conversation

@klemen1999

@klemen1999 klemen1999 commented Jun 4, 2026

Copy link
Copy Markdown
Collaborator

Purpose

  • Made changes to the docker handling so that now files created by docker (e.g. directories in shared_with_container/outputs folder) are made with user permissions instead of root
  • shared_with_container is now created automatically if it doesn't exist which solves the issue where previously this was created by docker and with root permissions
  • More clear README in respect to changes above

Specification

None / not applicable

Dependencies & Potential Impact

None / not applicable

Deployment Plan

None / not applicable

Testing & Validation

None / not applicable

AI Usage

Assisted-by: AGENT_NAME:MODEL_VERSION [TOOL1] [TOOL2]

Submitted code was reviewed by a human: YES/NO

The author is taking the responsibility for the contribution: YES/NO

Summary by CodeRabbit

  • Documentation

    • Restructured configuration guidance including legacy option support
    • Clarified file-sharing directory setup, auto-creation behavior, and visibility rules
    • Updated model conversion workflow instructions
  • Chores

    • Enhanced directory initialization at startup
    • Improved container environment configuration for proper user context and paths

@klemen1999 klemen1999 requested a review from a team as a code owner June 4, 2026 20:19
@klemen1999 klemen1999 requested review from conorsim, kozlov721 and tersekmatija and removed request for a team June 4, 2026 20:19
@coderabbitai

coderabbitai Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

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

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

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ 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.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 70b4987b-8d31-4c6d-98d4-489498f7387c

📥 Commits

Reviewing files that changed from the base of the PR and between 61c5ccb and 70931b9.

📒 Files selected for processing (3)
  • modelconverter/cli/utils.py
  • modelconverter/utils/constants.py
  • modelconverter/utils/docker_utils.py
📝 Walkthrough

Walkthrough

The PR extends ModelConverter's Docker setup by introducing shared directory initialization, container user identity mapping, and environment variable configuration. The launcher now calls init_dirs() to create host-side directories for shared files and runtime data, while Docker compose is updated to apply the current user's UID/GID and map container home/cache paths. README documentation is updated to explain the new directory structure and workflows.

Changes

Shared Directory and Docker User Configuration

Layer / File(s) Summary
Directory constants and CLI initialization
modelconverter/utils/docker_utils.py, modelconverter/cli/utils.py
Container-specific home and cache directory constants are defined. init_dirs() is expanded to create SHARED_DIR, MISC_DIR, and runtime subdirectories (runtime-home, runtime-cache) alongside existing config/model/output/calibration directories.
Docker user and environment configuration
modelconverter/utils/docker_utils.py, modelconverter/__main__.py
_get_current_user_spec() derives host UID/GID, and generate_compose_config() conditionally injects user identity and environment variable overrides (HOME, XDG_CACHE_HOME) into the compose service. The launcher calls init_dirs() before Docker tag selection.
README: Directory structure and workflow documentation
README.md
Documentation explains the new misc/ directory for internal scratch files, clarifies that shared_with_container and subdirectories are auto-created by the CLI, and provides separate setup instructions for CLI vs manual docker run workflows.
README: Configuration and RVC4 analysis documentation
README.md
Configuration section numbering is reorganized to add the "YAML Configuration File (Legacy)" entry, and RVC4 DLC analysis list is reordered to explicitly itemize layer cycle usage as item #2.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Suggested reviewers

  • tersekmatija
  • conorsim

Poem

🐰 A rabbit hops through directories anew,
Runtime homes and caches all in view,
Docker users mapped with UID care,
Shared spaces bloom in the container's lair,
Documentation blooms—the path is clear! 🌱

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately captures the main objective of the PR: ensuring files in shared_with_container have user permissions instead of root, which is the primary focus across all code changes (Docker config, directory initialization, and documentation).
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/outputs_with_user_permissions

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
modelconverter/utils/docker_utils.py (1)

26-27: ⚡ Quick win

Centralize runtime directory suffixes to avoid cross-file drift.

"runtime-home" and "runtime-cache" are duplicated here and in modelconverter/cli/utils.py (Line 75-76 there). Please define shared constants (e.g., in modelconverter.utils.constants) and derive both host/container paths from them so these paths cannot silently diverge later.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@modelconverter/utils/docker_utils.py` around lines 26 - 27, The two
hard-coded suffixes "runtime-home" and "runtime-cache" are duplicated as
_CONTAINER_USER_HOME and _CONTAINER_USER_CACHE; create shared constants (e.g.,
RUNTIME_HOME_SUFFIX and RUNTIME_CACHE_SUFFIX) in a new or existing module
modelconverter.utils.constants and replace the duplicated literals in
modelconverter/utils/docker_utils.py (symbols _CONTAINER_USER_HOME,
_CONTAINER_USER_CACHE) and in modelconverter/cli/utils.py with derived paths
that concatenate the shared suffixes to the common base (host/container
prefixes), and update imports in both files to pull the suffix constants from
modelconverter.utils.constants so the suffixes stay centralized.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@modelconverter/utils/docker_utils.py`:
- Around line 26-27: The two hard-coded suffixes "runtime-home" and
"runtime-cache" are duplicated as _CONTAINER_USER_HOME and
_CONTAINER_USER_CACHE; create shared constants (e.g., RUNTIME_HOME_SUFFIX and
RUNTIME_CACHE_SUFFIX) in a new or existing module modelconverter.utils.constants
and replace the duplicated literals in modelconverter/utils/docker_utils.py
(symbols _CONTAINER_USER_HOME, _CONTAINER_USER_CACHE) and in
modelconverter/cli/utils.py with derived paths that concatenate the shared
suffixes to the common base (host/container prefixes), and update imports in
both files to pull the suffix constants from modelconverter.utils.constants so
the suffixes stay centralized.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d9cc07ee-16c9-4b35-b70c-53d9de35bb3b

📥 Commits

Reviewing files that changed from the base of the PR and between c164bf1 and 61c5ccb.

📒 Files selected for processing (4)
  • README.md
  • modelconverter/__main__.py
  • modelconverter/cli/utils.py
  • modelconverter/utils/docker_utils.py

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