Skip to content

Commit a106e4b

Browse files
committed
Merge branch 'main' of https://github.com/developmentseed/eoapi into NewVpc
2 parents 7dd48b2 + 0095d2a commit a106e4b

File tree

5 files changed

+164
-4
lines changed

5 files changed

+164
-4
lines changed

docker-compose.official.yml

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
version: '3'
2+
3+
services:
4+
stac-fastapi:
5+
image: ghcr.io/stac-utils/stac-fastapi-pgstac:latest
6+
ports:
7+
- "${MY_DOCKER_IP:-127.0.0.1}:8081:8081"
8+
environment:
9+
- APP_HOST=0.0.0.0
10+
- APP_PORT=8081
11+
- ENVIRONMENT=local
12+
# Postgres connection
13+
- POSTGRES_USER=username
14+
- POSTGRES_PASS=password
15+
- POSTGRES_DBNAME=postgis
16+
- POSTGRES_HOST_READER=database
17+
- POSTGRES_HOST_WRITER=database
18+
- POSTGRES_PORT=5432
19+
- DB_MIN_CONN_SIZE=1
20+
- DB_MAX_CONN_SIZE=10
21+
depends_on:
22+
- database
23+
command:
24+
bash -c "bash /tmp/scripts/wait-for-it.sh -t 120 -h database -p 5432 && python -m stac_fastapi.pgstac.app"
25+
volumes:
26+
- ./dockerfiles/scripts:/tmp/scripts
27+
28+
titiler-pgstac:
29+
# At the time of writing, rasterio and psycopg wheels are not available for arm64 arch
30+
# so we force the image to be built with linux/amd64
31+
platform: linux/amd64
32+
image: ghcr.io/stac-utils/titiler-pgstac:latest
33+
ports:
34+
- "${MY_DOCKER_IP:-127.0.0.1}:8082:8082"
35+
environment:
36+
# Application
37+
- HOST=0.0.0.0
38+
- PORT=8082
39+
# https://github.com/tiangolo/uvicorn-gunicorn-docker#web_concurrency
40+
- WEB_CONCURRENCY=1
41+
# https://github.com/tiangolo/uvicorn-gunicorn-docker#workers_per_core
42+
- WORKERS_PER_CORE=1
43+
# https://github.com/tiangolo/uvicorn-gunicorn-docker#max_workers
44+
- MAX_WORKERS=10
45+
# Postgres connection
46+
- POSTGRES_USER=username
47+
- POSTGRES_PASS=password
48+
- POSTGRES_DBNAME=postgis
49+
- POSTGRES_HOST=database
50+
- POSTGRES_PORT=5432
51+
- DB_MIN_CONN_SIZE=1
52+
- DB_MAX_CONN_SIZE=10
53+
# - DB_MAX_QUERIES=10
54+
# - DB_MAX_IDLE=10
55+
# GDAL Config
56+
- CPL_TMPDIR=/tmp
57+
- GDAL_CACHEMAX=75%
58+
- GDAL_INGESTED_BYTES_AT_OPEN=32768
59+
- GDAL_DISABLE_READDIR_ON_OPEN=EMPTY_DIR
60+
- GDAL_HTTP_MERGE_CONSECUTIVE_RANGES=YES
61+
- GDAL_HTTP_MULTIPLEX=YES
62+
- GDAL_HTTP_VERSION=2
63+
- VSI_CACHE=TRUE
64+
- VSI_CACHE_SIZE=536870912
65+
# TiTiler Config
66+
- MOSAIC_CONCURRENCY=1
67+
# AWS S3 endpoint config
68+
- AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}
69+
- AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}
70+
depends_on:
71+
- database
72+
command:
73+
bash -c "bash /tmp/scripts/wait-for-it.sh -t 120 -h database -p 5432 && /start.sh"
74+
volumes:
75+
- ./dockerfiles/scripts:/tmp/scripts
76+
77+
tipg:
78+
image: ghcr.io/developmentseed/tipg:latest
79+
ports:
80+
- "${MY_DOCKER_IP:-127.0.0.1}:8083:8083"
81+
environment:
82+
# Application
83+
- HOST=0.0.0.0
84+
- PORT=8083
85+
# https://github.com/tiangolo/uvicorn-gunicorn-docker#web_concurrency
86+
- WEB_CONCURRENCY=10
87+
# https://github.com/tiangolo/uvicorn-gunicorn-docker#workers_per_core
88+
# - WORKERS_PER_CORE=1
89+
# https://github.com/tiangolo/uvicorn-gunicorn-docker#max_workers
90+
# - MAX_WORKERS=10
91+
# Postgres connection
92+
- POSTGRES_USER=username
93+
- POSTGRES_PASS=password
94+
- POSTGRES_DBNAME=postgis
95+
- POSTGRES_HOST=database
96+
- POSTGRES_PORT=5432
97+
- DB_MIN_CONN_SIZE=1
98+
- DB_MAX_CONN_SIZE=10
99+
command:
100+
bash -c "bash /tmp/scripts/wait-for-it.sh -t 120 -h database -p 5432 && /start.sh"
101+
depends_on:
102+
- database
103+
volumes:
104+
- ./dockerfiles/scripts:/tmp/scripts
105+
106+
database:
107+
container_name: eoapi.db
108+
image: ghcr.io/stac-utils/pgstac:v0.7.10
109+
environment:
110+
- POSTGRES_USER=username
111+
- POSTGRES_PASSWORD=password
112+
- POSTGRES_DB=postgis
113+
- PGUSER=username
114+
- PGPASSWORD=password
115+
- PGDATABASE=postgis
116+
ports:
117+
- "${MY_DOCKER_IP:-127.0.0.1}:5439:5432"
118+
command: postgres -N 500
119+
volumes:
120+
- ./.pgdata:/var/lib/postgresql/data
121+
122+
networks:
123+
default:
124+
name: eoapi-network

docs/mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ nav:
2121
- Development - Contributing: "contributing.md"
2222
- Release Notes: "release-notes.md"
2323
- Services Details: "services-details.md"
24+
- Deployment: "deployment.md"
2425

2526
plugins:
2627
- search

docs/src/deployment.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../infrastructure/DEPLOYMENT.md

infrastructure/DEPLOYMENT.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
## AWS
2+
## AWS (Lambda)
33

44
An example of Cloud Stack is available for AWS (RDS for the database and Lambda for the APIs)
55

@@ -77,3 +77,7 @@ The example commands here will deploy a CloudFormation stack called `eoAPI-stagi
7777
```
7878

7979
If you get an error saying that the max VPC's has been reached, this means that you have hit the limit for the amount of VPCs per unique AWS account and region combination. You can change the AWS region to a region that has less VPCs and deploy again to fix this.
80+
81+
## K8S
82+
83+
A Kubernetes chart is currently being developed at https://github.com/developmentseed/k8s-eoapi

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

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -459,12 +459,24 @@
459459
cell1.innerHTML = "Asset";
460460
cell2.innerHTML = "Type"
461461

462-
for (let asset_name in collection_metadata.item_assets) {
462+
const rio_types = [
463+
"image/tiff; application=geotiff",
464+
"image/tiff; application=geotiff; profile=cloud-optimized",
465+
"image/tiff; profile=cloud-optimized; application=geotiff",
466+
"image/vnd.stac.geotiff; cloud-optimized=true",
467+
"image/tiff",
468+
"image/x.geotiff",
469+
"image/jp2",
470+
"application/x-hdf5",
471+
"application/x-hdf",
472+
]
473+
const assets = Object.keys(collection_metadata.item_assets).filter(key => rio_types.includes(collection_metadata.item_assets[key].type))
474+
for (var i = 0; i < assets.length; i++) {
463475
var row = tbl.insertRow(-1);
464476
var cell1 = row.insertCell(0);
465477
var cell2 = row.insertCell(1);
466-
cell1.innerHTML = asset_name;
467-
cell2.innerHTML = collection_metadata.item_assets[asset_name].type;
478+
cell1.innerHTML = assets[i];
479+
cell2.innerHTML = collection_metadata.item_assets[assets[i]].type;
468480
}
469481
collection_meta.appendChild(tbl)
470482
}
@@ -496,6 +508,24 @@
496508
body.metadata.bounds = collection_metadata.extent.spatial.bbox[0];
497509
}
498510

511+
if (collection_metadata && collection_metadata.item_assets) {
512+
// if item_assets is found in the collection we set the mosaic `assets` in the metadata
513+
// collection_metadata.item_assets
514+
515+
const rio_types = [
516+
"image/tiff; application=geotiff",
517+
"image/tiff; application=geotiff; profile=cloud-optimized",
518+
"image/tiff; profile=cloud-optimized; application=geotiff",
519+
"image/vnd.stac.geotiff; cloud-optimized=true",
520+
"image/tiff",
521+
"image/x.geotiff",
522+
"image/jp2",
523+
"application/x-hdf5",
524+
"application/x-hdf",
525+
]
526+
body.metadata.assets = Object.keys(collection_metadata.item_assets).filter(key => rio_types.includes(collection_metadata.item_assets[key].type))
527+
}
528+
499529
// date filters
500530
const startdate = document.getElementById('start-date').value
501531
const enddate = document.getElementById('end-date').value

0 commit comments

Comments
 (0)