-
Notifications
You must be signed in to change notification settings - Fork 1
Deploy FAQ
- Services
- MariaDB - runs the latest MariaDB image
- QaServer app
- prod - runs ECR public image named ld4p/qa_authority_lookup:latest
- stg - runs ECR private image named ld4p/qa_authority_lookup-stg
- int - runs ECR private image named ld4p/qa_authority_lookup-int
- Machines
- MariaDB and app run on the same physical machine in separate docker containers
- There are two machines behind the load balancer for the purposes of bringing up a new instance and swapping which machine is live. This happens during deploy.
ld4p/qa_server_container is the source for the QaServer app image. The repo includes special files related to docker.
- Dockerfile - controls the build of the image
- docker-compose.yml - used to do a localhost deployment. This is not used anywhere but on the localhost machine.
- scripts
- bin/docker-entrypoint.sh - called from Dockerfile after all other processing is complete
- bin/db-wait.sh - waits for database to fully load
- bin/db-prepare.sh - runs db:migrate once database is running
The built image is pushed to ECR.
This is a link to the production server in progress. It will have a different URL once all setup is complete.
https://qa-server-service.library.cornell.edu/
NOTE: Need to update sync-s3-prod github action if this URL changes.
Public Image: https://gallery.ecr.aws/u8a1v5x2/ld4p/qa_authority_lookup
A set of CloudFormation templates is included in this repo specifically to build the infrastructure and do the initial deploy of the production server.
When a new image is released, the production instance can be redeployed with the redeploy-prod GitHub Action, which uses an AWS CLI command:
aws ecs update-service --cluster <name of your cluster> --service <name of your service> --force-new-deployment
https://qa-server-service-stg.library.cornell.edu/
NOTE: Need to update sync-s3-stg github action if this URL changes.
Private Image: ecr/repositories/private/092831676293/ld4p/qa_authority_lookup-stg
When a new image is released, the staging instance can be redeployed with the redeploy-stg GitHub Action.
https://qa-server-service-int.library.cornell.edu/
NOTE: Need to update sync-s3-int github action if this URL changes.
Private Image: ecr/repositories/private/092831676293/ld4p/qa_authority_lookup-int
When a new image is released, the integration instance can be redeployed with the redeploy-int GitHub Action.
- Navigate to: cul-it/qa_server_aws_deploy -> Actions -> redeploy-int
- At top of workflow runs table, click drop list: Run workflow
- Almost always, leave selected: Branch: dev (but can select another branch for deploy when debugging)
- Run workflow
- Navigate to: AWS -> ECS -> Clusters ->
- Click cluster name: lookup-int-deploy-cluster
- Click tab: Tasks
- Click first Task's ID in Task column
- Click tab: Logs
- Click select a container drop list and choose: qa_server_app
- scroll down through log messages
Note: You don't see all lines on the current log page. Need to scroll down before going to next page.
There are two types of ENV variables (e.g. S3 bucket name), deployment and application.
For ENV variables used in the deployment process, they are located at...
- Navigate to AWS -> Services -> CloudFormation
- search for qa-server-prerequisites
- click tab: Parameters
For ENV variables used by the application (e.g. PREFERRED_TIME_ZONE_NAME
), they are defined in the *.env
file in the -int S3 bucket.