does anybody know if there's a docker bundling plu...
# general
f
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
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
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
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
the eternal problem, let me. tell you
f
haha
h
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
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
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
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
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
And you're building the image from a Dockerfile?
c
We are today, but that’s not a requirement.
m
@happy-kitchen-89482 This would be such an useful feature. Can I know the status of this feature?
h
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
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
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)