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

246 Коммитов

Автор SHA1 Сообщение Дата
Tom Augspurger 6298fc2659 remove autoimport 2022-03-25 15:14:30 -05:00
Tom Augspurger 9b5e283bdb Added colormap for ALOS PALSAR `mask` band 2022-03-25 15:13:03 -05: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
Matt McFarland 7562b6052c
Fix tiler_href setting preventing full hrefs (#59)
The tiler_href env var value was updated to an incorrect value. This
fixes the appropriate setting, and adds a test to ensure that the setting
is applied as part of the generated tiler links.
2022-03-11 13:09:55 -05:00
Matt McFarland d3580fc17c
Lower cache TTLs for dev and PCT (#60)
TTL for table config and redis cached values is reduced to 1 second in
local development environment to prevent stale values returning during
development. In PCT environments, the table config TTL is also reduced
to 1 second to support faster iteration on config in the test
environment. The PCT redis TTL was lowered to 1 minute to still provide some
efficiency during test, but to lower the time to wait for new
items/collections to show up that were previously cached, as that a main
use case of the environment. Default values remain the same, so
staging/prod are not affected, but can now be set at a target, rather
than default, value.
2022-03-11 13:06:47 -05:00
Matt McFarland 8cb39caec3
Fix ip exception table name in terraform (#56)
* Fix ip exception table name in terraform

CI failed to deploy due to reference to undeclared resource.

* Make storage and cache top level helm config

Rather than duplicating the config for shared the resources of table
storage and redis cache, treat them as top level config similar to
postgres. Also fixes references to stac namespace from published tiler
helm chart.
2022-03-07 12:39:08 -05:00
Rob Emanuele 3684024c9c
Add redis for caching and rate limiting (#52)
* Add redis to docker-compose services

* Refactor get_request_ip into utils

* Rename TABLE_TTL -> TTL, will use it with caching

* Add redis caching and rate limiting to pccommon

* Add rate limit configuration

* Caching and rate limiting on STAC API

* Add redis to terraform

* Add redis config to helm charts

* Connect to redis for tests

* Add test for rate limit, but skip as it is nondeterministic

* Update CHANGELOG

* Implement backpressure

* Add backpressure to Helm chart

* Use decorators for rate_limit and back_pressure

* Add IP exception table that avoids rate limiting

* Get the IP from the last in the list, not first

If using an X-Forwarded-For to get the IP,
get the last one as that will be the IP coming from
the last proxy. The first IP can be anything set on
the header of the request. Since we take the
X-Azure-ClientIP header value first, this would
have not been used, but changing for best practice.

* And IP exception table to Helm chart

* Allow traffic from planetarycomputer-test

* Add ip-exception config to tiler docker-compose

Co-authored-by: Matt McFarland <mmcfarland@microsoft.com>
2022-03-04 15:23:45 -05:00
Matt McFarland fea7c69dc0
Fix PCT tiler signing (#54)
* Add correct PCT SAS token href for PCT tiler signing

Needed both the APIM url and the /token endpoint set in order for PCT
tiler to sign and read assets correctly.

* Consistently use quotes for jinja variables

We used a mix, and both are valid. However, my editor routinely tries to
add spaces between unquoted double braces using the JSON linter leading
to unintended syntax errors in the rendered Values file.
2022-03-01 10:30:10 -05:00
Matt McFarland 53a04c0b24
Fix legend endpoint and add documentation (#53)
* Fix classmap legend serialization

ORJSONResponse requires that dict keys are strings when serializing to
JSON. The legend classmaps use numeric keys for titiler. Switching to
the default JSONResponse allows non-string keys. Adds tests to
prevent regressions.

* Add documentation for collection config classes
2022-02-25 09:09:06 -05:00
Matt McFarland ca43ad851c
Upgrade to supported k8s version in staging (#51) 2022-02-24 02:21:18 -05:00
Matt McFarland 8396ee1c2b
Upgrade to Jinja2 v3 (#50)
Fixes dependency issues in downstream projects. Jinja2 v2 is unsupported
and currently broken.
2022-02-22 17:12:07 -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 90f94bf18f
fix wrong version of titiler-pgstac (#49) 2022-02-15 12:45:11 -05:00
Vincent Sarago aa009b25ee
New titiler pgstac (#46)
* update titiler-pgstac version
* uppdate changelog
2022-02-08 11:28:53 -05:00
Nathan Zimmerman b50fb4251f
Implement queryables through proxy to online json files (#44)
* Implement queryables through proxy to online json files

* lint

* Guard against 404

* Add logic for dynamic calculation of collection queryable intersection

* Add tests and appease mypy

* Update changelog

* Improve queryable test specificity

* Use cache and guard against errors

* Add test for /queryable 404 and use proper cache key
2022-02-08 11:28:17 -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
Matt McFarland 75354a8677
Consolidate and fix item render params (#43)
* Consolidate and fix item render params
* Update changelog
2022-02-03 09:55:19 -05:00
Matthew McFarland 2bf46e6b18
Fix generated tiler links in items (#41)
* wip

* Fix render params for titiler upgrade

* Lint

* Update changelog
2022-01-24 19:36:48 -05:00
Rob Emanuele e4e0c84f01
Update CHANGELOG for 2022.1.1 (#40) 2022-01-21 18:14:50 -05:00
Rob Emanuele accc90f96b
Fix conformance classes (#39)
* Use Extensions conformance classes.

Move to using only the default conformance classes and
extension-provided conformance classes.

Refactor extensions to be located in pcstac.config,
so that tests can share the same extensions.

* Guard against incorrect or duplicate c-classes

Do this by checking that any conformance class coming
from api.stacspec.org has the correct STAC API version.

* Fix STAC API version advertised by docs.

* Update api version to 1.2

The only place this is used is in the API documentation.

* Update CHANGELOG
2022-01-21 17:24:17 -05:00
Rob Emanuele 80a383f372
Update CHANGELOG for 2022.1.0 release (#38) 2022-01-20 18:34:53 -05:00
Rob Emanuele b3744a4d47
A few fixes pre-release (#37)
* Remove erroneous stac_extensions on landing page

Can be removed once https://github.com/stac-utils/stac-fastapi/issues/334 is fixed

* Allow search to state datetimes with date only

* Allow GeometryCollection

Can be removed when https://github.com/stac-utils/stac-fastapi/issues/187 is closed

* Formatting

* Update CHANGELOG
2022-01-20 18:21:11 -05:00
Matthew McFarland 48c44b41fa
Restore default limit and gnatsgo render config (#36)
* gnatsgo render config

* Override response limit for GET requests

Restores PC default limit of 250 items in response of GET searches and
collection item path queries.

* Update changelog

* Keep /items endpoint at default limit of 10

* Change gnatsgo collection ID to gnatsgo-rasters

* Add ability to scope test run

* Add test for search and /items page limit

* Update gnatsgo asset name

Co-authored-by: Rob Emanuele <rdemanuele@gmail.com>
2022-01-20 12:21:16 -05:00
Matthew McFarland 9c0164c6bd
Upgrade stac-fastapi (#35)
* Upgrade stac-fastapi

Uses an official release and removes temporary commit targeting.

* Update test for new STAC docs rel type

* Update changelog
2022-01-18 17:25:11 -05:00
Rob Emanuele 74c8b27402
Add configuration for IO LULC 9 class (#34)
* Add configuration for IO LULC 9 class

* Update CHANGELOG
2022-01-18 14:34:23 -05:00
Matthew McFarland 16fc0c8751
Small pre-release fixes (#33)
* Fix describedby collection link

Use trailing slash to keep dataset path-part.

* Remove superfluous trace log

The service logs all requests with collection information, the trace is
duplicative.

* Fix titiler param bug

* Set PC_SDK_SAS_URL per environment

Previously, outside of development environments, the PC signing SDK
would use the production SAS URL in all environments. Instead, have the
default stack point to its own deployed SAS service to fully test out
integrated changes.

Additionally, change the default dev environment SAS URL to staging, as
it will most likely match any forthcoming releases to test against.

* Update changelog
2022-01-18 14:34:04 -05:00
Pete Gadomski f2cff0d019
feat: add noaa-c-cap colormap (#28) 2022-01-13 17:48:52 -05:00
Matthew McFarland 6d53b657a1
Add chloris-biomass rendering config (#27) 2022-01-11 17:28:20 -05:00
Mark Mathis 30c5f8c9a6
Update IO LULC colormap (#26) 2022-01-11 14:44:53 -05:00
Matthew McFarland 3f767d6c00
Logging improvements (#23)
* Add dedicated health check endpoint for pctiler

Also sets the liveness probe to use this new endpoint. Uses the same URL
path as pcstac, this will help isolate requests in the logs.

* Use constants for logging service name

* Fix local volume mount

The directory is copied in the Dockerfile, so it was loading on the
container, however this typo prevented reloading of pccommon when
changes were made without rebuilding the image.

* Consolidate tracing functionality

Rather than maintaining parity between two request tracing
implementations, create a common trace that can be used by both
projects.

* Prevent request tracing on health check endpoints

* Parse collection/item ids from search for logging

* Allow ACR overrides in dev deployments

Defaults to publish images for staging deploys

* Rename for Python convention

* Include request ip in trace

* Remove unused config

* Use request sensitive middleware for trace logs

Traditional middleware will corrupt usage of starlette request objects
by downstream route functions. Use a middleware class crafted for
accessing the request body without interfering with further processing.

* Lint: formatting

Auto-formatter
2022-01-10 15:46:25 -05:00
Vincent Sarago a10a7d5908
update for titiler-pgstac 0.1.0a3 (#22)
* update for titiler-pgstac 0.1.0a3
2022-01-05 19:49:36 -05:00
Matthew McFarland 27f5b8ce78
Upgrade to unreleased stac-fastapi (#20)
* Upgrade to unreleased stac-fastapi

Bring in upstream changes to stac-fastapi to include unreleased support
for cql2-json.

* Update get_collection arguments

* lint

* Update for cql2 and dynamic extensions

* CHANGELOG

Co-authored-by: Nathan Zimmerman <npzimmerman@gmail.com>
2021-12-20 17:28:00 -05:00
Matthew McFarland 4974b17b22
Set subscription explicitly during deploy (#19)
Previously some non-deterministic ordering of subscriptions was used,
resulting in transient RBAC errors for the SP using the wrong
subscription id.
2021-12-15 16:51:17 -05:00
James Santucci 837df9e6fb
Use exception logging to capture failures in app insights (#14)
* Use exception logging to capture failures in app insights

* Format

* move global exception middleware to pccommon

* format

* fix return type of middleware

* remove unused

* Update changelog

* wip -- log encountered exceptions

* include extra metadata with exception

* remove metrics reporting

* configure liveness paths

* remove erroneous middlewares

* format

* remove more erroneous middleware

* Remove unused metrics module

* remove unused

* Remove pctiler unused

* Remove more unused

* Add special cd exception for this branch

* run on pull requests instead 🤞🏻

* correct tiler liveness env variable name

* bail on LIVENESS_PATH checks

* Format (_really_ thought I did that already)

* Remove pr trigger from cd

* Remove unused import

Co-authored-by: Rob Emanuele <rdemanuele@gmail.com>
Co-authored-by: Matt McFarland <mmcfarland@microsoft.com>
2021-12-15 13:30:00 -05:00
Matthew McFarland caa2f70370
Add legend endpoints (#17)
* Add legend swatch and mapping endpoints

* Allow trimming a cmap from either side

* Add legend comments and docstrings
2021-12-10 18:20:20 -05:00
Matthew McFarland 8e7e3ab441
Add config for nrcan-landcover (#16)
Adds new colormap and rendering config to allow correct rendering in
explorer and data catalog applications.
2021-12-10 18:15:42 -05:00
Nathan Zimmerman 735df29d62
Update search limits to avoid 500s (#15)
* Update limits on search to avoid 500s

* Add to changelog
2021-12-10 18:15:23 -05:00
Rob Emanuele 81a666e843
Project renames; publish and deploy (#12)
* Add helm chart publication

* Remove old cipublish path

* switch from "1" to "true"

GitHub sets CI to "true" rather than 1:
https://docs.github.com/en/actions/learn-github-actions/environment-variables#default-environment-variables

* wip -- attempt the run

* don't condition deploy step for now

* switch branch back to main

youc an use $default-branch in templates, but not
actual workflows:
https://github.blog/changelog/2020-07-22-github-actions-better-support-for-alternative-default-branch-names/

* switch branch back to main

youc an use $default-branch in templates, but not
actual workflows:
https://github.blog/changelog/2020-07-22-github-actions-better-support-for-alternative-default-branch-names/

* set azure env variables

* parse and echo from json

* don't set tenant id?

https://github.com/hashicorp/terraform-provider-azuread/issues/343#issuecomment-721455149

??

* oops i don't think these are getting passed through

* add override compose

this compose file un-sets the env variables that we don't have because
we don't have a .env file in ci, so I _think_ it should inherit them
from the environment

* add back mqe resource group

why was this deleted

am i being trolled

* Add path debugging

* check what tf keys we got

* remove api management from ingress 🤞🏻

* all container registries through github

* remove debug prints from jinja

* re-remove the mqe resource group

because it was deliberately missing, not accidentally

* skip tests for a sec

* debug echo cluster name and rg

* require az account env variables

* reuse tf env variable names

* don't point to `latest` tag

* Add workflow for publishing helm charts to GH Pages.

* Rename charts, separate published, reset versions

* Use -dev suffix for development release

* Publish dev charts only on main

* Rename mqe -> stac, dqe -> tiler in codebase

* Update README

Rename MQE to STAC API and DQE to Tiler; also editorally make things more terse

* Remove testdata, move loadtestdata to tests

* Remove out of date and generic docs for tiler

* Use cipublish to publish images

* Rename python packages to be prefixed with 'pc'

* Remove stac-vrt

* Remove unused model and method.

Also formatting

* Remove scripts/env

* Upgrade to stac-fastapi 2.2.0

* Delete unusued doc images

* Update deployment code with renames.

* Update cert-manager, other deployment fixes

* Test on cibuild, remove GA test branch trigger

* Fixup PR template

Co-authored-by: Nathan Zimmerman <npzimmerman@gmail.com>
Co-authored-by: James Santucci <james.santucci@gmail.com>
2021-11-01 11:27:39 -04:00
James Santucci 17e04ae08d
Organize and update docs (#11)
* order docs

* rewrap all the things

* move headers out a level

* add all the tables of contents

* fill in PQE_METADATA_URL with prod url

* fill in PQE_DATA_URL with prod url

* fill in docs URLs

* correct some statements in deployment doc

* re-initialize changelog in chan-compatible format

* correct branch name again

* Remove general planetary computer docs
2021-10-27 12:26:34 -04:00
Nathan Zimmerman 57b22b89d0
Add helm chart publication (#9)
* Add helm chart publication

* Remove old cipublish path
2021-10-25 12:47:41 -04:00
Rob Emanuele e1ec9529c6 Initial commit. 2021-10-18 12:13:28 -04:00
Microsoft Open Source 3712cd76c2 SUPPORT.md committed 2021-08-19 10:09:02 -07:00
Microsoft Open Source e7753cc610 SECURITY.md committed 2021-08-19 10:09:01 -07:00
Microsoft Open Source f5c465d88e README.md committed 2021-08-19 10:09:00 -07:00
Microsoft Open Source 195260bc3f LICENSE committed 2021-08-19 10:08:59 -07:00
Microsoft Open Source 10c85d9c61 CODE_OF_CONDUCT.md committed 2021-08-19 10:08:58 -07:00