Fix OpenSearchNode working directory to avoid executing in immutable Gradle cache directory#20229
Fix OpenSearchNode working directory to avoid executing in immutable Gradle cache directory#20229dbwiddis wants to merge 2 commits intoopensearch-project:mainfrom
Conversation
WalkthroughChanged OpenSearchNode so tools are resolved from the distribution's bin directory and processes are started with the node's working directory instead of the extracted distro/Gradle cache directory, preventing writes into the immutable Gradle transform cache. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (21)
Comment |
…ble Gradle cache directory Signed-off-by: Daniel Widdis <widdis@gmail.com>
0c0e7db to
35c5865
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #20229 +/- ##
============================================
+ Coverage 72.82% 73.18% +0.35%
- Complexity 71315 71771 +456
============================================
Files 5795 5795
Lines 328297 328306 +9
Branches 47282 47283 +1
============================================
+ Hits 239089 240276 +1187
+ Misses 69893 68787 -1106
+ Partials 19315 19243 -72 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| try (InputStream byteArrayInputStream = new ByteArrayInputStream(input.getBytes(StandardCharsets.UTF_8))) { | ||
| LoggedExec.exec(project, spec -> { | ||
| spec.setEnvironment(getOpenSearchEnvironment()); | ||
| spec.workingDir(getDistroDir()); |
There was a problem hiding this comment.
When is getDistroDir resolved to the gradle cache? Is that in instances when running integTest against a testcluster that is using the ARCHIVE distribution?
I'm wondering if we should start to remove the restrictions on copying only the transport modules in the INTEG_TEST distribution and then start a campaign across the plugins to use INTEG_TEST which always pulls the latest commit from core without pulling a min distribution though I'm not sure how that would impact test speed.
Let me try to dig up the comment about the distinction of ARCHIVE vs INTEG_TEST.
There was a problem hiding this comment.
Here was the comment: opensearch-project/query-insights#441 (comment)
There was a problem hiding this comment.
When is getDistroDir resolved to the gradle cache? Is that in instances when running integTest against a testcluster that is using the ARCHIVE distribution?
It's reproducible on main using ccr repo, so perhaps you can see if this change fixes it?
In any case, I'm not sure we want to execute in the distro dir and not the working dir...
Signed-off-by: Daniel Widdis <widdis@gmail.com>
|
❌ Gradle check result for 149bcdb: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
|
This PR is stalled because it has been open for 30 days with no activity. |
|
Closing as this has been addressed by a different approach. |
Description
Modified OpenSearchNode binary execution directory from
getDistroDir()toworkingDir.toFile()so that all OpenSearch bin scripts run from the node's working directory instead of the Gradle cache directory.Changed the Unix executable to use absolute paths since we changed the working directory.
Related Issues
Check List
[ ] API changes companion pull request created, if applicable.[ ] Public documentation issue/PR created, if applicable.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.