I noticed that a bunch of our docker backend tests...
# development
h
I noticed that a bunch of our docker backend tests failed with
Copy code
E       pants.engine.process.ProcessExecutionFailure: Process 'Building docker image base:latest' failed with exit code 1.
E       stdout:
E       
E       stderr:
E       ERROR: use `docker --context=default buildx` to switch to context "default"
because my docker client was not set to the right context.
docker context use default
set it right.
I guess this has to be this way, since we can't know which contexts are available?
Or rather, which one we should choose
But it's a little uneasy
c
This is locally on a mac? Internally, this trips up our mac users all the time, but I have not seen it on Linux.
h
Yeah, locally on a mac
What are those users try to do when being tripped up?
running your own docker-using tests in Pants?
c
Most commonly python tests that depend on docker images
h
Hmmm
@curved-television-6568 is this something we should be handling in Pants? I don't know how we'd decide what to set the context to, and it can change from system to system I suppose
c
we would need to support listing available contexts, then pick the one that has the right features--the features being specified in pants config.
h
Ooof
f
I’ve been adding
"DOCKER_CONTEXT=default"
to all our pants.toml files in the docker backend configuration. Maybe that env var could by set, by pants by default
h
We don't know that "default" is the right context though, even if it usually will be
f
correct, its just awkward that pants hard fails instead of using the default, by ugh, default.
h
True, maybe we can set the context in config
that would require everyone in the org to have a context with the same name
but that doesn't seem too onerous
especially when that name is
default
...
c
The
default
context may be special if that helps:
Copy code
$ docker context rm default
default: context "default" cannot be removed