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

Configure proxy support for create_custom_repos function #17140

Closed

Conversation

shubhamsg199
Copy link
Contributor

@shubhamsg199 shubhamsg199 commented Dec 10, 2024

Problem Statement

For IPv6 satellite, custom repos created using create_custom_repos having internal url(download.devel) fails to connect as they do not have IPv6 connectivity and the test fails.

Solution

Adding http_proxy while creating custom repos fixes the issue

@shubhamsg199 shubhamsg199 added CherryPick PR needs CherryPick to previous branches AutoMerge_Cherry_Picked The cherrypicked PRs of master PR would be automerged if all checks passing 6.14.z Introduced in or relating directly to Satellite 6.14 6.15.z Introduced in or relating directly to Satellite 6.15 6.16.z Introduced in or relating directly to Satellite 6.16 labels Dec 10, 2024
@shubhamsg199 shubhamsg199 self-assigned this Dec 10, 2024
@shubhamsg199 shubhamsg199 requested review from a team as code owners December 10, 2024 11:50
@shubhamsg199
Copy link
Contributor Author

trigger: test-robottelo
pytest: tests/foreman/cli/test_ansible.py -k test_positive_ansible_e2e
network_type: ipv6

@shubhamsg199 shubhamsg199 force-pushed the hhtp_proxy_custom_repos branch from 27527f4 to 9849bb2 Compare December 10, 2024 13:49
@shubhamsg199 shubhamsg199 changed the title Add http_proxy support for create_custom_repos function Configure proxy support for create_custom_repos function Dec 10, 2024
@shubhamsg199 shubhamsg199 force-pushed the hhtp_proxy_custom_repos branch from 9849bb2 to 81f16fb Compare December 10, 2024 13:56
@shubhamsg199
Copy link
Contributor Author

trigger: test-robottelo
pytest: tests/foreman/cli/test_ansible.py -k test_positive_ansible_e2e
network_type: ipv6

Copy link
Contributor

@ekohl ekohl left a comment

Choose a reason for hiding this comment

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

For IPv6 satellite, custom repos created using create_custom_repos having internal url fails to connect as they do not have IPv6 connectivity and the test fails.

Which are those? Both ohsnap and internal Satellite have IPv6.

@shubhamsg199
Copy link
Contributor Author

For IPv6 satellite, custom repos created using create_custom_repos having internal url fails to connect as they do not have IPv6 connectivity and the test fails.

Which are those? Both ohsnap and internal Satellite have IPv6.

download.devel

@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 9578
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/cli/test_ansible.py -k test_positive_ansible_e2e --external-logging
Test Result : ==== 2 failed, 5 passed, 25 deselected, 763 warnings in 3914.48s (1:05:14) =====

@Satellite-QE Satellite-QE added the PRT-Failed Indicates that latest PRT run is failed for the PR label Dec 10, 2024
robottelo/hosts.py Outdated Show resolved Hide resolved
# Add proxy configuration for IPv6
if settings.server.is_ipv6:
content += f'proxy={settings.http_proxy.http_proxy_ipv6_url}'
Copy link
Contributor

Choose a reason for hiding this comment

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

To me this looks rather magical. I don't know robottello well enough, but isn't there a better way?

Is there a tracker to add IPv6 support to the host that's missing? Would it be better to set up a reverse proxy just for the single host that's missing or instead use RHEL from satellite.sat which is IPv6 enabled?

Looking at the various tests this code is also used in other places where it could have negative side effects.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not aware if there's any tracker to add IPv6 support to the host, maybe @jyejare knows if there's any ?

Copy link
Member

Choose a reason for hiding this comment

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

@ekohl @shubhamsg199 Some Comments and questions:

  • Is there a tracker to add IPv6 support to the missing host?
    Do you mean a tracker in Jira or in robottelo automation?
    BTW, the proxy here must be used in case of IPv6 host is not able to reach to the external source for contents. The tracking for ipv6 is auto-handled as the test is modified to spin up the ipv6 host when the ipv6 satellite testing is running.

  • Would it be better to set up a reverse proxy just for the single host that's missing
    Whats the purpose here to setup a reverse proxy ?

  • Instead use RHEL from satellite.sat which is IPv6 enabled?
    The contents for RHEL are not different in IPv6 and Ipv4 so does not matter from where you get them. I may misunderstood your idea, please feel free to elaborate.

  • Looking at the various tests this code is also used in other places where it could have negative side effects.
    Yes, that's right the impact is there when the proxy would still be used even when the Ipv4 host is spinned up. So determining the host network would be a crucial but not critical. Especially this would be the case for cross network testing and atleast for now we are not there yet.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@jyejare IIUC I think for tracker @ekohl means if we've some JIRA/SNOW ticket to make download.devel.. host dual stack
And, I think it will take time since its not managed by our team, so until that's made dual stack we can configure proxy for IPv6 runs only, and it won't configure proxy in case of IPv4 run, so I feel it won't have any side effects on IPv4 results and It is only used for content host testing, not for satellite installations

Copy link
Contributor

Choose a reason for hiding this comment

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

@jyejare IIUC I think for tracker @ekohl means if we've some JIRA/SNOW ticket to make download.devel.. host dual stack

This is exactly what I meant. If we don't have that issue/ticket it's unlikely to ever be prioritized. It also means we can't really test the 100% native IPv6 without any HTTP proxy case even though at some point customers will start to deploy in that way. Our documentation doesn't say anything about content hosts needing some HTTP proxy set up.

To be explicit: I'm not against a short term workaround like this, but it's important to work to resolve it long term as well.

Copy link
Member

Choose a reason for hiding this comment

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

@ekohl Ohh Dual Stack. The dual stack is coming soon and we will parametrizing the content hosts to run on ipv4, ipv6 and dual stack sooner. And dual stack should not need proxy.

Hence I said above the proxy enablement should happen only when ipv6-only content host test is running.

@shubhamsg199 shubhamsg199 force-pushed the hhtp_proxy_custom_repos branch 4 times, most recently from 3d28fa5 to 1170fe8 Compare December 10, 2024 15:40
@shubhamsg199 shubhamsg199 force-pushed the hhtp_proxy_custom_repos branch from 1170fe8 to b2c8c3a Compare December 10, 2024 15:41
@shubhamsg199
Copy link
Contributor Author

trigger: test-robottelo
pytest: tests/foreman/cli/test_ansible.py -k test_positive_ansible_e2e
network_type: ipv6

@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 9583
Build Status: SUCCESS
PRT Comment: pytest tests/foreman/cli/test_ansible.py -k test_positive_ansible_e2e --external-logging
Test Result : ========= 7 passed, 25 deselected, 770 warnings in 3917.48s (1:05:17) ==========

@Satellite-QE Satellite-QE added PRT-Passed Indicates that latest PRT run is passed for the PR and removed PRT-Failed Indicates that latest PRT run is failed for the PR labels Dec 11, 2024
Comment on lines +566 to +569
content = f'[{name}]\n' f'name={name}\n' f'baseurl={url}\n' 'enabled=1\n' 'gpgcheck=0\n'
# Add proxy configuration for IPv6
if settings.server.is_ipv6:
content += f'proxy={settings.http_proxy.http_proxy_ipv6_url}'
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just a small suggestion for keeping this same for IPv4 run and just add a newline for proxy for IPv6 run

Suggested change
content = f'[{name}]\n' f'name={name}\n' f'baseurl={url}\n' 'enabled=1\n' 'gpgcheck=0\n'
# Add proxy configuration for IPv6
if settings.server.is_ipv6:
content += f'proxy={settings.http_proxy.http_proxy_ipv6_url}'
content = f'[{name}]\n' f'name={name}\n' f'baseurl={url}\n' 'enabled=1\n' 'gpgcheck=0'
# Add proxy configuration for IPv6
if settings.server.is_ipv6:
content += f'\nproxy={settings.http_proxy.http_proxy_ipv6_url}'

content = f'[{name}]\n' f'name={name}\n' f'baseurl={url}\n' 'enabled=1\n' 'gpgcheck=0'
content = f'[{name}]\n' f'name={name}\n' f'baseurl={url}\n' 'enabled=1\n' 'gpgcheck=0\n'
# Add proxy configuration for IPv6
if settings.server.is_ipv6:
Copy link
Contributor

@jameerpathan111 jameerpathan111 Dec 11, 2024

Choose a reason for hiding this comment

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

@shubhamsg199 We already have support for this. You can use enable_ipv6_dnf_and_rhsm_proxy present in robottelo/hosts.py

def enable_ipv6_dnf_and_rhsm_proxy(self):

Copy link
Contributor

Choose a reason for hiding this comment

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

And if we go with this change I would suggest not enabling it by default. Each test should decide on its own as we had discussed this in JPL call.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jameerpathan111 Thanks, that would work, no need to go with this change if we already have the solution for it. I will update the PR

@shubhamsg199
Copy link
Contributor Author

Closing this as enable_ipv6_dnf_and_rhsm_proxy will do the job and will create a new PR for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.14.z Introduced in or relating directly to Satellite 6.14 6.15.z Introduced in or relating directly to Satellite 6.15 6.16.z Introduced in or relating directly to Satellite 6.16 AutoMerge_Cherry_Picked The cherrypicked PRs of master PR would be automerged if all checks passing CherryPick PR needs CherryPick to previous branches PRT-Passed Indicates that latest PRT run is passed for the PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants