I'm trying to configure pants remote execution to ...
# general
s
I'm trying to configure pants remote execution to be able to build a docker image using buildbarn running on kubernetes. For this configuration I am using a dind sidecar. When runner docker in the runner everything is working as expected although when I submit a pants job its not finding the docker daemon. I think this is because pants isn't respecting the DOCKER_HOST environment variable on the remote executor, can any confirm whether this is the case or not. And if there is a way to set the environment variables used for remote execution when running pants?
For a little more information this approach worked successfully when I was mounting the nodes docker socket to the runner. But this is not a secure practice since the containers would then have access to all the pods running on the node.
For others running into the issue the solution was found here: https://www.pantsbuild.org/docs/docker#docker-configuration adding env_vars = ['DOCKER_HOST'] and passing DOCKER_HOST worked. Although it seems that pants should respect the environment variables of the remote environment
h
Ah glad you were able to get this working. I believe this is an instance of https://github.com/pantsbuild/pants/issues/7735, if you wanted to add a comment mentioning your use case
s
Thanks for pointing me to that @hundreds-father-404! I went ahead and added a comment that outlines my use case.
❤️ 1
e
I commented on the ticket, but unless I understand you wrong @stocky-raincoat-64723 there is no way to do what you want due to the structure of the reapi that BuildBarn, BuildFarm, etc ... all implement.
Essentially, letting the remote environment leak into the remote process, if available as an option at all, will be via an option of the reapi implementation. I.E.: Maybe BuildBarn or one of the others allows configuring this.
As a client of the reapi, Pants can't help though, unfortunately.
👍 1
s
@enough-analyst-54434 Thanks! That makes sense!