:bulb: Tip: If your CI environments (e.g., GitHub ...
# general
r
💡 Tip: If your CI environments (e.g., GitHub Actions) has updated
docker-compose
from v2.21.0 to v2.22.0/2.23.0, it may break your compose
up -d
commands with the error message "initializing git cache: /.cache/docker-compose/git" (note that it's on the root directory) executed inside a pytest fixture run by
pants test
, because now `docker-compose` requires `HOME` environment variable to be present. Since
pants
removes it by default, you need to update `pants.toml`:
[test].extra_env_vars = ["HOME"]
to make it working. FYI: docker-compose v2.22.0 was introduced in September 7th, and v2.23.0 was introduced in October 22nd to the
ubuntu-22.04
runner image.
👍 1
Currently the official docker apt repo for Ubuntu 22.04 provides
docker-compose-plugin
2.21.0 and you may experience that "it works on my local setup but breaks in the GitHub Actions".
You could reproduce the error by manually installing 2.23.0 by downloading it from the official website.
I think it might be better to pass
HOME
by default in
pants test
, though...
From my experience,
docker-compose
often breaks something when they do a minor update, and makes it difficult to keep up a hermetic CI setup (even we fix the runner image version to
ubuntu-22.04
or similar...)...
a
FWIW You could considering installing the standalone compose plugin explicitly to avoid the issue of accidental updates in your CI pipelines!
👍 1