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

Replace Chef with ECS Deployment #8314

Merged
merged 82 commits into from
Feb 7, 2024

Conversation

FinnIckler
Copy link
Member

@FinnIckler FinnIckler commented Sep 15, 2023

After testing the docker-compose landscape, we have decided it makes more sense to go straight to ECS, as updating the images by ourselves is much more of a hassle
TODO:

  • Create the correct infra files for our ECS setup
  • test on staging
  • make a PR to this rep which builds images and triggers a deploy
  • Create New Load Balancer and reference it for the services
  • Create a mixed instance fleet to better support prod on a bigger instance

@FinnIckler FinnIckler force-pushed the replace-chef-with-docker branch from 93a00c2 to 2430db3 Compare September 19, 2023 09:01
@FinnIckler FinnIckler changed the title Replace Chef with Docker Compose Replace Chef with ECS Deployment Sep 19, 2023
@FinnIckler
Copy link
Member Author

FinnIckler commented Sep 20, 2023

So a staging server does come up successfully with Sidekiq and PMA. There is still one issue with a webpacker dependency when building assets though:
Error [ERR_REQUIRE_ESM]: require() of ES Module /app/node_modules/find-cache-dir/node_modules/pkg-dir/index.js from /app/node_modules/find-cache-dir/index.js not supported.
That sounds like a dependency update gone wrong.
I will take some time tomorrow evening to investigate so we can get everything done by friday.

@FinnIckler
Copy link
Member Author

Successfully deployed a staging container now. Because we compile assets on the container (due to many blockers) we have quite a bad startup time and I had to increase grace periods on both the load balancer and the ECS Container side. This will make scaling a bit more annoying, but should be manageable because we are planning to make our own scaling metrics anyway
Screenshot 2023-09-22 at 16 36 50

@FinnIckler
Copy link
Member Author

FinnIckler commented Sep 25, 2023

Here is an explanation of my proposed way of building and deploying images that I implemented in this (and #8338) PR:
thewca/web-dev-docs#9
might be easier to review with that information. I can also write up some more technical diagrams showing each container and services if needed.

Copy link
Member

@gregorbg gregorbg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason why you paste the bucket into a variable before accessing it?
All use-cases in your most recent commit can be boiled down to regulations_bucket.object(...) directly

@FinnIckler
Copy link
Member Author

I did it because using @@s3 means we don't need to instantiate the bucket every time. I think I have a neater solution though

@gregorbg
Copy link
Member

gregorbg commented Feb 5, 2024

I did it because using @@s3 means we don't need to instantiate the bucket every time. I think I have a neater solution though

Sorry to say but your most recent commit changes absolutely nothing. Passing the parameter as a default argument simply means Rails will call it for you every time that a parameter hasn't been supplied otherwise.

@gregorbg
Copy link
Member

gregorbg commented Feb 5, 2024

Ah, now things are getting more interesting 😎

@FinnIckler FinnIckler force-pushed the replace-chef-with-docker branch from 70bcc9e to 4b7c832 Compare February 7, 2024 09:46
WcaOnRails/.gitignore Show resolved Hide resolved
WcaOnRails/app_secrets.rb Show resolved Hide resolved
WcaOnRails/config/unicorn.rb Outdated Show resolved Hide resolved
docker/apache-pma.conf Outdated Show resolved Hide resolved
@FinnIckler FinnIckler force-pushed the replace-chef-with-docker branch from 826e982 to 7eb8199 Compare February 7, 2024 11:45
@gregorbg gregorbg merged commit c0fb355 into thewca:master Feb 7, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants