Skip to content
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

Migrate Start Detector job to SDK using SDKRestClient #383

Closed
1 task done
Tracked by #5224
dbwiddis opened this issue Jan 29, 2023 · 3 comments
Closed
1 task done
Tracked by #5224

Migrate Start Detector job to SDK using SDKRestClient #383

dbwiddis opened this issue Jan 29, 2023 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@dbwiddis
Copy link
Member

dbwiddis commented Jan 29, 2023

Is your feature request related to a problem?

Part of opensearch-project/OpenSearch#5224

What solution would you like?

Migrate the Start Detector job Rest API to Extensions SDK using SDKRestClient.

Use the implementation of #353 as a reference. Add new issues for any steps you skip.

Implement the following API endpoints:

  • POST _plugins/_anomaly_detection/detectors/<detectorId>/_start
@joshpalis
Copy link
Member

joshpalis commented Mar 10, 2023

Completed Tasks for Real time analysis:

  • Implement create components for Anomaly Detection Extension
  • Register AD Rest Handlers for start detector : RestAnomalyDetectorJobAction
  • Register AD Action Handlers for start detector : AnomalyDetectorJobAction
  • Register extension Job Details with Job Scheduler when start detector API is invoked
  • Integrate AcquireLock API with AnomalyDetectorJobRunner
  • Integrate ReleaseLock API with AnomalyDetectorJobRunner

Replace the following instances in which client.execute() is used to trigger actions registered within OpenSearch with corresponding methods made available by the Java Client (OpenSearchAsyncClient).

Remaining Tasks :

Blockers :

#624

@joshpalis
Copy link
Member

joshpalis commented Apr 25, 2023

Tasks To Enable Historical Analysis

  • Integrate ForwardADTaskAction with the SDK and register within getActions
  • Modify ADTaskManager.forwardRequestToLeadNode to remove hashring and redirect the ForwardADTaskRequest to the extension node
  • Remove hashring from ADTaskManager.checkTaskSlots and execute ADStatsNodesAction for extension node only
  • Remove hashring from ADTaskManager.startHistoricalAnalysis and forwardDetectRequestToCoordinationNode for only the extension node. ADVersion should just be defaulted to current
  • Remove hashring from ADTaskManager.scaleTaskLaneOnCoordinatingNode
  • Remove hashRing from ADTaskManager.detectorTaskSlotScaleDelta so that the extension node is the only eligible data node
  • Register ad-batch-task-threadpool as an executor builder. Already added in by [Extensions] Migrate ADResultBulkAction/TransportAction and Multi-Entity real time analysis anomaly-detection#876
  • Integrate ADBatchAnomalyResultAction with the SDK and register within getActions. Called by ADTaskManager.runNextEntityForHCADHistorical (This just calls ADBatchTaskRunner.run for each request).
  • Modify ADBatchTaskRunner.getTopEntitiesListener and remove hashring to direct all high cardinality tasks back to the extension node
  • Modify ADBatchTaskRunner.forwardOrExecuteEntityTask and ensure that ADBatch Task is executed locally on the extension node. (This negates the need to register ADBatchTaskRemoteExecutionAction as all tasks will be executed on the extension node)
  • Comment out ADBatchTaskRunner.dispatchTask() and return cluster.localNode() directly as querying for node stats is not necessary for extensions.
  • Modify AbstractRetriever and replace all instances of Internal(Aggregation/Bucket/Etc) with corresponding Parsed(Aggregation/Bucket/Etc)
  • Potential Issue : double check SearchFeatureDao.parseBucketAggregationResponse as the aggregation class InternalComposite may not be supported by HLRC (May need to replace with ParsedComposite)
  • Potential issue : double check AbstractRetirever.parseAggregation as the aggregation class InternalSingleBucketAggregation may not be supported by HLRC
  • Replace StringTerms with ParsedStringTerms in ADBatchTaskRunner.searchTopEntitiesForSingleCategoryHC as the SDKRestClient uses the HLRC internally
  • Remove transportService from ADTaskManager.forwardADTaskToCoordinatingNode()and ADTaskManager.forwardStaleRunningEntitiesToCoordinatingNode() and replace with client execute call for ForwardADTaskAction
  • Remove hashring from ADTaskManager.stopHistoricalAnalysis to enable stoping historical analysis tasks
  • Integrate ADCancelTaskAction with the SDK and register within getActions
  • Fix affected test classes

@minalsha
Copy link
Collaborator

@joshpalis PR:opensearch-project/anomaly-detection#837 is merged for start detector. Can we close this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants