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

Bug 1816812: Enable mirroring test images offline #24887

Merged
merged 3 commits into from Dec 4, 2020

Conversation

smarterclayton
Copy link
Contributor

@smarterclayton smarterclayton commented Apr 17, 2020

Some users wish to run the OpenShift conformance suite disconnected. As a first step, we need to enable a pattern to sync images required by tests from online to offline. To do that, we maintain a public mirror at quay.io/openshift/community-e2e-images which contains unsupported but valid images for each version of Kube we release. The openshift-tests command supports a helper to generate a mirror file to take that repo offline for a given release, which integrates naturally with oc image mirror. After this merges there will be a set of other changes to ensure our tests are using upstream images where possible.

A test user would mirror the images to a local registry:

openshift-tests images --to-repository myregistry.com/test/location | oc image mirror -f - --filter-by-os=.*
openshift-tests run openshift/conformance --from-repository myregistry.com/test/location

By default, all tests will run from the default mirror (not from the original location) at quay.io/openshift/community-e2e-images

TODO:

  • mark upstream tests that require public access as skipped / or have them skip
  • identify openshift images that can be mirrored
  • potentially limit the suite if we need more images, or investigate switching to on cluster samples
  • fail if an image is used not from the mirror so we catch regressions

The openshift-tests images command generates a mirror file for use with oc image mirror to sync the images used by tests to a private repository (or to disk). The user would then pass --from-repository to openshift-tests run*.

The --upstream flag allows the tool to mirror the upstream images to their canonical location on quay.io for general project use. This is only for admin use within the project and results in the images making it to quay.io/openshift/community-e2e-images - full command is:

openshift-tests images --upstream --to-repository quay.io/openshift/community-e2e-images | oc image mirror -f - --filter-by-os=.*

The change is based around this carry (which I will follow up upstream on). Kube has less practical need for this solution because there is no infrastructure to mirror images in general and this is more specialized to our needs with our offline story (kube has no offline story). Even if this stays a carry, it is fairly compact.

UPSTREAM: : Allow test images to be in a single mirror

In order to enable offline test execution we need to be able to collect all images used by Kube e2e into a single repo and then mirror them. This structure has been discussed but not fully thought through upstream, but we need to enable customers now.

The presence of the env var switches all pullable images to use a single repository (which has been prepared by openshift-tests) except for those images that are explicitly not intended to be pulled (those tests can't run offline anyway). The original map is returned so the mirror has commands to run.

@openshift-ci-robot openshift-ci-robot added the vendor-update Touching vendor dir or related files label Apr 17, 2020
@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 17, 2020
@smarterclayton smarterclayton changed the title test: Enable mirroring test images offline Bug 1816812: Enable mirroring test images offline Apr 17, 2020
@openshift-ci-robot openshift-ci-robot added bugzilla/high bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. labels Apr 17, 2020
@openshift-ci-robot
Copy link

@smarterclayton: This pull request references Bugzilla bug 1816812, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.5.0) matches configured target release for branch (4.5.0)
  • bug is in the state NEW, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

In response to this:

Bug 1816812: Enable mirroring test images offline

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.

@openshift-ci-robot
Copy link

@smarterclayton: This pull request references Bugzilla bug 1816812, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.5.0) matches configured target release for branch (4.5.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

In response to this:

Bug 1816812: Enable mirroring test images offline

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.

@smarterclayton
Copy link
Contributor Author

/retest

1 similar comment
@smarterclayton
Copy link
Contributor Author

/retest

@smarterclayton smarterclayton force-pushed the images_mirror branch 11 times, most recently from 608937f to 055bdaa Compare April 23, 2020 21:37
@openshift-ci-robot openshift-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 24, 2020
@openshift-ci-robot openshift-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 24, 2020
@smarterclayton
Copy link
Contributor Author

/retest

@openshift-ci-robot openshift-ci-robot added bugzilla/severity-high Referenced Bugzilla bug's severity is high for the branch this PR is targeting. and removed bugzilla/high labels Apr 29, 2020
@smarterclayton smarterclayton merged commit 2c8a372 into openshift:master Dec 4, 2020
@openshift-ci-robot
Copy link

@smarterclayton: All pull requests linked via external trackers have merged:

Bugzilla bug 1816812 has been moved to the MODIFIED state.

In response to this:

Bug 1816812: Enable mirroring test images offline

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.

@abhat
Copy link
Contributor

abhat commented Dec 7, 2020

@smarterclayton will there be a 4.6 backport for getting around CI failures due to the docker.io rate limiting?

@r4f4
Copy link
Contributor

r4f4 commented Dec 7, 2020

@abhat #25721

@gabemontero
Copy link
Contributor

@abhat #25721

yeah my PR #25721 is just a subset of this for builds in case the 4.6 backport does not happen, and should not be considered the full 4.6 backport of this PR

* An upstream image that is provided by `test/utils/image`.
2. If your use case is novel, you must:
* Describe your use case in a PR to this file and have it approved
* Define a standard CI build and publish the image to quay.io in the openshift namespace
Copy link
Contributor

Choose a reason for hiding this comment

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

@smarterclayton as i understand it, standard CI builds don't publish content to quay.io, you have to add the mirroring config to https://github.com/openshift/release/blob/master/core-services/image-mirroring/openshift/mapping_origin_4_7 for that to happen.

So is that your expectation?

  1. add CI that builds it (makes image available on registry.svc.ci)
  2. add mirroring config that publishes the image to openshift namespace on quay (why do we need this?)
  3. have automation promote the image to quay mirror location (what location is this? community-e2e-images? should this also be done via the mirroring config?)
  4. have an OWNER manually push the image to quay.io/openshift/community-e2e-images (still unclear on the relationship between this and (3), why we need both, in what order to do them, etc)

cc @gabemontero

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

I also don't understand why these instructions tell people to add things to the "init" section of images.go. That's not what i'd expect if someone adds a new test that ref's a new image, only if they have an explicit exception case.

Finally, the instructions say to contact someone in OWNERS in this dir, but there is no OWNERS file in this dir.

@deads2k
Copy link
Contributor

deads2k commented Dec 10, 2020

/cherrypick release-4.6

@deads2k
Copy link
Contributor

deads2k commented Dec 10, 2020

/cherry-pick release-4.6

@openshift-cherrypick-robot

@deads2k: #24887 failed to apply on top of branch "release-4.6":

Applying: test: Enable mirroring test images to a different repository
Applying: test: Add a framework for mirroring origin images
Applying: test: Update openshift tests to use locked images
Using index info to reconstruct a base tree...
M	test/e2e/upgrade/alert/alert.go
M	test/extended/cli/debug.go
M	test/extended/etcd/etcd_storage_path.go
M	test/extended/images/extract.go
M	test/extended/images/imagestreamimport.go
M	test/extended/images/mirror.go
M	test/extended/prometheus/prometheus.go
M	test/extended/prometheus/prometheus_builds.go
A	test/extended/prometheus/storage.go
M	test/extended/security/scc.go
M	test/extended/testdata/bindata.go
M	test/extended/testdata/builds/test-build.yaml
M	test/extended/testdata/long_names/fixture.json
M	test/extended/testdata/run_policy/parallel-bc.yaml
M	test/extended/testdata/run_policy/serial-bc.yaml
M	test/extended/testdata/run_policy/serial-latest-only-bc.yaml
A	test/extended/testdata/test-deployment-config.yaml
A	test/extended/testdata/test-replication-controller.yaml
M	test/extended/topology_manager/utils.go
M	test/extended/util/annotate/generated/zz_generated.annotations.go
M	test/extended/util/framework.go
M	test/extended/util/pods.go
M	test/integration/testdata/test-buildcli.json
Falling back to patching base and 3-way merge...
Auto-merging test/integration/testdata/test-buildcli.json
Auto-merging test/extended/util/pods.go
Auto-merging test/extended/util/framework.go
Auto-merging test/extended/util/annotate/generated/zz_generated.annotations.go
Auto-merging test/extended/topology_manager/utils.go
Auto-merging test/extended/testdata/run_policy/serial-latest-only-bc.yaml
Auto-merging test/extended/testdata/run_policy/serial-bc.yaml
Auto-merging test/extended/testdata/run_policy/parallel-bc.yaml
Auto-merging test/extended/testdata/long_names/fixture.json
Auto-merging test/extended/testdata/builds/test-build.yaml
Auto-merging test/extended/testdata/bindata.go
CONFLICT (content): Merge conflict in test/extended/testdata/bindata.go
Auto-merging test/extended/security/scc.go
CONFLICT (content): Merge conflict in test/extended/security/scc.go
CONFLICT (modify/delete): test/extended/prometheus/storage.go deleted in HEAD and modified in test: Update openshift tests to use locked images. Version test: Update openshift tests to use locked images of test/extended/prometheus/storage.go left in tree.
Auto-merging test/extended/prometheus/prometheus_builds.go
Auto-merging test/extended/prometheus/prometheus.go
Auto-merging test/extended/images/mirror.go
Auto-merging test/extended/images/imagestreamimport.go
Auto-merging test/extended/images/extract.go
CONFLICT (content): Merge conflict in test/extended/images/extract.go
Auto-merging test/extended/etcd/etcd_storage_path.go
Auto-merging test/extended/cli/debug.go
CONFLICT (content): Merge conflict in test/extended/cli/debug.go
Auto-merging test/e2e/upgrade/alert/alert.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0003 test: Update openshift tests to use locked images
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherrypick release-4.6

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.

@openshift-cherrypick-robot

@deads2k: #24887 failed to apply on top of branch "release-4.6":

Applying: test: Enable mirroring test images to a different repository
Applying: test: Add a framework for mirroring origin images
Applying: test: Update openshift tests to use locked images
Using index info to reconstruct a base tree...
M	test/e2e/upgrade/alert/alert.go
M	test/extended/cli/debug.go
M	test/extended/etcd/etcd_storage_path.go
M	test/extended/images/extract.go
M	test/extended/images/imagestreamimport.go
M	test/extended/images/mirror.go
M	test/extended/prometheus/prometheus.go
M	test/extended/prometheus/prometheus_builds.go
A	test/extended/prometheus/storage.go
M	test/extended/security/scc.go
M	test/extended/testdata/bindata.go
M	test/extended/testdata/builds/test-build.yaml
M	test/extended/testdata/long_names/fixture.json
M	test/extended/testdata/run_policy/parallel-bc.yaml
M	test/extended/testdata/run_policy/serial-bc.yaml
M	test/extended/testdata/run_policy/serial-latest-only-bc.yaml
A	test/extended/testdata/test-deployment-config.yaml
A	test/extended/testdata/test-replication-controller.yaml
M	test/extended/topology_manager/utils.go
M	test/extended/util/annotate/generated/zz_generated.annotations.go
M	test/extended/util/framework.go
M	test/extended/util/pods.go
M	test/integration/testdata/test-buildcli.json
Falling back to patching base and 3-way merge...
Auto-merging test/integration/testdata/test-buildcli.json
Auto-merging test/extended/util/pods.go
Auto-merging test/extended/util/framework.go
Auto-merging test/extended/util/annotate/generated/zz_generated.annotations.go
Auto-merging test/extended/topology_manager/utils.go
Auto-merging test/extended/testdata/run_policy/serial-latest-only-bc.yaml
Auto-merging test/extended/testdata/run_policy/serial-bc.yaml
Auto-merging test/extended/testdata/run_policy/parallel-bc.yaml
Auto-merging test/extended/testdata/long_names/fixture.json
Auto-merging test/extended/testdata/builds/test-build.yaml
Auto-merging test/extended/testdata/bindata.go
CONFLICT (content): Merge conflict in test/extended/testdata/bindata.go
Auto-merging test/extended/security/scc.go
CONFLICT (content): Merge conflict in test/extended/security/scc.go
CONFLICT (modify/delete): test/extended/prometheus/storage.go deleted in HEAD and modified in test: Update openshift tests to use locked images. Version test: Update openshift tests to use locked images of test/extended/prometheus/storage.go left in tree.
Auto-merging test/extended/prometheus/prometheus_builds.go
Auto-merging test/extended/prometheus/prometheus.go
Auto-merging test/extended/images/mirror.go
Auto-merging test/extended/images/imagestreamimport.go
Auto-merging test/extended/images/extract.go
CONFLICT (content): Merge conflict in test/extended/images/extract.go
Auto-merging test/extended/etcd/etcd_storage_path.go
Auto-merging test/extended/cli/debug.go
CONFLICT (content): Merge conflict in test/extended/cli/debug.go
Auto-merging test/e2e/upgrade/alert/alert.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0003 test: Update openshift tests to use locked images
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherry-pick release-4.6

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.

openshift-merge-robot pushed a commit to openshift/release that referenced this pull request Dec 16, 2020
Since openshift/origin#24887 was merged, we've
lost some image overrides. Working on this, but in the meantime trying
to get some green 4.7 CI runs.

Signed-off-by: Christy Norman <christy@linux.vnet.ibm.com>
r4f4 added a commit to r4f4/release that referenced this pull request Dec 17, 2020
After openshift/origin#24887 we are seeing image
pull errors in CI for ppc64le and s390x. So for now we've created our
own multi-arch mirror.

Signed-off-by: Rafael Fonseca <r4f4rfs@gmail.com>
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. bugzilla/severity-high Referenced Bugzilla bug's severity is high for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. lgtm Indicates that a PR is ready to be merged. vendor-update Touching vendor dir or related files
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet