So I use a platform, balena, to build cross platfo...
# general
p
So I use a platform, balena, to build cross platform container images for various edge devices. Pants and pex were choosen due to the cross architecture nature of pex files.. and that is pretty rad. What I'd like to do now: • Generate pex file • Shove pex file into a docker image • Push docker image to registry • inject... pants.hash? .. into a templated dockerfile to shove up to balena. Questions: 1. Can I get the image digest instead of the pants.hash..? It is unique per image. I'd like to: a. Build the docker image b. Push the docker image c. Inject the pushed docker image
repository@sha
into another dockerfile d. Upload that 2. String together
pants publish
with another command? I'd like to have an alias say
build-edge-image
that will: a. Build/Push pex docker images b. Template a dockerfile via adhoc_tool with info from a c. Pants run balena tool that points to the dockerfile in dist/codegen
c
there’s also the related https://www.pantsbuild.org/docs/reference-publish#output or perhaps this is the same data now..
p
Is it safe to assume that setting a dependency on the publish data… causes publish to run ? So like Adhoc tool( Dependencies… publish data … ) Kind of thing.
c
you need the dependency on the packageable target.. which should give you the package data. The publish data (from the
--output
option on the publish goal) is not known to pants rules/build graph.
p
Interesting. Then maybe this is where the pants.hash comes in to play? Where to do a build there are two commands required Pants publish Pants run tools/builder And somehow the de builder tool knows the image/repository:hash from the docker target?
c
I’ve fed the path to the json file from the publish
--output
as argument to the second phase tool in the past.. it ought to have all the details you need.
g
On ci we build a small pex that does the following: • pants list (with filtering) to figure out what needs publishing • pants publish with --output to a file • reads that file and pushes the resulting metadata to the other places
👍 1