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-5094] Default to distributing unattributed networking/storage costs #5145

Merged
merged 2 commits into from
Jun 6, 2024

Conversation

cgoodfred
Copy link
Contributor

@cgoodfred cgoodfred commented Jun 5, 2024

Jira Ticket

COST-5094

Description

This change will run a migration to update all existing cost models to distribute unattributed networking and storage costs.

Testing

  1. Checkout Main
  2. Restart Koku
  3. Create test customer and load test customer data
  4. Check your cost models for distribution info:
postgres=# SELECT name, source_type, distribution_info FROM cost_model;
                    name                     | source_type |                                                           distribution_info                                                            
---------------------------------------------+-------------+----------------------------------------------------------------------------------------------------------------------------------------
 Cost Management OpenShift on AWS Cost Model | OCP         | {"worker_cost": true, "platform_cost": true, "distribution_type": "cpu", "network_unattributed": false, "storage_unattributed": false}
 Cost Management AWS Cost Model              | AWS         | {"worker_cost": true, "platform_cost": true, "distribution_type": "cpu", "network_unattributed": false, "storage_unattributed": false}
 Cost Management Azure Cost Model            | Azure       | {"worker_cost": true, "platform_cost": true, "distribution_type": "cpu", "network_unattributed": false, "storage_unattributed": false}
 Cost Management GCP Cost Model              | GCP         | {"worker_cost": true, "platform_cost": true, "distribution_type": "cpu", "network_unattributed": false, "storage_unattributed": false}
 Cost Management OCI Cost Model              | OCI         | {"worker_cost": true, "platform_cost": true, "distribution_type": "cpu", "network_unattributed": false, "storage_unattributed": false}
 Cost Management OpenShift Cost Model        | OCP         | {"worker_cost": true, "platform_cost": true, "distribution_type": "cpu", "network_unattributed": false, "storage_unattributed": false}
(6 rows)
  1. Checkout this branch and run the migration in this PR
make run-migrations
  1. Check the distribution info and verify the fields are now set to true for OCP cost models:
postgres=# SELECT name, source_type, distribution_info FROM cost_model;
                    name                     | source_type |                                                           distribution_info                                                            
---------------------------------------------+-------------+----------------------------------------------------------------------------------------------------------------------------------------
 Cost Management AWS Cost Model              | AWS         | {"worker_cost": true, "platform_cost": true, "distribution_type": "cpu", "network_unattributed": false, "storage_unattributed": false}
 Cost Management Azure Cost Model            | Azure       | {"worker_cost": true, "platform_cost": true, "distribution_type": "cpu", "network_unattributed": false, "storage_unattributed": false}
 Cost Management GCP Cost Model              | GCP         | {"worker_cost": true, "platform_cost": true, "distribution_type": "cpu", "network_unattributed": false, "storage_unattributed": false}
 Cost Management OCI Cost Model              | OCI         | {"worker_cost": true, "platform_cost": true, "distribution_type": "cpu", "network_unattributed": false, "storage_unattributed": false}
 Cost Management OpenShift on AWS Cost Model | OCP         | {"worker_cost": true, "platform_cost": true, "distribution_type": "cpu", "network_unattributed": true, "storage_unattributed": true}
 Cost Management OpenShift Cost Model        | OCP         | {"worker_cost": true, "platform_cost": true, "distribution_type": "cpu", "network_unattributed": true, "storage_unattributed": true}

Release Notes

  • proposed release note
* [COST-5094](https://issues.redhat.com/browse/COST-5094) Data migration to default to distributing network and storage unattributed costs for existing cost models.

@cgoodfred cgoodfred added smoke-tests pr_check will build the image and run minimal required smokes django migration Change requires a Django database migration labels Jun 5, 2024
@cgoodfred cgoodfred self-assigned this Jun 5, 2024
@cgoodfred cgoodfred requested review from a team as code owners June 5, 2024 14:51
Copy link

codecov bot commented Jun 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.1%. Comparing base (90e5273) to head (dd58b64).

Additional details and impacted files
@@          Coverage Diff          @@
##            main   #5145   +/-   ##
=====================================
  Coverage   94.1%   94.1%           
=====================================
  Files        375     375           
  Lines      31191   31191           
  Branches    3731    3731           
=====================================
  Hits       29344   29344           
  Misses      1177    1177           
  Partials     670     670           

@cgoodfred cgoodfred merged commit 38965e1 into main Jun 6, 2024
11 checks passed
@cgoodfred cgoodfred deleted the COST-5094-distribute-migration branch June 6, 2024 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
django migration Change requires a Django database migration smoke-tests pr_check will build the image and run minimal required smokes smokes-required
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants