Skip to content

Add retry option to container_push rule #1989

@jumbosushi

Description

@jumbosushi

🚀 feature request

Relevant Rules

container_push in contrib/push-all.bzl

Description

It would be great if container_push rule supports a retry option. (this is an idea briefly explored in #673). We recently ran into a transient networking issue which was resolved by retrying manually:

# note: gcr info is deducted
2021/12/19 19:16:45 Unable to publish images: unable to push image gcr.io/xyz:abc: Head "https://gcr.io/v2/xyz/blobs/sha256:abc": read tcp 10.248.250.64:53422->142.250.148.82:443: read: connection reset by peer

Describe the solution you'd like

  • Add a new retry attribute to container_push rule like the following.
container_push = rule(
    attrs = {
        ...
        "retry": attr.bool(
            default = False,
            doc = "If true, retry push images on transient errors.",
        ),
    }
    ...
)
  • Update container/go/cmd/pusher/pusher.go to support --retry boolean flag to enable retry logic

Describe alternatives you've considered

We could add a retry logic to our bazel run invocations as a workaround, but we run it at various places within our CI system :/


I would be interested in working on the implementation! Let me know if the feature would be useful

Metadata

Metadata

Assignees

No one assigned

    Labels

    Can Close?Will close in 30 days unless there is a comment indicating why not

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions