ansible-openqa-cloud

Created 23 days ago
Maintained by dbrouwer
Build and run a containerized deployment of openQA designed to use cloud resources.
Members 1
Deborah Brouwer committed 5 hours ago

About

There are three playbooks:

  1. openqa-cloud-server.yml will build, install, and run the openqa web server including the reverse-proxy, database, and scheduler.

  2. openqa-cloud-worker-container.yml will build, install and run 16 "generic" workers of class qemu_x86_64.

  3. openqa-cloud-worker-tap.yml will build, install and run 12 tap workers and 4 tap2 workers.

Examples

web server: run locally

ansible-playbook \
-e web_ip_private=$(hostname -I | awk '{print $1}') \
-e auth=Fake \
-e use_http=true \
-e dir=$HOME/my_cloud \
playbooks/hosts/openqa-cloud-server.yml \
--connection=local

web server: run on public ip

ansible-playbook \
-e web_ip_private=$(hostname -I | awk '{print $1}') \
-e web_ip_public=$(curl ipinfo.io/ip) \
-e apikey=<> \
-e apisecret=<> \
-e dir=$HOME/cloud_server \
playbooks/hosts/openqa-cloud-server.yml

worker containers: run locally

Warning: if using 'Fake' authentication, login to the web UI before running workers.

ansible-playbook \
-e worker_ip_private=$(hostname -I | awk '{print $1}')  \
-e use_http=true \
-e dir=$HOME/my_cloud \
playbooks/hosts/openqa-cloud-worker-container.yml \
--connection=local

worker containers: run with public web server

ansible-playbook \
-e worker_ip_private=$(hostname -I | awk '{print $1}')  \
-e web_ip_public=<> \
-e worker_ip_public=$(curl ipinfo.io/ip) \
-e apikey=<> \
-e apisecret=<> \
-e dir=$HOME/my_cloud_worker \
playbooks/hosts/openqa-cloud-worker-container.yml

tap workers: run with public web server

ansible-playbook \
-e worker_ip_private=$(hostname -I | awk '{print $1}')  \
-e web_ip_public=<> \
-e worker_ip_public=$(curl ipinfo.io/ip) \
-e apikey=<> \
-e apisecret=<> \
-e eth=$(ls -1 /sys/class/net | grep -E '^(en|eth)[0-9]*') \
playbooks/hosts/openqa-cloud-worker-tap.yml

webserver: stop manually

sudo systemctl stop openqa-reverse-proxy;
sudo systemctl stop openqa-dispatcher;
sudo systemctl stop openqa-webserver;
sudo systemctl stop openqa-database

generic workers: stop manually

sudo systemctl stop openqa-worker@{0..15}

tap workers: stop manually

Note the "tap" workers are called "plain" this is how they are named in the fedora openqa-worker package

sudo systemctl stop openqa-worker-plain@{0..15}

list workers

    sudo systemctl list-units --all 'openqa-worker@*.service';
    sudo systemctl list-units --all 'openqa-worker-plain@*.service';

Optional variables with their defaults:

Environment Variable Default Options
-e web_ip_public web_ip_private The ip address to access the web UI. If testing locally, leave this blank and it will just use the local ip. If not testing locally, provide a public ip or domain name e.g. openqa.fedorainfracloud.org. Warning: DO NOT use 127.0.0.1 or localhost for ANY ip address since this confuses the containers.
-e auth OpenID Set auth=Fake to test with demo user
-e use_http false Set use_http=true if the public ip has missing or self-signed certificates, so that tests can be scheduled and workers can run.
-e apikey 1234567890ABCDEF
-e apisecret 1234567890ABCDEF
-e dir $HOME Specify a directory for the containers.
-e eth eth0 Ethernet interface name for tap workers.

Load some tests

Warning: login through the web UI before loading tests; even if using 'Fake' authentication

podman exec -it openqa-webserver /bin/bash -c "cd /var/lib/openqa/share/tests/fedora/; ./fifloader.py --load templates.fif.json templates-updates.fif.json;"

Schedule tests

If you wait long enough, the openqa-dispatcher will pick up fedora messages with an image to test. Or to schedule a test manually get a BUILDULR from the "Settings" tab of any test by clicking through the test's coloured dot: https://openqa.fedoraproject.org

podman exec -it openqa-dispatcher /bin/bash -c "source /venv/bin/activate; fedora-openqa --use-vde compose -f https://kojipkgs.fedoraproject.org/compose/cloud/Fedora-Cloud-38-20240426.0/compose"