coreos / rpm-ostree

⚛📦 Hybrid image/package system with atomic upgrades and package layering
https://coreos.github.io/rpm-ostree
Other
856 stars 193 forks source link

rpm-ostree install to support broken or missing packages requests #3527

Open BeeGrech opened 2 years ago

BeeGrech commented 2 years ago

CentOS-Stream-9 OSTree build using osbuild-composer

Provide the output of rpm-ostree status. '# rpm-ostree status State: idle Deployments: ● cs9/aarch64/rpi4-qa Version: 9 (2022-03-17T15:48:47Z) Commit: b859a15c8ceebc6979824e89cdbb672ac7821988aeb80197b481b44a64cc7470

Expected vs actual behavior

Actual:
# rpm-ostree -A --idempotent --allow-inactive install package-for-another-releaseOnly
Checking out tree b859a15... done
Enabled rpm-md repositories: extras-common baseos appstream
Importing rpm-md... done
rpm-md repo 'extras-common' (cached); generated: 2022-03-17T01:39:11Z solvables: 25
rpm-md repo 'baseos' (cached); generated: 2022-03-15T14:21:11Z solvables: 2601
rpm-md repo 'appstream' (cached); generated: 2022-03-15T14:22:56Z solvables: 8541
error: Packages not found: package-for-another-releaseOnly

Expected: Broken or missing packages are skipped and rpm-ostree exits gracefully. In a previous issue, solution was mentioned to use --idempotent --allow-inactive, but the command still exits in error. I think something like --skip-broken would allow a "nothing to do" escape, similar to yum/dnf behavior.

# rpm-ostree -A --idempotent --allow-inactive --skip-broken install package-for-another-releaseOnly
Checking out tree b859a15... done
Enabled rpm-md repositories: extras-common baseos appstream
Importing rpm-md... done
rpm-md repo 'extras-common' (cached); generated: 2022-03-17T01:39:11Z solvables: 25
rpm-md repo 'baseos' (cached); generated: 2022-03-15T14:21:11Z solvables: 2601
rpm-md repo 'appstream' (cached); generated: 2022-03-15T14:22:56Z solvables: 8541
Dependencies resolved.
Nothing to do.
Complete!
...
Success!

Steps to reproduce it Provide any additional data that may help debug this - which specific version of an RPM is in the repo, or any host system configuration.

execute

rpm-ostree install 'any invalid package'

Would you like to work on the issue?

--Possibly?

jlebon commented 2 years ago

rpm-ostree implements a stricter more declarative model than dnf, where you provide an exact description of how the OS should be mutated, and rpm-ostree will ensure that new deployments match that description. Having something which may resolve sometimes and not other times doesn't really fit that model.

What are you trying to do exactly? Do you want to register an "intent to layer" ahead of a major version rebase? Or e.g. are you trying to apply an Ansible playbook to to multiple hosts of at different versions?

BeeGrech commented 2 years ago

This is more from an automation perspective. Where in this case, we are using rpm-ostree -A install to overlay testing dependencies on top of the base commit for RHIVOS. The artifact in my case is the qcow2 disk image. The issue is we are trying to adapt existing tests written for many releases, so in this case those packages were already labeled as "soft dependencies", they'll be present for some releases but not others. We'd prefer to have one "provision" style script vs individualized per release.

cgwalters commented 2 years ago

we are using rpm-ostree -A install to overlay testing dependencies

Did you investigate bundling tests as privileged containers?

We'd prefer to have one "provision" style script vs individualized per release.

Can't this script dispatch on some data from e.g. /usr/lib/os-release?

cgwalters commented 2 years ago

From my PoV I don't think I'd say no to a patch to add --ignore-nonexistent-packages or something, but I do think it's really just a yum misfeature, there are better ways to handle the problem and I certainly am not going to context switch to reintroduce it here.