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

Separate out non-CDK related code #30

Closed
emileten opened this issue Apr 3, 2023 · 3 comments
Closed

Separate out non-CDK related code #30

emileten opened this issue Apr 3, 2023 · 3 comments

Comments

@emileten
Copy link
Contributor

emileten commented Apr 3, 2023

from the title in the README, cdk-pgstac is a set of AWS CDK constructs that spin up AWS infrastructure to operate and use a pgstac database.

As such, any application it relies on shouldn't be defined in cdk-pgstac, but only used as an external dependency, so that cdk-pgstac focuses only on AWS CDK logic.

From that perspective, the following application code that currently is located in this repository should be separated out :

  1. the app that contains the logic to ingest records into the database aka ingestor-api
  2. the app that contains the logic to query records from the database, aka stac-api.
  3. the app that bootstraps the database.

I think @alukach already mentioned (1) in a previous call. Does this make sense to you ?

@emileten emileten changed the title Separate out application code Separate out non CDK related code Apr 3, 2023
@emileten emileten changed the title Separate out non CDK related code Separate out non-CDK related code Apr 3, 2023
@emileten
Copy link
Contributor Author

emileten commented Apr 3, 2023

Actually this looks like a (partial?) duplicate of #4.

@sharkinsspatial
Copy link
Member

@emileten Our approach for building APIs has largely focused on building FastAPI applications. One of their great advantages is the simplicity of having route logic defined internally in the application but still being able to support several different deployment targets, but this does require a some very thin mangum wrapping to support application deployment for the API Gateway/Lambda context.

The goal of of this cdk-pgtstac is to bring together all of the pieces required to have a functional STAC API (pgstac, 'stac-fastapi, ingestor-api`) into a simple deployable construct with some sensible defaults.

As @alukach was building out the ingestor-api functionality, it made sense to directly package the ingestor-api code into this repo for development purposes but as mentioned in #4 the goal is to extract this into a separate stand alone FastAPI application.

We will always some level of wrapping code that ties our deployment context (Lambda) and configuration to our FastAPI apps so having https://github.com/developmentseed/cdk-pgstac/tree/main/lib/stac-api/runtime will always be a necessity to simple things for construct users.

We'll use the same pattern as we incorporate https://github.com/stac-utils/titiler-pgstac into cdk-pgstac as well. I'm going to close this and we'll keep #4 as the main issue.

@emileten
Copy link
Contributor Author

Thanks for the reply @sharkinsspatial, I understand the logic and agree that

but as mentioned in #4 the goal is to extract this into a separate stand alone FastAPI application.

is the piece that should be moved.

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

No branches or pull requests

2 participants