You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: remove cloudfront distribution and custom alternate domain from backend (#422)
### Issue
#403#221
### What + Why
- Remove cloudfront distribution CDK from veda-backend because it's now
managed in veda-routes
- Update values passed into ingestor config to derive endpoint values
using the custom host and stac and raster API root paths
- Remove configuration and support for hosting duplicate stac and raster
apis as alternative domains.
### Testing?
Deployed to UAH
Copy file name to clipboardExpand all lines: README.md
+29-9Lines changed: 29 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,9 @@
1
1
# veda-backend
2
+
2
3
This project deploys a complete backend for a [SpatioTemporal Asset Catalog](https://stacspec.org/) including a postgres database, a metadata API, and raster tiling API. Veda-backend is a non-forked version of the [eoAPI](https://github.com/developmentseed/eoAPI) demo project. Veda-backend is decoupled from the demo project to selectively incorporate new stable functionality from the fast moving development in eoAPI while providing a continuous baseline for veda-backend users and to support project specific business and deployment logic.
3
4
4
5
The primary tools employed in the [eoAPI demo](https://github.com/developmentseed/eoAPI) and this project are:
_Edit this diagram in VS Code using the [Draw.io Integration Extension](https://marketplace.visualstudio.com/items?itemName=hediet.vscode-drawio) and export a new SVG_
@@ -33,12 +36,14 @@ An [.example.env](.example.env) template is supplied for local deployments. If u
33
36
34
37
### Fetch environment variables using AWS CLI
35
38
36
-
To retrieve the variables for a stage that has been previously deployed, the secrets manager can be used to quickly populate an .env file with [scripts/sync-env-local.sh](scripts/sync-env-local.sh).
39
+
To retrieve the variables for a stage that has been previously deployed, the secrets manager can be used to quickly populate an .env file with [scripts/sync-env-local.sh](scripts/sync-env-local.sh).
37
40
38
-
```
41
+
```bash
39
42
./scripts/sync-env-local.sh <app-secret-name>
40
43
```
44
+
41
45
### Basic environment variables
46
+
42
47
| Name | Explanation |
43
48
| --- | --- |
44
49
|`APP_NAME`| Optional app name used to name stack and resources, defaults to `veda-backend`|
@@ -48,6 +53,7 @@ To retrieve the variables for a stage that has been previously deployed, the sec
48
53
|`VEDA_DB_SNAPSHOT_ID`|**Once used always REQUIRED** Optional RDS snapshot identifier to initialize RDS from a snapshot |
49
54
50
55
### Advanced configuration
56
+
51
57
The constructs and applications in this project are configured using pydantic. The settings are defined in config.py files stored alongside the associated construct or application--for example the settings for the RDS PostgreSQL construct are defined in database/infrastructure/config.py. For custom configuration, use environment variables to override the pydantic defaults.
52
58
53
59
| Construct | Env Prefix | Configuration |
@@ -64,24 +70,28 @@ The constructs and applications in this project are configured using pydantic. T
-[jq](https://jqlang.github.io/jq/) (used for exporting environment variable secrets to `.env` in [scripts/sync-env-local.sh](/scripts/sync-env-local.sh))
70
77
71
78
These can be installed with [homebrew](https://brew.sh/) on MacOS
72
-
```
79
+
80
+
```bash
73
81
brew install node
74
82
brew install nvm
75
83
brew install jq
76
84
```
77
85
78
86
#### Virtual environment example
79
-
```
87
+
88
+
```bash
80
89
python3 -m venv .venv
81
90
source .venv/bin/activate
82
91
```
83
92
84
93
#### Install requirements
94
+
85
95
```bash
86
96
nvm use --lts
87
97
npm install --location=global aws-cdk
@@ -99,7 +109,7 @@ cdk diff
99
109
# Execute deployment and standby--security changes will require approval for deployment
100
110
cdk deploy
101
111
```
102
-
112
+
103
113
## Deleting the CloudFormation stack
104
114
105
115
If this is a development stack that is safe to delete, you can delete the stack in CloudFormation console or via `cdk destroy`, however, the additional manual steps were required to completely delete the stack resources:
@@ -112,44 +122,51 @@ If this is a development stack that is safe to delete, you can delete the stack
112
122
## Custom deployments
113
123
114
124
The default settings for this project generate a complete AWS environment including a VPC and gateways for the stack. See this guidance for adjusting the veda-backend stack for existing managed and/or shared AWS environments.
125
+
115
126
-[Deploy to an existing managed AWS environment](docs/deploying_to_existing_environments.md)
116
127
-[Creating a shared base VPC and AWS environment](docs/deploying_to_existing_environments.md#optional-deploy-standalone-base-infrastructure)
117
128
118
129
## Local Docker deployment
119
130
120
131
Start up a local stack
121
-
```
132
+
133
+
```bash
122
134
docker compose up
123
135
```
136
+
124
137
Clean up after running locally
125
-
```
138
+
139
+
```bash
126
140
docker compose down
127
141
```
128
142
129
143
## Running tests locally
130
144
131
145
To run tests implicated in CI, a script is included that requires as little setup as possible
132
-
```
146
+
147
+
```bash
133
148
./scripts/run-local-tests.sh
134
149
```
135
150
136
151
In case of failure, all container logs will be written out to `container_logs.log`.
137
152
138
153
# Operations
139
154
140
-
## Adding new data to veda-backend
155
+
## Adding new data to veda-backend
141
156
142
157
> **Warning** PgSTAC records should be loaded in the database using [pypgstac](https://github.com/stac-utils/pgstac#pypgstac) for proper indexing and partitioning.
143
158
144
159
The VEDA ecosystem includes tools specifially created for loading PgSTAC records and optimizing data assets. The [veda-data-airflow](https://github.com/NASA-IMPACT/veda-data-airflow) project provides examples of cloud pipelines that transform data to cloud optimized formats, generate STAC metadata, and submit records for publication to the veda-backend database via veda-backend's ingest API. Veda-backend's integrated ingest system includes an API lambda for enqueuing collection and item records in a DynamoDB table and an ingestor lambda that batch loads DDB enqueued records into the PgSTAC database. Currently, the client id and domain of an existing Cognito user pool programmatic client must be supplied in [configuration](ingest_api/infrastructure/config.py) as `VEDA_CLIENT_ID` and `VEDA_COGNITO_DOMAIN` (the [veda-auth project](https://github.com/NASA-IMPACT/veda-auth) can be used to deploy a Cognito user pool and client). To dispense auth tokens via the ingest API swagger docs and `/token` endpoints, an administrator must add the ingest API lambda URL to the allowed callbacks of the Cognito client.
145
160
146
161
## Support scripts
147
162
Support scripts are provided for manual system operations.
|**veda-backend**| Central index (database) and APIs for recording, discovering, viewing, and using VEDA assets |
@@ -159,6 +176,7 @@ Support scripts are provided for manual system operations.
159
176
|[**veda-data**](https://github.com/NASA-IMPACT/veda-data)| Collection and asset discovery configuration |
160
177
|[**veda-data-airflow**](https://github.com/NASA-IMPACT/veda-data-airflow)| Cloud optimize data assets and submit records for publication to veda-stac-ingestor |
161
178
|[**veda-docs**](https://github.com/NASA-IMPACT/veda-docs)| Documentation repository for end users of VEDA ecosystem data and tools |
179
+
|[**veda-routes**](https://github.com/NASA-IMPACT/veda-routes)| Configuration for VEDA's Content Delivery Network |
162
180
163
181
## VEDA usage examples
164
182
@@ -169,7 +187,9 @@ Support scripts are provided for manual system operations.
169
187
# STAC community resources
170
188
171
189
## STAC browser
190
+
172
191
Radiant Earth's [stac-browser](https://github.com/radiantearth/stac-browser) is a browser for STAC catalogs. The demo version of this browser [radiantearth.github.io/stac-browser](https://radiantearth.github.io/stac-browser/#/) can be used to browse the contents of the veda-backend STAC catalog, paste the veda-backend stac-api URL deployed by this project in the demo and click load. Read more about the recent developments and usage of stac-browser [here](https://medium.com/radiant-earth-insights/the-exciting-future-of-the-stac-browser-2351143aa24b).
173
192
174
193
# License
194
+
175
195
This project is licensed under **Apache 2**, see the [LICENSE](LICENSE) file for more details.
0 commit comments