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-797: Add processing for start and end dates in manifest #2603

Merged
merged 10 commits into from
Jan 22, 2021

Conversation

abaiken
Copy link
Contributor

@abaiken abaiken commented Jan 20, 2021

Description

  • This PR allows start and end dates that are specified in the manifest to be passed down the processing pipeline so that we can process reports from air gapped clusters where the data might fall outside of our previous 3 day processing window

Manual Testing:

  1. Get Ingress up and working in conjunction with the Koku services so that you can upload files to the listener - feel free to reach out to me for info on how I did this.
  2. Create an OCP source with the same cluster ID as what is in the payloads we are using for testing:
curl -d '{"name": "aaiken", "source_type": "OCP", "authentication": {"credentials": {"cluster_id": "5997a261-f23e-45d1-8e01-ee3c765f3aec"}}}' -H "Content-Type: application/json" -X POST http://0.0.0.0:8000/api/cost-management/v1/sources/
  1. Download the following file and then upload it using the make local-upload-data file=costreport1.tar.gz command
    costreport1.tar.gz
  2. Connect to the DB and look at the reporting_ocpusagelineitem_daily_summary table. I used the copy command to write the table contents to a CSV file so that I could compare them for before/after:
postgres=# \copy (SELECT * FROM acct10001.reporting_ocpusagelineitem_daily_summary) TO '/Users/ashleybrookeaiken/Development/koku/ocpreporting.csv' DELIMITER ',' CSV HEADER;
  1. Download the following file (start and end dates are 1/10 - 1/12) and upload it using the make local-upload-data file=costreport1.tar.gz command.
    costreport2.tar.gz

  2. You should now repeat step 4 but copy the contents to a different file so that you can compare the data. You should see that the pod_usage_cpu_core_hours doubles from the first report to the second for 1/10 and 1/11.

@abaiken abaiken marked this pull request as draft January 20, 2021 21:30
@codecov
Copy link

codecov bot commented Jan 20, 2021

Codecov Report

Merging #2603 (7edff1f) into master (bd2198e) will increase coverage by 0.0%.
The diff coverage is 100.0%.

@@          Coverage Diff           @@
##           master   #2603   +/-   ##
======================================
  Coverage    94.8%   94.8%           
======================================
  Files         281     281           
  Lines       21111   21124   +13     
  Branches     2404    2408    +4     
======================================
+ Hits        20003   20016   +13     
  Misses        666     666           
  Partials      442     442           

@abaiken abaiken marked this pull request as ready for review January 21, 2021 20:14
@abaiken abaiken self-assigned this Jan 22, 2021
@@ -539,6 +540,12 @@ backup-local-db-dir:
@cd - >/dev/null
$(DOCKER_COMPOSE) start db

local-upload-data:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!

Copy link
Contributor

@dccurtis dccurtis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

@abaiken abaiken merged commit 8df62fe into master Jan 22, 2021
@abaiken abaiken deleted the COST797-startend branch January 22, 2021 18:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants