Read versions from .tool-versions when building production image #464
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In order to minimize bugs and differences in behaviour between dev & prod, we want to be running the same runtime dependency versions (e.g. Erlang, Elixir, Node.js & PostgreSQL) in both environments.
In development, we are using https://asdf-vm.com/ to manage runtime dependencies. This means that with a single command -
asdf install
- everyone working with our codebase can have the same dependencies installed. Currently these are:We used to manually edit these versions in our CI/CD pipeline. Since we are using Dagger for CI/CD, this was no big deal since our pipeline is just code. But since it is code, we could go one step further. Our pipeline could read the
.tool-versions
file and use that information to build the container image that gets deployed to production. That's exactly what this change does.The only runtime dependency version that does not exist in
.tool-versions
is the OS - Ubuntu 22.04 in production. This is a reasonable limitation that we could improve as a follow-up. What I am thinking right now is that we should NOT depend on an OS for the production container image, and instead finish the migration to Elixir (Erlang) releases + one of those sweethttps://github.com/chainguard-images/images#chainguard-images, maybe https://github.com/chainguard-images/images/tree/main/images/glibc-dynamic . What we are really missing is an Elixir Chainguard image. One day...
Boy scout fixes:
go mod tidy
flyctl
version to latestyarn
,flyctl
&mage
viaasdf
mage
commands instead ofgo run main.go -w ..
asdf
on a fresh macOS 16.3 (arm64)asdf
on Debian 11TODO
CONTRIBUTING.md
by running on a fresh macOS.devcontainer/docker-compose.yml