Граф коммитов

21 Коммитов

Автор SHA1 Сообщение Дата
Matt McFarland 66fa8fe96d
Update pydantic, titiler, stac-fastapi (#233)
* update pccommon requirements

* update pcstac requirements

* update pcfuncs

* update pcfuncs/pcstac/pccommon

* allow YYYY-MM-DD date format in search

* update pctiler

* update stac-fastapi.*

* Dependencies

* Get mosaic tiles working

* Formatting

* Use items request model

* Backwards compat with searchid

* certifi upgrade

* Read envs correctly

* Restore health check filtering

* Update titiler uvicorn

* lint

* Fix casing on colormaps

* Fix cmap and add /crop

* Fixups

---------

Co-authored-by: vincentsarago <vincent.sarago@gmail.com>
2024-07-17 10:22:54 -04:00
Matt McFarland 3b1e9f7258
Set root-path from uvicorn (#221)
* Set root-path from uvicorn

Sets the root path in uvicorn to match that set via FastAPI. This is
required with updates to starlette, which were included previously.

Fixes https://github.com/microsoft/PlanetaryComputer/issues/360

* New black formatting
2024-06-14 13:58:12 -04:00
Matt McFarland 034b9c3bb2
Security patching (#219)
* Security patching

Near-SLA security updates

* fixup
2024-06-12 10:53:46 -04:00
Matt McFarland 5628de76c2
Security upgrades for pcstac and pctiler (#214)
* Upgrade STAC libraries

* Updates for tiler
2024-06-11 13:52:48 -04:00
Gustavo Hidalgo 69fb80c31c
Bump idna to 3.7 (#203) 2024-04-19 11:30:43 -04:00
Gustavo Hidalgo d68ec50e0c
Security patching (#191)
* Generate requirments.txt

* remove hashes

* Delete non-extra requirements file

* Now all projects have requirements.txt

* Remove BaseHTTPMiddlewares ,  Ensure origin host is used in STAC links

* Successfully build containers

* lint

* Docker images build

* Delete unused requirements file

* save

* Now requirements do get generated

* Update Azurite

* format setup.py

* add type annotation

* Read lerc_zstd

* speed up image rebuilds and better UT for lerc

* Update more packages

* upgrade stac-api-validation

* Remove files from older commits

---------

Co-authored-by: maitjoshi <maitjoshi@microsoft.com>
2024-04-16 10:22:07 -04:00
Gustavo Hidalgo dcfd7c7666
Use Key Vault secrets instead of cert-manager secret in AKS cluster (#185)
* Update deployment script and add nginx-values.yaml

* Update Dockerfile, values.yaml, variables.tf, and lib script

* Update to satisfy pydantic and mypy

* More mypy induced changes

* More mypy changes
2024-02-05 09:03:07 -05:00
Pete Gadomski b0471ea9f5
Update stac-fastapi and stac-fastapi-pgstac (#181)
* deps: update to stac-fastapi v2.4.8

* fix: update stac-fastapi-pgstac
2023-06-27 15:39:41 -04:00
Pete Gadomski 90cd8463f3
Update stac-fastapi-pgstac to v2.4.5 (#163)
* deps: update stac-fastapi-pgstac to v2.4.5

Includes a requirements.txt file (generated with pip-tools) to freeze
requirements for pcstac.

* chore: update changelog
2023-04-05 18:08:21 -04:00
Matt McFarland 26a67e1266
Support collection-level vector tiles (#147)
* Fetch all configs when iterating over collections

Rather then fetch 1 render config at a time on the /collections
endpoint, fetch all at once and preserve the Dict for the request
duration.

* Allow POST CORS requests in dev env

* Vector tile support

* Add default msft:region attribute to collections

* Upgrade to postgres 14 and pgstac 0.6.13

Prod services operate on pg14

* Fix tests and setup

The API now uses table_service.get_entities and there is an Azurite bug
that prevents an empty string for "all records", so it was switched to a
specific PartitionKey filter string.

* Add logging for pbf requests

* Deployment

* Add logging and debug code

Analyze relative performance of different calls in the VT endpoint
chain.

* Fix Exceptions

* Changelog
2023-01-24 15:22:44 -05:00
Matt McFarland d01a4858c9
Update fastapi, stacfastapi version (#144)
* Update fastapi, stacfastapi version

Updates to released versions of fastapi now that a needed starlette dep
has been upgraded. stac-fastapi is updated but still not using a release
due to some advanced work in the pgstac backend that we don't want to
incorporate yet (queryables).

* Update test for starlette
2023-01-11 13:38:53 -05:00
Matt McFarland 2f067f12ba
Fix func backoff error (#133)
* Write empty tile for any error during backoff

Rather than looking for TileError, assume any error emitted from the
backoff strategy should result in a blank tile. Typically, this will
actually be a BackoffError with an inner error of TileError.

* Upgrade unit test db version to 0.6.9
2022-10-26 21:22:05 -04:00
Matt McFarland 654d6ae36b
Log request entity (#125)
* Log request entity header or qs value

This can denote well-known clients as request origin entities for better
understanding logged requests.

* Correctly configure CORS settings

* mypy

* Pin pygeoif

The upstream pgstac backend for stac-fastapi had an unpinned dependency
move and break. Pinning locally to the project until the fix is applied
upstream.
2022-09-30 14:55:55 -04:00
Rob Emanuele bb4ac9de96
Add Azure Functions for creating images and animations (#115)
* Consolidate dev dependencies into requirements-dev.txt

* Add simple azure storage support to pccommon

* Set up azurite container for dev output

* Add pcfuncs codebase

This includes the "animation" and "image" functions,
as well as the "funclib" library that contains
reusable code for fetching rasters from the
PC data API.

* Add pcfuncs to dev servers and processes

* Add Azure Functions to deployment

* Move funcs information to main README

* Fix titiler link

* Avoid flake8 on setup.py

* Delete unused reprojection utility method/type

* Remove debug log information

* Don't restrict concurrency setting
2022-08-16 12:02:09 -04:00
Matt McFarland 3f0016b56d
Upgrade uvicorn (#106)
* Upgrade uvicorn

* Pin version of Azurite due to bug in upsert

A recent release of Azurite caused tests with upserts to fail due to
https://github.com/Azure/Azurite/issues/1565.
2022-06-24 15:36:57 -04:00
Rob Emanuele 174db793bf
Include hostname in redis cache key (#98)
* Consolidate how dev depenencies are installed

Previous to this change pcstac and pctiler had
two methods for installing dev dependencies.
This caused different behavior between the two
test projects. For instance, one project auto
upgraded the pytest asyncio plugin, which
under a new version started printing warnings.

This users the setup.py method for installing dev
dependencies consistently and pins some test dependencies

* Use asyncio_mode = auto to quell warnings

* Fix dependencies in docker-compose

* Use hostname in caching key.

Previous to this change, requests coming in from
different hostnames were causing the cache to return
results for different hostnames if that service was
accessible through both - this is the case after a release,
when planetarycomputer-staging.msft.com and planetarycomputer.msft.com
both point to the same stack. This was causing cached
results to be returned with links for staging through
requests to the production endpoints. Added the hostname
to the cache key will ensure cached results are scoped
to the specific hostname.

* Update CHANGELOG
2022-05-24 13:19:27 -04:00
Matt McFarland 70991721ea
Hydrate search result items in the API (#81)
* Hydrate search result items in the API

Uses new pgstac `nohydrate` option to avoid using database to merge
result items with collection base items. This reduces CPU load on the
database and distributes it across the API cluster, allowing higher
request throughput.

* Experimental malloc setting for memory consumption

Attempt at managing memory leak.

* Debug timing for tile stages

* Logs and max items

* Update default max_items setting

* Upgrade to pgstac 0.6.1

* Adjust two search tests

These tests began to fail at pgstac post 0.5.2. It wasn't clear why
there was an expectation that timestamps off by 1 second should match an
item, and the open window format of "../.." was clearly disallowed via
the spec:

https://github.com/radiantearth/stac-api-spec/blob/master/implementation.md#datetime-parameter-handling

> Only one of the interval ends may be open.

* Changelog

* Finalize dependencies
2022-05-13 21:16:41 -04:00
Matt McFarland d73146335d
Manage connections, uvicorn, cleanup (#73)
* Allow GDAL to rety certain HTTP failures

* Use uvicorn for stac api

This matches the change for pctiler in #67

* Clean up env vars

Some env vars were used only in gunicorn, which was removed previously.
Other helm values were nested under the wrong keys.

* Specify min/max connection size for pcstac at 1

This overrides the stac-fastapi default of 10, and ensures a single
instance only opens a single database connection.

* Add CQL_TEXT conformace class

* Updates from ./scripts/format
2022-04-12 19:05:23 -04:00
Matt McFarland 0b1f096a00
Upgrade to pgstac 0.4.5 (#61)
* Upgrade stac-fastapi / pgstac

Upgrades to an unreleased version of stac-fastapi to capture a pgstac
upgrade for item search improvements and cql2-text support. Also
upgrades fastapi version to match dependency requirements in stac-fastapi.

* Fix tests for new behavior of `limit`

When searching for ids, limit is no longer respected. You will get all
ids you requested. Two tests needed to be modified to account for this
behavior, to ensure that a paginated request was constructed, avoid
using ids and instead use a wide datetime to ensure a large response set
that can be limited.
2022-03-11 13:11:12 -05:00
Rob Emanuele 33f5487247
Use Azure Storage Tables for collection and container configuration (#48)
* Add additional dependencies to pccommon

* Fix mypy error in pctiler

Brining in the type stubs for cachetools caused
mypy to complain about unknown types for the key
function

* Refactor scripts to test pccommon

Also run flake8 on pccommon,
which wasn't happening

* Linting fixups

* Add tables classes

* Refactor collection config in pccommon

Also refactor CommonConfig to use pydantic settings.
Create a table setup for collection configuration
and container configuration.
Use cachetools to cache the configuration.

* Add Azurite setup

Encode collection configuration and container
configuration (which was hardcoded) as JSON.
This can be used to populate the initial
table structure in deployment as well, after
which this test data will diverge from production
settings.

* Update codebase to use refactored configuration

* Set azurite settings in docker-compose

Also account for environment prefix for DEBUG
that change with refactor to use BaseSettings in
CommonConfig

* Move to using only pytest for consistency

* Test get render config for naip

* Refactor config code layout

Enable configuration of TTL

* Run azurite setup in scripts/setup

Also fix setup_azurite

* Add mosaicInfo and queriables to collection config

* Remove usage of requirements.txt

This was being used inconsistently.

* Add script for local package install

* Fetch queryables from storage tables

* Use orjson in pccommon

* Use ORJSONResponse

* Remove unused endpoint prefixes

* Add mosiac/info endpoint

* Add method to fetch all rows

* Add CLI for loading and dumping config data

* Variable for k8s version; update dev

* Allow AKS to pull from ACR

* Storage Tables in terraform

* Add config table env vars to helm charts

* Update ingress apiVersion

* Make note in deploy README about updating tables

* Update CHANGELOG

* Linting/formatting

* Remove unused __init__ override

This was left over from a previous
implementation, should have been cleaned up.

* Remove unused vars in dev terraform

* Allow cli to dump configs by id

Co-authored-by: Matt McFarland <mmcfarland@microsoft.com>
2022-02-17 16:06:08 -05:00
Vincent Sarago 61985a8dea
add packages setup.py and simplify dockerfiles (#30)
* add packages setup.py and simplify dockerfiles
2022-02-07 09:52:01 -05:00