-
Notifications
You must be signed in to change notification settings - Fork 55
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
Add filtration feature in the bulk API #1391
Conversation
Signed-off-by: Saad Khan <[email protected]>
@khansaad This needs a Documentation update to mention the new filters being added. Also please add a few example filters in the kruize-demos repo (Eg Include only openshift-* namespaces or exclude them etc) and test them and post the results here, thanks |
Signed-off-by: Saad Khan <[email protected]>
Added the test results
|
@khansaad Please fix the conflicts |
Signed-off-by: Saad Khan <[email protected]>
Done |
design/BulkAPI.md
Outdated
"namespace": ["cadvisor", "openshift-tuning", "openshift-monitoring", "thanos-bench"], | ||
"workload": ["osd-rebalance-infra-nodes-28887030", "blackbox-exporter", "thanos-query"], | ||
"containers": ["tfb-0", "alertmanager"], | ||
"labels": { | ||
"org_id": "ABCOrga", | ||
"source_id": "ZZZ", | ||
"cluster_id": "ABG" | ||
} | ||
}, | ||
"include": { | ||
"namespace": [], | ||
"workload": [], | ||
"containers": [], | ||
"namespace": ["cadvisor", "openshift-tuning", "openshift-monitoring", "thanos-bench"], | ||
"workload": ["osd-rebalance-infra-nodes-28887030", "blackbox-exporter", "thanos-query"], | ||
"containers": ["tfb-0", "alertmanager"], |
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.
This is a bad example, the same things are present in both the include
and exclude
criteria. Also are not supporting wildcard chars here?
What we need to support is something like this
"exclude": {
"namespace": ["openshift-*"]
},
"include": {
"namespace": ["openshift-tuning"]
}
This should exclude all "openshift-" namespaces except "openshift-tuning"
Signed-off-by: Saad Khan <[email protected]>
With this bulk_input.json
I see that bulk API thinks there are 0 experiments
|
…ll namespaces Signed-off-by: Saad Khan <[email protected]>
Fixed the issue with experiments creation now but the demo is failing at |
`saakhan:bulk_demo$ ./bulk_service_demo.sh -c openshift -i quay.io/khansaad/autotune_operator:bulk-filter ####################################### Kruize Demo Setup on openshift####################################### 🔄 Pulling required repositories... ✅ Done! KRUIZE URL = http://kruize-openshift-tuning.apps.kruize2.lab.psi.pnq2.redhat.com ####################################### URL = http://kruize-openshift-tuning.apps.kruize2.lab.psi.pnq2.redhat.com/createMetricProfile ####################################### URL = http://kruize-openshift-tuning.apps.kruize2.lab.psi.pnq2.redhat.com/bulk ####################################### Experiments: processed / Total - 0 / 0 ####################################### |
@msvinaykumar - Can you please review this PR |
@khansaad - Tested with the below input json with quay.io/khansaad/autotune_operator:bulk-filter-with-cft, but it shows 0 processed experiments.
Job status
|
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.
LGTM
Description
This PR adds the filtration feature in the bulk API using which user can hit bulk API with filtered resources like namespaces, containers and workloads instead of always fetching everything.
Fixes # (issue)
Type of change
How has this been tested?
By manually hitting bulk API with multiple combinations of include and exclude filters
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