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

Local provisioning on Ubuntu fails in prepare step #2673

Closed
engelmi opened this issue Feb 8, 2024 · 2 comments
Closed

Local provisioning on Ubuntu fails in prepare step #2673

engelmi opened this issue Feb 8, 2024 · 2 comments
Assignees
Labels
step | prepare Stuff related to the prepare step
Milestone

Comments

@engelmi
Copy link
Contributor

engelmi commented Feb 8, 2024

Describe the bug

In BlueChi we use tmt to run our integration tests in the GitHub CI on Ubuntu (since this is the only linux OS supported there). Since the new release 1.31.0 those tests keep failing due to Package manager "None" is not supported. in the prepare step:

    prepare
        queued push task #1: push to default-0
        
        push task #1: push to default-0
    
        queued prepare task #1: Prepare containers setup on default-0
        queued prepare task #2: requires on default-0
        
        prepare task #1: Prepare containers setup on default-0
        how: shell
        name: Prepare containers setup
        overview: 1 script found
        
        prepare task #2: requires on default-0
        how: install
        summary: Install required packages
        name: requires
        where: default-0
        fail: Package manager "None" is not supported.

We are using the following plan: https://github.com/eclipse-bluechi/bluechi/blob/main/tests/plans/tier0.fmf

Note:

After briefly investigating, I found that /usr/bin/flock is automatically added as a required dependency (added in #2622). And when tmt tries to install it on the local host (due to the provision: how: local) it first determines the package manager - which throws the "None" package manager not supported error.

To Reproduce

On any OS with a package manager not supported (see list in code), e.g. Ubuntu, then execute a tmt run on a plan with

provision:
    how: local

It will automatically add /usr/bin/flock as a required dependency, try to install it on the local host and when determining the package manager throw the error for None package manager not supported.

Expected behavior

Ideally, we could use tmt 1.31 on hosts with an OS that doesn't use any of the package managers in the list of supported ones, e.g. Ubuntu.

Is it possible to skip or not add this automatically generated preparation step in those cases?

Note: We currently mitigate this by pinning the version to 1.30.

@happz
Copy link
Collaborator

happz commented Feb 8, 2024

Hello, I'm afraid this is an unexpected side effect of us recently identifying /usr/bin/flock as an essential requirement for running tests :/ As we discovered, /usr/bin/flock is not available by default in every distro we use, which means tmt needs to check for it & install it if necessary. In this sense, a package manager became part of the process so early.

For 1.32, I'd like to finish a refactoring of package manager implementations, #2557, and it covers Ubuntu and other distros with apt. We can improve the error message for unsupported ones, and improve the behavior when an unsupported package manager is encountered. tmt can always display a warning, for example, "failed to install essential requirements, you're on your own", instead of crashing.

@happz happz added the step | prepare Stuff related to the prepare step label Feb 8, 2024
@happz happz added this to the 1.32 milestone Feb 8, 2024
@happz happz self-assigned this Mar 12, 2024
@psss
Copy link
Collaborator

psss commented Mar 25, 2024

I believe this has been covered by the new package manager implementation:

Verified with the following plan

provision:
    how: container
    image: ubuntu
prepare:
    how: shell
    script: apt update
execute:
    how: tmt
    script: bash --version

For ubuntu the current limitation is that apt update has to be explicitly called by the user.

@psss psss closed this as completed Mar 25, 2024
mwperina added a commit to mwperina/bluechi that referenced this issue Apr 10, 2024
Issue teemtee/tmt#2673 was in tmt 1.32, so we
can remove pinning to version 1.30

Signed-off-by: Martin Perina <mperina@redhat.com>
mwperina added a commit to mwperina/bluechi that referenced this issue Apr 10, 2024
Issue teemtee/tmt#2673 was fixed in tmt 1.32,
so we can remove pinning to version 1.30

Signed-off-by: Martin Perina <mperina@redhat.com>
engelmi pushed a commit to eclipse-bluechi/bluechi that referenced this issue Apr 10, 2024
Issue teemtee/tmt#2673 was fixed in tmt 1.32,
so we can remove pinning to version 1.30

Signed-off-by: Martin Perina <mperina@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
step | prepare Stuff related to the prepare step
Projects
None yet
Development

No branches or pull requests

3 participants