From Fedora Project Wiki

(replace some more backticks with {{code}})
m (Remove outdated link to docker containers for openQA)
 
(10 intermediate revisions by 6 users not shown)
Line 1: Line 1:
This page provides specific steps to do a basic one-system installation of [[openQA]] (with jobs run on the same system as the server) on Fedora (25 or higher), directly to the system. See [[OpenQA docker installation guide]] if you would prefer to deploy openQA into Docker containers. For more details and background information on this process, see [https://github.com/os-autoinst/openQA/blob/master/docs/Installing.asciidoc the upstream install guide].
This page provides specific steps to do a basic one-system installation of [[openQA]] (with jobs run on the same system as the server) on Fedora (25 or higher), directly to the system. For more details and background information on this process, see [https://github.com/os-autoinst/openQA/blob/master/docs/Installing.asciidoc the upstream install guide].
{{admon/warning|trial on PowerPC host|refer to few comments in discussion tab.}}


* Install the required packages:
* Install the required packages:
  sudo dnf install openqa openqa-httpd openqa-worker
  sudo dnf install openqa openqa-httpd openqa-worker fedora-messaging python3-jsonschema
* Configure httpd:
* Configure httpd:
  cd /etc/httpd/conf.d/
  cd /etc/httpd/conf.d/
  cp openqa.conf.template openqa.conf
  cp openqa.conf.template openqa.conf
  cp openqa-ssl.conf.template openqa-ssl.conf
  cp openqa-ssl.conf.template openqa-ssl.conf
setsebool -P httpd_can_network_connect 1
systemctl restart httpd
* Configure the web UI by editing {{filename|/etc/openqa/openqa.ini}}:
* Configure the web UI by editing {{filename|/etc/openqa/openqa.ini}}:
  [global]
  [global]
Line 20: Line 23:
  provider = https://id.fedoraproject.org/
  provider = https://id.fedoraproject.org/
  httpsonly = 1
  httpsonly = 1
* install and configure PostgreSQL required for new version of openQA
<nowiki>
dnf install postgresql-server
postgresql-setup --initdb</nowiki>
* Start the services (consider also running {{code|enable}} if you want persistence):
* Start the services (consider also running {{code|enable}} if you want persistence):
<nowiki>
systemctl start postgresql
  systemctl start httpd
  systemctl start httpd
  systemctl start openqa-gru
  systemctl start openqa-gru
Line 26: Line 35:
  systemctl start openqa-websockets
  systemctl start openqa-websockets
  systemctl start openqa-webui
  systemctl start openqa-webui
systemctl start fm-consumer@fedora_openqa_scheduler</nowiki>
* Create non-temporary API keys in the web interface at {{code|http://localhost}}. Click ''Login'', then ''Manage API Keys'' and create a key and secret. Edit {{filename|/etc/openqa/client.conf}} as follows:
* Create non-temporary API keys in the web interface at {{code|http://localhost}}. Click ''Login'', then ''Manage API Keys'' and create a key and secret. Edit {{filename|/etc/openqa/client.conf}} as follows:
  [localhost]
  [localhost]
Line 35: Line 45:
* Check out the Fedora tests and load them into openQA:
* Check out the Fedora tests and load them into openQA:
  cd /var/lib/openqa/tests/
  cd /var/lib/openqa/tests/
  git clone https://pagure.io/fedora-qa/os-autoinst-distri-fedora.git
  git clone https://pagure.io/fedora-qa/os-autoinst-distri-fedora.git fedora
  chown -R geekotest:geekotest fedora
  chown -R geekotest:geekotest fedora
  cd fedora
  cd fedora
  ./templates
  ./fifloader.py -l -c templates.fif.json templates-updates.fif.json
* To run some of the tests, you will also need to build some hard disk images:
* To run some of the tests, you will also need to build some hard disk images:
  git clone https://pagure.io/fedora-qa/createhdds.git ~/createhdds
  git clone https://pagure.io/fedora-qa/createhdds.git ~/createhdds
Line 54: Line 64:
  cd /var/lib/openqa/share/tests/fedora
  cd /var/lib/openqa/share/tests/fedora
  git pull
  git pull
  ./templates --clean
  ./fifloader.py -l -c templates.fif.json templates-updates.fif.json


At this point you should be able to schedule jobs (see the [https://pagure.io/fedora-qa/fedora_openqa fedora_openqa] instructions) and most of the tests should work. However, a few of the tests require two or more workers to be able to communicate with each other (e.g. the FreeIPA tests, where one job sets up a server, and other jobs set up clients and try to connect to the server). For these tests to work, you must do some quite complex software-defined networking configuration on the worker host(s). Instructions for this are in the page [[OpenQA_advanced_network_guide]].
At this point you should be able to schedule jobs (see the [https://pagure.io/fedora-qa/fedora_openqa fedora_openqa] instructions) and most of the tests should work. However, a few of the tests require two or more workers to be able to communicate with each other (e.g. the FreeIPA tests, where one job sets up a server, and other jobs set up clients and try to connect to the server). For these tests to work, you must do some quite complex software-defined networking configuration on the worker host(s). Instructions for this are in the page [[OpenQA_advanced_network_guide]].
{{anchor|tpm}}
To run some tests (currently only one specific test for IoT images), you will also need to set up TPM emulation. To do this:
dnf install swtpm swtpm-tools
curl -o /etc/systemd/system/openqa-swtpm@.service https://pagure.io/fedora-infra/ansible/blob/master/f/roles/openqa/worker/files/openqa-swtpm@.service
systemctl daemon-reload
curl -o systemd-swtpm.pp https://pagure.io/fedora-infra/ansible/blob/master/f/roles/openqa/worker/files/systemd-swtpm.pp
semodule -i ./systemd-swtpm.pp
systemctl enable openqa-swtpm@1.service
systemctl start openqa-swtpm@1.service
Repeat the last two commands as many times as you have worker instances enabled, incrementing the number each time (so if you have three worker instances, do them three times, for {{code|openqa-swtpm@1.service}}, then {{code|openqa-swtpm@2.service}}, then {{code|openqa-swtpm@3.service}}). You will also need to edit {{filename|/etc/openqa/workers.ini}} and include {{code|tpm}} in the {{code|WORKER_CLASS}} setting.


[[Category:openQA]]
[[Category:openQA]]

Latest revision as of 17:44, 11 June 2024

This page provides specific steps to do a basic one-system installation of openQA (with jobs run on the same system as the server) on Fedora (25 or higher), directly to the system. For more details and background information on this process, see the upstream install guide.

trial on PowerPC host
refer to few comments in discussion tab.
  • Install the required packages:
sudo dnf install openqa openqa-httpd openqa-worker fedora-messaging python3-jsonschema
  • Configure httpd:
cd /etc/httpd/conf.d/
cp openqa.conf.template openqa.conf
cp openqa-ssl.conf.template openqa-ssl.conf
setsebool -P httpd_can_network_connect 1
systemctl restart httpd
  • Configure the web UI by editing /etc/openqa/openqa.ini:
[global]
branding=plain
download_domains = fedoraproject.org
  • To use insecure but convenient 'fake' authentication, add:
[auth]
method = Fake
  • To use more secure FAS-based authentication, add:
[auth]
method=OpenID
[openid]
provider = https://id.fedoraproject.org/
httpsonly = 1
  • install and configure PostgreSQL required for new version of openQA
dnf install postgresql-server
postgresql-setup --initdb
  • Start the services (consider also running enable if you want persistence):
 systemctl start postgresql
 systemctl start httpd
 systemctl start openqa-gru
 systemctl start openqa-scheduler
 systemctl start openqa-websockets
 systemctl start openqa-webui
 systemctl start fm-consumer@fedora_openqa_scheduler
  • Create non-temporary API keys in the web interface at http://localhost. Click Login, then Manage API Keys and create a key and secret. Edit /etc/openqa/client.conf as follows:
[localhost]
key = insert key from web api
secret = insert secret from web api
  • Start a worker, and check that it shows up in the web UI admin interface:
systemctl start openqa-worker@1
  • To start more workers, change the number after the @ sign in the above command.
  • Check out the Fedora tests and load them into openQA:
cd /var/lib/openqa/tests/
git clone https://pagure.io/fedora-qa/os-autoinst-distri-fedora.git fedora
chown -R geekotest:geekotest fedora
cd fedora
./fifloader.py -l -c templates.fif.json templates-updates.fif.json
  • To run some of the tests, you will also need to build some hard disk images:
git clone https://pagure.io/fedora-qa/createhdds.git ~/createhdds
dnf install libguestfs-tools libguestfs-xfs python3-fedfind python3-libguestfs libvirt-daemon-config-network libvirt-python3 virt-install withlock
mkdir -p /var/lib/openqa/factory/hdd/fixed
cd /var/lib/openqa/factory/hdd/fixed
~/createhdds/createhdds.py all
chown geekotest *
Long running process
Note that this will take quite a long time to run. You can continue with the rest of the set up while it runs, but until all the images are generated, some tests will fail to run correctly.
  • [optional] Set up a cron job that will run regularly and re-generate some of the images every two weeks or so. Create a file /etc/cron.daily/createhdds with this content (adjusting /path/to/createhdds as appropriate):
#!/bin/sh
cd /var/lib/openqa/share/factory/hdd/fixed
LIBGUESTFS_BACKEND=direct withlock /var/lock/createhdds.lock /path/to/createhdds/createhdds.py all --clean
  • To stay up-to-date as the tests are updated, you can do this periodically:
cd /var/lib/openqa/share/tests/fedora
git pull
./fifloader.py -l -c templates.fif.json templates-updates.fif.json

At this point you should be able to schedule jobs (see the fedora_openqa instructions) and most of the tests should work. However, a few of the tests require two or more workers to be able to communicate with each other (e.g. the FreeIPA tests, where one job sets up a server, and other jobs set up clients and try to connect to the server). For these tests to work, you must do some quite complex software-defined networking configuration on the worker host(s). Instructions for this are in the page OpenQA_advanced_network_guide.

To run some tests (currently only one specific test for IoT images), you will also need to set up TPM emulation. To do this:

dnf install swtpm swtpm-tools
curl -o /etc/systemd/system/openqa-swtpm@.service https://pagure.io/fedora-infra/ansible/blob/master/f/roles/openqa/worker/files/openqa-swtpm@.service
systemctl daemon-reload
curl -o systemd-swtpm.pp https://pagure.io/fedora-infra/ansible/blob/master/f/roles/openqa/worker/files/systemd-swtpm.pp
semodule -i ./systemd-swtpm.pp
systemctl enable openqa-swtpm@1.service
systemctl start openqa-swtpm@1.service

Repeat the last two commands as many times as you have worker instances enabled, incrementing the number each time (so if you have three worker instances, do them three times, for openqa-swtpm@1.service, then openqa-swtpm@2.service, then openqa-swtpm@3.service). You will also need to edit /etc/openqa/workers.ini and include tpm in the WORKER_CLASS setting.