Skip to content

Fix recursive permission update to reduce docker layer size - #1515

Merged
qianl-nv merged 5 commits into
mainfrom
qianl/chore/reduce-docker-venv-layer
Oct 26, 2026
Merged

qianl-nv merged 5 commits into
mainfrom
qianl/chore/reduce-docker-venv-layer

Conversation

@qianl-nv

@qianl-nv qianl-nv commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

Reduce the Docker image size by maintaining shared-group permissions in each package-installation layer. Repair restrictive modes preserved by package caches without duplicating the complete virtual environment in a final layer.

Why this change?

The Docker build made /opt/isaaclab-venv writable with a final chmod -R a+rwX. Docker overlay storage copied every changed inode into that layer, producing a 12.9 GB uncompressed editable-install layer and increasing image pull and extraction time.

Package installers can preserve restrictive modes from cached wheels. The Docker build therefore needs an explicit permission repair after each installation so the documented non-root runtime user can update the shared environment.

What changes?

  • Assign the virtual environment to the existing isaac-sim shared group when it is created.
  • Set the setgid bit on virtual-environment directories so new directories inherit that group.
  • Centralize the filtered group-ownership and group-write repair in docker/setup/repair_venv_permissions.sh.
  • Bind-mount and run that helper after each package installation, within the same Docker layer.
  • Remove the redundant initial recursive group-write update and the final world-writable chmod that duplicated the virtual environment.
  • Rely on the explicit permission repair instead of hardcoded build-process umasks.

Dynamically created runtime users continue to receive membership in the isaac-sim group.

Validation

  • Reduced the local image size from 73.1 GB before this change to 59.5 GB. This matches the Docker size before the Lab GA upgrade.
  • Verified every file and directory in /opt/isaaclab-venv belongs to the isaac-sim group and is group-writable.
  • Rebuilt the unchanged image in 10 seconds with all Docker stages cached.
  • Tested the shared repair helper against restrictive root-owned files and directories.
  • Passed the Docker build-graph check, pre-commit, and IDE lint checks.

@qianl-nv
qianl-nv force-pushed the qianl/chore/reduce-docker-venv-layer branch from 9991e39 to 88d060f Compare October 23, 2026 16:42
@qianl-nv
qianl-nv changed the base branch from qianl/feature/curobo-v2 to main October 23, 2026 16:42
@qianl-nv
qianl-nv marked this pull request as ready for review October 23, 2026 16:46
@greptile-apps

greptile-apps Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable issues were found.

Summary

The PR replaces the final recursive world-write change with shared-group permission repairs beside each package install.

  • Docker installs keep the virtual environment writable by shared-group users without a huge final layer.

Reviews (2) · Last reviewed commit: "Remove redundant Docker build umasks" · Reviewed by Greptile

Comment thread docker/Dockerfile.isaaclab_arena Resolved
Comment thread docker/setup/install_isaaclab.sh Resolved
@arena-review-bot

arena-review-bot Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

🤖 Isaac Lab-Arena Review Bot

Summary

The latest revision moves the permission repair into docker/setup/repair_venv_permissions.sh and drops the redundant chmod -R g+rwX. That resolves both threads from the last review. Every RUN that installs into the venv for the dev and dev-curobo images now runs the repair in the same layer. The repair skips files from earlier layers that already have the right group and mode, so they aren't copied into the new layer. One optional cleanup is left. This changes docker/, so it affects every contributor's image and still needs a maintainer's approval.

Findings

🔵 Improvement: docker/setup/install_isaaclab.sh:29: chgrp -R isaac-sim doesn't change the result. The repair at the end of sync_isaaclab runs in the same RUN and sets the group on every entry. Keep the chmod g+s line after it.

#1514 (still open): Since the last review, #1514 added a permission repair after its new cuRobo install. It still has two problems relative to this PR:

Whichever PR merges second needs to resolve that conflict. It should also change that RUN to bind-mount and call repair_venv_permissions.sh, so the find block doesn't come back as a copy.

CI status: Pre-commit and the docs build passed. The Arena and cuRobo image builds were still running when this review ran. CI runs the image as root, so it doesn't check whether the runtime user can write to the venv. That still relies on the manual check in the PR description.

Verdict

Ship it

@qianl-nv
qianl-nv marked this pull request as draft October 24, 2026 03:22
Signed-off-by: Qian Lin <qianl@nvidia.com>
Repair shared-group ownership and write access after package installs because
uv can preserve read-only modes from cached wheels despite the build umask.
Keep each repair in its installation layer to avoid duplicating the virtual
environment in a later image layer.

Signed-off-by: Qian Lin <qianl@nvidia.com>
Signed-off-by: Qian Lin <qianl@nvidia.com>
@qianl-nv
qianl-nv force-pushed the qianl/chore/reduce-docker-venv-layer branch from dce50a1 to 3ddbcc3 Compare October 26, 2026 09:58
@qianl-nv
qianl-nv marked this pull request as ready for review October 26, 2026 10:04
@qianl-nv qianl-nv changed the title Reduce Docker virtual environment layer size Fix recursive permission update to reduce docker layer size Oct 26, 2026
Comment thread docker/Dockerfile.isaaclab_arena Resolved
Comment thread docker/setup/install_isaaclab.sh Resolved
Signed-off-by: Qian Lin <qianl@nvidia.com>
@qianl-nv

Copy link
Copy Markdown
Collaborator Author

/review

Comment thread docker/setup/install_isaaclab.sh Resolved

@david-tingdahl-nvidia david-tingdahl-nvidia left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Great! I've seen similar issues before, when global ch[own|mod] commands make image size balloon. Good riddance!

Comment thread docker/setup/repair_venv_permissions.sh Resolved
Signed-off-by: Qian Lin <qianl@nvidia.com>
@qianl-nv
qianl-nv enabled auto-merge (squash) October 26, 2026 15:55
@qianl-nv
qianl-nv merged commit 7632eb7 into main Oct 26, 2026
13 checks passed
@qianl-nv
qianl-nv deleted the qianl/chore/reduce-docker-venv-layer branch October 26, 2026 17:25
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.

2 participants