Custom EE images for AWX 0.21.0 ?

638 views
Skip to first unread message

Dane DeValcourt

unread,
May 17, 2022, 9:33:24 PM5/17/22
to AWX Project
Following this guide for creating custom EE images for AWX, for our brand new install of 0.21.0.  https://www.linkedin.com/pulse/creating-custom-ee-awx-phil-griffiths/

Notice the quay image they point to for receptor is 0.9.7.  Also noticed there are new tags listed, like 1.0.0 now.  Safe to use the latest tag to build new images or stick with 0.9.7 ? 

Any dependency on the version of AWX your running and the version of receptor to use?

AWX Project

unread,
May 18, 2022, 5:24:05 PM5/18/22
to AWX Project
Hi!

that guide looks a little out of date, receptor is not needed for custom EE images

Also, the latest receptor images are now hosted at quay.io/ansible/receptor

Seth

Dane DeValcourt

unread,
May 19, 2022, 5:39:52 PM5/19/22
to AWX Project
Is there a better source on how to do custom EE using the latest versions of things for AWX 0.21.0 ?

This doesn't seem to elaborate much on it:


I need to be able to build custom ee with various requirements.txt from python venv.

Having issues with the original instructions I referenced complaining about:

RuntimeError("Install aborted - please install python-rpm from distribution system.")

My bindep.txt contains:

python3 [platform:rpm compile]
gcc [platform:rpm compile]
subversion [platform:rpm]
subversion [platform:dpkg]
git-lfs [platform:rpm]

AWX Project

unread,
May 19, 2022, 6:03:21 PM5/19/22
to AWX Project
the official docs live here https://ansible-builder.readthedocs.io/en/stable/

awx ships with a default execution environment. Here is the execution_environment.yml that is used in ansible-builder that will create the image


You can see how it is done there to get an idea for your own EE

As I mentioned, receptor isn't needed here so you can take out that line

Dane DeValcourt

unread,
May 20, 2022, 12:00:13 PM5/20/22
to AWX Project
I'm facing an error in building a custom image that I'm unsure about.

execution-environment.yml:

---
version: 1

build_arg_defaults:

dependencies:
galaxy: requirements.yml
python: requirements.txt

additional_build_steps:
append:
- RUN alternatives --set python /usr/bin/python3


requirements.yml:

---
collections:
- community.general


requirements.txt:

ansible==2.8.8
asn1crypto==0.24.0
Babel==2.5.1
bcrypt==3.2.0
certifi==2020.12.5
cffi==1.14.4
chardet==3.0.4
colorama==0.4.4
configparser==5.0.1
cryptography==3.3.1
future==0.18.2
# gpg==1.10.0
icdiff==1.9.1
idna==2.10
importlib-resources==5.1.0
Jinja2==2.11.2
jmespath==0.9.0
jsnapy==1.3.3
junos-eznc==2.3.1
jxmlease==1.0.1
lxml==4.6.2
MarkupSafe==1.1.1
ncclient==0.6.6
netaddr==0.8.0
netmiko==3.3.3
ntc-templates==1.6.0
paramiko==2.7.2
pexpect==4.8.0
ply==3.9
psutil==5.7.0
# psycopg2==2.7.5
ptyprocess==0.6.0
pyasn1==0.3.7
pycparser==2.20
Pygments==2.7.3
PyNaCl==1.4.0
pyparsing==2.4.7
pyserial==3.5
pysftp==0.2.9
python-dateutil==2.6.1
python-memcached==1.59
pytz==2017.2
PyYAML==5.3.1
requests==2.23.0
rpm
scp
selinux
six==1.11.0
supervisor==4.2.1
tenacity==6.3.1
textfsm==1.1.0
transitions==0.8.5
urllib3==1.25.11
virtualenv==16.7.10
yamlordereddictloader==0.4.0
zipp==3.4.0



Command to build:



Error:

Running command:
  docker build -f context/Dockerfile -t repo.somesite.com:5001/ee/awx-ansible28_py3_juniper-ee:latest context
...showing last 20 lines of output...
#16 742.3         File "/tmp/pip-install-00pi_m22/rpm_fc22e8a11390467882170438a89c4272/setup.py", line 8, in <module>
#16 742.3           raise RuntimeError("Install aborted - please install python-rpm from distribution system.")
#16 742.3       RuntimeError: Install aborted - please install python-rpm from distribution system.
#16 742.3       [end of output]
#16 742.3
#16 742.3   note: This error originates from a subprocess, and is likely not a problem with pip.
#16 742.3 error: metadata-generation-failed
#16 742.3
#16 742.3 × Encountered error while generating package metadata.
#16 742.3 ╰─> See above for output.
#16 742.3
#16 742.3 note: This is an issue with the package mentioned above, not pip.
#16 742.3 hint: See above for details.
#16 742.6 WARNING: You are using pip version 22.0.3; however, version 22.1 is available.
#16 742.6 You should consider upgrading via the '/usr/bin/python3 -m pip install --upgrade pip' command.
#16 ERROR: executor failed running [/bin/sh -c assemble]: exit code: 1
------
 > [builder 5/5] RUN assemble:
------
executor failed running [/bin/sh -c assemble]: exit code: 1

An error occured (rc=1), see output line(s) above for details.



Any ideas what I'm doing wrong or what I can do better to actually get these to build correctly?

Thanks,
Dane

AWX Project

unread,
Jun 1, 2022, 5:28:00 PM6/1/22
to AWX Project
"please install python-rpm from distribution system"

I tried this myself and found this workaround

remove the "rpm" from requirements.txt

you'll hit an error when compiling psutils, saying that you need gcc, so you can add a system: bindep.txt file with gcc

dependencies:
  galaxy: requirements.yml
  python: requirements.txt
  system: bindep.txt


in bindep.txt

gcc [compile]
gcc-c++ [compile]
python38-devel [compile]

the [compile] tag will ensure these dependencies will only be on the system for compiling python modules, and removed afterward

At this point ansible-builder build will work, but you'll be missing the rpm package. Is there any particular reason you need this package?

you could put python3-rpm in the bindep.txt, however, it will install the wrong one (will be installed for python3.6, not for python3.8, which is what ansible-runner is going to use). python38-rpm doesn't exist.

If you need python-rpm, you'll need to find a workaround for that.

Seth

Jeremy Bouse

unread,
Jun 3, 2022, 12:36:34 AM6/3/22
to AWX Project
If it helps... This is my custom EE build https://github.com/ugns/awx-custom-ee. I have it working on three AWX deployments via 0.22.0 operator and running 21.1.0.
Reply all
Reply to author
Forward
0 new messages