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

Don't perform index image verification when overwrite_from_index is False #166

Merged

Conversation

querti
Copy link
Contributor

@querti querti commented Sep 30, 2020

There is no risk of data loss when IIB doesn't overwrite the original index image. Thus, to prevent unnecessary failures, this check is disabled when overwrite_from_index is False.

More info in CLOUDDST-2783

@lcarva
Copy link
Contributor

lcarva commented Oct 1, 2020

No risk of data loss but IIB may report incorrect from index resolved image data. @shawn-hurley tells me that we can now use a digest for the index image pull spec. If we do that we can safely remove this check for all cases. Can we try that instead?

prebuild_info['from_index_resolved'], from_index, overwrite_from_index_token
)
if overwrite_from_index:
_verify_index_image(
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe in the future, but it would be great if this was done as part of the _overwrite_from_index function.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@querti querti force-pushed the remove-sanity-check branch 2 times, most recently from c305302 to 44affa0 Compare October 7, 2020 09:12
@querti querti marked this pull request as ready for review October 7, 2020 10:18
@querti querti requested a review from lcarva October 7, 2020 10:19
@querti
Copy link
Contributor Author

querti commented Oct 7, 2020

@yashvardhannanavati @shawn-hurley @mprahl check pls

@@ -617,10 +629,13 @@ def _overwrite_from_index(
:param str output_pull_spec: the pull specification of the manifest list for the index image
that IIB built.
:param str from_index: the pull specification of the image to overwrite.
:param str resolved_prebuild_from_index: resolved index image before starting the build.
:param str overwrite_from_index_token: the user supplied token to use when overwriting the
``from_index`` image. If this is not set, IIB's configured credentials will be used.
:raises IIBError: if one of the skopeo commands fails.
Copy link
Contributor

Choose a reason for hiding this comment

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

This needs to also reflect that _verify_index_image can raise an exception.

Copy link
Contributor

@mprahl mprahl left a comment

Choose a reason for hiding this comment

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

This looks good from a quick glance

@querti querti force-pushed the remove-sanity-check branch from 44affa0 to bd88a9d Compare October 8, 2020 07:23
@querti
Copy link
Contributor Author

querti commented Oct 9, 2020

@mprahl @lcarva @yashvardhannanavati Can you merge this? I don't have the rights

@mprahl mprahl self-requested a review October 12, 2020 15:06
@mprahl
Copy link
Contributor

mprahl commented Oct 12, 2020

One thing I just thought of is that the resolved from index is marked in the database at the beginning of the request, but if it changed during the request, then what is recorded as the resolved from index may be different than what was used.

# from_index is not resolved because podman does not support digest references
# https://github.com/containers/libpod/issues/5234 is filed for it
cmd.extend(['--from-index', from_index])

Once the resolved from index pullspec can be used, then we can actually just remove the verification code altogether.

It looks like podman 1.9.2 allows us to specify a digest for the from index:
containers/podman#5234

If you'd still like to pursue with this approach, perhaps you can update the resolved from index image in the database after the opm command.

@querti
Copy link
Contributor Author

querti commented Oct 13, 2020

One thing I just thought of is that the resolved from index is marked in the database at the beginning of the request, but if it changed during the request, then what is recorded as the resolved from index may be different than what was used.

# from_index is not resolved because podman does not support digest references
# https://github.com/containers/libpod/issues/5234 is filed for it
cmd.extend(['--from-index', from_index])

Once the resolved from index pullspec can be used, then we can actually just remove the verification code altogether.

It looks like podman 1.9.2 allows us to specify a digest for the from index:
containers/podman#5234

If you'd still like to pursue with this approach, perhaps you can update the resolved from index image in the database after the opm command.

I've actually already filed a story for implementing what you're describing. Luiz and I have agreed that this PR is an okay short-term solution (as some teams seem affected by the verification failures). Also, I think that the verification will still be required for overwriting the index image in order to prevent data loss.

@yashvardhannanavati
Copy link
Collaborator

@querti could you please resolve conflicts and update the PR?

…alse

There is no risk of data loss when IIB doesn't overwrite the original
index image. Thus, to prevent unnecessary failures, this check is
disabled when overwrite_from_index is False. The check has been
moved to overwrite_from_index function, as it is now only performed
before overwrite_from_index is attempted.
@querti querti force-pushed the remove-sanity-check branch from bd88a9d to 42975ba Compare October 14, 2020 07:47
@querti
Copy link
Contributor Author

querti commented Oct 14, 2020

@yashvardhannanavati done.

@yashvardhannanavati yashvardhannanavati merged commit 883faa6 into release-engineering:master Oct 14, 2020
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.

5 participants