Creating Execution Environment for AWX

722 views
Skip to first unread message

Arnaud PIZZETTA

unread,
Apr 13, 2022, 10:47:50 AM4/13/22
to AWX Project
Hi !

I'm currently trying to create a EE for AWX and I'm experiencing some issues.
i've download awx-ee environement for base (https://github.com/ansible/awx-ee)

And I'vejust added in requirements.txt the netaddr module I need.

---------------------------------requirement.txt------------------------------------- 
-----------------------------------------------------------------------------------------------

I've added in bindep.txt python3-netaddr module wich can be required too.

--------------------------------- bindep .txt--------------------------------------------
-----------------------------------------------------------------------------------------------

Then i build with docker :

I tag my image :

Finallly, I push it to quay.io

Then I add this EE in my AWX with :latest tag at the end of the link.
But jobs fails saying thath python's netaddr is not installed.

So I try to build image locally with podman and i've realized that python3-netaddr is installed with yum list installed command but netaddr module isn't....

Any ideas ?
Best regards.

Arnaud PIZZETTA

unread,
Apr 13, 2022, 10:49:33 AM4/13/22
to AWX Project
Sorry for double post but i've checked if netaddr is installed with pip list command obviously.

Rebeccah Hunter

unread,
Apr 13, 2022, 3:40:31 PM4/13/22
to AWX Project
Hey there, since you're doing a manual build using docker my first guess is that it could be a versioning issue to me.
What versions of python, netaddr, and ipaddr you have?
Cheers,
Beccah


Arnaud PIZZETTA

unread,
Apr 14, 2022, 2:36:24 AM4/14/22
to AWX Project
Hi, first, thanks for you'r reply.
I found that in my execution-environment.yml file, I forgot to set as dependecy my requirement.txt file...

So i added this line : 
-----------------------------------------execution-environment.yml------------------------------------------------
---
version: 1
build_arg_defaults:
  EE_BASE_IMAGE: 'quay.io/ansible/ansible-runner:latest'
dependencies:
  galaxy: _build/requirements.yml
  system: _build/bindep.txt
  python: requirements.txt
additional_build_steps:
  append:
    - RUN alternatives --set python /usr/bin/python3
    - COPY --from=quay.io/ansible/receptor:devel /usr/bin/receptor /usr/bin/receptor
    - RUN mkdir -p /var/run/receptor
    - ADD run.sh /run.sh
    - CMD /run.sh
    - USER 1000
    - RUN git lfs install
--------------------------------------------------------------------------------------------------------------------------------------

For the version I use, i set in _build/bindep.txt : 
----------------------------------------------------------bindep.txt------------------------------------------------------------
python38-devel [platform:rpm compile]
subversion [platform:rpm]
subversion [platform:dpkg]
git-lfs [platform:rpm]
python3-netaddr [platform:rpm]
--------------------------------------------------------------------------------------------------------------------------------------

For the versions installed i run the image locally with podman and type commands :
--------------------------------------------------------------------------------------------------------------------------------------
bash-4.4$ yum list installed python3-netaddr
python3-netaddr.noarch                     
0.7.19-8.el8

bash-4.4$ pip list | grep addr
ipaddress                          1.0.23

bash-4.4$ python3 --version
Python 3.8.12
--------------------------------------------------------------------------------------------------------------------------------------

But even after I've rebuild with the good dependencies, netaddr still not in pip list output..
There is another way than building with docker ?

Best regards.
Arnaud PIZZETTA

Arlan Lloyd

unread,
Apr 14, 2022, 3:52:50 AM4/14/22
to AWX Project
Here is an example building from a base Ubuntu image.   

https://github.com/acelinkit/ansibletools/blob/main/Dockerfile

Arnaud PIZZETTA

unread,
Apr 14, 2022, 5:38:21 AM4/14/22
to AWX Project
Hi guys !

First thanks to you two for answering me.
I've changed my building method by using ansible-builder.

Then I push to quay.io with podman push and it works !

Here the steps I followed :

1. Clone git repository of awx-ee locally.
2. Changed requirements (.txt, ;yml and bindep for packages)
3. Comment out EE_BASE_IMAGE: 'quay.io/ansible/ansible-runner:latest' in execution-environment.yml file because ansible-runner refuse it. (why ? I don't know...)
4. Launch build with ansible-builder build -t quay.io/a_pizzetta/hoplacloud-awx-ee2 --build-arg EE_BASE_IMAGE=quay.io/ansible/ansible-runner:latest -v3
5. Push to quay.io with podman push quay.io/a_pizzetta/hoplacloud-awx-ee2
6. Add Execution Environment in my AWX interface with link quay.io/a_pizzetta/hoplacloud-awx-ee2:latest

And it now works perfectly !

Best regards !
Arnaud PIZZETTA

Gabz Modz

unread,
Jun 30, 2022, 11:50:31 AM6/30/22
to AWX Project
This person is very saver, i love u so much bro its work for me !
Reply all
Reply to author
Forward
0 new messages