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-4936] Add memory and operating system columns to aws trino table #5071

Merged
merged 3 commits into from
May 2, 2024

Conversation

djnakabaale
Copy link
Contributor

Jira Ticket

COST-4936

Description

This change will:

  • add product_operatingsystem column to the aws_line_items table in trino
  • add product_memory and product_operatingsystem columns to aws_line_items_daily table in trino

Testing

  1. Checkout main branch

  2. Restart Koku and test aws source

  3. In the trino shell:

    i. see that you have aws_line_items and aws_line_items_daily tables

    show tables;
    

    ii. see that the new columns are missing in the respective tables

  4. Checkout this branch

  5. Run python scripts/cji_scripts/migrate_trino.py to drop the aws line tables. Verify by repeating step 3.i to see that those tables are removed.

  6. Generate a new report for your aws source and trigger download

    i. In your koku environment, generate a fresh report via nise (assuming your source is local)

    nise report aws -s 2024-04-01 -w --aws-s3-report-name None --aws-s3-bucket-name ./testing/local_providers/aws_local
    

    ii. Trigger download for the new report, which will trigger recreating the aws line item tables
    http://127.0.0.1:5042/api/cost-management/v1/download/?provider_uuid=<your_provider_uuid>

  7. Repeat step 3 and see that product_memory and product_operatingsystem columns are present in the respective tables.

    trino:org1234567> show columns from aws_line_items like 'product_%';
            Column          |  Type   | Extra | Comment 
    -------------------------+---------+-------+---------
    product_productname     | varchar |       |         
    product_instancetype    | varchar |       |         
    product_memory          | varchar |       |         
    product_operatingsystem | varchar |       |         
    product_physicalcores   | varchar |       |         
    product_productfamily   | varchar |       |         
    product_region          | varchar |       |         
    product_servicecode     | varchar |       |         
    product_sku             | varchar |       |         
    product_vcpu            | varchar |       |         
    (10 rows)
    
    
    trino:org1234567> show columns from aws_line_items_daily like 'product_%';
            Column          |  Type   | Extra | Comment 
    -------------------------+---------+-------+---------
    product_productfamily   | varchar |       |         
    product_instancetype    | varchar |       |         
    product_operatingsystem | varchar |       |         
    product_region          | varchar |       |         
    product_productname     | varchar |       |         
    product_vcpu            | varchar |       |         
    product_memory          | varchar |       |         
    (7 rows)
    
    

Release Notes

  • proposed release note
* [COST-4936](https://issues.redhat.com/browse/COST-4936) Add product_memory and product_operatingsystem columns to aws line items tables in trino

@djnakabaale djnakabaale added aws-smoke-tests pr_check will build the image and run aws + ocp on aws smoke tests trino migration Change requires a Trino migration labels Apr 26, 2024
@djnakabaale djnakabaale self-assigned this Apr 26, 2024
Copy link

codecov bot commented Apr 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.1%. Comparing base (5d8b4b4) to head (0375809).

Additional details and impacted files
@@          Coverage Diff          @@
##            main   #5071   +/-   ##
=====================================
  Coverage   94.1%   94.1%           
=====================================
  Files        377     377           
  Lines      31344   31344           
  Branches    3715    3715           
=====================================
+ Hits       29499   29500    +1     
  Misses      1175    1175           
+ Partials     670     669    -1     

@djnakabaale djnakabaale marked this pull request as ready for review April 26, 2024 15:12
@djnakabaale djnakabaale requested review from a team as code owners April 26, 2024 15:12
@djnakabaale djnakabaale merged commit e48395e into main May 2, 2024
11 checks passed
@djnakabaale djnakabaale deleted the cost-4936-add-os-col-to-aws-trino branch May 2, 2024 17:02
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 trino migration Change requires a Trino migration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants