Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

STACK_ as prefix; wrong case in dir; NAME instead of PROJECT #211

Merged
merged 5 commits into from
Feb 4, 2021
Merged
Show file tree
Hide file tree
Changes from 4 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
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* update FastAPI requirements
* add `validate` in `MosaicTilerFactory` (https://github.com/developmentseed/titiler/pull/206, author @drnextgis)
* rename `ressources` package to `resources` (https://github.com/developmentseed/titiler/pull/210, author @drnextgis)
* renamed environment variables prefixes for API and STACK configurations: ````TITILER_STACK``` as prefix to CDK and ```TITILER_API``` as prefix to API (https://github.com/developmentseed/titiler/pull/211, author @fredliporace)
vincentsarago marked this conversation as resolved.
Show resolved Hide resolved

## 0.1.0a14 (2021-01-05)

Expand Down
12 changes: 6 additions & 6 deletions deployment/aws/.env.example
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
STACK_NAME="my-tiler"
STACK_STAGE="dev"
STACK_BUCKETS='["my-bucket*", "*"]'
STACK_MEMORY=3008
TITILER_STACK_NAME="my-tiler"
TITILER_STACK_STAGE="dev"
TITILER_STACK_BUCKETS='["my-bucket*", "*"]'
TITILER_STACK_MEMORY=3008

# Uncomment to allow lambda to access content on requester-payer buckets
# STACK_ADDITIONAL_ENV='{"AWS_REQUEST_PAYER":"requester"}'
# TITILER_STACK_ADDITIONAL_ENV='{"AWS_REQUEST_PAYER":"requester"}'
# Uncomment if you only on the /cog endpoint
# STACK_ADDITIONAL_ENV='{"API_DISABLE_STAC": "TRUE", "API_DISABLE_MOSAIC": "TRUE"}'
# TITILER_STACK_ADDITIONAL_ENV='{"TITILER_API_DISABLE_STAC": "TRUE", "TITILER_API_DISABLE_MOSAIC": "TRUE"}'
4 changes: 2 additions & 2 deletions deployment/aws/cdk/config.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""STACK Configs."""
"""TITILER_STACK Configs."""

from typing import Dict, List, Optional

Expand Down Expand Up @@ -68,4 +68,4 @@ class Config:
"""model config"""

env_file = ".env"
env_prefix = "STACK_"
env_prefix = "TITILER_STACK_"
6 changes: 3 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ services:
- VSI_CACHE=TRUE
- VSI_CACHE_SIZE=536870912
- WORKERS_PER_CORE=1
# - API_DISABLE_STAC=TRUE
# - API_DISABLE_MOSAIC=TRUE
# - API_DISABLE_COG=TRUE
# - TITILER_API_DISABLE_STAC=TRUE
# - TITILER_API_DISABLE_MOSAIC=TRUE
# - TITILER_API_DISABLE_COG=TRUE
6 changes: 3 additions & 3 deletions docs/deployment/aws/ecs.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ The example handles tasks such as generating a docker image and setting up an ap
3. Update settings (see [intro.md](intro.md))

```bash
export TITILER_PROJECT="mytiler"
export TITILER_STAGE="dev"
export TITILER_MIN_ECS_INSTANCES=10
export TITILER_STACK_NAME="mytiler"
export TITILER_STACK_STAGE="dev"
export TITILER_STACK_MIN_ECS_INSTANCES=10
```

Available settings for ECS:
Expand Down
16 changes: 8 additions & 8 deletions docs/deployment/aws/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,23 @@ Example of of AWS deployments can be found in https://github.com/developmentseed

Deployment settings are managed via [pydantic.BaseSettings](https://pydantic-docs.helpmanual.io/usage/settings/) and stored in [config.py](https://github.com/developmentseed/titiler/blob/master/stack/config.py). Pydantic BaseSettings can receive input to overwrite the default value from `.env` file or from environment variables.

Variables in `.env` or in environment variable need to be prefixed with `STACK_`:
Variables in `.env` or in environment variable need to be prefixed with `TITILER_STACK_`:


```bash
STACK_NAME="my-tiler"
STACK_STAGE="dev"
TITILER_STACK_NAME="my-tiler"
TITILER_STACK_STAGE="dev"

STACK_BUCKETS='["my-bucket*", "*"]'
STACK_MOSAIC_HOST="my-bucket/mosaics"
TITILER_STACK_BUCKETS='["my-bucket*", "*"]'
TITILER_STACK_MOSAIC_HOST="my-bucket/mosaics"

STACK_MEMORY=3008
TITILER_STACK_MEMORY=3008

# Uncomment to allow lambda to access content on requester-payer buckets
# STACK_ADDITIONAL_ENV='{"AWS_REQUEST_PAYER":"requester"}'
# TITILER_STACK_ADDITIONAL_ENV='{"AWS_REQUEST_PAYER":"requester"}'

# Uncomment if you only on the /cog endpoint
# STACK_ADDITIONAL_ENV='{"API_DISABLE_STAC": "TRUE", "API_DISABLE_MOSAIC": "TRUE"}'
# TITILER_STACK_ADDITIONAL_ENV='{"TITILER_API_DISABLE_STAC": "TRUE", "TITILER_API_DISABLE_MOSAIC": "TRUE"}'
```

Default values from [config.py](https://github.com/developmentseed/titiler/blob/master/deployment/aws/cdk/config.py):
Expand Down
6 changes: 3 additions & 3 deletions docs/deployment/aws/lambda.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ The Lambda stack is also deployed by the [AWS CDK](https://aws.amazon.com/cdk/)
3. Update settings (see [intro.md](intro.md))

```bash
export TITILER_PROJECT="mytiler"
export TITILER_STAGE="dev"
export TITILER_MEMORY=512
export TITILER_STACK_NAME="mytiler"
export TITILER_STACK_STAGE="dev"
export TITILER_STACK_MEMORY=512
```

Available settings for AWS Lambda:
Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def set_env(monkeypatch):
monkeypatch.setenv("AWS_REGION", "us-west-2")
monkeypatch.delenv("AWS_PROFILE", raising=False)
monkeypatch.setenv("AWS_CONFIG_FILE", "/tmp/noconfigheere")
monkeypatch.setenv("API_CACHECONTROL", "private, max-age=3600")
monkeypatch.setenv("TITILER_API_CACHECONTROL", "private, max-age=3600")


@pytest.fixture(autouse=True)
Expand Down
2 changes: 1 addition & 1 deletion titiler/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ class Config:
"""model config"""

env_file = ".env"
env_prefix = "API_"
env_prefix = "TITILER_API_"