ansible / awx-ee

An Ansible execution environment for AWX project
https://quay.io/ansible/awx-ee
Other
132 stars 158 forks source link

Support the latest `vsphere-automation-sdk-python` as required by `community.vmware` #137

Closed kurokobo closed 1 year ago

kurokobo commented 1 year ago

Just to inform, daily builds seem to be failing since Sep. 29.

I have not looked into it in detail, but it seems to be taking an extremely long time to resolve dependencies by pip and is facing a 6 hour timeout.

https://github.com/ansible/awx-ee/actions

EDIT AFTER CASE CLOSED: The upstream ansible-runner image still needs to be fixed, but at this time as @shanemcd did in #141 adding ansible-runner>=2.2.1 to requirements.txt for Ansible Builder is the simplest workaround.

kurokobo commented 1 year ago

This seems to be caused by this commit on vsphere-automation-sdk-python: https://github.com/vmware/vsphere-automation-sdk-python/commit/4b49fbbcf3169020966b9c4c44d8a5454cca7bec This commit updated whls in the repository, and updated whls have updated dependencies.

My guess is:

Of course the latest vsphere-automation-sdk-python should be supported, but as a temporary (and super dirty) workaround, we can pin the version of vsphere-automation-sdk-python by following patch.

EDIT: Outdated workaround ```patch diff --git a/tox.ini b/tox.ini index e773891..28a9d44 100644 --- a/tox.ini +++ b/tox.ini @@ -10,21 +10,29 @@ deps = -r{toxinidir}/requirements.txt [testenv:podman] passenv = HOME -whitelist_external = +whitelist_externals = true + sed + podman commands = /bin/bash -c "podman rmi quay.io/ansible/awx-ee:latest || true" - ansible-builder build -v3 -c . -t quay.io/ansible/awx-ee {posargs} + ansible-builder create -v3 -c . + sed -ri 's/^(RUN ansible-builder introspect.*)$/\1; sed -i \'s\/vsphere-automation-sdk-python.git\/vsphere-automation-sdk-python.git@46aa57de24420ead6af13fe4c8783f1ff66ffcfd\/g\' \/tmp\/src\/requirements.txt/g' Containerfile + podman build {posargs} . [testenv:docker] passenv = HOME DOCKER_BUILDKIT -whitelist_external = +whitelist_externals = true + sed + docker commands = /bin/bash -c "podman rmi quay.io/ansible/awx-ee:latest || true" - ansible-builder build -v3 -c . -t quay.io/ansible/awx-ee {posargs} --container-runtime=docker + ansible-builder create -v3 -c . + sed -ri 's/^(RUN ansible-builder introspect.*)$/\1; sed -i \'s\/vsphere-automation-sdk-python.git\/vsphere-automation-sdk-python.git@46aa57de24420ead6af13fe4c8783f1ff66ffcfd\/g\' \/tmp\/src\/requirements.txt/g' Containerfile + docker build {posargs} . [testenv:check-diff] passenv = ```
thedatabaseme commented 1 year ago

@kurokobo Removing community-vmware fixes the issue for me. So within there, the problem seems to be.

kurokobo commented 1 year ago

Instead of using temporary workaround, to support updated vsphere-automation-sdk-python, there seems to be additional considerations:

mumohamm commented 1 year ago

Can you please let me know how to apply the patch?

kurokobo commented 1 year ago

@mumohamm

EDIT: Outdated workaround You can divide following `ansible-builder build` command; ```bash ansible-builder build --tag registry.example.com/ansible/ee:2.12-custom --container-runtime docker --verbosity 3 ``` into following three steps; ```bash # Create context files including Dockerfile. # This will create `context` directory on current directory. ansible-builder create --verbosity 3 # Modify Dockerfile to edit `requirements.txt` used during build process # This will append `; sed ... /tmp/src/requirements.txt` command to modify `requirements.txt` at the end of existing `ansible-builder introspect` command sed -ri 's/^(RUN ansible-builder introspect.*)$/\1; sed -i s\/vsphere-automation-sdk-python.git\/vsphere-automation-sdk-python.git@46aa57de24420ead6af13fe4c8783f1ff66ffcfd\/g \/tmp\/src\/requirements.txt/g' context/Dockerfile # Build EE docker build -t registry.example.com/ansible/ee:2.12-custom context ```
thedatabaseme commented 1 year ago

@kurokobo FYI, cryptography was fixed to this Version due to issue https://github.com/ansible/awx-ee/issues/134

djyasin commented 1 year ago

@shanemcd will be happy to help whoever picks this issue up.

relrod commented 1 year ago

Fixed by #141

kurokobo commented 1 year ago

@shanemcd @relrod Thanks for working on this :)