-
Notifications
You must be signed in to change notification settings - Fork 5
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
feat: titiler-pgstac v1 upgrade #398
Conversation
@vincentsarago do we need to upgrade pgstac as well? We're currently running |
no, I think you're fine |
✨ looks good to me, did you use https://stac-utils.github.io/titiler-pgstac/latest/migrations/v1_migration/? was it useful? |
Yes very useful! I did notice a discrepancy in this section. It imports
I'm assuming we have to import |
☝️ ignore, this was fixed in stac-utils/titiler-pgstac@6d84641 |
When running the raster api docker compose I got this error: |
9572a73
to
fcf3fed
Compare
@smohiudd I think we also need to replace/remove |
@smohiudd we also wanted to add the colormap endpoints - should we do it in the same PR? |
@@ -67,24 +78,36 @@ async def lifespan(app: FastAPI): | |||
# /mosaic - PgSTAC Mosaic titiler endpoint | |||
############################################################################### | |||
mosaic = MosaicTilerFactory( | |||
router_prefix="/mosaic", | |||
router_prefix="/searches/{search_id}", | |||
path_dependency=SearchIdParams, | |||
optional_headers=optional_headers, | |||
environment_dependency=settings.get_gdal_config, | |||
process_dependency=PostProcessParams, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we still need process_dependency
if we have tile_dependencies
below?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@smohiudd the process dependency is different from the tile_dependency. I see that we have custom post_process method, so if they are still used we should keep the process_dependency
@vincentsarago how come we don't have the |
raster_api/runtime/src/app.py
Outdated
# TODO | ||
# prefix will be replaced by `/mosaics/{search_id}` in titiler-pgstac 1.0.0 | ||
# add /list endpoint | ||
add_search_list_route(app, prefix="/searches", tags=["Mosaic"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this the equivalent of the list registered mosaics endpoint that we were setting in the .env as VEDA_RASTER_ENABLE_MOSAIC_SEARCH
and then
-
Inserting in the lambda env in infrastructure construct
-
And using the runtime config to conditionally enable the list endpoint which could potentially be expensive because it is not paginated (or it was not yet paginated at some point)?
If so, do we want it always on now?
you need to register a new set of endpoint using the MosaicTilerFactory factory |
@anayeaye, yes! in next major version of titiler we will remove the |
raster_api/runtime/src/app.py
Outdated
# TODO | ||
# prefix will be replaced by `/mosaics/{search_id}` in titiler-pgstac 1.0.0 | ||
# add /list endpoint | ||
add_search_list_route(app, prefix="/searches", tags=["Mosaic"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess the tags
should be Searches
?
) | ||
app.include_router(mosaic.router, prefix="/searches/{search_id}", tags=["Mosaic"]) | ||
|
||
add_search_register_route( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add
if settings.enable_mosaic_search:
add_search_register_route(
raster_api/runtime/src/app.py
Outdated
app.include_router( | ||
collection.router, tags=["STAC Collection"], prefix="/collections/{collection_id}" | ||
) | ||
|
||
|
||
############################################################################### | ||
# /stac - Custom STAC titiler endpoint |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
from titiler.pgstac.dependencies import ItemIdParams
stac = MultiBaseTilerFactory(
reader=PgSTACReader,
path_dependency=ItemIdParams,
optional_headers=optional_headers,
router_prefix="/stac",
environment_dependency=settings.get_gdal_config,
router=APIRouter(route_class=LoggerRouteHandler),
extensions=[
stacViewerExtension(),
],
colormap_dependency=ColorMapParams,
)
app.include_router(stac.router, tags=["Items"], prefix="/collections/{collection_id}/items/{item_id}")
###############################################################################
# /alt - Custom STAC titiler endpoint for alternate asset locations
###############################################################################
stac_alt = MultiBaseTilerFactory(
reader=PgSTACReaderAlt,
path_dependency=ItemIdParams,
optional_headers=optional_headers,
router_prefix="/alt/collections/{collection_id}/items/{item_id}",
environment_dependency=settings.get_gdal_config,
router=APIRouter(route_class=LoggerRouteHandler),
extensions=[
stacViewerExtension(),
],
colormap_dependency=ColorMapParams,
)
app.include_router(stac_alt.router, tags=["Items"], prefix="/alt/collections/{collection_id}/items/{item_id}")
…configuration for cloudfront, titiler-pgstac v1 upgrade (#405) ### 📣 Breaking - [feat!: titiler-pgstac v1 upgrade #398](#398) introduces breaking endpoint changes; see [titiler-pgstac v0.8 -> v1.0 migration docs](https://stac-utils.github.io/titiler-pgstac/latest/migrations/v1_migration/) ### ✨ Added - [feat: add optional web acl configuration for cloudfront #396](#396) ### 🪙 Changed/Updated - [chore: Improve stac integration tests #395](#395) - [chore: add gitignore entry for Jetbrains IDEs #409](#409) ### 🩹 Fixed - [fix: render fix for titiler-pgstac v1 upgrade #408](#408)
…1075) **Related Ticket:** #1070⚠️ **This needs to be coordinated with veda BE team on when this can be merged. BE team needs to merge their changes into their prod before this can merge.** ### Description of Changes Updating raster api (titiler) endpoints as part of new version breaking changes. This does not worry about integrating new endpoints. ### Notes & Questions About Changes * [VEDA BACKEND PR](NASA-IMPACT/veda-backend#398) for ref * [Titiler version migration guide](https://stac-utils.github.io/titiler-pgstac/latest/migrations/v1_migration/#searchid-id) for ref ### Relevant API Changes [**yes**] rename mosaic/ endpoint to searches/ [**no**] for `/register` endpoints, update `searchId` to `id` [**no**] a dd new /collections/{collection_id} endpoint [**no**] add new /colorMaps endpoint [**no**] rename stac/ endpoint to /collections/{collection_id}/items/{item_id} [**no**] rename stac-alt/ endpoint to /alt/collections/{collection_id}/items/{item_id} ### Validation / Testing _{Update with info on what can be manually validated in the Deploy Preview link for example "Validate style updates to selection modal do NOT affect cards"}_
Upgrade to titiler-pgstac 1.3.0 using migration guide.
Updated raster API deployed to dev.openveda.cloud/api/raster/docs. Changes include:
mosaic/
endpoint tosearches/
/collections/{collection_id} endpoint
/colorMaps
endpointstac/
endpoint to/collections/{collection_id}/items/{item_id}
stac-alt/
endpoint to/alt/collections/{collection_id}/items/{item_id}