action #43715
closedcoordination #80142: [saga][epic] Scale out: Redundant/load-balancing deployments of openQA, easy containers, containers on kubernetes
coordination #43706: [epic] Generate "download&use" docker image of openQA for SUSE QA
Update upstream dockerfiles to provide an easy to use docker image of workers
Description
Acceptance criteria¶
- AC1: DONE Ensure there is a working Docker file that builds an image
- AC2: DONE Documented steps to run the worker from the image
- AC3: DONE The worker can connect to a webui and run tests
Suggestions¶
- The upstream dockerfile can be used to generate a docker image of the worker in https://build.opensuse.org/package/show/devel:openQA/openQA
- Docker images for the worker are generated each time a new build of openQA is triggered in https://build.opensuse.org/package/show/devel:openQA/openQA
- QA developers can download that docker image and run a container from it that is ready to use (no configuration needed)
- Proper documentation of the use of that docker image is available upstream: https://github.com/os-autoinst/openQA/tree/master/docker
- OBS support for docker https://openbuildservice.org/help/manuals/obs-user-guide/cha.obs.building.html#id-1.5.8.3.8
Updated by szarate almost 6 years ago
- Related to action #43718: Docker image for webui and workers are versioned and uploaded to obs registry added
Updated by szarate almost 6 years ago
- Related to deleted (action #43718: Docker image for webui and workers are versioned and uploaded to obs registry)
Updated by okurz almost 6 years ago
- Target version changed from Milestone 22 to Milestone 24
Updated by okurz over 5 years ago
- Subject changed from [functional][u] Update upstream dockerfiles to provide an easy to use docker image of workers to Update upstream dockerfiles to provide an easy to use docker image of workers
- Category set to Feature requests
- Priority changed from Normal to Low
- Target version deleted (
Milestone 24)
See #43706#note-10
Updated by livdywan about 4 years ago
- Blocked by action #43712: Update upstream dockerfiles to provide an easy to use docker image of openQA-webui added
Updated by livdywan about 4 years ago
Let's consider this Blocked in the sense that the steps required are the same with a focus on the worker vs. the web UI.
Updated by ilausuch about 4 years ago
Before to work on this ticket I would like to complete this one https://progress.opensuse.org/issues/69355 because it's related and maybe dependent on how this is resolved
Updated by livdywan about 4 years ago
- Related to action #69355: [spike] redundant/load-balancing webui deployments of openQA added
Updated by ilausuch about 4 years ago
- Status changed from Blocked to In Progress
Updated by ilausuch about 4 years ago
One interesting thing should we consider is about the --link parameter in the docker run for the workers. There is an alert about that in this link https://docs.docker.com/network/links/
Updated by ilausuch about 4 years ago
Two initial problems to fix during the build
- Package 'qemu-uefi-aarch64' not found
- /root/qemu/kvm-mknod.sh: line 6: gunzip: command not found
Updated by ilausuch about 4 years ago
Updated by ilausuch about 4 years ago
New problems to solve
- gzip: /proc/config.gz: No such file or directory
- mknod: /dev/kvm: File exists
- Unable to make /dev/kvm node; software emulation will be used (This can happen if the container is run without -privileged)
In the last case, I think is because of configuration
Updated by okurz about 4 years ago
- Related to action #73450: POC: Create openQA worker container image (feature) added
Updated by okurz about 4 years ago
- Due date set to 2020-10-28
As I think you are actually working on this we should aim for not exceeding our usual cycle times for tickets, hence setting the due date to what I consider feasible and useful. Please make sure to provide an update soon and feel free to unassign again if you are not actually (anymore?) working on this
Updated by ilausuch about 4 years ago
Doing some tests on the worker I realized that the worker cannot start because:
[info] [pid:44] Project dir for host http://webui_haproxy_1 is /var/lib/openqa/share
[info] [pid:44] Registering with openQA http://webui_haproxy_1
[info] [pid:44] Establishing ws connection via ws://webui_haproxy_1/api/v1/ws/1
[warn] [pid:44] Unable to upgrade to ws connection via http://webui_haproxy_1/api/v1/ws/1 - trying again in 10 seconds
Facts:
- The worker can connect to the web UI API and authentificate the user
- The worker cannot connect to the websockets
To solve that Christian and me were working on a replacement for haproxy with nginx allowing the reverse proxy for the websokets. This seems to work
server {
listen 80;
listen 9526;
server_name localhost;
location ~ /api/v1/ws/(.*) {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-NginX-Proxy true;
rewrite ^//api/v1/ws/(.*)$ http://webui_websockets_1:9527/ws/$1;
proxy_pass http://webui_websockets_1:9527;
proxy_redirect off;
}
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://webui_haproxy_1:9526;
proxy_redirect off;
}
}
Facts:
- nginx pass to the websockets the query
- nginx always return Not Found in plain text (tested from the worker, and also in the Christian environment)
- Christian checked that in O3 the websockets service also returns Not Found for the same path /api/v1/ws/1 however in O3 the worker is starting and in this test not. Why is the reason for that?
Ideas:
- check in a fake websockets service that nginx is sending the correct path
- Check what the worker spect from the websockets
Closely related with https://progress.opensuse.org/issues/69355. Both tickets are interdependent
Updated by ilausuch about 4 years ago
- Status changed from In Progress to Feedback
Updated by mkittler about 4 years ago
I see that your NGINX config differs from what we have in our repository: https://github.com/os-autoinst/openQA/blob/master/etc/nginx/vhosts.d/openqa.conf
Maybe the lack of proxy_set_header Upgrade
leads to the 404 response.
As mentioned in the chat yesterday: It is also possible to specify the web UI port directly within the worker config. The worker will then use this port +2 for the web sockets route making it unnecessary to proxy the web socket connection. Having NGINX proxying the web socket connection would be the nicer solution of course.
Updated by ilausuch about 4 years ago
Works, preparing the https://progress.opensuse.org/issues/69355 finishing before
Updated by ilausuch about 4 years ago
- Status changed from Feedback to In Progress
Updated by ilausuch about 4 years ago
Thanks Marius, this worked and now we have a new PR for the web UI that solves all these problems. Now I am preparing this PR to use api keys and hosts for use with https://progress.opensuse.org/issues/69355
Updated by ilausuch about 4 years ago
Additionally and following the subject of this task "provide an easy to use..." I created an script to launch a pool of workers
https://github.com/os-autoinst/openQA/pull/3495
Updated by ilausuch about 4 years ago
- Description updated (diff)
The acceptance criteria AC1, AC2 and AC3 are covered by https://github.com/os-autoinst/openQA/pull/3475 and https://github.com/os-autoinst/openQA/pull/3495
My next step is to build the docker image
Updated by ilausuch about 4 years ago
I am preparing a PR to fix some problems in the Dockerfile
https://github.com/os-autoinst/openQA/pull/3523
In my home there are the packages I am working on
https://build.opensuse.org/package/show/home:ilausuch:branches:devel:openQA/openQA_container_image_worker_x86
https://build.opensuse.org/package/show/home:ilausuch:branches:devel:openQA/openQA_container_image_worker_aarch64
Updated by livdywan about 4 years ago
- Due date changed from 2020-10-28 to 2020-11-13
For the record, these questions were still being discussed today:
- We might need different containers for specific architectures with their own tags
- What base image to use
- Fetching repos via http://download.opensuse.org
Setting up working builds in a home project was far from straightforward even with OBS expertise on hand so I recommend this gets documented in a blog post or wiki page after, although it's not required to finish the ticket.
Updated by pdostal about 4 years ago
As well as I know, no tags are required for different architectures. There can be multiple builds of the same Dockerfile with the same tag for different architectures.
Updated by ilausuch about 4 years ago
I created a PR to discuss about all of that
https://github.com/os-autoinst/openQA/pull/3533
Also there are two build on my home
- https://build.opensuse.org/package/show/home:ilausuch:branches:devel:openQA/openQA_container_image_worker_x86
- https://build.opensuse.org/package/show/home:ilausuch:branches:devel:openQA/openQA_container_image_worker_aarch64
The x86 works
Updated by livdywan about 4 years ago
- Description updated (diff)
- Status changed from In Progress to Feedback
Publishing images on OBS is raising a lot of questions on top of a usable image that have nothing to do with containerizing the worker in general, and we actually have #43718 so I'm removing it from the AC here.
Updated by ilausuch about 4 years ago
Associated patch https://github.com/os-autoinst/openQA/pull/3534
Updated by okurz about 4 years ago
Please keep in mind, even if this is not explictly mentioned: We probably all agree that without automatic tests we would not call any contributions properly long-term supportable. These tests could be very simple, e.g. something like podman run --rm -it .... openqa-worker --help
or something. But if you do not plan to add tests as part of this ticket which is of course ok then please create a follow-up so that we don't forget that.
Updated by ilausuch about 4 years ago
Last changes on the PR works on the testing package in my home https://build.opensuse.org/package/show/home:ilausuch:branches:devel:openQA/openQA_container_image_worker_x86
Updated by livdywan about 4 years ago
okurz wrote:
Please keep in mind, even if this is not explictly mentioned: We probably all agree that without automatic tests we would not call any contributions properly long-term supportable. These tests could be very simple, e.g. something like
podman run --rm -it .... openqa-worker --help
or something. But if you do not plan to add tests as part of this ticket which is of course ok then please create a follow-up so that we don't forget that.
Ack. The specific AC however had build and publish in OBS in it (which #43718 basically is), and we don't even know that we can run tests in OBS after building the image. Although adding two lines in our existing setup might be more straightforward.
Updated by ilausuch about 4 years ago
- Status changed from Feedback to Resolved
The PR is merged and there is a build in OBS (https://build.opensuse.org/package/show/home:ilausuch:branches:devel:openQA/openQA_container_image_worker_x86) that builds the container image
Updated by okurz almost 4 years ago
unfortunately it seems you overlooked #43715#note-37 . I created #43706 for that now.