https://pantsbuild.org/ logo
w

wooden-thailand-8386

09/02/2020, 11:02 PM
hey there! I started testing pants 2.0.0a1 and I noticed that
python_app
is causing chaos and there isnt
bundle
as a goal anymore. 😞 Did it become something else or we won’t have support for that on v2.0?
h

hundreds-father-404

09/02/2020, 11:03 PM
Hey Thales. Yeah, for now
python_app
isn’t supported because we plan to redesign it in a better way. https://www.pantsbuild.org/v2.0/docs/how-to-upgrade-pants-2-0#python_app-and-the-bundle-goal-are-removed-130-vs-20 For now, the closest alternative would be running
binary
. Is this a blocker for you?
h

happy-kitchen-89482

09/02/2020, 11:29 PM
The distinction between
python_app
and
python_binary
, and between the
bundle
and
binary
goals, was unclear, and possibly unnecessary. You can now embed arbitrary files directly in the
.pex
file, using a
files()
target.
Do you need
python_app
and
bundle
? Or were you using it because it was idiomatic in v1?
h

hundreds-father-404

09/02/2020, 11:30 PM
You can now embed arbitrary files directly in the .pex file, using a files() target.
That would be the main difference. If the files are bundled directly in the
.pex
, vs. kept “loose” outside of the
.pex
w

wooden-thailand-8386

09/03/2020, 12:56 PM
I do need
python_app
and
bundle
. I’m putting my code inside the .pex file but the ML models are kept “loose” as Eric, mentioned. So when I run it I normally use flags to point to those “loose” folders/files.
I tried embedding it inside the
.pex
file but my
entrypoint
for the
.pex
is a ML
cli
tool that can’t really find the config files and models if it’s inside the
.pex
. It tries to find it where you’re running it from. That’s basically the main reason why we choose
pants
. The
python_app
and
bundle
were super straightforward for our use case.
I guess all I’d have to do is change my CI get the binary
.pex
and then all those “loose” files and put them together instead of that single
.tar.gz
for my Dockerfile.
h

hundreds-father-404

09/03/2020, 4:14 PM
Got it. Yeah, I agree we’ll want it back. The only reason we removed it was that the old mechanism was pretty complex, and hard to port from the v1 engine to the v2 engine. If we could redo it from the ground up, we would do it differently. We simply haven’t prioritized adding it back yet.
I guess all I’d have to do is change my CI get the binary .pex and then all those “loose” files and put them together instead of that single .tar.gz for my Dockerfile.
Okay. Does this work okay? If not, we can re-prioritize adding back
python_app
given the importance of it to your use case.
w

wooden-thailand-8386

09/03/2020, 5:58 PM
Well, if I can annoy you guys with prioritizing things I’d say go for the CA Cert thing not working on v2 lol. That one I have no way around it.
👍 1
h

hundreds-father-404

09/04/2020, 4:43 AM
Opened https://github.com/pantsbuild/pants/issues/10733 to track this. If you have any thoughts on what functionality you’d like, it’d be quite helpful to comment. For example, did you use any of the
rel_mapper
stuff?