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

Switch the container image from Fedora 39 -> RH UBI 9 #528

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

eskultety
Copy link
Collaborator

This PR switches the existing Fedora 39 container image to the RH UBI 9. A couple of tweaks were needed along the way to be able to perform the switch. This can be (doesn't necessarily need to be) perceived as a prerequisite to ultimately building the image in a multi-stage fashion.

Discussion: #401

Maintainers will complete the following section

  • Commit messages are descriptive enough
  • Code coverage from testing does not decrease and new code is covered
  • Docs updated (if applicable)
  • Docs links in the code are still valid (if docs were updated)

Note: if the contribution is external (not from an organization member), the CI
pipeline will not run automatically. After verifying that the CI is safe to run:

@eskultety
Copy link
Collaborator Author

eskultety commented Apr 29, 2024

since v1:

  • silence Hadolint DL3007: Using latest is prone to errors if the image will ever update. Pin the version explicitly to a release tag as we actually always want to test against the latest image and get early feedback when anything changes rather than rely on an old image tag

EDIT: Is there a way to silence hadolint via CLI rather than a commentary in the Containerfile as that would be the preferred solution.

@eskultety
Copy link
Collaborator Author

Since v2:

  • rebase on top of main
  • reword commit 1

@eskultety
Copy link
Collaborator Author

ping. I still need to have a look at the integration test failure but I'd like to get first round of reviews on the general idea.

@eskultety
Copy link
Collaborator Author

ping^2

@taylormadore
Copy link
Contributor

I believe that yarn v4 will require node >= 18. How do we want to handle that?

@eskultety
Copy link
Collaborator Author

I believe that yarn v4 will require node >= 18. How do we want to handle that?

With multi-stage, which would come next, that would give us all the flexibility we need, both in terms of node an Go.

A future patch will switch the container image from using Fedora 39 to
using UBI9 (Red Hat Universal Base Image 9). Since that one ships with
a pretty old version of Nodejs (v16.20.2) we need to revert the line in
question as a result of Dependabot updates to satisfy the Node engine
limitation on UBI9.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
We don't require NPM for anything really, we only need a version that
supplies corepack which we'll in turn use to install a specific version
of Yarn.
Given that we're going to switch the container image from Fedora to
UBI9 in a future patch which only ships with an old NodeJS v16.30.2
(i.e. one officially marked as in maintenance from upstream
 perspective) we need to prevent dependabot from trying to submit
update PRs for it. This can be easily done by providing an upper
boundary to the version of the NodeJS engine.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
Commit 9967a2e forgot to update the commentary when adding another
fixed version of Go SDK to download and install during the image build.

Fixes: 9967a2e

Signed-off-by: Erik Skultety <eskultet@redhat.com>
We're specifically interested in the 'go' binary which is part of the
compiler toolkit. It'll pull in 'golang' anyway, so there's no
practical difference from the build's POV, it's the slight nuance of
what we actually require for the resulting container and being exact in
terms of listing it.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
We may need this in order to build some of our Python dependencies
(e.g. reflink) that don't build as a wheel (because they're heavily
platform dependent) and need to be built locally during installation.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
Red Hat ships UBIs as free images with the same stability and security
guarantees like any other Red Hat product, so in terms of the runtime
environment for cachi2 it makes sense to use a stable, curated, and
well maintained base image.
As a side-effect, this will rid of the need to follow Fedora releases
and bump the base image version every 6 months or so when the next
major version is releases, marking the 2nd oldest major release as EOL.

However, using a stable and well maintained image isn't rainbows and
unicorns either as we'll likely fall into the trap of lacking the
latest package manager tooling required by cachi2 consumers which
Fedora kinda solved (e.g. by always using the latest release to get the
latest Golang version with the exception of >=1.21 and toolchains),
but not without any caveats, those would just become more apparent with
the selection of the next base image.

Since we're switching base images, this patch also updates the
integration mock data based on what's reported on UBI9.

Resolves: containerbuildsystem#401

Signed-off-by: Erik Skultety <eskultet@redhat.com>
@eskultety
Copy link
Collaborator Author

I found one fairly annoying downside to using UBI - for some weird reason it doesn't ship with createrepo_c which the base RHEL does ship with. We'd get it installed via pip to /usr/local/bin/ but with #544 that would change because what is proposed there is to install cachi2 inside a virtual env and copy that one to the final image. I'm mentioning it here rather than in #544 is that although we can symlink createrepo_c from the virtual env, but I'm open to a broader discussion here if it turns out that this might turn into a maintenance nightmare with respect to UBI's limited set of packages and instead we might consider something like AlmaLinux or RockyLinux instead (afterall, both are forks of RHEL).

@eskultety
Copy link
Collaborator Author

I found one fairly annoying downside to using UBI - for some weird reason it doesn't ship with createrepo_c which the base RHEL does ship with. We'd get it installed via pip to /usr/local/bin/ but with #544 that would change because what is proposed there is to install cachi2 inside a virtual env and copy that one to the final image. I'm mentioning it here rather than in #544 is that although we can symlink createrepo_c from the virtual env, but I'm open to a broader discussion here if it turns out that this might turn into a maintenance nightmare with respect to UBI's limited set of packages and instead we might consider something like AlmaLinux or RockyLinux instead (afterall, both are forks of RHEL).

For example if I try Rocky Linux's take on UBI then createrepo is present and unlike AlmaLinux Rocky still claims to be 100% bug-for-bug compatible with RHEL, i.e. a RHEL fork.

[root@aea9a6132ee5 /]# dnf search createrepo
Rocky Linux 9 - BaseOS                                                    1.6 MB/s | 2.2 MB     00:01    
Rocky Linux 9 - AppStream                                                 3.1 MB/s | 7.9 MB     00:02    
Rocky Linux 9 - Extras                                                     38 kB/s |  15 kB     00:00    
=================================== Name & Summary Matched: createrepo ===================================
python3-createrepo_c.x86_64 : Python 3 bindings for the createrepo_c library
======================================== Name Matched: createrepo ========================================
createrepo_c.x86_64 : Creates a common metadata repository
createrepo_c-libs.i686 : Library for repodata manipulation
createrepo_c-libs.x86_64 : Library for repodata manipulation
[root@aea9a6132ee5 /]# 

Any thoughts/preferences?

@ben-alkov
Copy link
Member

ben-alkov commented May 30, 2024

for some weird reason it doesn't ship with createrepo_c

You've hit the main issue with using UBIs as anything other than a base runtime - they're very stripped down.

It sounds like Rocky is the way to go, except at that point, are we really better off than just sticking with Fed?

@eskultety
Copy link
Collaborator Author

eskultety commented May 30, 2024

for some weird reason it doesn't ship with createrepo_c

You've hit the main issue with using UBIs as anything other than a base runtime - they're very stripped down.

Uhm, not entirely true I guess. See this has nothing to do with runtime, but repo setup. The Rocky flavour I tested with was also marked as UBI, except without carefully constructed limitations of the base repositories. Without disclosing too much detail, let's just say that the same repository on base RHEL contains the package while the RH UBI counterpart doesn't. And it makes sense to keep RH's UBI licensing and intended usage intact I guess, but what determines the package selection that ends up in those repositories is a mystery to me. I'll just close my thought with a simple: my bad for actually not checking the package catalog on the proposed RH UBI which would tell me immediately what I could get inside and what I couldn't.

It sounds like Rocky is the way to go, except at that point, are we really better off than just sticking with Fed?

Well, pretty much anything is really better than Fedora for a production use (i.e. other than CI to uncover potential problems early) since it won't suffer from the 13 months EOL period.
EDIT: though I wonder if there are any surprising deps coming that wouldn't be available even on distros like Alma or Rocky, I guess only time will tell.

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.

None yet

3 participants