Skip to content

Don't use skopeo inspect for canonical (digested) pull specs#51

Merged
cgwalters merged 1 commit intoopenshift:masterfrom
cgwalters:no-inspect-fully-qualified
Apr 25, 2019
Merged

Don't use skopeo inspect for canonical (digested) pull specs#51
cgwalters merged 1 commit intoopenshift:masterfrom
cgwalters:no-inspect-fully-qualified

Conversation

@cgwalters
Copy link
Copy Markdown
Member

skopeo inspect hits the /tags API which can be expensive
for registries to compute. Quay.io recently changed how
they do rate limiting, and we started hitting this in OpenShift CI
jobs.

Since the machine-config-operator always provides canonical/digested
pull specs, the non-digested support is just for local developer
convenience.

And anyways, what we really should do is pull the image unconditionally
and then inspect it afterwards, we don't need all of the tag info.

Basically this PR ends up in a place where the non-canonical
path only loses out on the optimization of avoiding pulling the
image in the case where we already have that target.

@openshift-ci-robot openshift-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Apr 24, 2019
Comment thread cmd/root.go
@wking
Copy link
Copy Markdown
Member

wking commented Apr 24, 2019

Is there a double-negative issue in the PR/commit subject? I think we want to skip skopeo inspect for canonical pull-specs, not non-canonical pull-specs.

@wking
Copy link
Copy Markdown
Member

wking commented Apr 24, 2019

Is there somewhere we can/should document the fact that with this PR pivot no longer uses skopeo at all?

Comment thread cmd/root.go
`skopeo inspect` hits the `/tags` API which can be expensive
for registries to compute.  Quay.io recently changed how
they do rate limiting, and we started hitting this in OpenShift CI
jobs.

Since the machine-config-operator always provides canonical/digested
pull specs, the non-digested support is just for local developer
convenience.

This PR changes things so we don't use `skopeo` at all anymore,
rather we `podman inspect` after we pull.

Basically this PR ends up in a place where the non-canonical
path only loses out on the optimization of avoiding pulling the
image in the case where we already have that target.
@cgwalters cgwalters force-pushed the no-inspect-fully-qualified branch from 3821542 to fb4271d Compare April 24, 2019 21:46
@cgwalters
Copy link
Copy Markdown
Member Author

Is there somewhere we can/should document the fact that with this PR pivot no longer uses skopeo at all?

Not sure why that'd matter? The few people who should care are all reading this PR.

though it wouldn't be hard to just adjust the logic so we still do this in the developer case too right? I.e.

Since as noted above this isn't a hard error anymore, all we're avoiding is re-pulling the image and only when the sha256 would match, and if it does, why are you asking pivot to pull it? Also I tested this PR manually in a few scenarios...fixes a pretty important issue, I don't think it's worth redoing just for that.

@jlebon
Copy link
Copy Markdown
Member

jlebon commented Apr 24, 2019

Ahh right, forgot about coreos/rpm-ostree#1807.

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Apr 24, 2019
@wking
Copy link
Copy Markdown
Member

wking commented Apr 25, 2019

Commit message is fixed, but PR subject still has the double-negative.

@cgwalters cgwalters changed the title Don't use skopeo inspect for non-canonical pull specs Don't use skopeo inspect for canonical (digested) pull specs Apr 25, 2019
@cgwalters cgwalters merged commit ad3d2d7 into openshift:master Apr 25, 2019
cgwalters added a commit to cgwalters/installer that referenced this pull request Apr 25, 2019
cgwalters added a commit to cgwalters/coreos-assembler that referenced this pull request Jun 2, 2020
A while ago, we were using `skopeo inspect` as part of `pivot`
for OpenShift 4 OS upgrades, and it turns out that enumerates
all tags, which is expensive and rate limited by quay.io:
openshift/pivot#51

The RHCOS oscontainer builds have been failing in `skopeo inspect`
and I suspect it's related to this.

It looks like nowadays podman has `--digestfile` which is
exactly what we want here, so let's use it and drop the `skopeo`.
This simplifies the code too.
cgwalters added a commit to cgwalters/coreos-assembler that referenced this pull request Jun 3, 2020
A while ago, we were using `skopeo inspect` as part of `pivot`
for OpenShift 4 OS upgrades, and it turns out that enumerates
all tags, which is expensive and rate limited by quay.io:
openshift/pivot#51

The RHCOS oscontainer builds have been failing in `skopeo inspect`
and I suspect it's related to this.

It looks like nowadays podman has `--digestfile` which is
exactly what we want here, so let's use it and drop the `skopeo`.
This simplifies the code too.
openshift-merge-robot pushed a commit to coreos/coreos-assembler that referenced this pull request Jun 3, 2020
A while ago, we were using `skopeo inspect` as part of `pivot`
for OpenShift 4 OS upgrades, and it turns out that enumerates
all tags, which is expensive and rate limited by quay.io:
openshift/pivot#51

The RHCOS oscontainer builds have been failing in `skopeo inspect`
and I suspect it's related to this.

It looks like nowadays podman has `--digestfile` which is
exactly what we want here, so let's use it and drop the `skopeo`.
This simplifies the code too.
cgwalters added a commit to cgwalters/coreos-assembler that referenced this pull request Jun 3, 2020
A while ago, we were using `skopeo inspect` as part of `pivot`
for OpenShift 4 OS upgrades, and it turns out that enumerates
all tags, which is expensive and rate limited by quay.io:
openshift/pivot#51

The RHCOS oscontainer builds have been failing in `skopeo inspect`
and I suspect it's related to this.

It looks like nowadays podman has `--digestfile` which is
exactly what we want here, so let's use it and drop the `skopeo`.
This simplifies the code too.

(cherry picked from commit b574572)
cgwalters added a commit to cgwalters/coreos-assembler that referenced this pull request Jun 3, 2020
A while ago, we were using `skopeo inspect` as part of `pivot`
for OpenShift 4 OS upgrades, and it turns out that enumerates
all tags, which is expensive and rate limited by quay.io:
openshift/pivot#51

The RHCOS oscontainer builds have been failing in `skopeo inspect`
and I suspect it's related to this.

It looks like nowadays podman has `--digestfile` which is
exactly what we want here, so let's use it and drop the `skopeo`.
This simplifies the code too.

(cherry picked from commit b574572)
cgwalters added a commit to coreos/coreos-assembler that referenced this pull request Jun 4, 2020
A while ago, we were using `skopeo inspect` as part of `pivot`
for OpenShift 4 OS upgrades, and it turns out that enumerates
all tags, which is expensive and rate limited by quay.io:
openshift/pivot#51

The RHCOS oscontainer builds have been failing in `skopeo inspect`
and I suspect it's related to this.

It looks like nowadays podman has `--digestfile` which is
exactly what we want here, so let's use it and drop the `skopeo`.
This simplifies the code too.

(cherry picked from commit b574572)
ashcrow pushed a commit to coreos/coreos-assembler that referenced this pull request Jun 4, 2020
A while ago, we were using `skopeo inspect` as part of `pivot`
for OpenShift 4 OS upgrades, and it turns out that enumerates
all tags, which is expensive and rate limited by quay.io:
openshift/pivot#51

The RHCOS oscontainer builds have been failing in `skopeo inspect`
and I suspect it's related to this.

It looks like nowadays podman has `--digestfile` which is
exactly what we want here, so let's use it and drop the `skopeo`.
This simplifies the code too.

(cherry picked from commit b574572)
sinnykumari added a commit to sinnykumari/machine-config-operator that referenced this pull request Jul 31, 2020
Calling image inspect directly pulls in RepoTags as well which
can add up some extra time. See openshift/pivot#51

Since we are already vendoring containers/image in MCO, we are now
calling necessary functions directly needed to get the OSTree version
and commit information for the OSContainer.

Thanks to Colin Walters and Miloslav Trmač for the idea of using
container/image stack directly and reviewing the implementation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm Indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants