https://pantsbuild.org/ logo
#general
Title
# general
f

flat-zoo-31952

06/12/2020, 6:01 PM
does anybody know if there's a docker bundling plugin for v2 yet? I'm struggling to search for it online, because "pants docker" keeps taking me to shopping results for khakis 😓
h

hundreds-father-404

06/12/2020, 6:03 PM
There is not, yet. @wonderful-iron-54019 started working on an internal plugin about two months ago, but I’m not sure how far that got.
It’s one of the more requested features. Cc @happy-kitchen-89482 for adding this to the roadmap
keeps taking me to shopping results for khakis 😓
😂 unfortunate naming
w

wonderful-iron-54019

06/12/2020, 6:06 PM
it worked great! unfortunately we're still on 1.26.0 in production so i hhaven't hardened it nor have i considered submitting it to the project itself, since i'd like to ensure no problems before i do
❤️ 1
only issue with it is that the. path for the docer executable is hardcoded right now where it really should be a CLI or
pants.ini
option
f

flat-zoo-31952

06/12/2020, 6:08 PM
okay, it's not a blocker for me, and as i understand the API better i'd be happy to contribute, but i'm just getting into this and i'm still learning + balancing this with my other responsibilities
w

wonderful-iron-54019

06/12/2020, 6:08 PM
the eternal problem, let me. tell you
f

flat-zoo-31952

06/12/2020, 6:08 PM
haha
h

hundreds-father-404

06/12/2020, 6:43 PM
Awesome! Did you end up continuing with the v2 engine implementation or rewrote with v1?
path for the docer executable is hardcoded right now where it really should be a CLI or pants.ini option
To do this, you would create a dedicated Subsystem like this https://github.com/pantsbuild/pants/blob/7268985491bb935c6c9845726ff91981211910fe/src/python/pants/source/source_root.py#L143-L160 Then, in your
rules()
entry point, add
SubsystemRule(DockerConfig)
(
from pants.engine.rules
). Then, in your
@rule
signature, include the parameter
docker_config: DockerConfig
. This will get you access to the subsystem, and you can access its values with something like
docker_config.options.docker_path
w

wonderful-iron-54019

06/12/2020, 6:43 PM
yeah we've got a v1 and a v2implementation right now
👍 1
we're eager to move entirely to v2 but we're handling it one upgrade at a time
❤️ 1
c

cuddly-window-48195

06/12/2020, 7:06 PM
It’s one of the more requested features. Cc @happy-kitchen-89482 for adding this to the roadmap
I would also be very interested in this!
I’m struggling to search for it online, because “pants docker” keeps taking me to shopping results for khakis 😓
I have been there. I will say that “pantsbuild” seems to be more fruitful.
👍 1
h

happy-kitchen-89482

06/12/2020, 7:20 PM
Yeah, bad naming theme collision there...
I am interested in what you'd like docker support to include - there are so many ways to go about it!
👍 1
c

cuddly-window-48195

06/12/2020, 7:26 PM
At the highest level, I don’t want to rebuild the image at all unless something has changed, and I want the image tag to only change when the fingerprint changes (I pass the full image URI to CloudFormation as a parameter, and it will try to redeploy the ECS service if that URI changes at all, and the redeploy can take upwards of 10 minutes pretty easily).
I don’t know that Pants necessarily needs to tag the image--I can probably do that myself if pants just exposes the fingerprint.
h

happy-kitchen-89482

06/13/2020, 1:54 AM
And you're building the image from a Dockerfile?
c

cuddly-window-48195

06/15/2020, 5:21 PM
We are today, but that’s not a requirement.
m

miniature-lamp-45970

08/19/2020, 5:32 PM
@happy-kitchen-89482 This would be such an useful feature. Can I know the status of this feature?
h

happy-kitchen-89482

08/21/2020, 1:10 PM
Hi @miniature-lamp-45970, we're still thinking about how to support Docker, it'll probably take a few weeks until we (the core team) can turn our attention to it. But we always welcome PRs from new contributors, and there are several interested parties, so that might move things along sooner.
m

miniature-lamp-45970

08/21/2020, 5:55 PM
Sounds Good @happy-kitchen-89482. Let me know, how the core team wants to proceed and I can contribute some free cycles. Really love pants and would love contributing to it!
h

hundreds-father-404

08/21/2020, 6:00 PM
That’s awesome to hear! And that’s before we’ve finished with the polish for 2.0 🙂 (e.g. fixing a major performance issue with startup time) Thanks for offering to help! That would indeed be really helpful. I think the first step would be thinking through what Docker support should look like. For example, what Docker commands/workflows are you wanting to support. It looks like https://github.com/pantsbuild/pants/issues/2648 has been open for a very very long time. It’d be great to add some thoughts on the scope there, and then we can ask other users what they think and scope out the next steps. (E.g. @wonderful-iron-54019 started working on an internal Docker target)