project-koku / nise

A tool for generating sample cost usage data for testing purposes
GNU Affero General Public License v3.0
9 stars 15 forks source link

[RFR] Adding data for ROS-Openshift service RHIROS-850 #427

Closed dgaikwad closed 1 year ago

dgaikwad commented 1 year ago

To get ROS-openshift data use --ros-ocp-info parameter. Creating new files and adding new columns along with basic information about the pod, namespace start and end date.

You can see we have added new CLI param that is --ros-ocp-info in the nise command below:

(nise) dgaikwad@Devidass-MacBook-Pro 20221101-20221201 %  nise report ocp --ocp-cluster-id abcd  --start-date  2022-11-01 --insights-upload testing/pvc_dir/insights_local --ros-ocp-info --help
usage: nise report ocp [-h] [-s YYYY-MM-DD] [-e YYYY-MM-DD] [--file-row-limit ROW_LIMIT] [--static-report-file STATIC_REPORT_FILE] [-w]
                       [--ocp-cluster-id OCP_CLUSTER_ID] [--insights-upload UPLOAD_ENDPOINT] [--ros-ocp-info]

The OCP parser

optional arguments:
  -h, --help            show this help message and exit
  -s YYYY-MM-DD, --start-date YYYY-MM-DD
                        Date to start generating data (YYYY-MM-DD)
  -e YYYY-MM-DD, --end-date YYYY-MM-DD
                        Date to end generating data (YYYY-MM-DD). Default is today.
  --file-row-limit ROW_LIMIT
                        Maximum number of lines per report file. Default is 100000.
  --static-report-file STATIC_REPORT_FILE
                        Generate static data based on yaml.
  -w, --write-monthly   Writes the monthly files.
  --ocp-cluster-id OCP_CLUSTER_ID
                        Cluster identifier for usage data.
  --insights-upload UPLOAD_ENDPOINT
                        URL for Insights Upload Service.
  --ros-ocp-info        Generate ROS for Openshift data
(nise) dgaikwad@Devidass-MacBook-Pro 20221101-20221201 % 

Below is the one of the example where we can see how to provide info to make ROS for openshift data available:

(nise) dgaikwad@Devidass-MacBook-Pro nise % nise report ocp --ocp-cluster-id abcd  --start-date  2022-11-01 --insights-upload testing/pvc_dir/insights_local --ros-ocp-info
patilsuraj767 commented 1 year ago

@dgaikwad Kruize team might add more Prometheus queries but we can open a separate PR later to add columns for those queries. I have not tested the PR but data collected/added in the PR seems to be sufficient for now. LGTM :+1:

chambridge commented 1 year ago

@maskarb can you take a look at this and provide feedback. My initial glance is that the output this PR is generating doesn't align with the data I'd assume the prometheus queries the Kruise team provided would result in.

dgaikwad commented 1 year ago

@maskarb please review this PR.

dgaikwad commented 1 year ago

You'll want to uptick the version here https://github.com/project-koku/nise/blob/main/nise/__init__.py#L1

that version is used to build a new package in pypi and make nise pip installable

Done

codecov[bot] commented 1 year ago

Codecov Report

Merging #427 (c41c374) into main (77e059f) will decrease coverage by 0.1%. The diff coverage is 86.7%.

@@           Coverage Diff           @@
##            main    #427     +/-   ##
=======================================
- Coverage   93.8%   93.7%   -0.1%     
=======================================
  Files         61      61             
  Lines       4426    4466     +40     
  Branches     621     627      +6     
=======================================
+ Hits        4152    4186     +34     
- Misses       148     153      +5     
- Partials     126     127      +1