ansible / awx

AWX provides a web-based user interface, REST API, and task engine built on top of Ansible. It is one of the upstream projects for Red Hat Ansible Automation Platform.
Other
14.06k stars 3.42k forks source link

Docker Documentation Not Working #15262

Open ckozler opened 5 months ago

ckozler commented 5 months ago

Please confirm the following

Bug Summary

Following this document to the letter in 3 tracked separate attempts. I am using Rocky Linux 9. I have tried from HEAD as well as 24.5.0 and all versions back to 24.0.0

https://github.com/ansible/awx/blob/devel/tools/docker-compose/README.md

And I am met with a different error in each tag so it feels like something is broken somewhere (dependency?)

Error 1 https://github.com/ansible/awx/issues/14876 Error 2 https://github.com/containers/podman/issues/21032 Error 3 https://github.com/containers/podman/issues/21024

Everything installs but Error 1 is showing the entire time inside make docker-compose logs. Error 2 and 3 are seen whenever I try to sync a project or run a template.

Each build takes me about 35 minutes or so as I have to snap the DO VM back to base install each time I want to make another attempt.

I was going to attempt other OS's like CentOS Stream 9 and RHEL directly but did not want to waste my time repeating the same issues as these are all the same derivative I would expect them to fail in the same way.

I've tried from tag 24.5.0 until 24.0.0 and each time I face a different error. The most common are the above.

No epel in use. Stock RL9 image from DO.

Ansible version installed not using EPEL [root@sfo3do-awx ~]# ansible --version ansible [core 2.15.12] config file = None configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /root/.local/lib/python3.9/site-packages/ansible ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections executable location = /root/.local/bin/ansible python version = 3.9.18 (main, Jan 24 2024, 00:00:00) [GCC 11.4.1 20231218 (Red Hat 11.4.1-3)] (/usr/bin/python3) jinja version = 3.1.4 libyaml = True

AWX version

24.5.0 - 24.0.0

Select the relevant components

Installation method

docker development environment

Modifications

no

Ansible version

2.5.12

Operating system

RockyLinux 9

Web browser

No response

Steps to reproduce

Documented above

Expected results

Can sync projects and run templates

Actual results

I cannot. While AWX installs fine nothing seems to work on the internals.

Additional information

A user on the ansible forums with similar issues as me but they went further back to 23.3.1 https://forum.ansible.com/t/updating-awx-image-on-docker/1850/6

ckozler commented 5 months ago

Fixed some typos on versions I tried. To clarify, issues seem to exist for me across the entire 24 version. I tried version 23 once without paying much attention and it failed because docker-compose command is replaced as a plugin in the version of docker installed via the above process so it appears as if there are a bunch of cross dependencies I am not seeing? While installation works it does not seem functional. I am still testing.

ckozler commented 5 months ago

I can confirm that, for me, I am unable to build a functional version 24. Running 23.8.1 and I can refresh projects and run templates. The attached script is a bootstrap script. The only dependency is needing an SSH key with root access in your ~/.ssh directory that will work with the destination.

I had to try so many times that I figured in the spirit of automation I should create a reproducible build. So I built it by hand a bunch and then ported it all in to a script. Observed the same failures by hand and by the automation script for version 24. Ran for the first time on 23.8.1 and everything was complete with UI accessible

awx-docker-deploy.sh.zip

Screenshot showing the bulk of the script

2024-06-08-150855_1104x334_scrot

ckozler commented 5 months ago

The attached two scripts can successfully deploy 23.8.1 and 24.5.0. The same requirements as the other script but just cleaned up with some more structure. awx-deploy.zip

This was in an effort to test as many other versions as I could to see what the issue was and can confirm the 24.x seems "broke" when doing the docker install.

Please let me know what you would like me to test. I cannot find any issues logged which have the same problem as I describe here.

gdeleon23 commented 2 months ago

I @ckozler

I test the version 24.6.0 on Ubuntu 22 LTS, i put all my commands to work correctly:

Installation of docker

sudo apt -y update
sudo apt -y install apt-transport-https ca-certificates curl gnupg-agent software-properties-common python3-venv python3-pip python3-dev
sudo pip3 install pytest virtualenv
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/docker-archive-keyring.gpg
sudo add-apt-repository -y "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt update
sudo apt -y install docker-ce docker-ce-cli containerd.io
sudo usermod -aG docker $USER
sudo curl -L https://github.com/docker/compose/releases/download/v2.18.1/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
sudo systemctl enable docker

Installation of awx ifr

git clone -b 24.6.0 https://github.com/ansible/awx.git
cd awx
CONTAINERCMD=docker TAG=quay.io/ansible/receptor:latest make container
export RECEPTOR_IMAGE=quay.io/ansible/receptor:latest
export DEVEL_IMAGE_NAME=ghcr.io/ansible/awx_devel:24.6.0
COMPOSE_TAG=24.6.0 make docker-compose-build 
COMPOSE_TAG=24.6.0 make docker-compose COMPOSE_UP_OPTS=-d
docker exec tools_awx_1 make clean-ui ui-devel
docker exec -ti tools_awx_1 awx-manage createsuperuser

Username (leave blank to use 'awx'): soy_root Email address: xxx@gmail.com Password: Password (again): Superuser created successfully.

Install awx-ui

cd awx/ui
docker build -t awx-ui .
docker run --name tools_ui_1 --network awx --link 'tools_awx_1:awx' -e TARGET="https://awx:8043" -p '3001:3001' --rm -v $(pwd)/src:/ui/src awx-ui

Compiled successfully! You can now view ui in the browser.

Local: https://localhost:3001 On Your Network: https://172.19.0.5:3001

And now i can login with my previous user called "soy_root"

I hope this is helpful.