Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test to run basic qm image build with a-i-b #697

Merged
merged 1 commit into from
Jan 16, 2025

Conversation

mkemel
Copy link
Contributor

@mkemel mkemel commented Jan 5, 2025

Introducing a new sanity test, that builds a basic qm image with automotive-image-builder.

Resolves: #675

@dougsland
Copy link
Collaborator

looks sane to me @Yarboa PTAL

@Yarboa
Copy link
Collaborator

Yarboa commented Jan 6, 2025

@mkemel
AFAICT, I see that no gate run this test.
Few questions here:

  • In general the test itself just build qm qcow image. is it?
  • Does it check that vm also running?
  • Do you have dependency in /dev/kvm?
  • Dont you think it should be part of automotive-sig?

One more thing here, What the tests should really test?
Is it a new QM image in autosd image with latest qm image?

Copy link
Collaborator

@Yarboa Yarboa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please refer this
#697 (comment)

@mkemel
Copy link
Contributor Author

mkemel commented Jan 6, 2025

Hi @Yarboa

  1. Yes
  2. No
  3. Not that I'm aware of, don't think that osbuild has such a dependency.
  4. The test should verify that a PR does not break QM compatibility with a-i-b and the build runs successfully. So it should be in QM.

One question from my side is - the requirement is for CI only. So maybe it would be better to create a separate plan for that?

@mkemel
Copy link
Contributor Author

mkemel commented Jan 6, 2025

@alexlarsson care to take a look?

@Yarboa
Copy link
Collaborator

Yarboa commented Jan 6, 2025

Hi @Yarboa

  1. Yes
  2. No
  3. Not that I'm aware of, don't think that osbuild has such a dependency.

As per this https://github.com/osbuild/osbuild?tab=readme-ov-file#requirements
only qemu-image, ack

  1. The test should verify that a PR does not break QM compatibility with a-i-b and the build runs successfully. So it should be in QM.
    So i thing there is an issue here, I will review PR again

And please add better description

One question from my side is - the requirement is for CI only. So maybe it would be better to create a separate plan for that?

The issue here is not the plan it is packit,
I would creatye tests with special hardware in pacvklit.yaml

@mkemel
Copy link
Contributor Author

mkemel commented Jan 6, 2025

The issue here is not the plan it is packit,
I would creatye tests with special hardware in pacvklit.yaml

Currently the test is run by packit as part of this job:

  - job: tests
    trigger: pull_request
    identifier: qm-tier-0
    tmt_plan: /plans/e2e/tier-0
    targets:
      - epel-9-x86_64
    tf_extra_params:
      environments:
        - artifacts:
          - *bluechi_copr_repo
          hardware:
            disk:
             - size: ">= 20 GB"

And the only hardware requirement is >= 20GB, and the test does not require more than that. But do we want this test have its own job?

@Yarboa
Copy link
Collaborator

Yarboa commented Jan 6, 2025

tmt_plan: /plans/e2e/tier-0

I do not think it is related,
All tests running are running on QM environment, and its prepare step, set QM env
Current test, have no relation with qm deployments, just verify qm image is build success with qm rpm PR generated.

Isnt it?

@mkemel
Copy link
Contributor Author

mkemel commented Jan 7, 2025

I do not think it is related,
All tests running are running on QM environment, and its prepare step, set QM env
Current test, have no relation with qm deployments, just verify qm image is build success with qm rpm PR generated.

Yes. I wasn't sure if I should just add this one to sanity tests (this is a sanity test after all), and run it in an environment with QM (which does not affect this test), or create a separate plan and run it as a separate job. I chose the former in avoid creating separate plan and job for one test. But if you think that it would be better to have a separate job for this one - I can add one, it's not a problem.

@Yarboa
Copy link
Collaborator

Yarboa commented Jan 7, 2025

I do not think it is related,
All tests running are running on QM environment, and its prepare step, set QM env
Current test, have no relation with qm deployments, just verify qm image is build success with qm rpm PR generated.

Yes. I wasn't sure if I should just add this one to sanity tests (this is a sanity test after all), and run it in an environment with QM (which does not affect this test), or create a separate plan and run it as a separate job. I chose the former in avoid creating separate plan and job for one test. But if you think that it would be better to have a separate job for this one - I can add one, it's not a problem.

Ack, ask for different machine with specific plan+test running, there is no prepare step here,
it needs only c9s machine with minimum of memory and storage, in case of no nested kvm, no need to ask it from testing farm

@Yarboa
Copy link
Collaborator

Yarboa commented Jan 7, 2025

The issue here is not the plan it is packit,
I would creatye tests with special hardware in pacvklit.yaml

Currently the test is run by packit as part of this job:

  - job: tests
    trigger: pull_request
    identifier: qm-tier-0
    tmt_plan: /plans/e2e/tier-0
    targets:
      - epel-9-x86_64
    tf_extra_params:
      environments:
        - artifacts:
          - *bluechi_copr_repo
          hardware:
            disk:
             - size: ">= 20 GB"

And the only hardware requirement is >= 20GB, and the test does not require more than that. But do we want this test have its own job?

better to maintain it separately in case it is broken, gate run also on bare c9s/fedora, it should not block merge of non related PRs

@dougsland
Copy link
Collaborator

dougsland commented Jan 13, 2025

Worth add for reference this comment and discussion: #674 (comment) I guess this is the root cause for this PR.

@dougsland
Copy link
Collaborator

If @michalskrivanek @Yarboa are satisfied we can proceed. I trust in their review.

@Yarboa
Copy link
Collaborator

Yarboa commented Jan 14, 2025

If @michalskrivanek @Yarboa are satisfied we can proceed. I trust in their review.

I thougt there is agreement on that
#697 (comment), waiting for another update

BTW, it could be moved to qm-next also

@michalskrivanek
Copy link

well, I'm NOT happy with copying the logic from auto-image-builder.sh. It even changed in the meantime...

@mkemel mkemel force-pushed the aib-ci branch 2 times, most recently from 592972e to 3955841 Compare January 14, 2025 13:01
@mkemel
Copy link
Contributor Author

mkemel commented Jan 14, 2025

  1. Created separate plan and Packit job to run it
  2. Now use auto-image-builder.sh

@mkemel
Copy link
Contributor Author

mkemel commented Jan 14, 2025

/packit retest-failed

Copy link
Collaborator

@Yarboa Yarboa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Yarboa
Copy link
Collaborator

Yarboa commented Jan 16, 2025

Introducing a new sanity test, that builds a basic qm image with
automotive-image-builder.

Signed-off-by: Mark Kemel <[email protected]>
@mkemel
Copy link
Contributor Author

mkemel commented Jan 16, 2025

@Yarboa It took me some time to make this work, the whole quotes thing in this script is quite complicated since we want to pass a mix of single and double quotes to a shell script which passes it to podman which passes it to container. Suppressed the warnings, shellcheck does not really recognize what I'm doing there.

@Yarboa
Copy link
Collaborator

Yarboa commented Jan 16, 2025

@Yarboa It took me some time to make this work, the whole quotes thing in this script is quite complicated since we want to pass a mix of single and double quotes to a shell script which passes it to podman which passes it to container. Suppressed the warnings, shellcheck does not really recognize what I'm doing there.

Did you try this one?
EXTRA_REPOS="extra_repos=[{\"id\":\"qm_build\",\"baseurl\":\"$COPR_URL\"}]"

And that one?
/bin/bash auto-image-builder.sh build --export qcow2 --define "$EXTRA_REPOS" qm.aib.yml qm.qcow2

this one was passing for me
find -name '*.sh' -exec shellcheck --severity=error -f gcc {} \;

@mkemel
Copy link
Contributor Author

mkemel commented Jan 16, 2025

Did you try this one?
EXTRA_REPOS="extra_repos=[{"id":"qm_build","baseurl":"$COPR_URL"}]"

This would work, but I like it less tbh, I think using single quote is much better than escaping every double quote, it makes reading much more difficult to my taste

And that one?
/bin/bash auto-image-builder.sh build --export qcow2 --define "$EXTRA_REPOS" qm.aib.yml qm.qcow2

This wouldn't work because we need single quotes there

@Yarboa Yarboa merged commit 2aa35bb into containers:main Jan 16, 2025
13 checks passed
@mkemel mkemel deleted the aib-ci branch January 20, 2025 07:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add CI job to build QM minimal image using automotive-image-builder
4 participants