Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions helm-chart/eoapi/tests/config_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ tests:
raster.enabled: false
stac.enabled: false
vector.enabled: true
multidim.enabled: false
asserts:
- isKind:
of: ConfigMap
Expand All @@ -21,6 +22,7 @@ tests:
raster.enabled: true
stac.enabled: false
vector.enabled: false
multidim.enabled: false
asserts:
- isKind:
of: ConfigMap
Expand All @@ -35,6 +37,7 @@ tests:
raster.enabled: false
stac.enabled: true
vector.enabled: false
multidim.enabled: false
asserts:
- isKind:
of: ConfigMap
Expand All @@ -44,3 +47,18 @@ tests:
- equal:
path: data.WEB_CONCURRENCY
value: "5"
- it: "multidim configmap defaults"
set:
raster.enabled: false
stac.enabled: false
vector.enabled: false
multidim.enabled: true
asserts:
- isKind:
of: ConfigMap
- matchRegex:
path: metadata.name
pattern: ^multidim-envvar-configmap-RELEASE-NAME$
- equal:
path: data.GDAL_HTTP_MULTIPLEX
value: "YES"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Guess checking one implies the rest worked? Or is this value very special to check?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This variable is set by titiler whenever it supports multidimensional datasets. There might be issues on titiler but those are/should be tested within the app's test. For the deployment it seems a good initial test to see if the capabilities are activated. We might add some actual data test later, though.

33 changes: 33 additions & 0 deletions helm-chart/eoapi/tests/deploy_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ tests:
raster.enabled: false
stac.enabled: false
vector.enabled: true
multidim.enabled: false
asserts:
- isKind:
of: Deployment
Expand Down Expand Up @@ -36,6 +37,7 @@ tests:
raster.enabled: true
stac.enabled: false
vector.enabled: false
multidim.enabled: false
asserts:
- isKind:
of: Deployment
Expand Down Expand Up @@ -65,6 +67,7 @@ tests:
raster.enabled: false
stac.enabled: true
vector.enabled: false
multidim.enabled: false
asserts:
- isKind:
of: Deployment
Expand All @@ -89,3 +92,33 @@ tests:
- equal:
path: metadata.labels.gitsha
value: "ABC123"
- it: "multidim deploy defaults"
set:
raster.enabled: false
stac.enabled: false
vector.enabled: false
multidim.enabled: true
asserts:
- isKind:
of: Deployment
- matchRegex:
path: metadata.name
pattern: ^multidim-RELEASE-NAME$
- equal:
path: spec.strategy.type
value: "RollingUpdate"
- equal:
path: spec.template.spec.containers[0].resources.limits.cpu
value: "768m"
- equal:
path: spec.template.spec.containers[0].resources.requests.cpu
value: "256m"
- equal:
path: spec.template.spec.containers[0].resources.limits.memory
value: "4096Mi"
- equal:
path: spec.template.spec.containers[0].resources.requests.memory
value: "3072Mi"
- equal:
path: metadata.labels.gitsha
value: "ABC123"
26 changes: 26 additions & 0 deletions helm-chart/eoapi/tests/ingress_tests_nginx.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ tests:
raster.enabled: false
stac.enabled: false
vector.enabled: true
multidim.enabled: false
asserts:
- isKind:
of: Ingress
Expand All @@ -30,6 +31,7 @@ tests:
raster.enabled: true
stac.enabled: false
vector.enabled: false
multidim.enabled: false
asserts:
- isKind:
of: Ingress
Expand All @@ -52,6 +54,7 @@ tests:
raster.enabled: false
stac.enabled: true
vector.enabled: false
multidim.enabled: false
asserts:
- isKind:
of: Ingress
Expand All @@ -68,3 +71,26 @@ tests:
- equal:
path: spec.ingressClassName
value: "nginx"
- it: "multidim ingress defaults"
set:
ingress.className: "nginx"
raster.enabled: false
stac.enabled: false
vector.enabled: false
multidim.enabled: true
asserts:
- isKind:
of: Ingress
- matchRegex:
path: spec.rules[0].http.paths[0].path
pattern: ^/multidim\(\/\|\$\)\(\.\*\)$
- equal:
path: metadata.annotations
value:
nginx.ingress.kubernetes.io/enable-access-log: "true"
nginx.ingress.kubernetes.io/use-regex: "true"
nginx.ingress.kubernetes.io/rewrite-target: /$2
nginx.ingress.kubernetes.io/enable-cors: "true"
- equal:
path: spec.ingressClassName
value: "nginx"
62 changes: 62 additions & 0 deletions helm-chart/eoapi/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ pgstacBootstrap:
######################
apiServices:
- raster
- multidim
- stac
- vector

Expand Down Expand Up @@ -236,6 +237,67 @@ raster:
# https://www.uvicorn.org/settings/#production
WEB_CONCURRENCY: "5"

multidim:
enabled: false # disabled by default
autoscaling:
# NOTE: to have autoscaling working you'll need to install the `eoapi-support` chart
# see ../../../docs/autoscaling.md for more information
enabled: false
minReplicas: 1
maxReplicas: 10
# `type`: "cpu" || "requestRate" || "both"
type: "requestRate"
behaviour:
scaleDown:
stabilizationWindowSeconds: 60
scaleUp:
stabilizationWindowSeconds: 0
targets:
# matches `type` value above unless `type: "both"` is selected
cpu: 75
# 'm' units here represents generic milli (one-thousandth) unit instead of 'decimal'
# https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale-walkthrough/#quantities
# so when the average unit among these pods is <requestRate>/1000 then scale
# you can watch the actual/target in real time using `kubectl get hpa/<name>`
requestRate: 100000m
image:
name: ghcr.io/developmentseed/titiler-md-demo
tag: 0ea56bfa44457b92e804fd4c0c2192019c002965
command:
- "uvicorn"
- "titiler.pgstac.main:app"
Copy link

@hrodmn hrodmn Mar 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for noticing. titiler_md_demo.main:app we need: #192

- "--host=$(HOST)"
- "--port=$(PORT)"
settings:
# https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
resources:
limits:
cpu: "768m"
memory: "4096Mi"
requests:
cpu: "256m"
memory: "3072Mi"
envVars:
##############
# titiler
##############
GDAL_CACHEMAX: "200" # 200 mb
GDAL_DISABLE_READDIR_ON_OPEN: "EMPTY_DIR"
GDAL_INGESTED_BYTES_AT_OPEN: "32768"
GDAL_HTTP_MERGE_CONSECUTIVE_RANGES: "YES"
GDAL_HTTP_MULTIPLEX: "YES"
GDAL_HTTP_VERSION: "2"
PYTHONWARNINGS: "ignore"
VSI_CACHE: "TRUE"
VSI_CACHE_SIZE: "5000000" # 5 MB (per file-handle)
##############
# uvicorn
##############
HOST: "0.0.0.0"
PORT: "8080"
# https://www.uvicorn.org/settings/#production
WEB_CONCURRENCY: "5"

stac:
enabled: true
autoscaling:
Expand Down