action #164595
closedopenqa-bootstrap does not clone job when invoked without systemd (i.e. inside container) size:S
0%
Description
Observation¶
When openqa-bootstrap is invoked with additional parameters it should use them for openqa-clone-job and also clone the job after the bootstrapping is done. This feature does not work in systemd-less environments like when invoked inside containers.
The problem is that the cloning is the very last part and the start-worker
function never returns when $running_systemd
is zero:
if [[ -z $running_systemd ]]; then
/usr/bin/install -d -m 0755 -o _openqa-worker /var/lib/openqa/pool/1
su _openqa-worker -c '/usr/share/openqa/script/worker --instance 1'
else
systemctl enable --now openqa-worker@1
fi
Reproducer: podman run --rm -ti --device /dev/kvm -p 1080:80 -p 1443:443 --env OPENQA_SERVICE_PORT_DELTA=0 opensuse/tumbleweed:latest bash -c 'zypper in -y openQA-bootstrap; /usr/share/openqa/script/openqa-bootstrap --from openqa.opensuse.org --skip-deps 4362951'
Acceptance criteria¶
AC1: openqa-clone-job
is called even without systemd
Suggestion¶
- Move some code around to initiate cloning before starting the worker
- Use bash magic to not block the execution
Updated by okurz 5 months ago
- Subject changed from openqa-bootstrap does not clone job when invoked without systemd (i.e. inside container) to openqa-bootstrap does not clone job when invoked without systemd (i.e. inside container) size:S
- Description updated (diff)
- Status changed from New to Workable
Updated by jbaier_cz 5 months ago
Quick (and actually not that ugly) solution: https://github.com/os-autoinst/openQA/pull/5814
Updated by jbaier_cz 5 months ago
A quick note for future, the behavior in systemd vs. non-systemd environment is still different (openqa-bootstrap script will return when systemd is present) but that distinction is desirable as the bootstrap script is used as an entrypoint for single-instance container (see https://github.com/os-autoinst/openQA/blob/master/container/single-instance/Dockerfile#L28 for context).
Updated by jbaier_cz 4 months ago
- Status changed from Feedback to Resolved
I did podman run --rm -ti --device /dev/kvm -p 1080:80 -p 1443:443 --env OPENQA_SERVICE_PORT_DELTA=0 opensuse/tumbleweed:latest bash -c 'zypper in -y openQA-bootstrap; /usr/share/openqa/script/openqa-bootstrap --from openqa.opensuse.org --skip-deps 4388373'
and all worked as expected.