OpenShiftP-633: Convert oc adm release mirror usage to oc-mirror v2#336
OpenShiftP-633: Convert oc adm release mirror usage to oc-mirror v2#336mpkredhat wants to merge 1 commit into
Conversation
e47c800 to
6fbc4b7
Compare
| - name: Downloading oc-mirror package | ||
| get_url: | ||
| url: "{{ oc_mirror_source }}" | ||
| dest: /usr/local/bin/oc-mirror.tar.gz |
There was a problem hiding this comment.
| dest: /usr/local/bin/oc-mirror.tar.gz | |
| dest: /usr/local/src/oc-mirror.tar.gz |
|
|
||
| - name: Unarchiving oc-mirror package | ||
| unarchive: | ||
| src: /usr/local/bin/oc-mirror.tar.gz |
There was a problem hiding this comment.
| src: /usr/local/bin/oc-mirror.tar.gz | |
| src: /usr/local/src/oc-mirror.tar.gz |
| ocp_channel_name: stable-4.20 | ||
| ocp_min_version: 4.20.2 | ||
| ocp_max_version: 4.20.2 |
There was a problem hiding this comment.
Formatting looks wrong, the L32 in original is offset 2 chars, you lost the integrity of setup_registry
| mirror: | ||
| platform: | ||
| architectures: | ||
| - "{{ ansible_architecture }}" |
There was a problem hiding this comment.
I think this needs to come from openshift-install version if it contains multi, then set, else use ansible_architecture
| ocp_install_kernel: "https://mirror.openshift.com/pub/openshift-v4/dependencies/rhcos/4.9/4.9.0/rhcos-4.9.0-x86_64-live-kernel-x86_64" | ||
| ocp_client: "https://mirror.openshift.com/pub/openshift-v4/clients/ocp/4.9.18/openshift-client-linux-4.9.18.tar.gz" | ||
| ocp_installer: "https://mirror.openshift.com/pub/openshift-v4/clients/ocp/4.9.18/openshift-install-linux-4.9.18.tar.gz" | ||
| oc_mirror_source: "https://mirror.openshift.com/pub/openshift-v4/ppc64le/clients/ocp/stable-4.20/oc-mirror.tar.gz" |
There was a problem hiding this comment.
| oc_mirror_source: "https://mirror.openshift.com/pub/openshift-v4/ppc64le/clients/ocp/stable-4.20/oc-mirror.tar.gz" | |
| oc_mirror: "https://mirror.openshift.com/pub/openshift-v4/clients/ocp/stable-4.20/oc-mirror.tar.gz" |
match the style
| when: | ||
| - setup_registry.autosync_registry | ||
| - (((ocp_version.stdout.split(' ')[0] | int ) >= 4 and (ocp_version.stdout.split(' ')[1] | int) > 19 ) or ((ocp_version.stdout.split(' ')[0] | int ) >= 5 )) | ||
|
|
There was a problem hiding this comment.
let's add a step that deletes the cache. by default is is disabled. We will only use this in CI.
| - name: Copy ImageSetConfig file | ||
| template: | ||
| src: ../templates/imageset-config.yaml.j2 | ||
| dest: /usr/local/src/imageset-config.yaml |
There was a problem hiding this comment.
Let's put this configuration in /etc
There was a problem hiding this comment.
Let's move this step to setup_registry.yaml
92792d7 to
357c01a
Compare
| owner: root | ||
| group: root | ||
|
|
||
| - name: Get openshift-install architecture |
There was a problem hiding this comment.
| - name: Get openshift-install architecture | |
| - name: Get openshift-install payload architecture |
| imageset_arch: >- | ||
| {{ | ||
| ['amd64', 'arm64', 'ppc64le', 's390x'] | ||
| if os_install_arch.stdout == 'multi' | ||
| else | ||
| [os_install_arch.stdout] | ||
| if os_install_arch.rc == 0 and os_install_arch.stdout | length > 0 | ||
| else | ||
| ['amd64'] | ||
| }} |
There was a problem hiding this comment.
You are telling it to mirror every payload ['amd64', 'arm64', 'ppc64le', 's390x']
We only care about the arch specified or multi not the branching.
| - name: Copy ImageSetConfig file | ||
| template: | ||
| src: ../templates/imageset-config.yaml.j2 | ||
| dest: /etc/imageset-config.yaml |
There was a problem hiding this comment.
Let's prefix with oc-mirror_
| dest: /etc/imageset-config.yaml | |
| dest: /etc/oc-mirror_imageset-config.yaml |
ac2b9e3 to
e188bd7
Compare
f30631b to
8798ac6
Compare
| - name: Generate Local Registry information | ||
| when: setup_registry.autosync_registry | ||
| copy: | ||
| content: "{{ registry.stdout }}" | ||
| content: "{{ registry.stdout_lines }}" | ||
| dest: ../postrun-local-registry-info |
There was a problem hiding this comment.
I suspect we don't need it. However, we shouldn't mutate the original intent with this code. Right?
It'd change the behavior of the existing installations. I'd recommend excluding it when running oc-mirror.
| - name: Process Local Registry information | ||
| when: setup_registry.autosync_registry | ||
| shell: "sed -i '1,/Success/d' ../postrun-local-registry-info" | ||
|
|
There was a problem hiding this comment.
It might not be used in many palces.
782021e to
d537536
Compare
| oc_mirror_bin: "oc-mirror" | ||
| oc_mirror_cmd: "/usr/local/bin/oc-mirror" | ||
| oc_mirror_wipe_cache: false | ||
| oc_mirror_workspace_dir: /tmp/oc-mirror-work-dir |
There was a problem hiding this comment.
this is not what we want to use. oc_mirror_workspace_dir: /tmp/oc-mirror-work-dir - we need to use the home folder or /var/oc-mirror.
RHEL uses systemd-tmpfiles to automatically prune files from /tmp. Unlike some distributions that only clear /tmp on reboot, RHEL will delete files while the system is running if they haven't been accessed for a certain amount of time.
| oc_mirror_bin: "oc-mirror" | ||
| oc_mirror_cmd: "/usr/local/bin/oc-mirror" | ||
| oc_mirror_wipe_cache: false | ||
| oc_mirror_workspace_dir: /var/oc-mirror-work-dir |
8aff9aa to
d777576
Compare
4732d61 to
22d83a2
Compare
| ocp_channel_name: "stable-4.20" | ||
| ocp_min_version: "4.20.2" | ||
| ocp_max_version: "4.20.2" |
There was a problem hiding this comment.
We shouldn't mutate the existing values and locations. It should only be changed when / if it is discussed and coordinate. Please revert these moves.
| oc_mirror_parallel_images: 10 | ||
| oc_mirror_parallel_layers: 10 | ||
| oc_mirror_bin: "oc-mirror" | ||
| oc_mirror_cmd: "/usr/local/bin/oc-mirror" | ||
| oc_mirror_wipe_cache: false | ||
| oc_mirror_workspace_dir: /var/oc-mirror-work-dir |
Signed-off-by: Mandar Kulkarni <mandar.kulkarni6@ibm.com>
This PR is for replacing "oc adm release mirror" command with "oc-mirror --v2" in disconnected installations.
This step is part of disconnected changes to get inline with current mirroring best practices.
Corresponding Redhat issue : https://issues.redhat.com/browse/OCPBUGS-70297