Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the ability to publish docker images non-interactively. #21880

Open
wants to merge 22 commits into
base: main
Choose a base branch
from

Conversation

trhodeos
Copy link
Contributor

Fixes #17613

@trhodeos trhodeos marked this pull request as ready for review January 28, 2025 22:05
@cburroughs cburroughs self-requested a review January 28, 2025 22:06
@trhodeos trhodeos force-pushed the tr.backgroundPublish branch from e4ef999 to 15b0f80 Compare January 28, 2025 22:19
@trhodeos trhodeos closed this Jan 29, 2025
@trhodeos trhodeos reopened this Jan 29, 2025
@trhodeos
Copy link
Contributor Author

Not sure why/how I closed this... Reopening.

@huonw
Copy link
Contributor

huonw commented Feb 6, 2025

Thanks for contributing, and thanks for waiting for a review.

We've just branched for 2.25, so merging this pull request now will come out in 2.26, please move the release notes updates to docs/notes/2.26.x.md. Thank you!

@cburroughs
Copy link
Contributor

cburroughs commented Feb 13, 2025

Pulling in some comments from chat:

I was able to sustain 1 Gbps for several minutes of pushing, I have this spiffy workunit trace:
image

So I'm feeling pretty good that the pushing really is working in parallel, yeah! 🚀

Same way to still print the lines:

a492eee5e559: Layer already exists 
7576b00d9bb1: Layer already exists 
2260218218a7: Already exists 
3fd67c6ea721: Layer already exists 
be92f6592e6d: Layer already exists 
dcaa1b9153e7: Layer already exists 
32b550be6cb6: Layer already exists 
2d2bff40c204: Layer already exists 
8630e3071c88: Layer already exists 
6cb66cb5f02b: Layer already exists 
35af2a7690f2: Layer already exists 

And nit, move the release note to the 2.26.x file.

@cburroughs
Copy link
Contributor

oh and you probably saw this, but src/python/pants/core/goals/publish_test.py is failing in the latest commit.

Thanks for flying this to the finish line!

@trhodeos trhodeos force-pushed the tr.backgroundPublish branch from f6bbfc0 to b677a23 Compare February 14, 2025 18:35
@trhodeos
Copy link
Contributor Author

Ok, tests and docs are updated / fixed

@cburroughs cburroughs requested a review from benjyw February 19, 2025 20:33
@cburroughs
Copy link
Contributor

@benjyw So @trhodeos (whom I worked work -- good luck!) is unlikely to be able to push this forward farther and I'm trying to get it over the line. I've played with it locally, am satisfied that it seems to works, and would happy to merge it and run with it. But I don't have a good sense of the deeper Process fundamentals at play. Would you like to take a look?

@benjyw
Copy link
Contributor

benjyw commented Feb 20, 2025

Sure, happy to take a look. Can you resolve the conflicts and get a CI going?

Copy link
Contributor

@benjyw benjyw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall! One substantial design question:

@@ -231,6 +233,24 @@ def env_vars(self) -> tuple[str, ...]:
"""
),
)
publish_noninteractively = BoolOption(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why these options are only available on the docker subsystem? Seems like they could apply for any publish implementation? Docker is the only one that currently uses them in a non-vacuous way, but if that changed I don't think we'd want to add clones of these options in every relevant backend.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My original thought was to have them be per-backend so it'd be clearer where they were supported. Thinking about it now, adding it to the goal and having docs outline which backends support it may make more sense!

Another thought: in a world where many backends support this, not sure if users would want some publish processes (like docker) to be non-interactive while others (say, twine) to be interactive. I have a feeling this'd be "no", but having per-backend options would enable this.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure if users would want

Yeah I still have a lot of uncertainty here. Like having docker use this because docker images are big and something else that involves GPG signing not do this something seems reasonable.

I'm not sure what the simplest future proof choice is, or if there is a way to express "non-interactive-able" in a way that doesn't dupe the same options across future subsystems.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess there are two categories of option here. The ones I was thinking should be global (i.e., on PublishSubsystem) are background_process_output and publish_noninteractively_verbose. Since if any publish is noninteractive then these options apply, and for any interactive publish they are vacuous.

The question remains whether publish_noninteractively itself could similarly be global. It could if we interpret it as "if a publish can be non-interactive then do that, otherwise publish interactively as usual".

Thoughts?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I like that more and it does avoid some awkward pass thru dancing. (Done in the latest commit.)

background_process_output is now in the PublishSubsystem (and publish_noninteractively_verbose is correctly deleted all thew way, background_process_output was intended as ac complete replacement.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow the publish goal for Docker images to push images in parallel
4 participants