limited-art-78990
08/22/2024, 5:20 PMdocker_image(
name = "image-builder",
)
adhoc_tool(
name = "image",
runnable = ":image-builder",
args=["dostuff"],
output_directories=["results/"],
log_output=True,
)
archive(
name = "archive",
format = "zip",
files = [
":image",
]
)
Now running pants package :archive
results in
ProcessExecutionFailure: Process 'the `adhoc_tool` at :image' failed with exit code 1.
stdout:
stderr:
the input device is not a TTY
Which is probably because the runnable target of the docker_image
is trying to start an interactive shell 🤔. Is it possible to use a pants-created docker image to create an artefact? Using adhoc_tool like this? Or should this be solved in a different way? Thanks!limited-art-78990
08/22/2024, 5:24 PMdocker_environment(
name="image-builder-env",
platform="image-builder",
image="//:image-builder",
)
But the target reference is not recognised 🤔fast-nail-55400
08/22/2024, 5:42 PMdocker_environment
the image has to be available locally before the start of the Pants run.fast-nail-55400
08/22/2024, 5:43 PMlimited-art-78990
08/22/2024, 6:28 PMfast-nail-55400
08/22/2024, 6:30 PMdocker_environment
has its entrypoint overridden so Pants knows the container will not exit immediately since subsequent process invocations in the container are handled via docker exec
fast-nail-55400
08/22/2024, 6:31 PMlimited-art-78990
08/22/2024, 6:34 PMlimited-art-78990
08/22/2024, 6:39 PMfast-nail-55400
08/22/2024, 6:45 PMdocker_environment
logic is mostly in Rust and does not have the ability currently to call back into the Python rule code to allow for such setup logic.fast-nail-55400
08/22/2024, 6:47 PMcache_scope="session"
for shell_command
and adhoc_tool
fast-nail-55400
08/22/2024, 6:49 PMfast-nail-55400
08/22/2024, 6:49 PMfast-nail-55400
08/22/2024, 6:49 PMfast-nail-55400
08/22/2024, 6:50 PM