-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Override Distribution Downloader to download opensearch-min artifact from a custom url #1240
Comments
Related to opensearch-project/opensearch-build#319 |
There are 2 different pieces to this.
|
Adding on this, couple of different options: Short term: Update the zip in the artifacts repository for distribution downloader to pick it up. Downsides: This is manual and needs hand holding for every release. Long Term 1: Skip downloading the zip via distribution downloader when an external cluster is provided for integration tests. Downsides: This only works for integration tests but not BWC tests. -> about 2-3 days of work. Long Term 2: Override distribution downloader to download the cluster zip from a new endpoint dynamically. This solution works for IntegTests, and BWC tests. -> about 4-6 days of work. I am leaning towards Long term 1, as its simpler and it has to be done anyway in the future. As the plugins integration test framework unnecessarily depend on published zips even though it's not used. |
We have decided to go with Long term 1 for 1.2 which should anyway be done. Double clicking on it: Example: Looking at Anomaly Detection plugin. The There are 2 ways to solve this:
So for longterm solution 1, this fix has to be made in plugins. |
To test the above solution I did a quick POC in AD. Added
The tests start to run on Darwin (which usually doesnt because darwin artifacts are not published yet for OpenSearch).
|
Long Term 1 is now implemented and taken care of in the plugins. The issue is still open to take care of Long term 2, which is |
I will work on this. |
We should override the Ivy repository url in Ref: https://github.com/opensearch-project/anomaly-detection/blob/main/build.gradle#L302 |
@Rishikesh1159 are you still looking into this? |
@dblock Yes I am working on this. |
Looks like we reverted the implementation? What happened? What's the next step for getting this implemented? |
Yes @dblock. This implementation was causing Alerting plugin build to fail. (opensearch-project/alerting#312). I moved setupDownloadService() call out from apply method for this implementation. Looks like it is causing the error of "Cannot mutate content repository descriptor 'MavenLocal(file:/usr/share/opensearch/.m2/repository/)' after repository has been used". Before releasing PR, I tested this implementation with Anomaly Detection plugin and job scheduler plugin. Both of them worked fine as expected. I still did not fix this or find an alternative for this implementation. I will work on this. Also we need to write a test this failing scenario. |
Yes, please do. Thank you! /C |
I was able to root cause failure in Alerting plugin. In order to fix this issue #1240, in my previous PR I moved call to setupDownloadServiceRepo() in DistributionDownloadPlugin.java from apply() method to setupDistributions() method, which is called in afterEvaluate(). Here is previous PR: #2086 which is reverted. -> This change made to setup repo at the end of configuration phase [One of gradle life cycle process] after entire root and sub projects are configured. -> Internally in subprojects of Alerting plugin in configuration phase call to the repo is being made before it was actually setup. But the setup will happen after configuration phase ends. So, this was the reason Alerting plugin was failing. -> Temporarily we moved back call to setupDownloadServiceRepo() in DistributionDownloadPlugin.java to apply() method as it was before. Here the repo is setup before evaluation happens. But, it does not fix this issue. Fix: -> The fix I found was to use Project properties to set the custom url from plugin instead of system properties. Before, I was trying to use system properties to set custom url from plugin. -> These system properties are not available for us to use them in configuration phase, we had to wait until configuration phase ends and afterEvaluate() happens to use these system properties. ->But Project properties are different and are available in configuration phase. -> So, the fix would be using Project properties to set custom url from plugin side. -> So no moving of seupDownloadServiceRepo() call out of apply() in DistributionDownloadPlugin.java is necessary and just adding conditions and logic of cutom Url is enough to fix this issue. Test case for handling Alerting plugin failure: -> I haven't thought of a way writing test case for this failure. As, it is happening because of moving method call in gradle life cycle phase, I find it a bit complex to write a test case for this scenario. opensearch-project/alerting#312 Conclusion: |
Here is the exact line where Alerting plugin fail with my previous reverted PR #2086. There are other plugins using similar piece of code but for those this piece of code is wrapped inside an after evaluate block, which is making it not fail. So, test case mentioned in my above comment will be related to this. This was the error on Alerting plugin side: opensearch-project/alerting#312 Here is the PR #2420 where I will be working on this issue. |
The opensearch-plugin-cli works well for getting the last released and release candidate builds, but lacks pull artifacts from any location for scenarios like local development and testing.
This is needed for build and release process to validate components before they are released.
The text was updated successfully, but these errors were encountered: