Skip to content

Apply eoAPI updates#21

Merged
anayeaye merged 14 commits intodevelopfrom
feature/update-requirements
Feb 8, 2022
Merged

Apply eoAPI updates#21
anayeaye merged 14 commits intodevelopfrom
feature/update-requirements

Conversation

@anayeaye
Copy link
Copy Markdown
Collaborator

@anayeaye anayeaye commented Feb 7, 2022

What

eoAPI updates

This project is an implementation of the eoAPI which has had recent upgrades and features that were not yet implemented in the delta-backend. This PR upgrades the stac and raster APIs to the latest eoAPI.

  • pgstac migrated to version 0.4.3
  • stac-fastapi upgraded to version 2.3
  • stac and raster searches now support cql2-json filter language
  • simple stac api viewer is now deployed to {stac-api}/index.html
  • NOTE this PR enables the context extension in pgstac which is disabled by default. This differs from eoAPI.

misc updates

  • experimentation with managing cdk configuration in cdk.json
  • initial work towards two stage deployment (rds deletion policy as a function of deployment stage)

How tested

Deployed a temporary 'delete me' stack and loaded test collections and items. Verified tiling works in a notebook and executed simple stac json and cql2-json filter searches. Going forward we will maintain separate dev and prod stacks and can implement automated tests rather than deploying and loading a stack to test each change.

logging.getLogger("mangum.http").setLevel(logging.ERROR)

handler = Mangum(app, lifespan="auto", log_level="error") No newline at end of file
handler = Mangum(app, lifespan="auto") No newline at end of file
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@vincentsarago our stac_api began failing with:[ERROR] TypeError: __init__() got an unexpected keyword argument 'log_level' in the log. @leothomas found that the latest mangum only supports a subset of kwargs which seems to be the problem. Removing log_level lets us deploy the app but do you think we need to handle setting the log level elsewhere and/or pin the mangum version?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

👀 thanks for letting me know this. I think you're safe. I'm not even sure why we set it in the past

" VALUES "
" ('context', 'auto')"
" ON CONFLICT ON CONSTRAINT pgstac_settings_pkey DO UPDATE SET value = excluded.value;"
))
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This works to enable context in stac api results (if it is not set the number matched will always be the request limit or less). I am not sure if this is the right way to make this change. I'm also sure there is a performance hit so we may decide not to enable it but I like it for a sanity check.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Ah. This is not a good way to handle the change--it fails if it is executed before the migration to pgstac 0.4.3 (the pgstac_settings table doesn't exist in earlier versions).
I'll remove it if I don't find a better way to handle changing the setting.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Moved the execution of this step further down.

@anayeaye anayeaye requested a review from leothomas February 7, 2022 23:44
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.

3 participants