Skip to content

Deploy FAQ

Christina Cortland edited this page Nov 10, 2023 · 16 revisions

Frequently Asked Questions for Deploying Dockerized QaServer

Architecture

  • 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.

Pre-process

QaServer app image

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.

General Deploy Process

FAQ for the production server

What is the URL for the production server?

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.

What image does the production server use?

Public Image: https://gallery.ecr.aws/u8a1v5x2/ld4p/qa_authority_lookup

How to do the initial deploy of the production server?

A set of CloudFormation templates is included in this repo specifically to build the infrastructure and do the initial deploy of the production server.

How to redeploy production with an updated ld4p/qa_authority_lookup image?

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


FAQ for the staging server

What is the URL for the staging server?

https://qa-server-service-stg.library.cornell.edu/

NOTE: Need to update sync-s3-stg github action if this URL changes.

What image does the staging server use?

Private Image: ecr/repositories/private/092831676293/ld4p/qa_authority_lookup-stg

How to redeploy staging with an updated ld4p/qa_authority_lookup-stg image?

When a new image is released, the staging instance can be redeployed with the redeploy-stg GitHub Action.


FAQ for the integration server

What is the URL for the integration server?

https://qa-server-service-int.library.cornell.edu/

NOTE: Need to update sync-s3-int github action if this URL changes.

What image does the integration server use?

Private Image: ecr/repositories/private/092831676293/ld4p/qa_authority_lookup-int

How to redeploy integration with an updated ld4p/qa_authority_lookup-int image?

When a new image is released, the integration instance can be redeployed with the redeploy-int GitHub Action.

How to redeploy the integration server when it isn't running?

  • 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

Check status of deploy in AWS

  • 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.

How to find the values of ENV variables?

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.