Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: project-koku/koku
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: r.2024.07.18.0
Choose a base ref
...
head repository: project-koku/koku
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: r.2024.07.23.0
Choose a head ref
  • 10 commits
  • 66 files changed
  • 11 contributors

Commits on Jul 18, 2024

  1. [COST-5299] clear cache when table is dropped by migration (#5221)

    maskarb authored Jul 18, 2024

    Verified

    This commit was signed with the committer’s verified signature.
    djhi Gildas Garcia
    Copy the full SHA
    0d7c445 View commit details
  2. Update nise and AWS DataTransferGenerator resource IDs (#5222)

    * Add gitleaks ignore AWS nise YAML
      The IAM identifier is only used for testing purposes
    
    * Change resorce_id format for AWS DataTransferGenerators
    samdoran authored Jul 18, 2024

    Verified

    This commit was signed with the committer’s verified signature.
    djhi Gildas Garcia
    Copy the full SHA
    b81c9fa View commit details
  3. [COST-5289] EC2 compute API - update openapi doc (#5224)

    * [COST-5289] EC2 compute API - update openapi doc
    
    * add operating_system to EC2 compute filters
    djnakabaale authored Jul 18, 2024

    Verified

    This commit was signed with the committer’s verified signature.
    djhi Gildas Garcia
    Copy the full SHA
    7c64c4f View commit details

Commits on Jul 19, 2024

  1. [COST-4945] Create a new API to return list of EC2-compute instances (#…

    …5117)
    
    * feat: cleaning up old changes. making first changes to create the API pieces.
    
    * feat: cleaning up old changes. making first changes to create the API pieces.
    
    * feat: insert new filters.
    
    * feat: insert new filters and order by params.
    
    * feat: customizing provider map and serializer.
    
    * fix: changing TIME_CHOICES options.
    
    * feat: first unit tests.
    
    * feat: wip.
    
    * feat: fixing provider map.
    
    * feat: fixing provider map.
    
    * update ec2 annotations to get all required fields
    
    * use AWSEC2ComputeQueryParamSerializer
    
    * feat: creating orderby and groupby serializers for ec2
    
    * feat: unit tests for filters
    
    * feat: removing group_by - not needed on ec2
    
    * feat: fixing orderby serializer and starting units tests
    
    * fix: typo
    
    * feat: changing usage_hours to usage_amount
    
    * feat: fixing unit test.
    
    * wip: blocking some filters and unit test.
    
    * feat: unit tests for group by filter
    
    * flake8 fix
    
    * feat: inserting more filters on validate function.
    
    * feat: updating validate method to use similar logic and add filters.
    
    * fix: changing unit tests for some filters.
    
    * feat: testing filter combinations and flake8 checks.
    
    * fix: test
    
    * feat: serializer Unit tests and view Unit test fix
    
    * flake8 fix
    
    * fix: new approach to satisfy CodeCov
    
    * fix:: getting rid of validate custom method.
    
    * fix: commenting tags.
    
    * fix: validarte functions, tests.
    
    * handle filter params for specific report type
    
    * transform tags to desired ui format
    
    * default to monthly resolution on the EC2 endpoint
    
    * add special pagination for EC2
    
    * use default report type time period settings if exists
    
    * fix typo
    
    * fix: fixing parameters validations.
    
    * [COST-5141] Fix management command to use continue instead of return. (#5173)
    
    * [COST-5128] Process new subs tagging strategy to identify non-converted instances (#5162)
    
    * [COST-4745] Add data_transfer_direction to OCP on GCP Trino tables (#5130)
    
    * [COST-4741] Add data_transfer_direction for AWS network costs to Trino tables (#5129)
    
    * [COST-5168] - Adding new penalty pipeline (#5176)
    
    * [COST-5168] - Adding new penalty pipeline
    
    * Improve our logging readability (#5178)
    
    * add prometheus metrics for new queues (#5179)
    
    * add v3.3.0 operator commits (#5143)
    
    * [COST-5124] Improve Trino migration management command (#5163)
    
    * Add exponential backoff and logging to retries
    * Change log level to reflect severity
    * Explicit SQL alias for clarity
    * Catch and log exception instead of exiting
    * Add return type hints
    * Return if unsuccessful
      No point in verifying if the SQL did not run correctly
    * Fine tune exponential backoff
    * Create action class for adding/verifying columns were added
    * Assign default list using default_fatory
      Instead of doing it in the post_init, which get’s a little weird.
    * Add drop column action
    * Quote items in logs for better legibility
    * Consolidate action classes
      We lose some of the action-specific logging messages, but there is less
      code overall. I’m not sure how this scale to the action related to dropping.
    * Change local variable name
      No need to add a prefix to differentiate it from the parameter name.
    * Use a set to prevent running on the same schema multiple times
    
    Co-authored-by: Cody Myers <[email protected]>
    
    * Filter accounts by matching criteria during subs processing to prevent unnecessary SQL from running (#5184)
    
    * Update tasks.py (#5185)
    
    * clean up grafana dashboard (#5183)
    
    * Skip OCPCloud tag SQL if key is present in cache but value is None (#5186)
    
    * [COST-5196] - Send OCP tasks to correct queues (#5187)
    
    * [COST-5196] - Send OCP tasks to correct queues
    
    * [COST-5176] correctly pass context dictionary within log_json function call (#5182)
    
    * [COST-5176] correctly pass context dictionary within log_json function call
    
    * add unittests for exceptions in generate_report
    
    * batch delete S3 files (#5180)
    
    * Bump urllib3 from 1.26.18 to 1.26.19 in the pip group across 1 directory (#5172)
    
    Bumps the pip group with 1 update in the / directory: [urllib3](https://github.com/urllib3/urllib3).
    
    
    Updates `urllib3` from 1.26.18 to 1.26.19
    - [Release notes](https://github.com/urllib3/urllib3/releases)
    - [Changelog](https://github.com/urllib3/urllib3/blob/1.26.19/CHANGES.rst)
    - [Commits](urllib3/urllib3@1.26.18...1.26.19)
    
    ---
    updated-dependencies:
    - dependency-name: urllib3
      dependency-type: indirect
      dependency-group: pip
    ...
    
    Signed-off-by: dependabot[bot] <[email protected]>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    
    * Add flower as a dev dependency (#5189)
    
    * Add docs
    
    * [COST-4844] Serializer update for ordering by storageclass (#5174)
    
    * Switch to using podman in build_deploy (#5193)
    
    The VM used in CI is now RHEL 8
    
    * skip polling providers still processing (#5181)
    
    * skip polling providers that are still processing
    
    * [COST-5214] Move TARGETARCH declaration to the top of the Dockerfile (#5195)
    
    There is a bug in podman where this is only used correctly for the
    multi-stage build if it is defined as the first line.
    
    Update Jenkinsfile to use RHEL 8
    
    Unfortunately this breaks the image build for Docker. I'll fix that in a followup PR.
    
    * [COST-5213] - fix S3 prepare (#5194)
    
    * Switch default parquet flag to prevent iterating on all files in each worker when there is nothing to delete
    
    * [COST-5214] pass build-arg to docker build command (#5196)
    
    * [COST-5216] Delete filtering optimization (#5197)
    
    * Revert "[COST-5216] Delete filtering optimization (#5197)" (#5200)
    
    This reverts commit 97ba98e.
    
    * [COST-5226] - Skip S3 delete (daily flow) if we have marked deletion complete. (#5198)
    
    * dont attempt more S3 deletes if we have marked deletion complete
    
    * [COST-5076] upgrade to python 3.11 (#4444)
    
    * upgrade to python 3.11
    
    * pipfile update
    
    * add gcc-c++ compiler
    
    Co-authored-by: Sam Doran <[email protected]>
    
    * update test
    
    * replace gcc with gcc-c++
    
    ---------
    
    Co-authored-by: Sam Doran <[email protected]>
    
    * [COST-5228] log outside for loop (#5202)
    
    * [COST-5228] log outside for loop
    
    * additional log clean up
    
    * add context to logs in _remove_expired_data func
    
    * log s3 batch deletes (#5204)
    
    * log s3 batch deletes
    
    * [COST-5219] Correctly report VM usage for metering when billing record is split (#5201)
    
    * [COST-5219] Handle Azure instance record being split
    
    * [COST-4745] OCPGCP Network data processing SQL (#5058)
    
    * [COST-4745] OCPGCP Network data processing SQL
    
    ---------
    
    Co-authored-by: Sam Doran <[email protected]>
    
    * [COST-5198] - split read traffic to read replica db using nginx proxy (#5188)
    
    * update nginx with HTTP method routing
    * switch koku-api to koku-api-writes
    * duplicate koku-api to koku-api-reads add a optional mounted secret for the read replica
    * update clowder configurator to read from read replica secret if mounted and enabled via ENV var
    
    * remove unused methods (#5208)
    
    * Bump certifi in the pip group across 1 directory (#5207)
    
    * chore(image): update and rebuild image (#5203)
    
    Co-authored-by: Update-a-Bot <[email protected]>
    
    * Handle case when resource ID cannot be obtained (#5209)
    
    * Catch exception case.
    
    * [COST-5148] filter out empty resource ids and SavingsPlanCoveredUsage entries (#5206)
    
    * [COST-5148] update insert sql
    filter out empty resource ids
    offset savings from SavingsPlanCoveredUsage
    
    * closing CASE statement
    
    * clean up comment
    
    * remove case stmts in favor of filtering out SavingsPlanCoveredUsage
    
    * clean up
    
    * Unpause the csi volume handle sql (#5175)
    
    * update linting
    
    * feat: cleaning up old changes. making first changes to create the API pieces.
    
    * feat: cleaning up old changes. making first changes to create the API pieces.
    
    * feat: insert new filters.
    
    * feat: insert new filters and order by params.
    
    * feat: customizing provider map and serializer.
    
    * fix: changing TIME_CHOICES options.
    
    * feat: first unit tests.
    
    * feat: wip.
    
    * feat: fixing provider map.
    
    * feat: fixing provider map.
    
    * update ec2 annotations to get all required fields
    
    * use AWSEC2ComputeQueryParamSerializer
    
    * feat: creating orderby and groupby serializers for ec2
    
    * feat: unit tests for filters
    
    * feat: removing group_by - not needed on ec2
    
    * feat: fixing orderby serializer and starting units tests
    
    * fix: typo
    
    * feat: changing usage_hours to usage_amount
    
    * feat: fixing unit test.
    
    * wip: blocking some filters and unit test.
    
    * feat: unit tests for group by filter
    
    * flake8 fix
    
    * feat: inserting more filters on validate function.
    
    * feat: updating validate method to use similar logic and add filters.
    
    * fix: changing unit tests for some filters.
    
    * feat: testing filter combinations and flake8 checks.
    
    * fix: test
    
    * feat: serializer Unit tests and view Unit test fix
    
    * flake8 fix
    
    * fix: new approach to satisfy CodeCov
    
    * fix:: getting rid of validate custom method.
    
    * fix: commenting tags.
    
    * fix: validarte functions, tests.
    
    * handle filter params for specific report type
    
    * transform tags to desired ui format
    
    * default to monthly resolution on the EC2 endpoint
    
    * add special pagination for EC2
    
    * use default report type time period settings if exists
    
    * fix typo
    
    * fix: fixing parameters validations.
    
    * update linting
    
    * squash commits
    
    * clean up query params and time period settings
    
    * do not use filter keyword
    
    * more code clean up
    update unit tests
    
    * address feedback
    - move report_specific filters to main filter map
    - use report_type instead of kwargs in get_paginator
    - do not use deepcopy - just overwrite query_data
    - resolution and time_scope_units are always monthly and month respectively
    - overide start and end date params in base ParamSerializer
    - overide limit and offset in base FilterSerializer
    
    * more unit tests
    
    * update openapi spec
    
    * clean up and add unit tests
    
    * move changes to openapi spec to a separate pr
    
    * use serializer choice field and not customer validate method
    
    ---------
    
    Signed-off-by: dependabot[bot] <[email protected]>
    Co-authored-by: David N <[email protected]>
    Co-authored-by: Luke Couzens <[email protected]>
    Co-authored-by: Cody Myers <[email protected]>
    Co-authored-by: Corey Goodfred <[email protected]>
    Co-authored-by: Sam Doran <[email protected]>
    Co-authored-by: Michael Skarbek <[email protected]>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    Co-authored-by: Chris Hambridge <[email protected]>
    Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
    Co-authored-by: Update-a-Bot <[email protected]>
    11 people authored Jul 19, 2024

    Verified

    This commit was signed with the committer’s verified signature.
    djhi Gildas Garcia
    Copy the full SHA
    45d8e31 View commit details
  2. update data_updated_timestamp for polled provider that has no new rep…

    …orts to be downloaded (#5205)
    lcouzens authored Jul 19, 2024

    Verified

    This commit was signed with the committer’s verified signature.
    djhi Gildas Garcia
    Copy the full SHA
    682edb8 View commit details
  3. Consolidate local volume mounts to dev/containers (#5215)

    maskarb authored Jul 19, 2024

    Verified

    This commit was signed with the committer’s verified signature.
    djhi Gildas Garcia
    Copy the full SHA
    dc1b7f8 View commit details
  4. [COST-5198] Skip customer save on get request (#5225)

    * To enable read replica usage skip cusotmer save on get/head requests
    chambridge authored Jul 19, 2024
    Copy the full SHA
    c23153f View commit details
  5. [COST-5280] - rename cpu/memory request/limits parameters (#5226)

    maskarb authored Jul 19, 2024
    Copy the full SHA
    c93cf97 View commit details
  6. add additional info to INSERT operation (#5227)

    maskarb authored Jul 19, 2024
    Copy the full SHA
    7aad9f8 View commit details

Commits on Jul 22, 2024

  1. [COST-4993] gate ec2 endpoint with unleash (#5229)

    maskarb authored Jul 22, 2024
    Copy the full SHA
    6ffdd28 View commit details
Showing with 1,548 additions and 577 deletions.
  1. +2 −0 .gitignore
  2. +1 −0 .gitleaks.toml
  3. 0 .trino/parquet_data/.gitkeep
  4. 0 .trino/trino/.gitkeep
  5. +11 −10 Makefile
  6. +3 −3 Pipfile.lock
  7. +256 −256 deploy/clowdapp.yaml
  8. +16 −16 deploy/kustomize/base/base.yaml
  9. +8 −8 deploy/kustomize/patches/koku-reads.yaml
  10. +8 −8 deploy/kustomize/patches/koku-writes.yaml
  11. +8 −8 deploy/kustomize/patches/listener.yaml
  12. +8 −8 deploy/kustomize/patches/masu.yaml
  13. +8 −8 deploy/kustomize/patches/nginx.yaml
  14. +8 −8 deploy/kustomize/patches/scheduler.yaml
  15. +8 −8 deploy/kustomize/patches/sources-client.yaml
  16. +8 −8 deploy/kustomize/patches/sources-listener.yaml
  17. +8 −8 deploy/kustomize/patches/worker-celery.yaml
  18. +8 −8 deploy/kustomize/patches/worker-cost-model-penalty.yaml
  19. +8 −8 deploy/kustomize/patches/worker-cost-model-xl.yaml
  20. +8 −8 deploy/kustomize/patches/worker-cost-model.yaml
  21. +8 −8 deploy/kustomize/patches/worker-download-penalty.yaml
  22. +8 −8 deploy/kustomize/patches/worker-download-xl.yaml
  23. +8 −8 deploy/kustomize/patches/worker-download.yaml
  24. +8 −8 deploy/kustomize/patches/worker-hcs.yaml
  25. +8 −8 deploy/kustomize/patches/worker-ocp-penalty.yaml
  26. +8 −8 deploy/kustomize/patches/worker-ocp-xl.yaml
  27. +8 −8 deploy/kustomize/patches/worker-ocp.yaml
  28. +8 −8 deploy/kustomize/patches/worker-priority-penalty.yaml
  29. +8 −8 deploy/kustomize/patches/worker-priority-xl.yaml
  30. +8 −8 deploy/kustomize/patches/worker-priority.yaml
  31. +8 −8 deploy/kustomize/patches/worker-refresh-penalty.yaml
  32. +8 −8 deploy/kustomize/patches/worker-refresh-xl.yaml
  33. +8 −8 deploy/kustomize/patches/worker-refresh.yaml
  34. +8 −8 deploy/kustomize/patches/worker-subs-extraction.yaml
  35. +8 −8 deploy/kustomize/patches/worker-subs-transmission.yaml
  36. +8 −8 deploy/kustomize/patches/worker-summary-penalty.yaml
  37. +8 −8 deploy/kustomize/patches/worker-summary-xl.yaml
  38. +8 −8 deploy/kustomize/patches/worker-summary.yaml
  39. +5 −0 dev/containers/minio/.gitignore
  40. +5 −0 dev/containers/trino/data/.gitignore
  41. +5 −0 dev/containers/trino/logs/.gitignore
  42. +6 −6 dev/scripts/nise_ymls/ocp_on_aws/aws_static_data.yml
  43. +4 −4 docker-compose.yml
  44. +477 −5 docs/specs/openapi.json
  45. +34 −6 koku/api/common/pagination.py
  46. +23 −14 koku/api/query_handler.py
  47. +29 −5 koku/api/query_params.py
  48. +117 −1 koku/api/report/aws/provider_map.py
  49. +37 −1 koku/api/report/aws/query_handler.py
  50. +117 −1 koku/api/report/aws/serializers.py
  51. +16 −0 koku/api/report/aws/view.py
  52. +7 −0 koku/api/report/constants.py
  53. +1 −0 koku/api/report/queries.py
  54. +15 −0 koku/api/report/test/aws/test_queries.py
  55. +61 −0 koku/api/report/test/aws/test_views.py
  56. +9 −0 koku/api/report/test/test_serializers.py
  57. +11 −5 koku/api/report/view.py
  58. +8 −0 koku/api/urls.py
  59. +1 −0 koku/api/views.py
  60. +5 −0 koku/koku/cache.py
  61. +3 −2 koku/koku/middleware.py
  62. +13 −0 koku/koku/test_cache.py
  63. +1 −1 koku/masu/database/ocp_report_db_accessor.py
  64. +5 −0 koku/masu/management/commands/migrate_trino_tables.py
  65. +3 −0 koku/masu/processor/tasks.py
  66. +1 −1 tox.ini
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -108,6 +108,8 @@ ENV/
# Local Postgres data
pg_data/
pg_data.bak*/
dev/containers/postgresql/data/
dev/containers/postgresql/data.bak*/

# static files
koku/staticfiles/
1 change: 1 addition & 0 deletions .gitleaks.toml
Original file line number Diff line number Diff line change
@@ -3,4 +3,5 @@ paths = [
'''grafana\/grafana.db.sql''',
'''.env.example''',
'''docs\/devtools.md''',
'''dev\/scripts\/nise_ymls\/ocp_on_aws\/aws_static_data.yml''',
]
Empty file removed .trino/parquet_data/.gitkeep
Empty file.
Empty file removed .trino/trino/.gitkeep
Empty file.
21 changes: 11 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
@@ -67,7 +67,7 @@ help:
@echo "--- Commands using local services ---"
@echo " delete-testing Delete stale files/subdirectories from the testing directory."
@echo " delete-trino Delete stale files/subdirectories from the trino data directory."
@echo " delete-trino-data Delete old trino data from .trino/parquet_data/koku-bucket/."
@echo " delete-trino-data Delete old trino data from the Minio koku-bucket bucket."
@echo " delete-redis-cache Flushes cache keys inside of the redis container."
@echo " create-test-customer create a test customer and tenant in the database"
@echo " create-test-customer-no-sources create a test customer and tenant in the database without test sources"
@@ -97,7 +97,7 @@ help:
@echo " make-migrations make migrations for the database"
@echo " requirements generate Pipfile.lock"
@echo " clowdapp generates a new clowdapp.yaml"
@echo " delete-db delete local directory $(TOPDIR)/pg_data"
@echo " delete-db delete local directory $(TOPDIR)/dev/containers/postgresql/data"
@echo " delete-test-db delete the django test db"
@echo " reset-db-statistics clear the pg_stat_statements statistics"
@echo " run-migrations run migrations against database"
@@ -167,10 +167,11 @@ delete-testing:
@$(PREFIX) $(PYTHON) $(SCRIPTDIR)/clear_testing.py -p $(TOPDIR)/testing

delete-trino:
@$(PREFIX) rm -rf $(TOPDIR)/.trino/trino/*
@$(PREFIX) rm -rf $(TOPDIR)/dev/containers/trino/data/*
@$(PREFIX) rm -rf $(TOPDIR)/dev/containers/trino/logs/*

delete-trino-data:
@$(PREFIX) rm -rf $(TOPDIR)/.trino/parquet_data/koku-bucket/*
@$(PREFIX) rm -rf $(TOPDIR)/dev/containers/minio/koku-bucket/*

delete-redis-cache:
$(DOCKER) exec -it koku_redis redis-cli -n 1 flushall
@@ -213,7 +214,7 @@ make-migrations:
$(DJANGO_MANAGE) makemigrations api reporting reporting_common cost_models key_metrics

delete-db:
@$(PREFIX) rm -rf $(TOPDIR)/pg_data/data/*
@$(PREFIX) rm -rf $(TOPDIR)/dev/containers/postgresql/data/

delete-test-db:
@PGPASSWORD=$$DATABASE_PASSWORD psql -h $$POSTGRES_SQL_SERVICE_HOST \
@@ -382,7 +383,7 @@ docker-iqe-api-tests: docker-reinitdb _set-test-dir-permissions delete-testing
docker-iqe-vortex-tests: docker-reinitdb _set-test-dir-permissions delete-testing
./testing/run_vortex_api_tests.sh

CONTAINER_DIRS = $(TOPDIR)/pg_data/data $(TOPDIR)/.trino/{parquet_data,trino}
CONTAINER_DIRS = $(TOPDIR)/dev/containers/postgresql/data $(TOPDIR)/dev/containers/minio $(TOPDIR)/dev/containers/trino/{data,logs}
docker-host-dir-setup:
@mkdir -p -m 0755 $(CONTAINER_DIRS) 2>&1 > /dev/null
@chown $(USER_ID):$(GROUP_ID) $(CONTAINER_DIRS)
@@ -564,7 +565,7 @@ backup-local-db-dir:
$(DOCKER_COMPOSE) stop db
@cd $(TOPDIR)
@echo "Copying pg_data to pg_data.bak..."
@$(PREFIX) cp -rp ./pg_data ./pg_data.bak
@$(PREFIX) cp -rp ./dev/containers/postgresql/data ./dev/containers/postgresql/data.bak
@cd - >/dev/null
$(DOCKER_COMPOSE) start db

@@ -577,12 +578,12 @@ local-upload-data:

restore-local-db-dir:
@cd $(TOPDIR)
@if [ -d ./pg_data.bak ] ; then \
@if [ -d ./dev/containers/postgresql/data.bak ] ; then \
$(DOCKER_COMPOSE) stop db ; \
echo "Removing pg_data..." ; \
$(PREFIX) rm -rf ./pg_data ; \
$(PREFIX) rm -rf ./dev/containers/postgresql/data ; \
echo "Renaming pg_data.bak to pg_data..." ; \
$(PREFIX) mv -f ./pg_data.bak ./pg_data ; \
$(PREFIX) mv -f ./dev/containers/postgresql/data.bak ./dev/containers/postgresql/data ; \
$(DOCKER_COMPOSE) start db ; \
echo "NOTE :: Migrations may need to be run." ; \
else \
6 changes: 3 additions & 3 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading