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

Feature/issue 236: Update track ingest to allow UAT query of CMR #240

Merged
merged 110 commits into from
Oct 4, 2024

Conversation

nikki-t
Copy link
Collaborator

@nikki-t nikki-t commented Sep 25, 2024

Github Issue: #236

Description

Update track ingest to allow UAT query of CMR to support querying and loading data in different venues.

Overview of work done

  • Updated python_cmr query to include UAT mode function and bearer_token.
  • Added method to retrieve bearer token from EARTHDATA_USERNAME and EARTHDATA_PASSWORD environment variables.
  • UAT requires query on parent collection so create a method to filter for dataset type (e.g. "Reach", "Node" or "Prior") in granule UR.
  • Ensure granule URL includes UAT for SIT and UAT venues.

Overview of verification done

  • Updated existing tests to accomodate CMR UAT query.

New and existing unit tests pass.

Overview of integration done

See #238.

PR checklist:

  • Linted
  • Updated unit tests
  • Updated changelog
  • Integration testing

See Pull Request Review Checklist for pointers on reviewing this pull request

nikki-t and others added 30 commits April 22, 2024 12:34
* changelog

* update examples, remove load_data readme, info moved to wiki
* Reorganize timeseries code to  prep for Accept header

* Enable Accept header to return response of specific content-type

* Fix whitespace and string continuation

* Make error handling consistent and add an additional test where a reach can't be found

* Update changelog with issue for unreleased version

* Add 415 status code to API definition

* Few minor cleanup items

* Few minor cleanup items

* Update to aiohttp@3.9.4

* Fix dependencies

---------

Co-authored-by: Frank Greguska <89428916+frankinspace@users.noreply.github.com>
* Enable payload compression

* Update changelog with issue

---------

Co-authored-by: Frank Greguska <89428916+frankinspace@users.noreply.github.com>
…feature (#177)

* Reorganize timeseries code to  prep for Accept header

* Enable Accept header to return response of specific content-type

* Fix whitespace and string continuation

* Make error handling consistent and add an additional test where a reach can't be found

* Update changelog with issue for unreleased version

* Add 415 status code to API definition

* Few minor cleanup items

* Few minor cleanup items

* Update to aiohttp@3.9.4

* Fix dependencies

* Update required query parameters based on current API functionality

* Enable return of 'compact' GeoJSON response

* Fix linting and add test data

* Update documentation for API accept headers and compact GeoJSON response

* Fix references to incorrect Accept header examples

---------

Co-authored-by: Frank Greguska <89428916+frankinspace@users.noreply.github.com>
* Provide introduction to timeseries endpoint

* Remove _units in fields list

* Fix typo

* Update examples with Accept headers and compact query parameter

* Add issue to changelog

* Fix typo in timeseries documentation

* Update pymysql

* Update pymysql

* Provide clarity on accept headers and request parameter fields
* API Gateway Lambda authorizer to facilitate API keys and usage plans

* Unit tests to test Lambda authorizer

* Fix terraform file formatting

* API Gateway Lambda Authorizer

- Lambda function
- API Keys and Authorizer definition in OpenAPI spec
- API gateway API keys
- API gateway usage plans
- SSM parameters for API keys

* Fix trailing whitespace

* Set default region environment variable

* Fix SNYK vulnerabilities

* Add issue to changelog

* Implement custom trusted partner header x-hydrocron-key

* Update cryptography for SNYK vulnerability

* Update documentation to include API key usage

* Update quota and throttle settings for API Gateway

* Update API keys documentation to indicate to be implemented

* Move API key lookup to Lambda INIT

* Remove API key authentication and update API key to x-hydrocron-key
* Update pylint to deal with errors and fix collection reference

* Initial CMR and Hydrocron queries

- Includes placeholders for other operations needed to track granule
ingest.
- GranuleUR query for Hydrocron tables.

* Add and set up vcrpy for testing CMR API query

* Test track ingest operations

- Test CMR and hydrocron queries
- Test granuleUR query
- Update database to include granuleUR GSI

* Update to use track_ingest naming consistently

* Initial Lambda function and IAM role definition

* Replace deprecated path function with as_file

* Add SSM read IAM permissions

* Add DynamoDB read permissions

* Update track ingest lambda memory

* Remove duplicate IAM permissions

* Add in permissions to query index

* Update changelog

* Update changelog description

* Use python_cmr for CMR API queries
* Update intro.md with DOI

* Update overview.md with DOI
* add code to handle prior lakes shapefiles, add test prior lake data

* update terraform to add prior lake table

* fix tests, change to smaller test data file, changelog

* linting

* reconfigure main load_data method to make more readable and pass linting

* lint

* lint

* fix string casting to lower storage req & update test responses to handle different rounding pattern in coords

* update load benchmarking function for linting and add unit test

* try parent collection for lakes

* update version parsing for parent collection

* fix case error

* fix lake id reference

* add logging to troubleshoot too large features

* add item size logging and remove error raise for batch write

* clean up logging statements & move numeric_columns assignment

* update batch logging statement

* Rename constant

* Fix temp dir security risk https://rules.sonarsource.com/python/RSPEC-5443/

* Fix temp dir security risk https://rules.sonarsource.com/python/RSPEC-5443/

* fix code coverage calculation

---------

Co-authored-by: Frank Greguska <89428916+frankinspace@users.noreply.github.com>
…214)

* Define track ingest database and IAM permissions

* Update changelog with issue

* Modify table structure to support sparse status index

* Updated to only apply PITR in ops

---------

Co-authored-by: Frank Greguska <89428916+frankinspace@users.noreply.github.com>
* add functions to handle null geometries and convert polygons to points

* update doi in docs

* fix fill null geometries

* fix tests and update changelog
)

* adjust lambdas to populate track ingest table on granule load

* changelog

* remove test cnm

* lint

* change error caught when handling checksum

* update lambda role permissions to write to track ingest table

* fix typo on lake table terraform

* set default fill values for checksum and rev date in track status

* fix checksum handling in bulk load data

* lint

* add logging to debug
@nikki-t nikki-t self-assigned this Sep 25, 2024
@nikki-t nikki-t marked this pull request as ready for review September 25, 2024 17:26
@nikki-t
Copy link
Collaborator Author

nikki-t commented Sep 25, 2024

Please see #238 for the latest testing in SIT.

…re/issue-211

# Conflicts:
#	CHANGELOG.md
#	docs/examples.md
#	hydrocron/api/data_access/db.py
#	hydrocron/db/track_ingest.py
#	terraform/hydrocron-apigw.tf
#	terraform/hydrocron-iam.tf
#	terraform/hydrocron-lambda.tf
#	tests/conftest.py
#	tests/test_data/query_cmr_granule_results.json
#	tests/test_track_ingest.py
@frankinspace frankinspace changed the title Feature/issue 236 Feature/issue 236: Update track ingest to allow UAT query of CMR Oct 3, 2024
Base automatically changed from feature/issue-203 to develop October 4, 2024 14:42
@nikki-t nikki-t merged commit 7a43c90 into develop Oct 4, 2024
@nikki-t nikki-t deleted the feature/issue-236 branch October 4, 2024 14:48
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.

4 participants