Skip to content

Commit 3aec2f5

Browse files
authored
Merge pull request #144 from developmentseed/feat/use-eoapi-cdk-v3
- import eoapi-cdk constructs and reuse them - add ingestor - add browser - removed NAT gateway from AWS deployment
2 parents 5c2b679 + ef64a59 commit 3aec2f5

File tree

11 files changed

+425
-278
lines changed

11 files changed

+425
-278
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,3 +113,8 @@ node_modules/
113113

114114
# Demo files to ignore
115115
demo/cmip6/CMIP6_daily_*stac_items.ndjson
116+
117+
118+
# browser compiled code and default config
119+
infrastructure/aws/stac-browser
120+
infrastructure/aws/browser_config.js

README.md

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232

3333
- **OGC Features and Vector Tiles** API built on top of [https://github.com/developmentseed/tipg](https://github.com/developmentseed/tipg)
3434

35+
- **A STAC Catalog browsing UI** based on the radiant earth browser : [https://github.com/radiantearth/stac-browser](https://github.com/radiantearth/stac-browser)
36+
3537
---
3638

3739
## 🌍 eoAPI: An Open-Source Community Project
@@ -57,22 +59,19 @@ Then you can start exploring your dataset with:
5759

5860
- the STAC Metadata service [http://localhost:8081](http://localhost:8081)
5961
- the Raster service [http://localhost:8082](http://localhost:8082)
62+
- the browser UI [http://localhost:8085](http://localhost:8085)
6063

6164
If you've added a vector dataset to the `public` schema in the Postgres database, they will be available through the **Vector** service at [http://localhost:8083](http://localhost:8083).
6265

63-
## Deployment
66+
## Deployment with standard runtimes
6467

6568
This repository has current runtimes that are consistently updated with new functionality.
6669

67-
The services can be deployed locally via docker with `docker compose up`.
68-
69-
Two Infrastructure as Code (IaC) repositories are available:
70-
- [eoapi-cdk](https://github.com/developmentseed/eoapi-cdk): A set of AWS CDK constructs to deploy eoAPI services
71-
- [eoapi-k8s](https://github.com/developmentseed/eoapi-k8s): IaC and Helm charts for deploying eoAPI services on AWS and GCP
70+
### Local deployment
7271

73-
Finally, [eoapi-template](https://github.com/developmentseed/eoapi-template) is an AWS CDK app that shows how to configure the eoapi-cdk constructs.
72+
The services can be deployed altogether locally with `docker compose up`.
7473

75-
Alternatively, you may install the libraries locally:
74+
Alternatively, you may install the libraries and launch the applications manually :
7675

7776
<details>
7877

@@ -109,7 +108,19 @@ Note: python libraries might have incompatible dependencies, which you can resol
109108

110109
</details>
111110

112-
## Custom runtimes
111+
### Deployment on the cloud
112+
113+
#### Kubernetes
114+
115+
[eoapi-k8s](https://github.com/developmentseed/eoapi-k8s) contains IaC and Helm charts for deploying eoAPI services on AWS and GCP.
116+
117+
#### AWS CDK
118+
119+
[eoapi-cdk](https://github.com/developmentseed/eoapi-cdk) defines a set of AWS CDK constructs that can be used to deploy eoAPI services on AWS. This repository itself makes use of these in `infrastructure/aws`. An official example usage of these constructs can be found at [eoapi-template](https://github.com/developmentseed/eoapi-template).
120+
121+
122+
123+
## Deployment with custom runtimes
113124

114125
The eoAPI repository hosts customized versions of each base service which can work in parallel or in combination with each other.
115126

docker-compose.custom.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
11
version: '3'
22

33
services:
4+
stac-browser:
5+
profiles:
6+
- gunicorn
7+
build:
8+
context: dockerfiles
9+
dockerfile: Dockerfile.browser
10+
ports:
11+
- "${MY_DOCKER_IP:-127.0.0.1}:8085:8085"
12+
depends_on:
13+
- stac
14+
- database
15+
- raster
416
stac:
517
container_name: eoapi.stac
618
profiles:

docker-compose.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
11
version: '3'
22

33
services:
4+
5+
# change to official image when available https://github.com/radiantearth/stac-browser/pull/386
6+
stac-browser:
7+
build:
8+
context: dockerfiles
9+
dockerfile: Dockerfile.browser
10+
ports:
11+
- "${MY_DOCKER_IP:-127.0.0.1}:8085:8085"
12+
depends_on:
13+
- stac-fastapi
14+
- titiler-pgstac
15+
- database
16+
417
stac-fastapi:
518
# Note:
619
# the official ghcr.io/stac-utils/stac-fastapi-pgstac image uses python 3.8 and uvicorn

dockerfiles/Dockerfile.browser

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Copyright Radiant Earth Foundation
2+
3+
FROM node:lts-alpine3.18 AS build-step
4+
ARG DYNAMIC_CONFIG=true
5+
6+
WORKDIR /app
7+
8+
RUN apk add --no-cache git
9+
RUN git clone https://github.com/radiantearth/stac-browser.git .
10+
# remove the default config.js
11+
RUN rm config.js
12+
RUN npm install
13+
# replace the default config.js with our config file
14+
COPY ./browser_config.js ./config.js
15+
RUN \[ "${DYNAMIC_CONFIG}" == "true" \] && sed -i 's/<!-- <script defer="defer" src=".\/config.js"><\/script> -->/<script defer="defer" src=".\/config.js"><\/script>/g' public/index.html
16+
RUN npm run build
17+
18+
19+
FROM nginx:1-alpine-slim
20+
21+
COPY --from=build-step /app/dist /usr/share/nginx/html
22+
COPY --from=build-step /app/config.schema.json /etc/nginx/conf.d/config.schema.json
23+
24+
# change default port to 8084
25+
RUN apk add jq pcre-tools && \
26+
sed -i 's/\s*listen\s*80;/ listen 8084;/' /etc/nginx/conf.d/default.conf && \
27+
sed -i 's/\s*location \/ {/ location \/ {\n try_files $uri $uri\/ \/index.html;/' /etc/nginx/conf.d/default.conf
28+
29+
EXPOSE 8084
30+
31+
STOPSIGNAL SIGTERM
32+
33+
# override entrypoint, which calls nginx-entrypoint underneath
34+
COPY --from=build-step /app/docker/docker-entrypoint.sh ./docker-entrypoint.d/40-stac-browser-entrypoint.sh

dockerfiles/browser_config.js

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
module.exports = {
2+
catalogUrl: "http://0.0.0.0:8081",
3+
catalogTitle: "eoAPI STAC Browser",
4+
allowExternalAccess: true, // Must be true if catalogUrl is not given
5+
allowedDomains: [],
6+
detectLocaleFromBrowser: true,
7+
storeLocale: true,
8+
locale: "en",
9+
fallbackLocale: "en",
10+
supportedLocales: [
11+
"de",
12+
"es",
13+
"en",
14+
"fr",
15+
"it",
16+
"ro"
17+
],
18+
apiCatalogPriority: null,
19+
useTileLayerAsFallback: true,
20+
displayGeoTiffByDefault: false,
21+
buildTileUrlTemplate: ({href, asset}) => "http://0.0.0.0:8082/cog/tiles/{z}/{x}/{y}@2x?url=" + encodeURIComponent(asset.href.startsWith("/vsi") ? asset.href : href),
22+
stacProxyUrl: null,
23+
pathPrefix: "/",
24+
historyMode: "history",
25+
cardViewMode: "cards",
26+
cardViewSort: "asc",
27+
showThumbnailsAsAssets: false,
28+
stacLint: true,
29+
geoTiffResolution: 128,
30+
redirectLegacyUrls: false,
31+
itemsPerPage: 12,
32+
defaultThumbnailSize: null,
33+
maxPreviewsOnMap: 50,
34+
crossOriginMedia: null,
35+
requestHeaders: {},
36+
requestQueryParameters: {},
37+
preprocessSTAC: null,
38+
authConfig: null
39+
};

docs/src/services.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,4 +109,25 @@ It enables vector Features/Features Collection exploration and visualization for
109109

110110
- https://vector.eoapi.dev/collections/public.landsat_wrs/viewer shows the `landsat_wrs` Table on a Map client using vector tiles
111111

112-
- https://vector.eoapi.dev/tileMatrixSets/WebMercatorQuad `WebMercatorQuad` TileMatrixSet information
112+
- https://vector.eoapi.dev/tileMatrixSets/WebMercatorQuad `WebMercatorQuad` TileMatrixSet information
113+
114+
115+
## Browsing UI
116+
117+
The browsing UI deployed in eoAPI is built on [the radiant earth STAC browser](https://github.com/radiantearth/stac-browser), and provides a configurable, user-friendly interface to search across and within collections and quickly visualize single items assets.
118+
119+
120+
<p align="center">
121+
<img alt="stac-fastapi" src="https://github.com/developmentseed/eoAPI/assets/45140658/fae75d99-44c5-4899-8185-d003cd3c2c6a"/>
122+
</p>
123+
124+
!!! example
125+
126+
- http://eoapi-dev-stac-browser.s3-website-us-east-1.amazonaws.com landing page
127+
128+
- http://eoapi-dev-stac-browser.s3-website-us-east-1.amazonaws.com/collections display available **Collection**
129+
130+
- http://eoapi-dev-stac-browser.s3-website-us-east-1.amazonaws.com/collections/MAXAR_southafrica_flooding22/items display available **Items** for the `MAXAR_southafrica_flooding22` collection
131+
132+
- http://eoapi-dev-stac-browser.s3-website-us-east-1.amazonaws.com/collections/MAXAR_southafrica_flooding22/items/36_213131033000_1040010076566100 show the `36_213131033000_1040010076566100` **Item** in the `MAXAR_southafrica_flooding22` collection and visualize its "visual" asset.
133+
---
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
module.exports = {
2+
catalogUrl: null,
3+
catalogTitle: "eoAPI STAC Browser",
4+
allowExternalAccess: true, // Must be true if catalogUrl is not given
5+
allowedDomains: [],
6+
detectLocaleFromBrowser: true,
7+
storeLocale: true,
8+
locale: "en",
9+
fallbackLocale: "en",
10+
supportedLocales: [
11+
"de",
12+
"es",
13+
"en",
14+
"fr",
15+
"it",
16+
"ro"
17+
],
18+
apiCatalogPriority: null,
19+
useTileLayerAsFallback: true,
20+
displayGeoTiffByDefault: false,
21+
buildTileUrlTemplate: ({href, asset}) => "https://raster.dev/cog/tiles/{z}/{x}/{y}@2x?url=" + encodeURIComponent(asset.href.startsWith("/vsi") ? asset.href : href),
22+
stacProxyUrl: null,
23+
pathPrefix: "/",
24+
historyMode: "history",
25+
cardViewMode: "cards",
26+
cardViewSort: "asc",
27+
showThumbnailsAsAssets: false,
28+
stacLint: true,
29+
geoTiffResolution: 128,
30+
redirectLegacyUrls: false,
31+
itemsPerPage: 12,
32+
defaultThumbnailSize: null,
33+
maxPreviewsOnMap: 50,
34+
crossOriginMedia: null,
35+
requestHeaders: {},
36+
requestQueryParameters: {},
37+
preprocessSTAC: null,
38+
authConfig: null
39+
};

0 commit comments

Comments
 (0)