Hey there,
I wanted to make sure I don’t overlook something, before I open a bug report.
I created a custom EE for AWX 18, since installing collections didn’t work properly there.
It worked absolutely fine, when I set it as an image in the instance group → customize pod settings.
Now, with a brand new awx 19 installation, installing collections and roles workes absolutely fine, but when I try to use the same EE (with and without setting it in the instance group) the playbook fails instantly with the following error:
2021-04-08 15:00:15,229 ERROR [4a0369353c4f4fdbb45f873938b5f6a3] awx.main.tasks job 27 (running) Exception occurred while running task
Traceback (most recent call last):
File “/var/lib/awx/venv/awx/lib64/python3.8/site-packages/awx/main/tasks.py”, line 1397, in run
res = receptor_job.run()
File “/var/lib/awx/venv/awx/lib64/python3.8/site-packages/awx/main/tasks.py”, line 2957, in run
return self._run_internal(receptor_ctl)
File “/var/lib/awx/venv/awx/lib64/python3.8/site-packages/awx/main/tasks.py”, line 3008, in _run_internal
raise RuntimeError(detail)
RuntimeError: Error creating pod: container failed with exit code 1:
Did you customize your pod definition when you were on AWX 18? We made a small tweak. You’ll need to reset to the default value and build on top of that. Sorry for the confusion.
Unfortunately, I was not able to upgrade from AWX 18 (Tbh, I still don’t know why, but I might messed up the minikube enviroment). The setup in question is completely new. Is it neccessary to add the custom ee as specs while deploying?
Okay, I don’t know if anybody has the same problem, but I was able to find a workaround. Though I really would love if someone more capable than me, would be able to explain to me what I was missing while building the custom ee.
The problem is propably, that I’m missing some crucial dependencies while building my own ee, though I don’t know which.
If some should be struggeling with the same error: I cloned the github repo of the awx-ee project and appended the python modules which weren’t included in the already deployed ee.
Anyway: Thanks to the maintainers of the awx-ee-repo, I hope it is okay for me to take your code and build on it…and if someone knows where I might missed something… feel free to contact me.
I’m having exactly the same problem in AWX 19.0.0 (running with minikube) when trying to use an execution environment that I made using ansible-builder.
Traceback (most recent call last):
File “/var/lib/awx/venv/awx/lib64/python3.8/site-packages/awx/main/tasks.py”, line 1397, in run res = receptor_job.run()
File “/var/lib/awx/venv/awx/lib64/python3.8/site-packages/awx/main/tasks.py”, line 2957, in run return self._run_internal(receptor_ctl)
File “/var/lib/awx/venv/awx/lib64/python3.8/site-packages/awx/main/tasks.py”, line 3008, in _run_internal raise RuntimeError(detail) RuntimeError: Error creating pod: container failed with exit code 1:
Cloning the awx-ee repo and adding the collections and python modules I needed worked, but now I have much more stuff in the image than what I wanted. I had no experience with Docker or Kubernetes before having to install AWX, so this is a really steep learning curve for me.
I wish someone could do an example installation of an execution environment with custom collections and Python modules that works with AWX 19.0.0 and write a blog about it.
Hi, me too!!!
“I wish someone could do an example installation of an execution environment with custom collections and Python modules that works with AWX 19.0.0 and write a blog about it.”
That’s a nice blog, I had already studied it when trying to understand how ansible-builder works. But it’s missing a working example of how to get the execution environment working in AWX 19 without getting the “RuntimeError: Error creating pod: container failed with exit code 1:” error.
The only way I was able to use an execution environment in AWX 19 was to clone the https://github.com/ansible/awx-ee repo and add the collections and Python modules that I needed. But this adds a lot of unneeded collections and Python modules to the environment.
Hi, Please can you tell me details about how “The only way I was able to use an execution environment in AWX 19 was to clone the https://github.com/ansible/awx-ee repo and add the collections and Python modules that I needed. But this adds a lot of unneeded collections and Python modules to the environment.” ?
Sure, here are the steps:
git clone https://github.com/ansible/awx-ee.git
cd awx-ee
vim _build/requirements.yml # I just added the collections I needed at the bottom of this file
vim _build/requirements.txt # This file is new, contains the Python modules I need
vim execution-environment.yml # I added “python: _build/requirements.txt” under dependencies
cp run.sh _build/run.sh
cp run.sh context/run.sh # ansible-builder was complaining about run.sh missing, so I copied it to both the _build and the context folders (not sure which one is needed)
ansible-builder build --tag myuser/mytag --verbosity 3
I was then able to push the image to Docker Hub and specify that an Execution Environment in AWX 19.
It is a container at this point so you would push that into a repository like nexus /artifactory and then in awx there is an option under administration execution environments to add in the image
Ok, I’ve got something working but I need to track back exactly what I did!
Check you are running the latest devel release of ansible-builder which at time of writing is 1.0.0.0a1
If you just pip install ansible-runner you only get 0.6.0 which appears broken.
I’ll try to recreate a working example and post something either here or LinkedIn