gemini-code-assist[bot] commented on code in PR #38862:
URL: https://github.com/apache/beam/pull/38862#discussion_r3379974328


##########
buildSrc/src/main/groovy/org/apache/beam/gradle/BeamModulePlugin.groovy:
##########
@@ -3145,7 +3145,8 @@ class BeamModulePlugin implements Plugin<Project> {
           }
           project.exec {
             executable 'sh'
-            args '-c', ". ${project.ext.envdir}/bin/activate && pip install uv 
&& uv pip install --pre ${installTargets}"
+            // uv times out on its cache lock when py310/py314 installGcpTest 
run in parallel.
+            args '-c', ". ${project.ext.envdir}/bin/activate && pip install 
--pre --retries 10 ${installTargets}"

Review Comment:
   ![medium](https://www.gstatic.com/codereviewagent/medium-priority.svg)
   
   Instead of completely reverting to `pip` (which is significantly slower than 
`uv`), we can resolve the cache lock contention by configuring `uv` to use a 
unique cache directory per environment. Since `${project.ext.envdir}` is unique 
for each Python version (e.g., `py310`, `py314`), pointing `uv` to a cache 
directory inside it avoids parallel execution conflicts while retaining `uv`'s 
performance benefits.
   
   ```
               // Use uv with a unique cache directory per environment to avoid 
parallel cache lock contention.\n            args '-c', \". 
${project.ext.envdir}/bin/activate && pip install uv && uv pip install 
--cache-dir ${project.ext.envdir}/.uv_cache --pre ${installTargets}\"
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to