Hey Mattias,
Looking at the scripts you mention below, my high-level understanding is that they setup the rails environment (paths, the name of the db to use...), installs ruby gems, compiles js and css to versioned files (the ones with a hash in the url that allow infinite caching), the second one migrates the db schema ot the new format when there are changes.
I would love to know about the rationale to encapsulate everything in containers.
My reasoning for our site has
been roughly the following:
We (madada.fr) use ansible to deploy alaveteli, and almost everything runs on the same single machine. We have a couple of extra services in containers (eg. metabase, which is available as a container image or JAR) but the standard alaveteli components are not.
I have thought about moving to
containers and eventually stopped, after containerizing a
variety of other services, which generally made me sad :)
Containers add a layer of complexity, you need to build each image, then get them to work together ("orchestrate them") via docker compose, swarm or kubernetes or something else.
They also increase hardware requirements because of CPU/RAM overhead linked to the container management process.
Ultimately, containers are paving the way towards high availability, no downtime deployments, "infinite" scalability, etc...: you rent a bunch of servers, add them all to a cluster, throw all your containers in there, and the container orchestrator replaces the dead ones, upgrades them to the new version without users noticing, etc...
The thing is, our site does not
need all this: our site is small, we will "never" reach a size
where we cannot find a server powerful enough to run the entire
service, and if we run into that problem, I will just move the
database to a separate machine, and be fine for a while. We also
have a natural maintenance window every night and weekend, where
traffic is very low (usually only crawlers between 2-6am), so we
can afford to stop the server for a few minutes without anyone
complaining. Over the past 3 months, we've had 99.96%
availability on madada.fr. None of the container based services
I run are doing as well (but I also don't pay for a hosted
container orchestrator like k8s which costs a small fortune).
In practice, I do our regular deployments during the day, nobody notices. I upgrade alaveteli versions on weekends, just in case something breaks.
My biggest problem for a while was the development environment which never exactly matches production. Containers are supposed to help with that, but in my experience, they just make everything tedious and replace one type of problem with another. My dev env is in a virtual machine now (yes, old fashioned!).
My current annoyance is how long
the deployment takes (10-15minutes), but since it happens in the
background, it's very minor. And the fact that ansible can break
halfway through an upgrade, but that usually gets fixed on the
staging server, so it doesn't affect production.
In summary, I decided against
containers because they imply a lot of extra work that produces
only limited benefits for our use case.
If I were starting from scratch now, I would probably use nix instead of ansible.
Laurent
--
You received this message because you are subscribed to the Google Groups "Alaveteli Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to alaveteli-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/alaveteli-dev/CAEJghOq9cjfRE%3DXXW%2Bf7_8wgKUMS74ZprTFxoREgotyGg45mUg%40mail.gmail.com.
--