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
63 changes: 63 additions & 0 deletions .github/workflows/deploy-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: CDK Deploy Dev Workflow 🚀

permissions:
id-token: write
contents: read

on:
workflow_dispatch:
inputs:
branch:
description: 'Branch to deploy'
required: true
default: 'main'
pull_request:
types: [labeled, synchronize]

jobs:
deploy:
name: Deploy to dev 🚀
runs-on: ubuntu-latest
environment: dev
if: >
github.event_name != 'pull_request' ||
(github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'deploy-dev'))
env:
UV_PYTHON: 3.12
CDK_DEFAULT_ACCOUNT: ${{ vars.CDK_DEFAULT_ACCOUNT }}
CDK_DEFAULT_REGION: ${{ vars.CDK_DEFAULT_REGION }}
STAGE: ${{ vars.STAGE }}
VPC_ID: ${{ vars.VPC_ID }}
TITILER_MULTIDIM_PYTHONWARNINGS: ignore
TITILER_MULTIDIM_DEBUG: true
TITILER_MULTIDIM_READER_ROLE_ARN: ${{ vars.TITILER_MULTIDIM_READER_ROLE_ARN }}

steps:
- name: Determine branch to deploy
id: set_branch
run: |
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
echo "branch=${{ github.event.inputs.branch }}" >> $GITHUB_OUTPUT
elif [ "${{ github.event_name }}" == "pull_request" ]; then
echo "branch=${{ github.event.pull_request.head.ref }}" >> $GITHUB_OUTPUT
else
echo "branch=${{ github.ref_name }}" >> $GITHUB_OUTPUT
fi

- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ steps.set_branch.outputs.branch }}

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: ${{ vars.AWS_ROLE_ARN }}
role-session-name: test-deploy
aws-region: us-west-2

- name: Run titiler-cmr deployment
uses: "./.github/actions/cdk-deploy"
with:
dir: "./infrastructure/aws"
env_aws_secret_name: ""
7 changes: 2 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,8 @@ 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/.
* **Production deployments** are handled in the [NASA-IMPACT/veda-deploy](https://github.com/NASA-IMPACT/veda-deploy) repository.
* **Test/dev stack deployments** can be triggered by applying the `deploy-dev` label to a pull request in this repository.

## New Deployments

Expand Down
2 changes: 2 additions & 0 deletions infrastructure/aws/lambda/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ COPY src/titiler/ ./src/titiler/
RUN uv export --locked --no-editable --no-dev --extra lambda --format requirements.txt -o requirements.txt && \
uv pip install --compile-bytecode --no-binary pydantic --target /asset -r requirements.txt

# copy libexpat.so.1 into /asset which is included in LD_LIBRARY_PATH
RUN cp /usr/lib64/libexpat.so.1 /asset/

# Reduce package size and remove useless files
RUN cd /asset && find . -type f -name '*.pyc' | while read f; do n=$(echo $f | sed 's/__pycache__\///' | sed 's/.cpython-[0-9]*//'); cp $f $n; done;
Expand Down
14 changes: 10 additions & 4 deletions src/titiler/multidim/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,18 @@ def map_viewer(
description="Whether to decode times",
),
] = True,
drop_dim: Annotated[
sel: Annotated[
Optional[str],
Query(description="Dimension to drop"),
Query(
description="Xarray Indexing using dimension names `{dimension}={value}`.",
),
] = None,
datetime: Annotated[
Optional[str], Query(description="Slice of time to read (if available)")
method: Annotated[
Optional[Literal["nearest", "pad", "ffill", "backfill", "bfill"]],
Query(
alias="sel_method",
description="Xarray indexing method to use for inexact matches.",
),
] = None,
tile_format: Annotated[
Optional[ImageType],
Expand Down
Loading