Skip to content

Deployment Checklist

Deployments

To successfully deploy this code to production, you will first need to have docker desktop installed. You will also need our AWS Credentials, or you can create your own credentials depending on where you would like to deploy code modifications. We leverage a variety of different AWS services, including AWS S3 for frontend storage, AWS Cloudfront for invalidating distributions, AWS Route53 for domain linkage, and AWS ECR for EC2 instances with GPUs, amongst other services that you might need to pre-configure. From there, you can use the following commands:

Frontend Deployment Command

$ REACT_APP_API_ENDPOINT=https://api.anote.ai npm run build && for file in ./build/static/js/*.js; do uglifyjs "$file" --compress --mangle -o "$file"; done && aws s3 sync build/ s3://YOUR_S3_BUCKET_NAME --acl public-read

Documentation Deployment Command

$ mkdocs build
$ aws s3 sync site/ s3://YOUR_S3_BUCKET_NAME  --acl public-read

Backend Deployment Command

$ docker build -t YOUR_BACKEND_NAME . --platform linux/amd64
$ docker run -p 5000:5000 YOUR_BACKEND_NAME (To test that it works.  With the server running, you can manually test on the react frontend)
$ docker tag YOUR_BACKEND_NAME:latest ACCOUNT_NUMBER.dkr.ecr.us-east-1.amazonaws.com/YOUR_BACKEND_NAME:latest
$ docker push ACCOUNT_NUMBER.dkr.ecr.us-east-1.amazonaws.com/YOUR_BACKEND_NAME:latest

If you’re not logged into AWS, the push may fail and you would have to run:

$ aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin ACCOUNT_NUMBER.dkr.ecr.us-east-1.amazonaws.com

Now your docker build with all the new server code will be saved as an “image” to ECR. We want to take an instance of this image (a container) and deploy it to Elastic Beanstalk. We need to

$ cd server/aws_deploy

Because this contains the Dockerrun.aws.json file that references our ECR docker image. Then we can run:

$ aws credentials
$ eb init
$ eb deploy

PyPi Package Deployment for SDK

You can run the following commands to deploy an SDK:

$ python setup.py sdist bdist_wheel
$ twine upload dist/*

You will need access to our pypi package token. To test this in prod, you can install the upgraded version of the pypi package:

$ pip install -U anoteai

Then you can create an API key on https://dashboard.anote.ai/, and test out the updated pypi package calls.