Skip to content

Commit 66993ae

Browse files
committed
update runtimes and cdk requirements
1 parent 1ad2481 commit 66993ae

File tree

9 files changed

+49
-58
lines changed

9 files changed

+49
-58
lines changed

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/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"],
Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
"""API settings."""
22

33

4-
import pydantic
4+
from pydantic import field_validator
5+
from pydantic_settings import BaseSettings
56

67

7-
class ApiSettings(pydantic.BaseSettings):
8+
class ApiSettings(BaseSettings):
89
"""API settings"""
910

1011
name: str = "eoAPI-vector"
@@ -14,13 +15,9 @@ class ApiSettings(pydantic.BaseSettings):
1415

1516
catalog_ttl: int = 300
1617

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

runtime/eoapi/vector/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-
"tipg==0.3.0",
22+
"tipg==0.4.4",
2323
]
2424

2525
[project.optional-dependencies]

0 commit comments

Comments
 (0)