-
Notifications
You must be signed in to change notification settings - Fork 23.7k
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
Cannot run ansible-test sanity behind a proxy #77304
Comments
Files identified in the description: If these files are incorrect, please update the |
This is most likely because ansible/test/lib/ansible_test/_internal/util.py Lines 361 to 378 in 7cb581e
|
I have the same problem. It looks like it changed between ansible-core 2.11 and 2.12. When doing this with python3.6 and ansible-core 2.11.x sanity test passes, but when I use python3.8+ and ansible-core 2.12 I'm getting the same error. |
@mattclay I have |
@df-cgdm @mkot02 As a temporary work-around, can you manually download the pip bootstrapping scripts before running The file(s) to download will depend on which Python version(s) are being used to run the sanity tests: For Python 3.6+: https://ci-files.testing.ansible.com/ansible-test/get-pip-21.3.1.py -> For Python 2.7 and 3.5: https://ci-files.testing.ansible.com/ansible-test/get-pip-20.3.4.py -> For Python 2.6: https://ci-files.testing.ansible.com/ansible-test/get-pip-9.0.3.py -> NOTE: The URLs above are from the |
Is there any option to skip this installation and use local environment ? |
@ketank1000 I recommend using the |
@mattclay I actually have cicd pipline and need to run the ansible-test command in docker itself, I have everything installed in docker container and want to avoid any further installation and use local environment. Do we have any option like that ? |
@ketank1000 If you include the If that isn't an option for you, you could build your container using the If neither of those work for you, then I can provide some tips on how to include the necessary requirements in your own container, but I don't recommend this approach. It requires the most setup and maintenance, since you'll need to keep in sync with the requirements of ansible-core as they change. Let me know if you'd like to try this approach. |
I am facing the same issue and @mattclay workaround worked for me. In core-2.11.0 that was not the case and if you managed to install pip by a proxy future virtualenvs created would already have pip installed and that problem would not arrive. Even though that seems to create issues in some cases, couldn't we have a way to decide that via an argument ? Ex: $ ansible-test sanity --test ansible-doc -vvv
Running sanity test "ansible-doc"
...
Run command: /usr/bin/python3.8 -m venv --without-pip ~/.ansible/test/venv/sanity.ansible-doc/3.8/948d72e0 This seems to be defined in the code here but there is no way to decide that via an argument I think: test/lib/ansible_test/_internal/venv.py
def create_virtual_environment(args, # type: EnvironmentConfig
python, # type: PythonConfig
path, # type: str
system_site_packages=False, # type: bool
pip=False, # type: bool <<< here
): # type: (...) -> bool` If I manage to change pip to True here and If I create an "empty" get-script (AKA not using it) it seems to work: What do you think? Just my two cents. |
I have the same situation when using --docker option - ansible-test doesn't pass proxy settings and |
With this commit the --proxy parameter is added to pip install. The value is sourced from the os environment. fixes ansible#77304
Since I've searched a bit to find a solution and find it quite of strange, when I got the error message and even a link to this issue here. I may as well leave it for sharing, how i've solved it as workaround. Here is what I did, downloaded the get-pip21.3.1.py and modified this line and made sure it is available in ~/.ansible/test/cache/get_pip_21_3_1.py: That fixed part of it, where it bootstraps the pip, unfortunately he still wants to install a lot of stuff after that for the virtualenv it builds, so I added a line to my .gitlab-ci.yml as well: After doing both, it just went through. May it be of some help to somebody else. |
Summary
When I try to run ansible-test it tries to download files from ansible-ci-files.s3.amazonaws.com/ansible-test.
The problem is that I'm behind a proxy
Even by setting env http_proxy it's not working
Issue Type
Bug Report
Component Name
bin/ansible-test
Ansible Version
Configuration
OS / Environment
debian
Steps to Reproduce
''''
Expected Results
I expect to be able to run ansible-test either by setting the proxy.
I should also be able to run ansible-test without connection to internet (I use it likes that in version 2.10)
Actual Results
Code of Conduct
The text was updated successfully, but these errors were encountered: