openshift-metal3 / dev-scripts

Scripts to automate development/test setup for openshift integration with https://github.com/metal3-io/
Apache License 2.0
92 stars 182 forks source link

IP_STACK: v6 - allow MIRROR_IMAGES=false #1669

Open hjensas opened 1 month ago

hjensas commented 1 month ago

IPv6 forces MIRROR_IMAGES and sets disableAllDefaultSources for OperatorHub, and the pull-secret contains only an entry for the mirror. This probably makes sense for disconnected installs, but not when there is actual connectivity.

This changes the code to only set MIRROR_IMAGES=true when it is undefined, and all conditions on MIRROR_IMAGES has been updated to treat the value false the same way it treats unset.

This should allow to explicitly disable MIRROR_IMAGES, and thus allow deploying with IP_STACK=v6 without the image mirror.

openshift-ci[bot] commented 1 month ago

Hi @hjensas. Thanks for your PR.

I'm waiting for a openshift-metal3 member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository.
elfosardo commented 1 month ago

/ok-to-test

bfournie commented 4 weeks ago

For the agent installer I think the checks in the yaml files also need to change to check for 'true', e.g. mirror_images is set here: https://github.com/openshift-metal3/dev-scripts/blob/master/agent/roles/manifests/vars/main.yml#L36

And its currently being checked in multiple places like this: https://github.com/openshift-metal3/dev-scripts/blob/master/agent/roles/manifests/templates/install-config_baremetal_yaml.j2#L109

That should be changed to {% if mirror_images == 'true' %}

hjensas commented 4 weeks ago

For the agent installer I think the checks in the yaml files also need to change to check for 'true', e.g. mirror_images is set here: https://github.com/openshift-metal3/dev-scripts/blob/master/agent/roles/manifests/vars/main.yml#L36

And its currently being checked in multiple places like this: https://github.com/openshift-metal3/dev-scripts/blob/master/agent/roles/manifests/templates/install-config_baremetal_yaml.j2#L109

That should be changed to {% if mirror_images == 'true' %}

I changed it like this:

-mirror_images: "{{ lookup('env', 'MIRROR_IMAGES') != '' }}"
+mirror_images: "{{ lookup('env', 'MIRROR_IMAGES') | bool }}"

This means values true, True, TRUE, 1, yes etc should make {% if mirror_images %} evaluate to true - empty string, false, False, FALSE, no, 0 etc it evaluates to false. So no need to update the conditions? :crossed_fingers:

bfournie commented 4 weeks ago

For the agent installer I think the checks in the yaml files also need to change to check for 'true', e.g. mirror_images is set here: https://github.com/openshift-metal3/dev-scripts/blob/master/agent/roles/manifests/vars/main.yml#L36 And its currently being checked in multiple places like this: https://github.com/openshift-metal3/dev-scripts/blob/master/agent/roles/manifests/templates/install-config_baremetal_yaml.j2#L109 That should be changed to {% if mirror_images == 'true' %}

I changed it like this:

-mirror_images: "{{ lookup('env', 'MIRROR_IMAGES') != '' }}"
+mirror_images: "{{ lookup('env', 'MIRROR_IMAGES') | bool }}"

This means values true, True, TRUE, 1, yes etc should make {% if mirror_images %} evaluate to true - empty string, false, False, FALSE, no, 0 etc it evaluates to false. So no need to update the conditions? 🤞

Sounds good, thanks Harald

bfournie commented 4 weeks ago

/lgtm

hjensas commented 4 weeks ago

/test e2e-metal-ipi-serial-ipv4

elfosardo commented 4 weeks ago

the ipv4 job is currently fubar we're waiting for https://github.com/openshift/release/pull/53433

hjensas commented 4 weeks ago

/test e2e-metal-ipi-serial-ipv4

https://github.com/openshift/release/pull/53433 is merged, so giving it a go.

hjensas commented 4 weeks ago

@elfosardo - looking at logs[1] - I take the failure is not related to this change? dev-scripts install finished succesfully?

[1] https://gcsweb-ci.apps.ci.l2s4.p1.openshiftapps.com/gcs/test-platform-results/pr-logs/pull/openshift-metal3_dev-scripts/1669/pull-ci-openshift-metal3-dev-scripts-master-e2e-metal-ipi-serial-ipv4/1806491899238813696/artifacts/e2e-metal-ipi-serial-ipv4/baremetalds-devscripts-setup/artifacts/root/dev-scripts/logs/

openshift-ci[bot] commented 3 weeks ago

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Once this PR has been reviewed and has the lgtm label, please ask for approval from bfournie. For more information see the Kubernetes Code Review Process.

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

Needs approval from an approver in each of these files: - **[OWNERS](https://github.com/openshift-metal3/dev-scripts/blob/master/OWNERS)** Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
hjensas commented 3 weeks ago

I added another commit to use the ,, to do case modification on MIRROR_IMAGES before comparing to false - this allows the user to use False, FALSE etc. Nice to have when ansible is used to write the configuration.

elfosardo commented 3 weeks ago

/retest /lgtm it looks ok, just verifying failing jobs

rabi commented 1 week ago

/retest

openshift-ci[bot] commented 1 week ago

@hjensas: The following test 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-metal-ipi-serial-ipv4 bc515114beb13f7cfcf068220bdee0bafbaff163 link true /test e2e-metal-ipi-serial-ipv4

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).