Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

trial/dan-1292-create-infra-scripts-to-automate-the-deployment-onto-ecs #3724

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

trial-danswer
Copy link
Collaborator

@trial-danswer trial-danswer commented Jan 20, 2025

Description

  • Adds cloudformation templates, parameter json files, deploy script, uninstall script, parameterized postgres pg_hba.conf file, and added env variables to the run_nginx.sh script.
  • The deploy script is idempotent in that it checks if the stack already exists then moves onto deploying the next stack in the array.
  • This deploys a lambda function that is scheduled to restart the ECS Services on a nightly basis. Furthermore, it can be invoked directly via the command line...and the scheduling can be disabled. This will streamline the process of ensuring that onyx apps are up-to-date.

How Has This Been Tested?

Steps

  • Ensure to update the parameter.json files as needed, the defaults work with the trial AWS account. VpcID and SubnetIDs are unique to AWS account.
  • The deploy.sh script requires installed envsubst or directly updating pg_hba.conf to replace the value ${ECS_FARGATE_VPC_CIDR} with the AWS account VPC CIDR IPv4 value.
  • Run the deploy script all the way through to confirm that it works . I used the following command./deploy 172.31.0.0/16.

Backporting (check the box to trigger backport action)

Note: You have to check that the action passes, otherwise resolve the conflicts manually and tag the patches.

  • This PR should be backported (make sure to check that the backport attempt succeeds)
  • [Optional] Override Linear Check

@trial-danswer trial-danswer requested a review from Weves January 20, 2025 20:25
Copy link

vercel bot commented Jan 20, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
internal-search ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 21, 2025 10:08pm

@trial-danswer trial-danswer changed the title Infra and Deployment for ECS Fargate trial/dan-1292-create-infra-scripts-to-automate-the-deployment-onto-ecs Jan 20, 2025
jpb80 added 2 commits January 21, 2025 13:38
…edCount. Add Autoscaling policies for services that can benefit from horizontal scaling, scale up/down based on CPU utilization and Memory.
…d at it, Thus it is not required to have the server 443 block for the app.conf.template.use-cloudtls. A separate template is used so not to break the deployments that use certbot + letsencrypt.
@trial-danswer
Copy link
Collaborator Author

I've updated the PR with changes to include horizontal auto-scaling of tasks based on cpu and memory for api-backend, background, model-servers, and web-server. Additionally, I've updated the templates to accept parameters for task memory, cpu, and desired count. Lastly, I set the default memory & cpu for tasks based on approx values from the Kubernetes helm-charts. The ECS Fargate mem/cpu values are based on the following table: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-cpu-memory-error.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants