Harden perf-smoke seeder mount permissions#6590
Conversation
Avoid cross-UID output and cache failures on long-lived GPU runners so all baseline samples can be collected and published reliably.
Greptile SummaryThis PR hardens the perf-smoke seeder's container interaction by writing benchmark output inside the container and copying it out via
Confidence Score: 4/5The PR is safe to merge; the core artifact-extraction logic is well-tested and the permission-isolation strategy is sound. The artifact-extraction logic is well-tested and the permission-isolation strategy is sound. The only finding is that copy_result is assigned inside the try block but read in the return statement outside it — static analysers flag this, and a future try/except wrapper could expose a genuine NameError. Everything else — cache isolation, atexit cleanup, container lifecycle, docker cp semantics, and test coverage — looks correct. tools/perf_smoke_test/seed_baselines.py around the try/finally block in _docker_run_benchmark (lines 476-489). Important Files Changed
Sequence Diagram%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
participant Main
participant Docker
participant Container
participant Host
Main->>Docker: "docker rm -f container (pre-flight)"
Main->>Docker: "docker run --name container (no --rm)"
Note over Container: "umask 000, mkdir -p /tmp/bench_out, run benchmark"
Docker-->>Main: "exit code"
Main->>Docker: "docker cp container:/tmp/bench_out/. artifact_dir"
Docker-->>Host: "copy files"
Main->>Host: "chmod -R a+rwX artifact_dir"
Main->>Docker: "docker rm -f container"
Note over Main: "return composite exit code"
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
participant Main
participant Docker
participant Container
participant Host
Main->>Docker: "docker rm -f container (pre-flight)"
Main->>Docker: "docker run --name container (no --rm)"
Note over Container: "umask 000, mkdir -p /tmp/bench_out, run benchmark"
Docker-->>Main: "exit code"
Main->>Docker: "docker cp container:/tmp/bench_out/. artifact_dir"
Docker-->>Host: "copy files"
Main->>Host: "chmod -R a+rwX artifact_dir"
Main->>Docker: "docker rm -f container"
Note over Main: "return composite exit code"
Reviews (1): Last reviewed commit: "Harden perf-smoke seeder mount permissio..." | Re-trigger Greptile |
| permissions_returncode = 0 | ||
| try: | ||
| copy_result = subprocess.run( | ||
| ["docker", "cp", f"{container_name}:/tmp/bench_out/.", str(artifact_dir)], | ||
| text=True, | ||
| ) | ||
| if copy_result.returncode == 0: | ||
| permissions_returncode = subprocess.run( | ||
| ["chmod", "-R", "a+rwX", str(artifact_dir)], | ||
| text=True, | ||
| ).returncode | ||
| finally: | ||
| subprocess.run(["docker", "rm", "-f", container_name], capture_output=True, text=True) | ||
| return result.returncode or copy_result.returncode or permissions_returncode |
There was a problem hiding this comment.
copy_result referenced outside the try block it is assigned in
copy_result is assigned only inside the try block (line 478) but read on the return at line 489, which is outside the try/finally. At runtime this is safe: any OS-level exception from subprocess.run(["docker", "cp", ...]) propagates through finally and exits the function without reaching the return. However, static-analysis tools (mypy, ruff) flag this as a potentially-unbound reference, and a future maintainer who wraps the outer body in a try/except could trigger a genuine NameError. Initializing copy_result = subprocess.CompletedProcess([], returncode=1) (or similar sentinel) before the try block would make the intent explicit and satisfy static analysis without changing runtime behaviour.
fatimaanes
left a comment
There was a problem hiding this comment.
LGTM — solid fix for the L40S seeder output/cache permission blocker. Verified the docker cp + host chmod path is sound (CI image runs as USER isaaclab uid 1000 = runner uid) and per-bucket Kit cache isolation is the right call for the camera-task crash. Approving.
bd5af43
into
isaac-sim:perf-smoke/develop-staging
Summary
Test plan
52 passed, 1 skipped)