Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/developmentseed/eoapi into …
Browse files Browse the repository at this point in the history
…NewVpc
  • Loading branch information
vincentsarago committed Aug 25, 2023
2 parents a106e4b + f76a5b4 commit 39d17c8
Show file tree
Hide file tree
Showing 32 changed files with 4,091 additions and 261 deletions.
18 changes: 14 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,16 @@ on:
- main
tags:
- '*'
paths:
# Only rebuild website when docs have changed
- 'runtime/**'
- 'dockerfiles/**'
- 'docker-compose.*'
- '.github/workflows/ci.yml'
- '.isort.cfg'
- '.mypy.ini'
- 'ruff.toml'
- '.pre-commit-config.yaml'
pull_request:

jobs:
Expand All @@ -28,7 +38,7 @@ jobs:
pre-commit run --all-files
- name: Launch services
run: docker-compose up -d stac raster vector
run: docker compose up -d stac raster vector

- name: install lib postgres
run: |
Expand Down Expand Up @@ -57,8 +67,8 @@ jobs:
# see https://github.com/developmentseed/tipg/issues/37
- name: Restart the Vector service
run: |
docker-compose stop vector
docker-compose up -d vector
docker compose stop vector
docker compose up -d vector
- name: Sleep for 10 seconds
run: sleep 10s
Expand All @@ -68,7 +78,7 @@ jobs:
run: python -m pytest .github/workflows/tests/

- name: Stop services
run: docker-compose stop
run: docker compose stop


publish-docker:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests/test_raster.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def test_mosaic_api():
assert list(resp.json()[0]) == ["id", "bbox", "assets", "collection"]
assert resp.json()[0]["id"] == "20200307aC0853900w361030"

resp = httpx.get(f"{raster_endpoint}/mosaic/{searchid}/15/8589/12849/assets")
resp = httpx.get(f"{raster_endpoint}/mosaic/{searchid}/tiles/15/8589/12849/assets")
assert resp.status_code == 200
assert len(resp.json()) == 1
assert list(resp.json()[0]) == ["id", "bbox", "assets", "collection"]
Expand Down
6 changes: 4 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@ python -m pip install --upgrade virtualenv
virtualenv .venv
source .venv/bin/activate

# Install eoapi modules
# Install eoapi module
python -m pip install "psycopg[binary,pool]"
python -m pip install -e runtime/eoapi/raster["test"] -e runtime/eoapi/stac["test"] -e runtime/eoapi/vector["test"]
python -m pip install -e runtime/eoapi/raster["test"] # or -e runtime/eoapi/stac["test"] | -e runtime/eoapi/vector["test"]
```

Note: services might have incompatible dependencies which you can resolve by using virtual environnement per service

**pre-commit**

This repo is set to use `pre-commit` to run *isort*, *ruff*, *pydocstring*, *black* ("uncompromising Python code formatter") and mypy when committing new code.
Expand Down
64 changes: 27 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

<p align="center">
<img width="700" src="https://github.com/developmentseed/eoAPI/assets/10407788/2a12d3ea-2fff-4f15-979b-7d1f0be795f7"/>
<img width="700" src="docs/logos/eoAPI.png"/>
<p align="center">Create a full Earth Observation API with Metadata, Raster and Vector services.</p>
</p>

Expand All @@ -15,7 +15,7 @@

---

**Documentation**: <a href="https://developmentseed.org/eoAPI/" target="_blank">https://developmentseed.org/eoAPI/</a>
**Documentation**: <a href="https://eoapi.dev" target="_blank">https://eoapi.dev</a>

**Source Code**: <a href="https://github.com/developmentseed/eoAPI" target="_blank">https://github.com/developmentseed/eoAPI</a>

Expand All @@ -35,46 +35,20 @@

---

## Why should you use `eoAPI`
## 🌍 eoAPI: An Open-Source Community Project

- **Focus on your use case:** `eoAPI` is used for large-scale data processing, building geographic information systems (GIS), creating real-time data applications, climate research and environmental monitoring, machine learning model training, and more.
`eoAPI` is proudly open-source and driven by a dedicated community of contributors. We believe in the power of open collaboration and welcome anyone to contribute, discuss, and grow this tool with us. Join the conversations on [GitHub Discussions](https://github.com/developmentseed/eoAPI/discussions) and make a difference in the Earth Observation realm.

- **Unified Repository:** `eoAPI` provides a single, unified repository to several state-of-the-art Earth Observation (EO) data services, including Metadata search (STAC), Raster, and Vector services. This can simplify the process of accessing and working with these services.

- **Interoperability:** `eoAPI` is designed to enable interoperability among its included services. This can make building complex applications that leverage different types of EO data easier.

- **Open Source and Community Support:** As an open-source project, `eoAPI` allows developers to inspect its code, contribute to its development, and use it as a base for custom solutions. It also benefits from the support and innovation of a community of developers and EO data users.

- **Scalability and Flexibility:** Each service in `eoAPI` can be used or deployed independently, which provides a lot of flexibility. If a developer's application only requires one or two of eoAPI's services, they don't need to deploy the entire suite.

- **Facilitate Earth Observation Tasks:** `eoAPI` includes specialized tools for working with EO data, such as dynamic tiling, metadata searching, and features/vector tiles API. These can significantly facilitate EO data processing, analysis, and visualization.

- **Ease of Deployment:** `eoAPI` supports containerized deployment using Docker, making it easier to set up, scale, and maintain applications built on it. Spin up the demo locally and start experimenting in minutes.

---

## Services Overview


- **STAC Metadata**: Built with [stac-fastapi.pgstac](https://github.com/stac-utils/stac-fastapi) and extended with a custom extension to connect it to **`TiTiler`** and a **[Search Viewer](http://localhost:8081/index.html)**. See [docs](http://localhost:8081/docs) for API details.

- **Raster Tiles**: Built with [titiler-pgstac](https://github.com/stac-utils/titiler-pgstac) and [pgstac](https://github.com/stac-utils/pgstac) to enable large scale mosaic based on results of STAC searches queries. See [docs](http://localhost:8082/docs) for API details.

- **OGC Features & Vector Tiles**: Built with [tipg](https://github.com/developmentseed/tipg) to create a lightweight OGC Features and Tiles API with a PostGIS database. See [docs](http://localhost:8083/api.html) for API details.

See [service details](./docs/src/services-details.md) for more information.

*Note: The documentation links referenced require lauching the application with `docker-compose` or another deployment*.

---

## Getting started

- Clone the repository: `git clone https://github.com/developmentseed/eoAPI.git`
- Navigate to the project: `cd eoAPI`
- Run services with `docker-compose up`
- Run services with `docker compose up`
- Follow the [MAXAR open data demo](https://github.com/vincentsarago/MAXAR_opendata_to_pgstac) (or get inspired by the other [demos](./demo/)) to load some data into eoAPI
- Checkout the [Search Viewer](http://localhost:8081/index.html), and the API documentation ([STAC Metadata](http://localhost:8081/docs), [Raster Tiles](http://localhost:8082/docs), [Vector Tiles](http://localhost:8083/api.html))
- Check out the [Search Viewer](http://localhost:8081/index.html), and the API documentation ([STAC Metadata](http://localhost:8081/docs), [Raster Tiles](http://localhost:8082/docs), [Vector Tiles](http://localhost:8083/api.html))

Alternatively, you may launch the application locally:
```bash
Expand All @@ -90,24 +64,40 @@ export DATABASE_URL=postgresql://username:[email protected]:5439/postgis # Conne
.venv/bin/uvicorn eoapi.{SERVICE}.app:app --port 8000 --reload
```

Note: services might have incompatible dependencies which you can resolve by using virtual environement per service
Note: services might have incompatible dependencies which you can resolve by using a virtual environment for each service

---

## Deployment

See [DEPLOYMENT.md](https://github.com/developmentseed/eoAPI/blob/main/infrastructure/DEPLOYMENT.md)
This repository has current runtimes that are consistently updated with new functionality.

The services can be deployed locally via docker with `docker-compose up`. The official runtimes can be launched with `docker-compose -f docker-compose.yml -f docker-compose.official.yml up stac-fastapi titiler-pgstac tipg`.

Two Infrastructure as Code (IaC) repositories are available:
- [eoapi-cdk](https://github.com/developmentseed/eoapi-cdk): A set of AWS CDK constructs to deploy eoAPI services
- [eoapi-k8s](https://github.com/developmentseed/eoapi-k8s): IaC and Helm charts for deploying eoAPI services on AWS and GCP

Finally, [eoapi-template](https://github.com/developmentseed/eoapi-template) is an AWS CDK app that shows how to configure the eoapi-cdk constructs.

## Contribution & Development

See [CONTRIBUTING.md](https://github.com/developmentseed/eoAPI/blob/main/CONTRIBUTING.md)
We highly value and rely on our community! Whether you're an expert or just getting started, you can make a difference. Here's how:

- **Contribute**: Check out our [CONTRIBUTING.md](https://github.com/developmentseed/eoAPI/blob/main/CONTRIBUTING.md) guide to understand how you can contribute.
- **Engage in Discussions**: Share your ideas, ask questions, or provide feedback through [GitHub Discussions](https://github.com/developmentseed/eoAPI/discussions). This is where most of our project conversations take place.
- **Report Issues**: Found a bug or have a feature request? Raise it on our [issues page](https://github.com/developmentseed/eoAPI/issues).

---
## License

See [LICENSE](https://github.com/developmentseed/eoAPI/blob/main/LICENSE)
At Development Seed, we believe in open collaboration and making tools and data more accessible. In line with this ethos, we've explicitly chosen a MIT license for `eoAPI`.

For full license details, see [LICENSE](https://github.com/developmentseed/eoAPI/blob/main/LICENSE).

## Authors

Created by [Development Seed](<http://developmentseed.org>)
Nurtured by [Development Seed](<http://developmentseed.org>)

See [contributors](https://github.com/developmentseed/eoAPI/graphs/contributors) for a listing of individual contributors.

Expand Down
21 changes: 16 additions & 5 deletions docker-compose.official.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,24 @@ version: '3'

services:
stac-fastapi:
image: ghcr.io/stac-utils/stac-fastapi-pgstac:latest
build:
context: .
dockerfile: dockerfiles/Dockerfile.stac
ports:
- "${MY_DOCKER_IP:-127.0.0.1}:8081:8081"
environment:
- APP_HOST=0.0.0.0
- APP_PORT=8081
- ENVIRONMENT=local
# Application
- HOST=0.0.0.0
- PORT=8081
- MODULE_NAME=stac_fastapi.pgstac.app
- VARIABLE_NAME=app
# gunicorn
# https://github.com/tiangolo/uvicorn-gunicorn-docker#web_concurrency
- WEB_CONCURRENCY=10
# https://github.com/tiangolo/uvicorn-gunicorn-docker#workers_per_core
# - WORKERS_PER_CORE=1
# https://github.com/tiangolo/uvicorn-gunicorn-docker#max_workers
# - MAX_WORKERS=10
# Postgres connection
- POSTGRES_USER=username
- POSTGRES_PASS=password
Expand All @@ -21,7 +32,7 @@ services:
depends_on:
- database
command:
bash -c "bash /tmp/scripts/wait-for-it.sh -t 120 -h database -p 5432 && python -m stac_fastapi.pgstac.app"
bash -c "bash /tmp/scripts/wait-for-it.sh -t 120 -h database -p 5432 && /start.sh"
volumes:
- ./dockerfiles/scripts:/tmp/scripts

Expand Down
23 changes: 15 additions & 8 deletions docs/mkdocs.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
site_name: eoAPI
site_name: The Earth Observation API
site_description: Create a full Earth Observation API with Metadata, Raster and Vector services.

docs_dir: 'src'
Expand All @@ -13,24 +13,31 @@ extra:
link: "https://github.com/developmentseed"
- icon: "fontawesome/brands/twitter"
link: "https://twitter.com/developmentseed"
- icon: "fontawesome/brands/medium"
link: "https://medium.com/devseed"
- icon: "fontawesome/brands/linkedin"
link: "https://www.linkedin.com/company/development-seed"
- icon: "fontawesome/solid/rss"
link: "https://developmentseed.org/blog"

nav:
- Readme: "index.md"
- Development - Contributing: "contributing.md"
- Release Notes: "release-notes.md"
- Services Details: "services-details.md"
- Home: "index.md"
- Intro: "intro.md"
- Services: "services.md"
- Deployment: "deployment.md"
- Development - Contributing: "contributing.md"


plugins:
- search

theme:
name: material
custom_dir: src/overrides/
palette:
primary: indigo
primary: black
scheme: default
features:
- navigation.tabs
- navigation.tabs.sticky
favicon: img/favicon.ico
logo: img/logo.png

Expand Down
1 change: 1 addition & 0 deletions docs/src/CNAME
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
eoapi.dev
1 change: 0 additions & 1 deletion docs/src/contributing.md

This file was deleted.

34 changes: 34 additions & 0 deletions docs/src/contributing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
hide:
- navigation
- toc
---

Issues and pull requests are more than welcome: https://github.com/developmentseed/eoAPI/issues

**dev install**

```bash
# Download the code
git clone https://github.com/developmentseed/eoAPI.git
cd eoAPI

# Create a virtual environment
python -m pip install --upgrade virtualenv
virtualenv .venv
source .venv/bin/activate

# Install eoapi module
python -m pip install "psycopg[binary,pool]"
python -m pip install -e runtime/eoapi/raster["test"] # or -e runtime/eoapi/stac["test"] | -e runtime/eoapi/vector["test"]
```

Note: services might have incompatible dependencies which you can resolve by using virtual environnement per service

**pre-commit**

This repo is set to use `pre-commit` to run *isort*, *ruff*, *pydocstring*, *black* ("uncompromising Python code formatter") and mypy when committing new code.

```bash
$ pre-commit install
```
1 change: 0 additions & 1 deletion docs/src/deployment.md

This file was deleted.

Loading

0 comments on commit 39d17c8

Please sign in to comment.