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

registry: Calculate schema 1 layer sizes in the registry #16776

Closed
wants to merge 1 commit into from

Conversation

miminar
Copy link

@miminar miminar commented Oct 10, 2017

Manifest V2 schema 1 lacks blob sizes in most cases. The registry is the only component that can fix the missing sizes. In case of schema 1, the registry must fill the image metadata and send it to the master API.

Resolves bz#1491589

@openshift-merge-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: miminar
We suggest the following additional approver: mfojtik

Assign the PR to them by writing /assign @mfojtik in a comment when ready.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these OWNERS Files:

You can indicate your approval by writing /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Oct 10, 2017
@miminar
Copy link
Author

miminar commented Oct 10, 2017

/assign @dmage @legionus

@miminar
Copy link
Author

miminar commented Oct 10, 2017

/test
/test extended_image_registry

@miminar
Copy link
Author

miminar commented Oct 10, 2017

/retest

Copy link
Contributor

@dmage dmage left a comment

Choose a reason for hiding this comment

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

It's crazy that different manifests are handled on different sides.

// fillImageMetadata fills metadata for image if needed. The metadata is filled by the master API if not
// already filled and if the maniest and config blobs are sent together with the image. The registry needs to
// fill the metadata only for schema 1 manifests that don't contain image sizes. Only the registry is capable
// of fetching and correcting blob sizes.
Copy link
Contributor

Choose a reason for hiding this comment

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

In general this is false, anybody with valid credentials can use HEAD to fetch blob sizes.

Copy link
Author

Choose a reason for hiding this comment

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

Do you want to rephrase just the comment or do you suggest to make the master fetch the sizes from the registry?

Copy link
Author

Choose a reason for hiding this comment

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

Rewritten.

@miminar
Copy link
Author

miminar commented Oct 12, 2017

It's crazy that different manifests are handled on different sides.

I agree. We can't get rid of handling of the manifest on the master side though, As we are slowly moving to schema 2 and deprecating schema 1, we will be able to deprecate the latter in the future eventually. So only the parsing on the master will stay.

Manifest V2 schema 1 lacks blob sizes in most cases. The registry is the
only component that can fix the missing sizes. In case of schema 1, the
registry must fill the image metadata and send it to the master API.

Signed-off-by: Michal Minář <miminar@redhat.com>
@openshift-ci-robot
Copy link

openshift-ci-robot commented Oct 12, 2017

@miminar: The following tests failed, say /retest to rerun them all:

Test name Commit Details Rerun command
ci/openshift-jenkins/extended_image_registry 15a3b53 link /test extended_image_registry
ci/openshift-jenkins/experimental/unit a8bdcd5 link /test origin-ut

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

miminar pushed a commit to miminar/origin that referenced this pull request Oct 12, 2017
The extended test suite now secures the registry. This patch allows for
secure connection to the registry.

Mark few registry tests as serial. Prevent them from being run parallel
with some other registry tests.

Write registry log to file on re-deployment. The registry log is
essential for externded test debugging. Without writing it to a file,
this information will be lost.

Skip image signature workflow test until we figure out, how to make
`oadm verify-image-signature` work with secured integrated Docker
registry. Issue openshift#16344.

Temporarily skip limitrange_admission test. The image size counting is
still broken for schema 1 - the layer sizes need to be filled on registry
side. Will be fixed by openshift#16776.

Signed-off-by: Michal Minář <miminar@redhat.com>
@legionus
Copy link
Contributor

Please don't !!!

As we are slowly moving to schema 2 and deprecating schema 1

It will happen after few years at best.

@miminar
Copy link
Author

miminar commented Oct 12, 2017

It will happen after few years at best.

Sure, it won't happen any time soon, but eventually... 😄

Btw, our image sync will ignore schema 1 #14471, which is another step to deprecating it.

Copy link
Contributor

@bparees bparees left a comment

Choose a reason for hiding this comment

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

one nit and lgtm.

@@ -219,6 +230,56 @@ var manifestInflight = make(map[digest.Digest]struct{})
// manifestInflightSync protects manifestInflight
var manifestInflightSync sync.Mutex

// fillImageMetadata fills metadata for image if needed. The metadata is filled by the master API if not
// already filled and if the maniest and config blobs are sent together with the image. The registry needs to
Copy link
Contributor

Choose a reason for hiding this comment

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

s/maniest/manifest/

@bparees
Copy link
Contributor

bparees commented Oct 12, 2017

/unassign @mfojtik
/assign

@miminar
Copy link
Author

miminar commented Oct 13, 2017

After discussion with @dmage and @legionus, this will be closed. @dmage will submit a PR where the registry will fill the DockerImageLayers only and master will prefer them over manifest metadata.

@bparees
Copy link
Contributor

bparees commented Oct 18, 2017

After discussion with @dmage and @legionus, this will be closed. @dmage will submit a PR where the registry will fill the DockerImageLayers only and master will prefer them over manifest metadata.

is this the new PR? #16885

@miminar
Copy link
Author

miminar commented Oct 19, 2017

is this the new PR? #16885

That's right. Closing.

@miminar miminar closed this Oct 19, 2017
@miminar miminar deleted the get-schema1-blob-sizes branch February 22, 2018 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority/P1 size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants