-
Notifications
You must be signed in to change notification settings - Fork 73
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
Remove rcf jar and fix zip fetching for AD and JS #497
Conversation
…tegcluster Signed-off-by: Amit Galitzky <[email protected]>
Signed-off-by: Amit Galitzky <[email protected]>
Signed-off-by: Amit Galitzky <[email protected]>
Signed-off-by: Amit Galitzky <[email protected]>
Signed-off-by: Amit Galitzky <[email protected]>
Codecov Report
@@ Coverage Diff @@
## main #497 +/- ##
============================================
+ Coverage 78.14% 78.17% +0.03%
- Complexity 4155 4160 +5
============================================
Files 296 296
Lines 17654 17654
Branches 1877 1877
============================================
+ Hits 13795 13801 +6
+ Misses 2963 2959 -4
+ Partials 896 894 -2
Flags with carried forward coverage won't be shown. Click here to find out more.
|
String json = Files.readString(Paths.get(filePath), Charset.defaultCharset()); | ||
Map map = gson.fromJson(json, Map.class); | ||
String model = (String) ((Map) ((Map) ((ArrayList) ((Map) map.get("hits")).get("hits")).get(0)).get("_source")).get("modelV2"); | ||
ThresholdedRandomCutForest forest = checkpointDao.toTrcf(model); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add checks on the specific fields of trcf. Please check my other tests.
@@ -154,7 +157,7 @@ | |||
private GenericObjectPool<LinkedBuffer> serializeRCFBufferPool; | |||
private RandomCutForestMapper mapper; | |||
private ThresholdedRandomCutForestMapper trcfMapper; | |||
private V1JsonToV2StateConverter converter; | |||
private V1JsonToV3StateConverter converter; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is also a V2StateToV3ForestConverter. We need to convert from v1 to v3, v2 to v3. If v2 and v3 are incompatible, we need to add a field modelV3 in checkpoint.
// .parseReader(new FileReader(new File(getClass().getResource(labalFileName).toURI()), Charset.defaultCharset())) | ||
|
||
public void testDeserializeRCFModel() throws Exception { | ||
// Model in file 1_3_0_rcf_model.json not passed initialization yet |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So it means the model is empty? If yes, have you tested model fully initialized?
@@ -590,6 +607,9 @@ dependencies { | |||
compileOnly "org.opensearch:opensearch-job-scheduler-spi:${job_scheduler_version}" | |||
implementation "org.opensearch:common-utils:${common_utils_version}" | |||
implementation "org.opensearch.client:opensearch-rest-client:${opensearch_version}" | |||
implementation 'software.amazon.randomcutforest:randomcutforest-parkservices:3.0-rc2' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you list the tests you have done to upgrade to rc2? What I can think of:
- real time single stream and HCAD (including create/start detector, see detector emit results; then stop cluster and restart it to see if results continue to show)
- historical single stream and HCAD
- backward compatible tests: v1 to v3 model, v2 to v3 model: v1 model in checkpoint should not be overridden, and we add v2 and v3 model in checkpoint if necessary. You can start with a v1 cluster, start real time single stream and hcad detector, let them run and produce results; then upgrade some nodes to v2 cluster, see if anything happens when both v1 and v2 node co-exists in the cluster (this is to simulate our blue/green deployment in service), then remove v1 nodes and let v2 run a while, then upgrade some nodes to v3, and see if they can co-exist, then remove v2 and let v3 nodes run.
- Does memory size formula still hold (Check MemoryTracker)? No need to be exactly the same. Want to verify if the ballpark number is similar.
V1 refers to the checkpoint version we have used until #149. v2 is what we have until your PR. v3 is what your PR tries to bring.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested single stream real time and historical, I'll do the same for HCAD right now. BWC test were the test added based on Yaliang's code to check deserialize model from 1.3. And converting test to v1 to v3, I didn't add v2 to v3.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The unit tests for bwc is not enough. It just checks the conversion has no exception. We will need to do some e2e testing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I manually tested that after starting both single and HCAD (both real time and historical) with current RCF and getting results, I can switch to RCF 3.0-rc2 and there is no issues, detectors continue to run the same
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After letting the detector run for longer I do get one issue, Failed to generate checkpoint, java.lang.IllegalStateException: There is discepancy in indices
@@ -1000,4 +1003,14 @@ public void testFromEntityModelCheckpointWithEntity() throws Exception { | |||
} | |||
return point; | |||
} | |||
// .parseReader(new FileReader(new File(getClass().getResource(labalFileName).toURI()), Charset.defaultCharset())) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unused code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will remove
Closing in favor of new PR that fetches RCF 3.0-rc1 instead of 3.0-rc2. There are some compatibility issue that need further investigation for AD transition to rc2. |
Description
V1JsonToV2StateConverter
usageV1JsonToV3StateConverter
Issues Resolved
resolves #433
Check List
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.