diff --git a/README.md b/README.md index 1134413..75790ab 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ Lambda function for ingesting and processing camera trap images. - Animl base program http://github.com/tnc-ca-geo/animl-base - Animl ingest function http://github.com/tnc-ca-geo/animl-ingest - Animl ML resources http://github.com/tnc-ca-geo/animl-ml -- Animl desktop app https://github.com/tnc-ca-geo/animl-desktop +- Animl analytics http://github.com/tnc-ca-geo/animl-analytics ## About @@ -47,7 +47,7 @@ cd animl-ingest npm install ``` -## Deployment +## Dev deployment From project root folder (where ```serverless.yml``` lives), run the following to deploy or update the stack: ``` @@ -58,3 +58,17 @@ serverless deploy --stage dev serverless deploy --stage prod ``` +## Prod deployment +Use caution when deploying to production, as the application involves multiple stacks (animl-ingest, animl-api, animl-frontend), and often the deployments need to be synchronized. For major deployments to prod in which there are breaking changes that affect the other components of the stack, follow these steps: + +1. Set the frontend `IN_MAINTENANCE_MODE` to `true` (in `animl-frontend/src/config.js`), deploy to prod, then invalidate its cloudfront cache. This will temporarily prevent users from interacting with the frontend (editing labels, bulk uploading images, etc.) while the rest of the updates are being deployed. + +2. Set ingest-image's `IN_MAINTENANCE_MODE` to `true` (in `animl-ingest/ingest-image/task.js`) and deploy to prod. This will temporarily route any images from wireless cameras that happen to get send to the ingestion bucket to the `animl-images-parkinglot-prod` bucket so that Animl isn't trying to process new images while the updates are being deployed. + +3. Backup prod DB by running `npm run export-db-prod` from the `animl-api` project root. + +4. Deploy animl-api to prod. + +5. Turn off `IN_MAINTENANCE_MODE` in animl-frontend and animl-ingest, and deploy both to prod + +6. Copy any image that happened to land in `animl-images-parkinglot-prod` while the stacks were being deployed to `animl-images-ingestion-prod` diff --git a/ingest-zip/package.json b/ingest-zip/package.json index 624f499..3377e11 100644 --- a/ingest-zip/package.json +++ b/ingest-zip/package.json @@ -2,7 +2,7 @@ "name": "ingest-zip", "private": true, "type": "module", - "version": "1.0.0", + "version": "2.0.0", "description": "Unzip Batch Zips and explode them into a directory of single images on S3", "main": "index.js", "scripts": {