What's the best way to ensure that the version of ...
# best-practices
t
What's the best way to ensure that the version of meltano installed in all environments is the same? Use
pip install meltano=x.y.z
rather than
meltano upgrade
? And then followed by
meltano upgrade database
(and maybe
meltano upgrade files
)?
s
I think https://meltano.slack.com/archives/C01UTUSP34M/p1668662919551819 covers your question quite well. The short answer: almost everyone recommends a dockerized approach, and some (@aaronsteers & me) recommend devcontainers ;) That way, if someone triggers a rebuild of the container that needs a database upgrade (if you keep the same db) he is also responsible for taking care of that. Because you don't just want your meltano version fixed, you want everything fixed, the underlying OS, Python,...
m
We do as I think @Sven Balnojan suggests: • Docker containers hosted in our own GCP artifact/container registry • Developers run a script (run-meltano-docker.sh) to start the container: ◦ Latest version of the meltano artifact docker image is pulled ◦ with mounted GCP credentials ◦ git repo with meltano files mounted at /usr/app/, so that dev can keep working in VSCode on their machine, and run tests using docker ▪︎ (static meltano files are stored for reference in /usr/local/meltano-image-static) ◦ some environment variables • And also, in Dockerfile-meltano ◦ We always use explicit versions, ie., so that we do not accidentally run into a new version which might break things ▪︎ FROM meltano/meltano:*v2.17*-python3.9 This way, we ensure that we all use the exact same version and execution environment, and upgrades are central and pushed to our artifact registry so that all devs easily get the new version. Works like a charm 😛 This very same architecture is used for dbt and terraform/terragrunt.
t
Thanks all. Docker isn't an option so I think the answer for us is going to be different Python venvs with specific meltano versions installed followed by running
meltano upgrade database
🤔