-
-
Notifications
You must be signed in to change notification settings - Fork 22
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 VulnerabilityScanResultProcessor
from Kafka Streams to Parallel Consumer
#637
Conversation
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferencesCodacy will stop sending the deprecated coverage status from June 5th, 2024. Learn more |
As introduced in DependencyTrack/hyades-apiserver#637 Also removes Kafka Streams related environment variables for API server from `docker-compose.yml` Signed-off-by: nscuro <[email protected]>
As introduced in DependencyTrack/hyades-apiserver#637 Also removes Kafka Streams related environment variables for API server from `docker-compose.yml` Signed-off-by: nscuro <[email protected]>
As introduced in DependencyTrack/hyades-apiserver#637 Also removes Kafka Streams related environment variables for API server from `docker-compose.yml` Signed-off-by: nscuro <[email protected]>
…llel Consumer Signed-off-by: nscuro <[email protected]>
Signed-off-by: nscuro <[email protected]>
Signed-off-by: nscuro <[email protected]>
Signed-off-by: nscuro <[email protected]>
Signed-off-by: nscuro <[email protected]>
…lowState` Signed-off-by: nscuro <[email protected]>
Signed-off-by: nscuro <[email protected]>
Signed-off-by: nscuro <[email protected]>
Signed-off-by: nscuro <[email protected]>
Signed-off-by: nscuro <[email protected]>
Signed-off-by: nscuro <[email protected]>
Signed-off-by: nscuro <[email protected]>
Signed-off-by: nscuro <[email protected]>
The status of the workflow step will always be `COMPLETED`, no matter if delayed dispatch is enabled or not. This is existing behavior and the regression was catched via `BomProcessedNotificationDelayedE2ET`. Signed-off-by: nscuro <[email protected]>
Signed-off-by: nscuro <[email protected]>
Signed-off-by: nscuro <[email protected]>
…f components Signed-off-by: nscuro <[email protected]>
As a replacement for `KAFKA_STREAMS_DRAIN_TIMEOUT_DURATION`. Signed-off-by: nscuro <[email protected]>
…ssor` Signed-off-by: nscuro <[email protected]>
Signed-off-by: nscuro <[email protected]>
This is to improve throughput, and to match the default used by Kafka Streams, which we are replacing: https://kafka.apache.org/37/documentation/streams/developer-guide/config-streams.html#default-values Signed-off-by: nscuro <[email protected]>
As introduced in DependencyTrack/hyades-apiserver#637 Also removes Kafka Streams related environment variables for API server from `docker-compose.yml` Signed-off-by: nscuro <[email protected]>
Signed-off-by: nscuro <[email protected]>
Signed-off-by: nscuro <[email protected]>
Signed-off-by: nscuro <[email protected]>
Description
This PR migrates the
VulnerabilityScanResultProcessor
from Kafka Streams to the new, Parallel Consumer based, processor API. As this was the last piece of functionality relying on Kafka Streams, this PR removes Kafka Streams entirely.Addressed Issue
Relates to DependencyTrack/hyades#346
Relates to DependencyTrack/hyades#901
Relates to DependencyTrack/hyades#907
Additional Details
A new processor is introduced:
ProcessedVulnerabilityScanResultProcessor
.Its job is to handle
ScanResult
s that were successfully processed by the API server, and:VulnerabilityScan
sVulnerabilityScan
is detected to be complete:PROJECT_VULN_ANALYSIS_COMPLETE
notificationBOM_PROCESSED
notificationThis was previously a large chunk of the Kafka Streams topology:
hyades-apiserver/src/main/java/org/dependencytrack/event/kafka/streams/KafkaStreamsTopologyFactory.java
Lines 84 to 219 in 1d305b8
The downside of doing it in Kafka Streams was that the entire procedure is executed for every single record.
Now, records are consumed in batches (up to 1000 records per default), which drastically increases throughput.
Warning
For existing deployments,
alpine.kafka.processor.vuln.scan.result.consumer.auto.offset.reset
should be set tolatest
in order to avoid re-consuming existing vulnerability analysis results.With the removal of Kafka Streams (which includes RocksDB), the API server JAR is a good 50MB smaller!
Breaking Changes
dtrack.vuln-analysis.result.processed
(Adddtrack.vuln-analysis.result.processed
topic hyades#1166)dtrack-apiserver-processed-vuln-scan-result-by-scan-token-repartition
is no longer required and can be deleted after successful deploymentChecklist
This PR fixes a defect, and I have provided tests to verify that the fix is effectiveThis PR introduces changes to the database model, and I have added corresponding update logicThis PR introduces new or alters existing behavior, and I have updated the documentation accordingly