Skip to content

Commit cecd114

Browse files
committed
Merge branch 'landingpage-update1' of https://github.com/developmentseed/eoAPI into landingpage-update1
2 parents 95fc0c4 + 8e9505d commit cecd114

File tree

12 files changed

+63
-60
lines changed

12 files changed

+63
-60
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
5151
- name: Install python dependencies
5252
run: |
53-
python -m pip install pytest pytest-asyncio httpx pypgstac==0.7.1 psycopg[pool] brotlipy boto3 pytest-pgsql psycopg2
53+
python -m pip install pytest pytest-asyncio httpx pypgstac==0.8.1 psycopg[pool] brotlipy boto3 pytest-pgsql psycopg2
5454
5555
- name: Test CDK DB Bootstrap
5656
working-directory: ./infrastructure/aws
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"id":"noaa-emergency-response", "title": "NOAA Emergency Response Imagery", "description":"NOAA Emergency Response Imagery hosted on AWS Public Dataset.","stac_version":"1.0.0","license":"public-domain","links":[],"extent":{"spatial":{"bbox":[[-180,-90,180,90]]},"temporal":{"interval":[["2005-01-01T00:00:00Z","null"]]}}}
1+
{"id":"noaa-emergency-response", "title": "NOAA Emergency Response Imagery", "description":"NOAA Emergency Response Imagery hosted on AWS Public Dataset.","stac_version":"1.0.0","license":"public-domain","links":[],"extent":{"spatial":{"bbox":[[-180,-90,180,90]]},"temporal":{"interval":[["2005-01-01T00:00:00Z",null]]}}}

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ services:
128128

129129
database:
130130
container_name: eoapi.db
131-
image: ghcr.io/stac-utils/pgstac:v0.7.10
131+
image: ghcr.io/stac-utils/pgstac:v0.8.1
132132
environment:
133133
- POSTGRES_USER=username
134134
- POSTGRES_PASSWORD=password

infrastructure/aws/.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ CDK_EOAPI_NAME=eoAPI
33
CDK_EOAPI_FUNCTIONS='["stac","raster","vector"]'
44

55
# DB
6-
CDK_EOAPI_DB_PGSTAC_VERSION="0.7.1"
6+
CDK_EOAPI_DB_PGSTAC_VERSION="0.8.1"
77
CDK_EOAPI_DB_PGSTAC_MOSAIC_INDEX=TRUE
88

99
# STAC API

infrastructure/aws/cdk/config.py

Lines changed: 30 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from enum import Enum
44
from typing import Dict, List, Optional
55

6-
import pydantic
6+
from pydantic_settings import BaseSettings
77

88

99
class functionName(str, Enum):
@@ -14,24 +14,24 @@ class functionName(str, Enum):
1414
vector = "vector"
1515

1616

17-
class eoAPISettings(pydantic.BaseSettings):
17+
class eoAPISettings(BaseSettings):
1818
"""Application settings"""
1919

2020
name: str = "eoapi"
2121
stage: str = "production"
22-
owner: Optional[str]
23-
client: Optional[str]
22+
owner: Optional[str] = None
23+
client: Optional[str] = None
2424
functions: List[functionName] = [functionName.stac, functionName.raster]
2525

26-
class Config:
27-
"""model config"""
28-
29-
env_file = ".env"
30-
env_prefix = "CDK_EOAPI_"
31-
use_enum_values = True
26+
model_config = {
27+
"env_prefix": "CDK_EOAPI_",
28+
"env_file": ".env",
29+
"extra": "ignore",
30+
"use_enum_values": True,
31+
}
3232

3333

34-
class eoDBSettings(pydantic.BaseSettings):
34+
class eoDBSettings(BaseSettings):
3535
"""Application settings"""
3636

3737
dbname: str = "eoapi"
@@ -43,29 +43,27 @@ class eoDBSettings(pydantic.BaseSettings):
4343
context: bool = True
4444
mosaic_index: bool = True
4545

46-
class Config:
47-
"""model config"""
48-
49-
env_file = ".env"
50-
env_prefix = "CDK_EOAPI_DB_"
46+
model_config = {
47+
"env_prefix": "CDK_EOAPI_DB_",
48+
"env_file": ".env",
49+
}
5150

5251

53-
class eoSTACSettings(pydantic.BaseSettings):
52+
class eoSTACSettings(BaseSettings):
5453
"""Application settings"""
5554

5655
env: Dict = {}
5756

5857
timeout: int = 10
5958
memory: int = 256
6059

61-
class Config:
62-
"""model config"""
63-
64-
env_file = ".env"
65-
env_prefix = "CDK_EOAPI_STAC_"
60+
model_config = {
61+
"env_prefix": "CDK_EOAPI_STAC_",
62+
"env_file": ".env",
63+
}
6664

6765

68-
class eoRasterSettings(pydantic.BaseSettings):
66+
class eoRasterSettings(BaseSettings):
6967
"""Application settings"""
7068

7169
# Default options are optimized for CloudOptimized GeoTIFF
@@ -98,23 +96,21 @@ class eoRasterSettings(pydantic.BaseSettings):
9896
timeout: int = 10
9997
memory: int = 3008
10098

101-
class Config:
102-
"""model config"""
103-
104-
env_file = ".env"
105-
env_prefix = "CDK_EOAPI_RASTER_"
99+
model_config = {
100+
"env_prefix": "CDK_EOAPI_RASTER_",
101+
"env_file": ".env",
102+
}
106103

107104

108-
class eoVectorSettings(pydantic.BaseSettings):
105+
class eoVectorSettings(BaseSettings):
109106
"""Application settings"""
110107

111108
env: Dict = {}
112109

113110
timeout: int = 10
114111
memory: int = 512
115112

116-
class Config:
117-
"""model config"""
118-
119-
env_file = ".env"
120-
env_prefix = "CDK_EOAPI_VECTOR_"
113+
model_config = {
114+
"env_prefix": "CDK_EOAPI_VECTOR_",
115+
"env_file": ".env",
116+
}

infrastructure/aws/requirements-cdk.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ aws_cdk-aws_apigatewayv2_integrations_alpha==2.94.0a0
55
constructs>=10.0.0
66

77
# pydantic settings
8-
pydantic~=1.0
9-
python-dotenv
8+
pydantic~=2.0
9+
pydantic-settings~=2.0
Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
"""API settings."""
22

3-
import pydantic
3+
from pydantic import field_validator
4+
from pydantic_settings import BaseSettings
45

56

6-
class ApiSettings(pydantic.BaseSettings):
7+
class ApiSettings(BaseSettings):
78
"""API settings"""
89

910
name: str = "eoAPI-raster"
@@ -12,13 +13,9 @@ class ApiSettings(pydantic.BaseSettings):
1213
debug: bool = False
1314
root_path: str = ""
1415

15-
@pydantic.validator("cors_origins")
16+
model_config = {"env_prefix": "EOAPI_RASTER_", "env_file": ".env"}
17+
18+
@field_validator("cors_origins")
1619
def parse_cors_origin(cls, v):
1720
"""Parse CORS origins."""
1821
return [origin.strip() for origin in v.split(",")]
19-
20-
class Config:
21-
"""model config"""
22-
23-
env_file = ".env"
24-
env_prefix = "EOAPI_RASTER_"

runtime/eoapi/raster/eoapi/raster/templates/mosaic-builder.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,12 @@
230230
</div>
231231
</div>
232232

233+
<div class='px12 pt12 pb6'>
234+
<div class='txt-h5 mt6 mb6 color-black'>Mosaic Name</div>
235+
<input id="mosaic-name" class='input inline-block align-center color-black'/>
236+
<div id='mosaic-metadata'></div>
237+
</div>
238+
233239
<!-- <div class='px12 pt12 pb6'>
234240
<div class='txt-h5 mt6 mb6 color-black'>Mosaic Metadata</div>
235241
<div class='mt12'>
@@ -369,6 +375,7 @@
369375
document.getElementById('start-date').value = ''
370376
document.getElementById('end-date').value = ''
371377
document.getElementById('mosaic-info').innerHTML = ''
378+
document.getElementById('mosaic-name').value = ''
372379
})
373380

374381
document.getElementById('collection-select').addEventListener('change', () => {
@@ -569,6 +576,11 @@
569576

570577
if (filter.args.length > 0) body.filter = filter
571578

579+
var name = document.getElementById('mosaic-name').value
580+
if (name) {
581+
body.metadata.name = name
582+
}
583+
572584
fetch('{{ register_endpoint }}', {
573585
method: 'POST',
574586
body: JSON.stringify(body),

runtime/eoapi/raster/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ classifiers = [
1919
]
2020
dynamic = ["version"]
2121
dependencies = [
22-
"titiler.pgstac==0.5.1",
22+
"titiler.pgstac==0.7.0",
2323
"starlette-cramjam>=0.3,<0.4",
2424
"importlib_resources>=1.1.0;python_version<'3.9'",
2525
]

runtime/eoapi/vector/eoapi/vector/app.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ async def lifespan(app: FastAPI):
9898
if settings.catalog_ttl:
9999
app.add_middleware(
100100
CatalogUpdateMiddleware,
101+
func=register_collection_catalog,
101102
ttl=settings.catalog_ttl,
102103
schemas=["public"],
103104
exclude_function_schemas=["public"],

0 commit comments

Comments
 (0)