https://pantsbuild.org/ logo
l

lively-king-98806

07/28/2022, 3:12 PM
Hello all.I have a question regarding
python_test(s)
. The docs state that
runtime_package_dependencies
puts the packaged resources into chroot. If the
runtime_package_dependencies
is a
docker_image
, is there a way to get the image name/tag that was created?
b

bitter-ability-32190

07/28/2022, 3:13 PM
I dont' think so šŸ¤” It should build the image before executing the tests, but I'm not sure if there's a way to deduce the image name/tag or anything in the sandbox
@curved-television-6568 I've mused about all packagables putting something in the sandbox (another way of saying that every Packageable needs an
output_path
field). If I'm not thinking too crazily this would allow us to dump a file either named after the image tag, or containing the image tag.
šŸ‘€ 1
l

lively-king-98806

07/28/2022, 3:14 PM
Yeah it does get built as expected. I’m currently just forcing
latest
and hard coding the name/tag as en environment variable Yeah it does get built as expected. I’m currently using
b

bitter-ability-32190

07/28/2022, 3:15 PM
Very interesting use case šŸ™‚ Love it
😁 2
l

lively-king-98806

07/28/2022, 3:25 PM
Yeah that sounds like a good solution šŸ™‚ It would be interesting to be able to directly reference output properties of a target either directly or with a helper or interpolation - not sure how that fits in with the general pants world though. Something like:
Copy code
extra_env_vars = [
    # Helper func 
    "IMAGE_NAME=" + output(":docker", "sha"),
    #or interpolation
    "IMAGE_NAME={:docker.sha}"
]
h

happy-kitchen-89482

07/28/2022, 4:45 PM
@lively-king-98806 could you open a ticket at https://github.com/pantsbuild/pants/issues with as much detail as you think is useful? Thanks!
āœ… 1
6 Views