Hi! I'm trying to write a plugin, which runs a Doc...
# plugins
f
Hi! I'm trying to write a plugin, which runs a Docker container. The container is supposed to build Python Wheels and I would like to mount a host directory into the container. Docker requires the mounts to be specified as absolute paths, though. Is there a way to retrieve the absolute Path of the current working directory (i.e. /tmp/processExecution…)?
w
you can request the
BuildRoot
type, and then relativize to that
i assume that this is in a
@rule
…?
f
Exactly, I'm in a rule. I do request
BuildRoot
and work with that at the moment. It feels a bit like I'm sidestepping the sandbox, though. I just thought there might be a nicer way, but I'll just stick with BuildRoot : ) Thanks @witty-crayon-22786!
w
@full-policeman-85126: you are sidestepping the sandbox, for sure.
are you launching
docker
using
Process
…?
f
Yes
w
if so, the right way to ensure that
docker
reruns as things change would be to capture a
Digest
of the inputs to
docker
, and include those in the arguments to the
Process
giving
docker
direct access to files in the buildroot will break caching.
f
Good point! I didn't think of that. The basic idea was to build wheels for PEXes when there is a
platform
option specified in
pex_binary
. The plan is to inject them as dependencies to the PEX target. I think I already have most of it in place, but I was curious about the Docker volume mounts.