Project

General

Profile

Actions

action #166430

closed

[tools] Keep a hardlink to iso in repo folder for agama test

Added by leli 3 months ago. Updated 3 months ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
-
Start date:
2024-09-06
Due date:
% Done:

0%

Estimated time:

Description

Description

For agama live installer test on s390x, it need an iso in o3 server /repo/ folder(under the ftp).

Because agama can only boot in s390x with the iso (it doesn't have install= because it doesn't have linuxrc to boot from the extracted repo). Still we need to pass the extracted repo here for the qaboot and then later the iso here in the parmfile.
At the moment we can sync the repo without problem, it is already implemented in obsync but we are asking Andrii to implement to have a hardlink under /repo/ pointing to the .iso in iso/ folder (soft links didn't work). But we don't want that this hardlink will disappear, is there any way to prevent its automatic removal.

Ex:

leli@ariel:/var/lib/openqa/factory/iso> sudo ln -s agama-installer.s390x-9.0.0-openSUSE-Build17.9.iso ../repo/agama-installer.s390x-9.0.0-openSUSE-Build17.9.iso
leli@ariel:/var/lib/openqa/factory/repo> la agama-installer.s390x-9.0.0-openSUSE-Build17.9.iso
lrwxrwxrwx 1 root root 50 Sep  5 08:26 agama-installer.s390x-9.0.0-openSUSE-Build17.9.iso -> agama-installer.s390x-9.0.0-openSUSE-Build17.9.iso

Acceptance Criteria

  • AC1:: Keep a hardlink to iso in repo folder for agama test on s390x.

Related issues 1 (0 open1 closed)

Related to openQA Infrastructure (public) - action #166433: [alert] Waves of emails due to manual changes in /opt/openqa-trigger-from-obs size:SResolvedlivdywan

Actions
Actions #1

Updated by leli 3 months ago

  • Description updated (diff)
Actions #2

Updated by livdywan 3 months ago

@leli Please note that /opt/openqa-trigger-from-obs is automatically updated from git. So there should not be manual changes to it.

Actions #3

Updated by livdywan 3 months ago

  • Description updated (diff)
Actions #4

Updated by livdywan 3 months ago

  • Project changed from openQA Project (public) to openQA Infrastructure (public)
Actions #5

Updated by tinita 3 months ago

  • Related to action #166433: [alert] Waves of emails due to manual changes in /opt/openqa-trigger-from-obs size:S added
Actions #6

Updated by tinita 3 months ago

  • Target version set to Ready
Actions #7

Updated by mkittler 3 months ago

  • Assignee set to mkittler

I'm having a look what this is about considering I got a PM about it.

Actions #8

Updated by mkittler 3 months ago

  • Status changed from New to In Progress

Is this about a hardlink or a symlink? The ticket title says hardlink and in the PM you also wrote that a symlink would not work but the commands in the ticket description create a symlink.

Probably this is about a hardlink considering a hardlink is also in place on o3:

martchus@ariel:/var/lib/openqa/factory/iso> ls -i ../repo/agama-installer.s390x-9.0.0-openSUSE-Build17.9.iso
103231581 ../repo/agama-installer.s390x-9.0.0-openSUSE-Build17.9.iso
martchus@ariel:/var/lib/openqa/factory/iso> ls -i agama-installer.s390x-9.0.0-openSUSE-Build17.9.iso
103231581 agama-installer.s390x-9.0.0-openSUSE-Build17.9.iso
Actions #9

Updated by mkittler 3 months ago ยท Edited

I searched for an example job and found https://openqa.opensuse.org/tests/4457756#settings (scenario is https://openqa.opensuse.org/tests/latest?arch=s390x&distri=opensuse&flavor=agama-installer&machine=s390x-zVM-vswitch-l2&test=agama_default&version=agama-9.0).

The latest job is using the following settings:

ISO=agama-installer.s390x-9.0.0-openSUSE-Build17.9.iso
REPO_0=agama-installer.s390x-9.0.0-openSUSE-Build17.9

This will associate the file /var/lib/openqa/factory/iso/agama-installer.s390x-9.0.0-openSUSE-Build17.9.iso and the file/directory /var/lib/openqa/factory/repo/agama-installer.s390x-9.0.0-openSUSE-Build17.9 with that job. The repo does not exist, though.

I suppose you wanted:

ISO=agama-installer.s390x-9.0.0-openSUSE-Build17.9.iso
REPO_0=agama-installer.s390x-9.0.0-openSUSE-Build17.9.iso

This way the repo points to an existing asset (the hardlink you want to preserve) and thus openQA will associate the asset with the job.

I had a look at the code and I don't think repo assets are treated in a special way. So you can have a single file as a repo asset and it will be associated with the job as usual.

To verify this I created a test job with the mentioned settings: https://openqa.opensuse.org/tests/4459707

The repo asset was correctly associated with the iso file/hardlink within the repo directory:

openqa=# select * from assets where id in (select asset_id from jobs_assets where job_id = 4459707);
    id    | type  |                            name                            |         t_created          |         t_updated          |   size    | checksum | last_use_job_id | fixed 
----------+-------+------------------------------------------------------------+----------------------------+----------------------------+-----------+----------+-----------------+-------
 72605169 | iso   | agama-installer.s390x-9.0.0-openSUSE-Build17.9.iso         | 2024-09-04 21:33:11.128931 | 2024-09-04 21:33:11        | 558170112 |          |         4457756 | f
 72661737 | other | agama-installer.s390x-9.0.0-openSUSE-Build17.21.iso.sha256 | 2024-09-06 09:32:58.415696 | 2024-09-06 09:32:58        |       118 |          |                 | f
 72662202 | repo  | agama-installer.s390x-9.0.0-openSUSE-Build17.9.iso         | 2024-09-06 10:39:08.637938 | 2024-09-06 10:39:08.637938 |           |          |                 | f
(3 rows)

So the harlink will be preserved by the cleanup algorithm (as long as there is enough room in the job group the job is part of).

If you use the REPO_0 variable in your test code and it needs the .iso extension removed you can do that in test code. That's better than lying openQA about the actual path of the asset.

Note that the size accounting is probably not going to work if the repo is a file/hardlink. However, I suppose this is actually in our favor here because we probably don't want to take the file size twice into account here.

One caveat of this is that the repo asset will not be cloned (because repo assets are generally not cloned) and features like the check for missing assets when restarting a job won't work (because repo assets are generally excluded from it).

Actions #10

Updated by mkittler 3 months ago

  • Status changed from In Progress to Feedback
Actions #11

Updated by JERiveraMoya 3 months ago

  • Status changed from Feedback to Resolved

Thanks a lot for the support and the quick answer! we will use for the iso REPO_999 to avoid confusion with other variable names used (acording to Andrii) and REPO_0 for the repo, as we need both at the same time to be preserved. This doubt solved helps us to keep going with agama development, appreciated!

Actions

Also available in: Atom PDF