CI CD - adelinaenache/MenuMaker GitHub Wiki

MenuMaker Infrastructure

The MenuMaker backend server is hosted on AWS (Account: 608961235058) in the eu-north-1 region, utilizing ECS with Fargate for container orchestration.

API Endpoints

ECS Clusters

Each environment (staging and production) is managed in a separate ECS cluster:

Container Registry

The backend application is built into a Docker container and pushed to AWS Elastic Container Registry (ECR). While local pushes are possible, they are not recommended.

Task Definitions

Each service has a corresponding task definition where environment variables, container mappings, and registry details are configured:

The task configurations are also in the .aws service.

Environment Variables

Environment variables are stored and managed in AWS Secrets Manager as key-value pairs. When adding a new secret, ensure it is referenced in the task definition for the respective environment.

Logging

Logs are available in CloudWatch and can also be accessed through the ECS Service Logs tab.

Services

ECS services manage the scaling of backend containers. Currently, each service is configured to maintain one running task, with the ability to scale based on traffic in the future. To deploy the latest version of the backend, update the service with the latest task definition revision.

Load Balancer

An Application Load Balancer (ALB) is used to route traffic to the backend containers, which have dynamic IPs. The ALB also performs health checks on the /health API endpoint.

Frontend

The frontend is deployed on Vercel.

CI/CD

Frontend

The frontend is updated every time a push is made on master. The deployments can be seen here, on Vercel: https://vercel.com/enacheadelina99s-projects/menu-maker-h5d5/deployments

Environment Variables and Secrets Management

Environment variables and secrets are configured and managed within the Settings > Actions section for each environment.

Authentication

Authentication is handled using an AWS OIDC (OpenID Connect) provider linked to our GitHub account, ensuring secure access to AWS resources.

Branch Deployment Strategy

  • The main branch is configured to deploy the backend to the is-production environment.
  • The dev branch is configured to deploy the backend to the is-staging environment.

Deployments

The deployment process follows these steps using github actions:

  1. Build: Docker images are built and pushed to AWS ECR Public
  2. Task Definition: The ECS task definition is updated with the new image
  3. Deployment: The updated task definition is deployed to the ECS cluster
  4. Validation: The service stability is monitored automatically

The backend deployments can be seen here.