Fix local farm issues#3169
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a new CLI launcher script (bin/meshroom_localfarm) for managing the local farm, enhances logging in localFarmBackend.py by adding task durations and single-quoting environment variables, and refactors REZ command wrapping in localFarmSubmitter.py. It also updates the test suite to isolate tests from the host's REZ environment and increases a timeout.
However, a critical issue was identified in localFarmSubmitter.py where prepending environment variables directly to the command before wrapping it with rez env will cause a runtime execution failure, as rez will incorrectly treat the first environment variable assignment as the executable command. A code suggestion has been provided to resolve this by prepending the environment variables to the outer command instead.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| envVars = " ".join([f'{k}="{v}"' for k, v in additionalEnv.items()]) | ||
| if envVars: | ||
| cmd = f"{envVars} {cmd}" | ||
| if rezBin: | ||
| cmd = f"{rezBin} env {packagesStr} -- {cmd}" |
There was a problem hiding this comment.
Prepending envVars directly to cmd before wrapping it with rez env will cause rez to treat the first environment variable assignment (e.g., VAR=VAL) as the executable command. This leads to a runtime error such as rez: Command failed: 'VAR=VAL' was not found or is not executable because rez env does not run the command in a shell by default.
To fix this, envVars should be prepended to the outer command (before rez env) so that they are set in the shell environment before rez is invoked. rez will then correctly inherit and propagate these variables to the resolved environment.
| envVars = " ".join([f'{k}="{v}"' for k, v in additionalEnv.items()]) | |
| if envVars: | |
| cmd = f"{envVars} {cmd}" | |
| if rezBin: | |
| cmd = f"{rezBin} env {packagesStr} -- {cmd}" | |
| envVars = " ".join([f'{k}="{v}"' for k, v in additionalEnv.items()]) | |
| if rezBin: | |
| cmd = f"{rezBin} env {packagesStr} -- {cmd}" | |
| if envVars: | |
| cmd = f"{envVars} {cmd}" |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #3169 +/- ##
========================================
Coverage 86.07% 86.07%
========================================
Files 78 78
Lines 12111 12111
========================================
Hits 10425 10425
Misses 1686 1686 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Description
Fix issues on the local farm
Fix a bug on the command generation inside the submitter.