Project

General

Profile

Actions

action #164595

closed

openqa-bootstrap does not clone job when invoked without systemd (i.e. inside container) size:S

Added by jbaier_cz 18 days ago. Updated 8 days ago.

Status:
Resolved
Priority:
Low
Assignee:
Category:
Feature requests
Target version:
Start date:
2024-07-29
Due date:
% Done:

0%

Estimated time:

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
Actions #1

Updated by okurz 18 days ago

  • Tags changed from bug to reactive work
  • Category set to Feature requests
Actions #2

Updated by okurz 15 days 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
Actions #3

Updated by jbaier_cz 15 days ago

  • Status changed from Workable to In Progress
  • Assignee set to jbaier_cz
Actions #4

Updated by jbaier_cz 15 days ago

Quick (and actually not that ugly) solution: https://github.com/os-autoinst/openQA/pull/5814

Actions #5

Updated by jbaier_cz 15 days 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).

Actions #6

Updated by jbaier_cz 11 days ago

  • Status changed from In Progress to Feedback

PR is merged, changes are not yet in production. I will wait for that to verify.

Actions #7

Updated by jbaier_cz 8 days 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.

Actions

Also available in: Atom PDF