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

[WIP] Add support for Red Hat UBI #658

Closed

Conversation

HarryMichal
Copy link
Member

Adding support for [Red Hat UBI] (Universal Base Image) is a requirement for Toolbox to be included in RHEL (and in the process replacing https://github.com/coreos/toolbox).

Adding support for a new image requires implementing an internal "store" of supported images. To be frank, this is something I dreaded quite a bit for some time already :). This implements a very basic image store that allows matching based on a os-release:ID (e.g., fedora is Fedora, rhel is RHEL - in case of Toolbox UBI,..). This matching is available through a new option --distro | -d. The existing --release | -r option complements the new option.

The updated workflow should look a bit like this:

  • Scenario 1 - host machine is Fedora 33
$ toolbox create              <- creates a Fedora 33-based container
$ toolbox create -r 31        <- creates a Fedora 31-based container
$ toolbox create -d rhel -r 7 <- creates a RHEL 7-based container
  • Scenario 2 - host machine is RHEL 8
$ toolbox create           <- creates a RHEL 8-based container
$ toolbox create -r 7      <- creates a RHEL 7-based container
$ toolbox create -d fedora <- creates a Fedora 32-based container (default version of Fedora is used)
  • Scenario 3 - host machine is Arch Linux
$ toolbox create <- creates a Fedora 32-based container

On distributions without a matching supported image will Fedora stay as the default.

While this adds only support for UBI, technically speaking, it should be possible to add support for even other images. Another matter is who is going to maintain the images and where they will be stored. Before these questions are answered, we'll continue offering only Fedora and UBI images (but you are always free to use an image of your own making!).

This is now reused in utils.ImageReferenceGetBasename() and is needed
for future work on toolbox images "tracking".
UBI is here :).

TODO
@HarryMichal HarryMichal added 3. Enhancement Improvement to an existing feature 5. Help Wanted Extra attention is needed 6. Major Change May cause breakage 2. Images Images for creating toolbox containers labels Jan 5, 2021
@HarryMichal HarryMichal added this to the Release 0.1.0 milestone Jan 5, 2021
@softwarefactory-project-zuul
Copy link

Merge Failed.

This change or one of its cross-repo dependencies was unable to be automatically merged with the current state of its repository. Please rebase the change and upload a new patchset.

@HarryMichal HarryMichal added this to In progress in Support Red Hat UBI Jan 5, 2021
Copy link
Member

@debarshiray debarshiray left a comment

Choose a reason for hiding this comment

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

Thank you for working on this!

Let's see if we can split the commits a bit more. eg., one where ResolveContainerAndImageNames gets replaced by the new image backend, followed by one where --distro gets added and so on.

Some quick comments:

src/cmd/create.go Show resolved Hide resolved
src/cmd/create.go Show resolved Hide resolved
"fedora-toolbox": {
"registry.fedoraproject.org",
"fedora-toolbox",
"latest",
Copy link
Member

Choose a reason for hiding this comment

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

The latest part makes me a bit nervous. :)

I did toolbox create on my F33 host, and got a F34 container named fedora-toolbox-latest. Another point of confusion would be when the host gets upgraded, or the value of latest changes over time.

}

// Image holds parts of a full URI of an image
type Image struct {
Copy link
Member

Choose a reason for hiding this comment

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

I am wondering if we should call it Distro, instead of Image. Then we could include a function pointer to parse the release string in a distro-specific way.

@debarshiray
Copy link
Member

I split up the commits, and fixed up some of the above issues in #667

Most importantly, I had to skip some parts of the new container and image tracking backend to side-step some issues that I couldn't figure out on my own. eg., the one caused by the use of latest tags. Let's keep this pull request open to work through those.

@HarryMichal HarryMichal removed this from In progress in Support Red Hat UBI Feb 18, 2021
@HarryMichal HarryMichal removed this from the Release 0.1.0 milestone Feb 18, 2021
Base automatically changed from master to main March 25, 2021 22:25
@travier
Copy link
Member

travier commented Sep 9, 2022

We've made progress in this front in #1019. See the top comment for links to community supported images.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2. Images Images for creating toolbox containers 3. Enhancement Improvement to an existing feature 5. Help Wanted Extra attention is needed 6. Major Change May cause breakage
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants