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

be buildable with f34 cosa somehow, or bust #552

Closed
cgwalters opened this issue May 14, 2021 · 8 comments · Fixed by coreos/rpm-ostree#2990 or coreos/coreos-assembler#2302
Closed
Assignees
Labels

Comments

@cgwalters
Copy link
Member

cgwalters commented May 14, 2021

Followup to #547 and #548

Right now we're in an ugly situation where because f34 rpm dropped support for bdb, yet rhel8 only works with bdb we cannot use f34 to build rhcos(8).

Options:

  • Just require the rhcos-4.8 cosa-f33 branch for a while (6 months?) and see if the rpm maintainers end up doing something here (e.g. sqlite support in rhel8).
  • jlebon's idea of somehow using the host librpm to write as sqlite, and then pipe the data to the target rpm to downconvert to bdb (I think we'd need to carry f33 rpm for this which is the only one that does both? How ugly would it be to e.g. build a statically linked f33 rpm binary and include it in our container?) Hmm, maybe we could convince the rpm maintainers to ship something like /usr/lib/rpm/rpm-sqlite2bdb --dbin /path/to/srcdb --dbout /path/to/destdb in rhel8?
  • Switch over to using a C8S coreos-assembler for both fcos and rhcos
  • Switch over to C8S coreos-assembler just for rhcos

Or something else?

cgwalters added a commit to cgwalters/rpm-ostree that referenced this issue May 14, 2021
I was trying to do an RHCOS build using a custom rpm-ostree build
in a f34 container without having used `--enable-sqlite-rpmdb-default`.

This immediately failed trying to load the host rpmdb.
Now, in practice we don't care about this problem, and it doesn't
solve openshift/os#552 because
the f34 rpm still can't write bdb and so just dies later.

But, I think this is the right thing to do - we shouldn't pollute
the sack with the host (container) rpmdb in the `compose tree`
case.
@cgwalters
Copy link
Member Author

jlebon correctly found https://bugzilla.redhat.com/show_bug.cgi?id=1938928 but I lost track of that BZ in the PRs/issues here. I commented there, I think rpm sqlite readonly support is enough. Let's leave this open to track work doing the conversion.

@cgwalters
Copy link
Member Author

Ultimately the conversion code I think should land in rpm-ostree, i.e. all that happens here is we set rpmdb: bdb and rpm-ostree knows to do the dance internally instead of us doing it as a postprocess script or whatever.

@jlebon
Copy link
Member

jlebon commented May 17, 2021

Yeah, I think that's the easiest approach, even if it's not great. One note is that the RHBZ is planned for 8.5, so we might have to hold until RHCOS rebases.

cgwalters added a commit to cgwalters/rpm-ostree that referenced this issue Jun 7, 2021
I was trying to do an RHCOS build using a custom rpm-ostree build
in a f34 container without having used `--enable-sqlite-rpmdb-default`.

This immediately failed trying to load the host rpmdb.
Now, in practice we don't care about this problem, and it doesn't
solve openshift/os#552 because
the f34 rpm still can't write bdb and so just dies later.

But, I think this is the right thing to do - we shouldn't pollute
the sack with the host (container) rpmdb in the `compose tree`
case.
@miabbott
Copy link
Member

miabbott commented Jun 9, 2021

Do we have a path forward on this issue?

4.8 is reaching code freeze soon, which means we would just start using coreos-assembler:main again.

Could we change the internal coreos-assembler-main BuildConfig to use F33?

    dockerStrategy:
      env:
      - name: GIT_URL
        value: https://github.com/coreos/coreos-assembler
      - name: GIT_REF
        value: main
      - name: OPENSHIFT_GIT_HACK
        value: "TRUE"
      from:
        kind: ImageStreamTag
        name: fedora:33
      noCache: true
    type: Docker

@cgwalters
Copy link
Member Author

Do we have a path forward on this issue?

The conversation above covers one where rpm-ostree learns how to do this conversion.

Could we change the internal coreos-assembler-main BuildConfig to use F33?

That's not long term sustainable though because we're mostly focusing on F34+ for e.g. rpm-ostree builds and cosa development. If we have to fork in that way, the other option is to try again to create a rhel8 based coreos assembler plus cherry picked newer versions of things. But, I think we should chase down the rpm-ostree approach above first.

@cgwalters cgwalters added the jira label Jul 2, 2021
@cgwalters cgwalters self-assigned this Jul 2, 2021
cgwalters added a commit to cgwalters/rpm-ostree that referenced this issue Jul 9, 2021
In Fedora 34+ librpm can no longer write bdb, so we fail
to build RHCOS.  But the error for this is obscure.  Make
this an obvious, up front error.

This relies on the implicit "sqlite default == fedora34+ == rpm without bdb write".

xref openshift/os#552
xref https://bugzilla.redhat.com/show_bug.cgi?id=1938928
cgwalters added a commit to cgwalters/os that referenced this issue Jul 9, 2021
Since that's what it needs to be.  There is read-only
sqlite support queued in
https://bugzilla.redhat.com/show_bug.cgi?id=1938928
But we need read-write for package layering etc.

xref openshift#552

This is effectively a no-op right now because the default
backend in F33 rpm-ostree is bdb, but by setting this
explicitly we'll get a useful error message after
coreos/rpm-ostree#2978

And then ideally we teach rpm-ostree how to actually deal
with this.
@cgwalters
Copy link
Member Author

I'm looking at this actively, and am testing a hack for converting the rpmdb as part of postprocessing, but this may then trigger further issues around things like rpm-ostree db diff and such that also happen at build time.

Ahh whee and it needs to happen before the bootupd integration runs which also reads the rpmdb.

cgwalters added a commit to cgwalters/os that referenced this issue Jul 9, 2021
Since that's what it needs to be.  There is read-only
sqlite support queued in
https://bugzilla.redhat.com/show_bug.cgi?id=1938928
But we need read-write for package layering etc.

xref openshift#552

This is effectively a no-op right now because the default
backend in F33 rpm-ostree is bdb, but by setting this
explicitly we'll get a useful error message after
coreos/rpm-ostree#2978

And then ideally we teach rpm-ostree how to actually deal
with this.
cgwalters added a commit to coreos/rpm-ostree that referenced this issue Jul 10, 2021
In Fedora 34+ librpm can no longer write bdb, so we fail
to build RHCOS.  But the error for this is obscure.  Make
this an obvious, up front error.

This relies on the implicit "sqlite default == fedora34+ == rpm without bdb write".

xref openshift/os#552
xref https://bugzilla.redhat.com/show_bug.cgi?id=1938928
cgwalters added a commit to cgwalters/rpm-ostree that referenced this issue Jul 12, 2021
This is a key bit to resolve openshift/os#552
(But we'll close that issue when the PR to use cosa master lands)

We want to support "cross building" where e.g. a Fedora 34+ host
(or container) is generating a RHEL8 ostree commit.  The
status quo right now is that F34+ librpm supports read/write
of sqlite and just reading bdb.  And rhel8 librpm only supports
read/write of bdb.

To deal with this, detect if the input manifest specifies an rpmdb format
(namely `bdb`) that is not the current default (namely `sqlite`
in Fedora 34+/RHEL9+) and if so, fork of the *host* rpm to export
the database we wrote back into memory, and then pass that
down to a bwrap container with the *target* rootfs `rpm`.
cgwalters added a commit to cgwalters/rpm-ostree that referenced this issue Jul 12, 2021
This is a key bit to resolve openshift/os#552
(But we'll close that issue when the PR to use cosa master lands)

We want to support "cross building" where e.g. a Fedora 34+ host
(or container) is generating a RHEL8 ostree commit.  The
status quo right now is that F34+ librpm supports read/write
of sqlite and just reading bdb.  And rhel8 librpm only supports
read/write of bdb.

To deal with this, detect if the input manifest specifies an rpmdb format
(namely `bdb`) that is not the current default (namely `sqlite`
in Fedora 34+/RHEL9+) and if so, fork of the *host* rpm to export
the database we wrote back into memory, and then pass that
down to a bwrap container with the *target* rootfs `rpm`.
@cgwalters
Copy link
Member Author

🎉 this works for me coreos/rpm-ostree#2990

cgwalters added a commit to cgwalters/rpm-ostree that referenced this issue Jul 13, 2021
This is a key bit to resolve openshift/os#552
(But we'll close that issue when the PR to use cosa master lands)

We want to support "cross building" where e.g. a Fedora 34+ host
(or container) is generating a RHEL8 ostree commit.  The
status quo right now is that F34+ librpm supports read/write
of sqlite and just reading bdb.  And rhel8 librpm only supports
read/write of bdb.

To deal with this, detect if the input manifest specifies an rpmdb format
(namely `bdb`) that is not the current default (namely `sqlite`
in Fedora 34+/RHEL9+) and if so, fork of the *host* rpm to export
the database we wrote back into memory, and then pass that
down to a bwrap container with the *target* rootfs `rpm`.
cgwalters added a commit to cgwalters/rpm-ostree that referenced this issue Jul 13, 2021
This is a key bit to resolve openshift/os#552
(But we'll close that issue when the PR to use cosa master lands)

We want to support "cross building" where e.g. a Fedora 34+ host
(or container) is generating a RHEL8 ostree commit.  The
status quo right now is that F34+ librpm supports read/write
of sqlite and just reading bdb.  And rhel8 librpm only supports
read/write of bdb.

To deal with this, detect if the input manifest specifies an rpmdb format
(namely `bdb`) that is not the current default (namely `sqlite`
in Fedora 34+/RHEL9+) and if so, fork of the *host* rpm to export
the database we wrote back into memory, and then pass that
down to a bwrap container with the *target* rootfs `rpm`.
jlebon added a commit to jlebon/coreos-assembler that referenced this issue Jul 19, 2021
Latest rpm-ostree release with
coreos/rpm-ostree#2990 is in the continuous tag.
Rebuild to get it into cosa.

Closes: openshift/os#552
@jlebon
Copy link
Member

jlebon commented Jul 19, 2021

Nice work @cgwalters! Confirmed I got a successful RHCOS compose using latest rpm-ostree release.

So all that's left to do now is: coreos/coreos-assembler#2302

jlebon added a commit to coreos/coreos-assembler that referenced this issue Jul 19, 2021
Latest rpm-ostree release with
coreos/rpm-ostree#2990 is in the continuous tag.
Rebuild to get it into cosa.

Closes: openshift/os#552
ravanelli pushed a commit to ravanelli/coreos-assembler that referenced this issue Aug 25, 2021
Latest rpm-ostree release with
coreos/rpm-ostree#2990 is in the continuous tag.
Rebuild to get it into cosa.

Closes: openshift/os#552
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants