Restart dead and exited `docker_environment` containers
Building on my previous PR, here's one to restart dead and exited containers in addition to missing ones.
This also applies a label to Pants-created environments containers org.pantsbuild.environment: <environment name> and will remove any pre-existing dead containers with said label upon initialization, so they still get cleaned up if you have a bad pantsd exit at some point. If there's a way we can source this information, we could even apply a second label to denote the ID of the pantsd invocation that created the container and remove any containers created by old invocations, regardless of their status. As far as I know, the only limitation to doing this now would be running multiple pants invocations concurrently.
Closes #18307
Maybe also cl0ses #20153 and partially cl0ses #21328
Tagging @huonw directly, since you reviewed my previous PR.
cl0ses
hah, nice trick 😂
@huonw I updated the unit tests and release notes and have the docker tests down to 26.40. Is that an acceptable figure or should I try going lower still? Also, one of the CI checks failed with what I'm pretty sure is an intermittent failure but I don't have perms to rerun.
Also, one of the CI checks failed with what I'm pretty sure is an intermittent failure but I don't have perms to rerun.
I've hit the auto-merge button and kicked off a new run.
Tagging @huonw again
Thanks for the contribution (and thanks for waiting). We've just branched for 2.28, so merging this pull request now will come out in 2.29, please move the release notes updates to docs/notes/2.29.x.md if that's appropriate.
@huonw @tdyas Can one of you rerun the failed workflow? I think the node it was running on must've been pre-empted or something.
@huonw @tdyas Can one of you rerun the failed workflow? I think the node it was running on must've been pre-empted or something.
I'll restart it once the remaining jobs complete (or not) so any potential successes are not undone.
Landed the PR.
@ndellosa95: Thanks again for the contribution!
Thanks for the contribution @ndellosa95, and @tdyas for shepherding it through the final steps.