Skip to content

release/mirror: Add examples for using the new mirror#6

Merged
openshift-merge-robot merged 2 commits intoopenshift:masterfrom
mtnbikenc:mirror-repos
Aug 1, 2019
Merged

release/mirror: Add examples for using the new mirror#6
openshift-merge-robot merged 2 commits intoopenshift:masterfrom
mtnbikenc:mirror-repos

Conversation

@mtnbikenc
Copy link
Copy Markdown
Member

@mtnbikenc mtnbikenc commented Jul 18, 2019

Resubmission of openshift/origin#23381

When performing a release mirror, provide examples for use in
install-config.yaml (install) or ImageContentSourcePolcy (upgrade).

https://jira.coreos.com/browse/CORS-1105

Example output:

$ oc adm release mirror --from=registry.svc.ci.openshift.org/ocp/release:4.2 --to=registry.svc.ci.openshift.org/rteague-1/mirror-test
info: Mirroring 94 images to registry.svc.ci.openshift.org/rteague-1/mirror-test ...

...
Success
Update image:  registry.svc.ci.openshift.org/rteague-1/mirror-test:release
Mirror prefix: registry.svc.ci.openshift.org/rteague-1/mirror-test

To use the new mirrored repository to install, add the following section to the install-config.yaml:

imageContentSources:
- mirrors:
  - registry.svc.ci.openshift.org/rteague-1/mirror-test
  source: quay.io/openshift-release-dev/ocp-v4.0-art-dev
- mirrors:
  - registry.svc.ci.openshift.org/rteague-1/mirror-test
  source: registry.svc.ci.openshift.org/ocp/release


To use the new mirrored repository for upgrades, use the following to create an ImageContentSourcePolicy:

apiVersion: operator.openshift.io/v1alpha1
kind: ImageContentSourcePolicy
metadata:
  name: example
spec:
  repositoryDigestMirrors:
  - mirrors:
    - registry.svc.ci.openshift.org/rteague-1/mirror-test
    source: quay.io/openshift-release-dev/ocp-v4.0-art-dev
  - mirrors:
    - registry.svc.ci.openshift.org/rteague-1/mirror-test
    source: registry.svc.ci.openshift.org/ocp/release

@openshift-ci-robot openshift-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jul 18, 2019
@mtnbikenc
Copy link
Copy Markdown
Member Author

/cc @smarterclayton

@mtnbikenc
Copy link
Copy Markdown
Member Author

/cc @abhinavdahiya

@smarterclayton
Copy link
Copy Markdown
Contributor

Temporary hold for openshift/api#384

/hold

Still need to hear the question about what happens on upgrade when you have to create an ICSP instead.

@openshift-ci-robot openshift-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 18, 2019
Comment thread pkg/cli/admin/release/mirror.go Outdated
@mtnbikenc mtnbikenc changed the title mirror: Add repo details for disconnected install release/mirror: Add examples for using the new mirror Jul 19, 2019
@mtnbikenc
Copy link
Copy Markdown
Member Author

mtnbikenc commented Jul 19, 2019

@smarterclayton @abhinavdahiya
Refactored for API update. Updated example in the description.

Copy link
Copy Markdown
Contributor

@mtrmac mtrmac left a comment

Choose a reason for hiding this comment

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

LGTM.

Comment thread pkg/cli/admin/release/mirror.go Outdated
Comment thread pkg/cli/admin/release/mirror.go Outdated
Comment thread pkg/cli/admin/release/mirror.go Outdated
@openshift-ci-robot openshift-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jul 22, 2019
@mtnbikenc
Copy link
Copy Markdown
Member Author

@smarterclayton @abhinavdahiya
Refactored to use types defined in API and generate complete ICSP. Sorted sources by Source. Added newlines. Updated example in the description.

Comment thread pkg/cli/admin/release/mirror.go
Comment thread pkg/cli/admin/release/mirror.go Outdated
@abhinavdahiya
Copy link
Copy Markdown
Contributor

/hold cancel

@openshift-ci-robot openshift-ci-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. labels Jul 22, 2019
@openshift-ci-robot openshift-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jul 24, 2019
@mtnbikenc
Copy link
Copy Markdown
Member Author

@smarterclayton @abhinavdahiya
For ICSP, added apiVersion, kind and name. Hacked out creationTimestamp.
Updated example in the description.

@abhinavdahiya
Copy link
Copy Markdown
Contributor

/lgtm

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

ping @smarterclayton @mfojtik

// printImageContentInstructions provides exapmles to the user for using the new repository mirror
// https://github.com/openshift/installer/blob/master/docs/dev/alternative_release_image_sources.md
func printImageContentInstructions(out io.Writer, from, to string, repositories map[string]struct{}) error {
type installConfigSubsection struct {
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.

Is it possible this gets called with no entries?

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.

If repositories had no entries it would mean the release image didn't reference any images. In this case, only one item would be printed for mirror usage, which is provided by --from.

imageContentSources:
- mirrors:
  - registry.svc.ci.openshift.org/rteague-1/mirror-test
  source: quay.io/openshift-release-dev/ocp-release

@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label Jul 26, 2019
@mtnbikenc
Copy link
Copy Markdown
Member Author

Fixed an issue with error handling and used unstructured to remove creationTimestamp.

If this looks good I can squash.

@abhinavdahiya
Copy link
Copy Markdown
Contributor

ping @mfojtik @deads2k @smarterclayton

@smarterclayton
Copy link
Copy Markdown
Contributor

Looks good, once this merges can you add an e2e test in openshift/origin PR that

  1. grabs the current release value (from cluster version)
  2. runs oc adm release mirror ... in a pod (see the tests for images like test/extended/images/info.go for an example of what code you can use) and mirrors to an image stream inside the registry (use the internal registry spec, an image stream in your namespace)
  3. check the result for success and the output to match these values

@smarterclayton
Copy link
Copy Markdown
Contributor

Please squash

When performing a release mirror, provide examples for use in
install-config.yaml (install) or ImageContentSourcePolcy (upgrade).
@mtnbikenc
Copy link
Copy Markdown
Member Author

Squashed. All green.

@abhinavdahiya
Copy link
Copy Markdown
Contributor

ping @smarterclayton @deads2k @mfojtik

@smarterclayton
Copy link
Copy Markdown
Contributor

/lgtm

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: abhinavdahiya, mtnbikenc, mtrmac, smarterclayton

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 openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 31, 2019
@openshift-bot
Copy link
Copy Markdown
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

2 similar comments
@openshift-bot
Copy link
Copy Markdown
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Copy Markdown
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-merge-robot openshift-merge-robot merged commit d7b7697 into openshift:master Aug 1, 2019
@mtnbikenc mtnbikenc deleted the mirror-repos branch August 1, 2019 13:32
wking added a commit to wking/oc that referenced this pull request Sep 18, 2019
Typo from 7e45752 (release/mirror: Add examples for using the new
mirror, 2019-07-19, openshift#6).
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. 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.

7 participants