-
Notifications
You must be signed in to change notification settings - Fork 62
Add JVM info details for Runtime Recomm #1764
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
Draft
khansaad
wants to merge
5
commits into
kruize:mvp_demo
Choose a base branch
from
khansaad:add-jvm-info
base: mvp_demo
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: Saad Khan <saakhan@ibm.com>
Contributor
Reviewer's GuideIntroduces a new Config abstraction to hold recommendations (requests, limits, and future runtime env) and starts wiring runtime/JVM-aware recommendations into the engine, including notifications and autoscaler consumers, while keeping runtime logic mostly stubbed for now. Sequence diagram for generating recommendations with runtime env listsequenceDiagram
participant NS as NamespaceData
participant RE as RecommendationEngine
participant KO as KruizeObject
participant RM as RecommendationModel
participant DRM as DataSourceCollection
participant DSI as DataSourceInfo
participant MRM as MappedRecommendationForModel
NS->>RE: generateRecommendationsBasedOnNamespace(namespaceData, kruizeObject)
RE->>RE: generateNamespaceRecommendationBasedOnModel(..., kruizeObject, ...)
RE->>RE: generateRecommendationBasedOnModel(monitoringStartTime, model, containerData, monitoringEndTime, kruizeObject, currentConfigMap, termsEntry)
RE->>KO: getRecommendation_settings()
KO-->>RE: RecommendationSettings
RE->>KO: getDataSource()
KO-->>RE: datasourceName
RE->>DRM: getInstance()
DRM-->>RE: DataSourceCollection
RE->>DRM: getDataSourcesCollection()
DRM-->>RE: Map datasourceMap
RE->>RE: dataSourceInfo = datasourceMap.get(datasourceName)
RE->>DSI: getServiceName()
DSI-->>RE: serviceName
RE->>RE: handleRuntimeRecommendations(kruizeObject)
RE-->>RE: runtimeRecommList(List RecommendationConfigEnv)
RE->>RE: populateRecommendation(termEntry, recommendationModel, monitoringStartTime, monitoringEndTime, containerCpuLimit, numPods, cpuThreshold, memoryThreshold, recommendationAcceleratorRequestMap, runtimeRecommList)
activate RE
RE->>MRM: new MappedRecommendationForModel()
RE->>RE: build requestsMap and limitsMap
RE->>MRM: getConfig()
MRM-->>RE: Config config
RE->>config: setRequests(requestsMap)
RE->>config: setLimits(limitsMap)
alt runtimeRecommList not null and not empty
RE->>MRM: getConfig()
MRM-->>RE: Config config
RE->>config: setEnv(runtimeRecommList)
RE->>RM: addNotification(INFO_RUNTIMES_RECOMMENDATIONS_AVAILABLE)
end
RE->>MRM: setConfig(config)
deactivate RE
RE-->>NS: mappedRecommendationForModel
Class diagram for new Config and runtime recommendation modelclassDiagram
class Config {
+Map~AnalyzerConstants.RecommendationItem, RecommendationConfigItem~ requests
+Map~AnalyzerConstants.RecommendationItem, RecommendationConfigItem~ limits
+List~RecommendationConfigEnv~ env
+Map getRequests()
+void setRequests(Map requests)
+Map getLimits()
+void setLimits(Map limits)
+List getEnv()
+void setEnv(List env)
}
class RecommendationConfigEnv {
-String name
-String value
-String errorMsg
+RecommendationConfigEnv(String name, String value)
+String getName()
+void setName(String name)
+String getValue()
+void setValue(String value)
+String getErrorMsg()
+void setErrorMsg(String errorMsg)
}
class MappedRecommendationForModel {
-int podsCount
-double confidence_level
-Config config
-HashMap~AnalyzerConstants.ResourceSetting, HashMap~AnalyzerConstants.RecommendationItem, RecommendationConfigItem~~ variation
-HashMap~String, List~RecommendationNotification~~ notificationHashMap
+MappedRecommendationForModel()
+int getPodsCount()
+void setPodsCount(int podsCount)
+double getConfidence_level()
+void setConfidence_level(double confidence_level)
+Config getConfig()
+void setConfig(Config config)
}
class RecommendationModel {
<<interface>>
+RecommendationConfigItem getCpuRequestRecommendation(Map filteredResultsMap, ArrayList notifications)
+RecommendationConfigItem getMemoryRequestRecommendation(Map filteredResultsMap, ArrayList notifications)
+RecommendationConfigItem getCpuLimitRecommendation(Map filteredResultsMap, ArrayList notifications)
+RecommendationConfigItem getMemoryLimitRecommendation(Map filteredResultsMap, ArrayList notifications)
+Map getAcceleratorRequestRecommendation(Map filteredResultsMap, ArrayList notifications)
+RecommendationConfigEnv getRuntimeRecommendation(Map filteredResultsMap, ArrayList notifications)
+String getModelName()
+void validate()
}
class GenericRecommendationModel {
+String name
+RecommendationConfigEnv getRuntimeRecommendation(Map filteredResultsMap, ArrayList notifications)
+String getModelName()
+void validate()
+RecommendationConfigItem getCpuRequestRecommendation(Map filteredResultsMap, ArrayList notifications)
+RecommendationConfigItem getMemoryRequestRecommendation(Map filteredResultsMap, ArrayList notifications)
+RecommendationConfigItem getCpuLimitRecommendation(Map filteredResultsMap, ArrayList notifications)
+RecommendationConfigItem getMemoryLimitRecommendation(Map filteredResultsMap, ArrayList notifications)
+Map getAcceleratorRequestRecommendation(Map filteredResultsMap, ArrayList notifications)
}
class RecommendationEngine {
+boolean generateRecommendationsBasedOnTerms(ContainerData containerData, NamespaceData namespaceData, KruizeObject kruizeObject)
-MappedRecommendationForModel generateRecommendationBasedOnModel(Timestamp monitoringStartTime, RecommendationModel model, ContainerData containerData, Timestamp monitoringEndTime, KruizeObject kruizeObject, HashMap currentConfigMap, Map.Entry termsEntry)
-List~RecommendationConfigEnv~ handleRuntimeRecommendations(KruizeObject kruizeObject)
-boolean populateRecommendation(Map.Entry termEntry, RecommendationModel recommendationModel, Timestamp monitoringStartTime, Timestamp monitoringEndTime, double containerCpuLimit, int numPods, double cpuThreshold, double memoryThreshold, Map recommendationAcceleratorRequestMap, List runtimeListToPopulate)
-void addIfNotEmpty(List list, String name, StringBuilder valueBuilder)
}
class RecommendationNotification {
<<enum>>
INFO_COST_RECOMMENDATIONS_AVAILABLE
INFO_PERFORMANCE_RECOMMENDATIONS_AVAILABLE
INFO_MODEL_RECOMMENDATIONS_AVAILABLE
INFO_RUNTIMES_RECOMMENDATIONS_AVAILABLE
}
class AnalyzerConstants {
}
class ResourceSetting {
<<enum>>
requests
limits
}
class RuntimesSetting {
<<enum>>
env
}
class ConfigType {
<<enum>>
REQUESTS
LIMITS
ENV
-Enum sourceEnum
}
AnalyzerConstants <|-- ResourceSetting
AnalyzerConstants <|-- RuntimesSetting
AnalyzerConstants <|-- ConfigType
RecommendationModel <|.. GenericRecommendationModel
Config "1" o-- "*" RecommendationConfigEnv : env
MappedRecommendationForModel "1" o-- "1" Config : config
RecommendationEngine --> RecommendationModel
RecommendationEngine --> MappedRecommendationForModel
RecommendationEngine --> Config
RecommendationEngine --> RecommendationConfigEnv
RecommendationEngine --> RecommendationNotification
ConfigType --> ResourceSetting
ConfigType --> RuntimesSetting
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
503caa9 to
c4891c4
Compare
Signed-off-by: Saad Khan <saakhan@ibm.com>
0406368 to
e4db884
Compare
Signed-off-by: Saad Khan <saakhan@ibm.com>
12 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR adds the metric details and the corresponding code changes for the JVM info details as part of the runtime recommendations.
Fixes # (issue)
Type of change
How has this been tested?
Please describe the tests that were run to verify your changes and steps to reproduce. Please specify any test configuration required.
Test Configuration
Checklist 🎯
Additional information
Include any additional information such as links, test results, screenshots here
Summary by Sourcery
Introduce a structured config model that can carry both resource and runtime (env) recommendations and integrate it into the recommendation generation pipeline.
New Features:
Enhancements: