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

[COST-5137] Run OCP on Cloud Summary after new processing flow #5276

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

cgoodfred
Copy link
Contributor

@cgoodfred cgoodfred commented Aug 29, 2024

Jira Ticket

COST-5137

Description

This change will run OCP on Cloud summary after the new processing flow if both the cost-management.backend.feature-cost-5129-ocp-cloud-processing and cost-management.backend.feature-cost-5129-ocp-cloud-summary unleash flags are enabled. It also updates the report_data masu endpoint to trigger the new processing/ocp on cloud summary task IF the unleash flags are on.

Testing

  1. Checkout Branch
  2. Restart Koku
  3. Create and enable cost-management.backend.feature-cost-5129-ocp-cloud-processing in unleash, do not enable the summary flag.
  4. Create and load test customer data
  5. Check trino to make sure the data inside managed_aws_openshift_daily
trino:org1234567> SELECT count(*) FROM managed_aws_openshift_daily ;
 _col0 
-------
 20480 
(1 row)
  1. Verify that things operated as normal and OCP on Cloud data is present
  2. Run a few queries to gather a baseline to compare with, I've added a few examples, feel free to check more.
trino:org1234567> SELECT count(*) FROM reporting_ocpawscostlineitem_project_daily_summary;
 _col0 
-------
 25993 
(1 row)

trino:org1234567> SELECT sum(unblended_cost) FROM reporting_ocpawscostlineitem_project_daily_summary;
       _col0       
-------------------
 2317.321365199998 
(1 row)
  1. Enable the summary unleash flag cost-management.backend.feature-cost-5129-ocp-cloud-summary.
  2. *you can also avoid masu and the unleash flags by making the summary check flag return True temporarily.
  3. Hit the report data endpoint for your source replacing the provider uuid
    /api/cost-management/v1/report_data/?schema=org1234567&provider_uuid=58c94173-027e-4ccf-a41e-5f2b169e09b5&start_date=2024-07-01
  4. See summary run and check to make sure the new table was used. I checked this in trino by visiting localhost:8080/ui and searching for INSERT INTO hive.org1234567.aws_openshift_daily_resource_matched_temp and select the first query and verify the FROM statement is FROM hive.org1234567.managed_aws_openshift_daily as aws.
  5. Run the same queries from 7 and verify that the values match
trino:org1234567> SELECT count(*) FROM reporting_ocpawscostlineitem_project_daily_summary;
 _col0 
-------
 25993 
(1 row)

trino:org1234567> SELECT sum(unblended_cost) FROM reporting_ocpawscostlineitem_project_daily_summary;
       _col0       
-------------------
 2317.321365199997 
(1 row)

Release Notes

  • proposed release note
* [COST-5137](https://issues.redhat.com/browse/COST-5137) Run OCP on Cloud summary after new processing flow

@cgoodfred cgoodfred added the aws-smoke-tests pr_check will build the image and run aws + ocp on aws smoke tests label Aug 29, 2024
@cgoodfred cgoodfred self-assigned this Aug 29, 2024
Copy link

codecov bot commented Aug 29, 2024

Codecov Report

Attention: Patch coverage is 93.75000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 94.0%. Comparing base (207833c) to head (2f0190e).

Additional details and impacted files
@@          Coverage Diff          @@
##            main   #5276   +/-   ##
=====================================
  Coverage   94.0%   94.0%           
=====================================
  Files        375     375           
  Lines      31506   31529   +23     
  Branches    4642    4646    +4     
=====================================
+ Hits       29631   29653   +22     
+ Misses      1197    1195    -2     
- Partials     678     681    +3     

@cgoodfred cgoodfred marked this pull request as ready for review August 29, 2024 15:16
@cgoodfred cgoodfred requested review from a team as code owners August 29, 2024 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
aws-smoke-tests pr_check will build the image and run aws + ocp on aws smoke tests smokes-required
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants