Skip to content

[OCPNODE-553] Add CRD ImageDigestMirrorSet,ImageTagMirrorSet - #3037

Merged
openshift-merge-robot merged 2 commits into
openshift:masterfrom
QiWang19:imgmirrorset
Jan 24, 2023
Merged

openshift-merge-robot merged 2 commits into
openshift:masterfrom
QiWang19:imgmirrorset

Conversation

@QiWang19

@QiWang19 QiWang19 commented Mar 26, 2022 •

Copy link
Copy Markdown
Member

- What I did

  • Add support for ImageDigestMirrorSet,ImageTagMirrorSet mirror configuration CRDs.
  • Reject the update of one of current icsp and new idms.itms resources if both exist to avoid having both icsp and new CRs on the same cluster.

Close card: https://issues.redhat.com/browse/OCPNODE-553
Epic: https://issues.redhat.com/browse/OCPNODE-521
Dependent PR: openshift/runtime-utils#15

- How to verify it

Apply following CR, check the /etc/containers/registries.conf

apiVersion: config.openshift.io/v1
kind: ImageTagMirrorSet
metadata:
  name: tag-mirror
spec:
  imageTagMirrors:
  - mirrors:
    - example.io/example/ubi-minimal 
    source: registry.access.redhat.com/ubi8/ubi-minimal
  - mirrors:
    - example.io/example/ubi-minimal 
    source: registry.access.redhat.com/ubi8/ubi-minimal-1
    mirrorSourcePolicy: NeverContactSource

/etc/containers/registries.conf

unqualified-search-registries = ["registry.access.redhat.com", "docker.io"]
short-name-mode = ""

[[registry]]
  prefix = ""
  location = "registry.access.redhat.com/ubi8/ubi-minimal"

  [[registry.mirror]]
    location = "example.io/example/ubi-minimal"
    pull-from-mirror = "tag-only"

[[registry]]
  prefix = ""
  location = "registry.access.redhat.com/ubi8/ubi-minimal-1"
  blocked = true

  [[registry.mirror]]
    location = "example.io/example/ubi-minimal"
    pull-from-mirror = "tag-only"

- Description for the changelog

Add support for ImageDigestMirrorSet,ImageDigestMirrorSet CRDs

@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 26, 2022
@openshift-ci

openshift-ci Bot commented Mar 26, 2022

Copy link
Copy Markdown
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-ci
openshift-ci Bot requested review from sinnykumari and umohnani8 March 26, 2022 04:13
@kikisdeliveryservice
kikisdeliveryservice requested review from kikisdeliveryservice and removed request for sinnykumari March 28, 2022 18:50
@openshift-ci openshift-ci Bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 4, 2022
@openshift-ci openshift-ci Bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 4, 2022
@QiWang19
QiWang19 force-pushed the imgmirrorset branch 2 times, most recently from 9186155 to 7a3a7d7 Compare April 5, 2022 04:16
@QiWang19 QiWang19 changed the title [WIP] Add CRD ImageDigestMirrorSet,ImageDigestMirrorSet [OCPNODE-553] Add CRD ImageDigestMirrorSet,ImageDigestMirrorSet Apr 5, 2022
@QiWang19
QiWang19 marked this pull request as ready for review April 5, 2022 04:28
@openshift-ci openshift-ci Bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 5, 2022
@openshift-ci
openshift-ci Bot requested review from mtrmac and sinnykumari April 5, 2022 04:29

@mtrmac mtrmac left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just an initial pass (I didn’t actually read the added tests).

Comment thread pkg/controller/container-runtime-config/helpers.go Outdated
Comment thread pkg/controller/container-runtime-config/helpers.go Outdated
Comment thread pkg/controller/container-runtime-config/helpers.go Outdated
Comment thread pkg/controller/container-runtime-config/helpers.go Outdated
@nee1esh

nee1esh commented Apr 6, 2022

Copy link
Copy Markdown

/retest

@QiWang19

QiWang19 commented Apr 6, 2022 •

Copy link
Copy Markdown
Member Author

@yuqi-zhang @mtrmac This PR and dependent PR: openshift/runtime-utils#15 will update the registry.conf. And the runtime-utils PR replaced sysregistriesv2.Registry.MirrorByDigestOnly with new per-mirror field sysregistriesv2.Endpoint.PullFromMirror to edit the registry.conf. So I think this PR should also update isSafeContainerRegistryConfChanges().

// isSafeContainerRegistryConfChanges looks inside old and new versions of registries.conf file.
// It compares the content and determines whether changes made are safe or not. This will
// help MCD to decide whether we can skip node drain for applied changes into container
// registry.
// Currently, we consider following container registry config changes as safe to skip node drain:
// 1. A new mirror is added to an existing registry that has `mirror-by-digest-only=true`
// 2. A new registry has been added that has `mirror-by-digest-only=true`
// See https://bugzilla.redhat.com/show_bug.cgi?id=1943315
//nolint:gocyclo
func isSafeContainerRegistryConfChanges(oldIgnConfig, newIgnConfig ign3types.Config) (bool, error) {

Not sure how the safe conditions are defined, but looking at https://bugzilla.redhat.com/show_bug.cgi?id=1943315#c1, we could propose the following as safe?

// Currently, we consider following container registry config changes as safe to skip node drain:
// 1. A new mirror is added to an existing registry that has per-mirror setting `pull-from-mirror=digest-only` or registry level setting `mirror-by-digest-only=true`
// 2. A new registry has been added that has `mirror-by-digest-only=true` or per-mirror setting `pull-from-mirror=digest-only` for all of its mirrors

@QiWang19 QiWang19 changed the title [OCPNODE-553] Add CRD ImageDigestMirrorSet,ImageDigestMirrorSet [OCPNODE-553] [WIP] Add CRD ImageDigestMirrorSet,ImageDigestMirrorSet Apr 8, 2022
@openshift-ci openshift-ci Bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 17, 2022
@openshift-ci

openshift-ci Bot commented Apr 17, 2022

Copy link
Copy Markdown
Contributor

@QiWang19: PR needs rebase.

Details

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.

@mtrmac mtrmac left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM overall. (FWIW the PR doesn’t currently compile).

Comment thread pkg/controller/container-runtime-config/helpers.go Outdated
Comment thread pkg/controller/container-runtime-config/helpers.go Outdated
Comment thread pkg/controller/container-runtime-config/helpers.go Outdated
Comment thread pkg/controller/container-runtime-config/helpers.go Outdated
@mtrmac

mtrmac commented Dec 7, 2022

Copy link
Copy Markdown
Contributor

/lgtm again , at least based on the relevant parts of the diff being the same…

@mtrmac

mtrmac commented Dec 7, 2022

Copy link
Copy Markdown
Contributor

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Dec 7, 2022
@rphillips

Copy link
Copy Markdown
Contributor

/lgtm

@QiWang19

QiWang19 commented Dec 8, 2022

Copy link
Copy Markdown
Member Author

@yuqi-zhang could the MCO team review and approve this PR? It is ready to get in.

@yuqi-zhang yuqi-zhang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Did a first pass with some question/comments below

Also, the MCO team is doing pre-merge QE testing for 4.13. Is node team doing pre-merge QE testing? Would someone from node QE be able to verify this new feature and apply QE approval?

Comment thread pkg/daemon/drain.go Outdated
Comment thread test/e2e/ctrcfg_test.go Outdated
Comment thread test/e2e/ctrcfg_test.go Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

To be clear, this doesn't actually test any pulling, it just checks if ICSP sets up the correct conf?

Would we want to instead test IDSM/ITMS since that's (I assume) the preferred way?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This is just to test the ICSP can still work with the addition of new CRDs, before we deprecate the ICSP.

yes, we can add some tests for IDSM/ITMS.

Comment thread pkg/daemon/drain.go Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

would we want to keep the old conditionals? It is possible that someone with a hand-crafted registries.conf could be still using the old method

Or, are we saying that we don't support that, and there isn't any way for ICSP to generate the old style mirror flags anymore?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Add some unit test cases with mirror-by-digest-only for the old style. ICSP will no longer generate this old style, but it is still supported when there are hand-crafted registries.conf.

Comment thread pkg/controller/container-runtime-config/container_runtime_config_controller.go Outdated

@yuqi-zhang yuqi-zhang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think this generally makes sense to me, approving, thanks for working on this!

Also going to add a

/hold

for QE pre-merge testing and QE approval.

Doesn't have to be part of this PR, but could you provide some docs on how to use IDMS/ITMS? Or maybe some links to other docs are fine as well, thanks!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hmm, does this actually change anything? Just curious

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

These files are also used in the e2e test. To fix the error I saw in the ci e2e test that is image repository name must be lowercase.

@QiWang19

Copy link
Copy Markdown
Member Author

/retest-required

@rphillips

Copy link
Copy Markdown
Contributor

/lgtm
/hold for qe review

@QiWang19 Please remove the hold when ready.

@lyman9966

Copy link
Copy Markdown

/label qe-approved

@QiWang19

Copy link
Copy Markdown
Member Author

for QE pre-merge testing and QE approval.

Doesn't have to be part of this PR, but could you provide some docs on how to use IDMS/ITMS? Or maybe some links to other docs are fine as well, thanks!

@yuqi-zhang This passed the QE approval label. Could you merge this?
The doc can be added in another PR.

@yuqi-zhang

Copy link
Copy Markdown
Contributor

/hold cancel

@openshift-ci-robot

Copy link
Copy Markdown
Contributor

/retest-required

Remaining retests: 0 against base HEAD fc27a2b and 2 for PR HEAD 73e22c3cc054f6a89f55ac48704ebc7cc523e35f in total

@yuqi-zhang

Copy link
Copy Markdown
Contributor

gcp-op may require a rebase to master which has some e2e test fixes

Signed-off-by: Qi Wang <qiwan@redhat.com>
Signed-off-by: Qi Wang <qiwan@redhat.com>
@QiWang19

Copy link
Copy Markdown
Member Author
ctrcfg_test.go:283: default configuration value "digest-only" same as values being tested against. Consider updating the test

https://storage.googleapis.com/origin-ci-test/pr-logs/pull/openshift_machine-config-operator/3037/pull-ci-openshift-machine-config-operator-master-e2e-gcp-op/1615814135679815680/build-log.txt the
rebased, e2e-gcp-op result shows the test platform has icsp resources. I can keep the icsp e2e test but have to drop idms,items e2e test. Before the icsp CRD gets deprecated, using idms, items on the same cluster where icsp resource exists is prohibited.

@QiWang19

Copy link
Copy Markdown
Member Author

/retest-required

@QiWang19

Copy link
Copy Markdown
Member Author

@yuqi-zhang could you retag lgtm?

@yuqi-zhang

Copy link
Copy Markdown
Contributor

/lgtm

@openshift-ci

openshift-ci Bot commented Jan 20, 2023

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mtrmac, QiWang19, rphillips, yuqi-zhang

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

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot

Copy link
Copy Markdown
Contributor

/retest-required

Remaining retests: 0 against base HEAD 324bc30 and 2 for PR HEAD 7971961 in total

@QiWang19

Copy link
Copy Markdown
Member Author

/retest-required

@openshift-ci

openshift-ci Bot commented Jan 23, 2023 •

Copy link
Copy Markdown
Contributor

@QiWang19: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-openstack 5549a09bf7ea66ba72f19cc29246b67c963e1c0f link false /test e2e-openstack
ci/prow/okd-scos-e2e-aws 73e22c3cc054f6a89f55ac48704ebc7cc523e35f link false /test okd-scos-e2e-aws
ci/prow/e2e-alibabacloud 73e22c3cc054f6a89f55ac48704ebc7cc523e35f link false /test e2e-alibabacloud
ci/prow/okd-scos-e2e-aws-ovn 7971961 link false /test okd-scos-e2e-aws-ovn
ci/prow/e2e-alibabacloud-ovn 7971961 link false /test e2e-alibabacloud-ovn
ci/prow/e2e-gcp-rt-op 7971961 link false /test e2e-gcp-rt-op
ci/prow/okd-scos-e2e-gcp-ovn-upgrade 7971961 link false /test okd-scos-e2e-gcp-ovn-upgrade

Full PR test history. Your PR dashboard.

Details

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.

@QiWang19

Copy link
Copy Markdown
Member Author

@yuqi-zhang can we skip the tests?

@openshift-ci-robot

Copy link
Copy Markdown
Contributor

/retest-required

Remaining retests: 0 against base HEAD 97ddbfe and 1 for PR HEAD 7971961 in total

@yuqi-zhang

Copy link
Copy Markdown
Contributor

Only e2e-aws-ovn is required, is failing, and being retested, so skipping tests won't really help us either way. The other failures don't block the PR

Or did you mean you wanted me to override e2e-aws-ovn?

@QiWang19

Copy link
Copy Markdown
Member Author

Yes, override e2e-aws-ovn. The e2e-aws-ovn was retested several times and failed. Can we override it?

@yuqi-zhang

Copy link
Copy Markdown
Contributor

The latest commit did have a passing run: https://prow.ci.openshift.org/pr-history/?org=openshift&repo=machine-config-operator&pr=3037

So I think it's most likely ok. Still, I am uncomfortable overriding a required job unless the fix is urgent or directly attributed to it. Let's wait until the end of today, and, if there are no passes, I can look to override

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. qe-approved Signifies that QE has signed off on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants