https://github.com/developmentseed/titiler-multidim
TiTiler extension for xarray
https://github.com/developmentseed/titiler-multidim
xarray zarr
Last synced: 4 months ago
JSON representation
TiTiler extension for xarray
- Host: GitHub
- URL: https://github.com/developmentseed/titiler-multidim
- Owner: developmentseed
- License: mit
- Created: 2023-03-07T22:58:13.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-03-26T01:55:44.000Z (7 months ago)
- Last Synced: 2025-03-26T02:40:39.461Z (7 months ago)
- Topics: xarray, zarr
- Language: Python
- Homepage: https://developmentseed.org/titiler/packages/xarray/
- Size: 9.82 MB
- Stars: 43
- Watchers: 6
- Forks: 10
- Open Issues: 23
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# titiler-multidim
---
**Source Code**: https://github.com/developmentseed/titiler-multidim
---
## Running Locally
```bash
# It's recommended to install dependencies in a virtual environment
python -m venv .venv
source .venv/bin/activatepython -m pip install -e . uvicorn
export TEST_ENVIRONMENT=true # set this when running locally to mock redis
uvicorn titiler.multidim.main:app --reload
```To access the docs, visit .
## Development
Tests use data generated locally by using `tests/fixtures/generate_test_*.py` scripts.
Install the package using [`uv`](https://docs.astral.sh/uv/getting-started/installation/) with all development dependencies:
```bash
uv sync
uv run pre-commit install
```To run all the tests:
```bash
uv run pytest
```To run just one test:
```bash
uv run pytest tests/test_app.py::test_get_info
```## VEDA Deployment
The Github Actions workflow defined in [.github/workflows/ci.yml](./.github/workflows/ci.yml) deploys code to AWS for the VEDA project.
* There are 2 stacks - one production and one development.
* The production stack is deployed when the `main` branch is tagged, creating a new release. The production stack will deploy to a stack with an API Gateway associated with the domain prod-titiler-xarray.delta-backend.com/.
* The development stack will be deployed upon pushes to the `dev` and `main` branches. The development stack will deploy to a stack with an API Gateway associated with the domain dev-titiler-xarray.delta-backend.com/.## New Deployments
The following steps detail how to to setup and deploy the CDK stack from your local machine.
1. Install CDK and connect to your AWS account. This step is only necessary once per AWS account.
```bash
# Download titiler repo
git clone https://github.com/developmentseed/titiler-xarray.git# Install with the deployment dependencies
uv sync --group deployment# Install node dependency
uv run npm --prefix infrastructure/aws install# Deploys the CDK toolkit stack into an AWS environment
uv run npm --prefix infrastructure/aws run cdk -- bootstrap# or to a specific region and or using AWS profile
AWS_DEFAULT_REGION=us-west-2 AWS_REGION=us-west-2 AWS_PROFILE=myprofile npm --prefix infrastructure/aws run cdk -- bootstrap
```2. Update settings
Set environment variable or hard code in `infrastructure/aws/.env` file (e.g `STACK_STAGE=testing`).
3. Pre-Generate CFN template
```bash
uv run npm --prefix infrastructure/aws run cdk -- synth # Synthesizes and prints the CloudFormation template for this stack
```4. Deploy
```bash
STACK_STAGE=staging uv run npm --prefix infrastructure/aws run cdk -- deploy titiler-xarray-staging# Deploy in specific region
AWS_DEFAULT_REGION=us-west-2 AWS_REGION=us-west-2 AWS_PROFILE=smce-veda STACK_STAGE=production uv run npm --prefix infrastructure/aws run cdk -- deploy titiler-xarray-production
```**Important**
In AWS Lambda environment we need to have specific version of botocore, S3FS, FSPEC and other libraries.
To make sure the application will both work locally and in AWS Lambda environment you can install the dependencies using `python -m pip install -r infrastructure/aws/requirement-lambda.txt`