buttonmen-dev / buttonmen

Buttonmen - an online dice game
Other
16 stars 23 forks source link

migrate away from vagrant to deploy buttonmen #2908

Open cgolubi1 opened 1 year ago

cgolubi1 commented 1 year ago

We're using vagrant to manage prod/staging/dev/replay buttonmen sites on EC2 instances (we use docker-based circleci to run regression tests). This has served us okay so far, but, since we committed to the vagrant+instance path, docker+container has kind of become the done thing. There are a couple of specific reasons we might want to migrate:

This issue is to make and implement a plan for migrating site installs from vagrant+EC2 to docker+ECS.

Problems that need to be addressed (this list is incomplete):

cgolubi1 commented 1 year ago

I've been thinking about this for awhile, but it has possibly become an emergency thing, because a set of forced upgrades and other misadventures has led to my not currently having a working vagrant install. I'm experimenting with other ways to get vagrant up and running, because that's obviously the shorter-term patch, but it's tempting to not waste a crisis, and just move over to where i wish we were.

cgolubi1 commented 1 year ago

In theory (in theory, theory and practice are the same), CircleCI tells us that fundamentally we can build the site, including a local DB for sites that use that, and run the code, using a dockerfile. So for dev and replay sites, all we should need is:

  1. A dockerfile with the rest of the stuff that deploy/vagrant in the codebase currently does for us (apache configuration, postfix, cron jobs, cloudwatch metrics, mostly, i think)
  2. A straightforward rig for running docker and pushing the results to ECR
  3. An ECS task definition to launch that container image

Staging and prod have some extra config to talk to RDS (which can presumably be dockerized trivially as well), and use elastic IPs (which i'm not sure we can attach to containers directly, so we might have to stick them behind load balancers).

But all of that strikes me as basically doable.

cgolubi1 commented 3 months ago

Okay, so: as far as i know, we've resolved the hard blockers for prod/staging. The only way to find out for sure is to try this out on staging. So i'm going to work towards that now --- i'll cut a new issue for deploying and testing that change.

cgolubi1 commented 2 months ago

Okay, so i went down quite a rathole on this cron error thing.

Here's the situation:

So my recommendation is that we make that small fix so that syslog rotation will do what we expect it to, and that we be aware of the lack of access to /proc and corresponding failure of init scripts to behave how we'd expect on stop, but don't do anything about it because we don't actually have a use case for needing those things.

cgolubi1 commented 2 months ago

Okay, i have a branch pushed which makes that change [1], and i'll monitor it for a few days until it rotates the logs, and assuming it does the right thing, i'll put up a PR.

[1] https://2908-install-systemd.cgolubi1.dev.buttonweavers.com/ui/ if you need it, but you don't, because i didn't make any changes impacting the website --- and, yes, the branch is somewhat misnamed, we're not actually doing anything with systemd. I'm planning to not lose sleep over it.

cgolubi1 commented 1 month ago

I'm not 100% confident in my validation of the log rotation solution, but:

So i'm going to call that good enough and PR my solution.