Skip to content

Rewrite container handling internals to drop graphdriver and gpgme dependencies [RHEL-56367] - #2607

Open
achilleas-k wants to merge 18 commits into
osbuild:mainfrom
achilleas-k:drop-dep/containers-image/part2
Open

Rewrite container handling internals to drop graphdriver and gpgme dependencies [RHEL-56367]#2607
achilleas-k wants to merge 18 commits into
osbuild:mainfrom
achilleas-k:drop-dep/containers-image/part2

Conversation

@achilleas-k

@achilleas-k achilleas-k commented Aug 20, 2026

Copy link
Copy Markdown
Member

This PR rewrites container-related things in order to drop our dependency on graphdrivers and gpgme. It finishes the work I started in #2346, where I changed the container resolver internals to use skopeo.

Changes in this PR, in order:

  1. Rewrite testregistry to use github.com/distribution/distribution. This simplifies the implementation of the internal container test registry significantly, offloading all the work to distribution/distribution. It also gives us a more fully-featured test registry, so we can test pushing containers as well.
  2. Test osbuild-upload-container with the new test registry. The upload code wasn't being tested at all before, so any testing here is an improvement.
  3. Rewrite osbuild-upload-container to use skopeo copy internally.

With these rewrites, we rely on skopeo for almost all of our interactions with container registries, which means we don't depend on any of the filesystem libraries or gpgme.

@achilleas-k
achilleas-k requested review from a team and thozza as code owners August 20, 2026 18:38
@achilleas-k
achilleas-k force-pushed the drop-dep/containers-image/part2 branch 6 times, most recently from 540ac2e to 5bf4948 Compare August 20, 2026 19:01
Set up the test container registry using
github.com/distribution/distribution.  This delegates more of the
registry handling to third party libraries, but will allow us to build a
more complete test registry so we can test both pushing and resolving.
Add a method to the new registry that adds a manifest list with 4 random
images for testing.
Rewrite the resolver tests to use the new test registry functionality.
Return the image IDs that were created by the PopulateWithManifestList()
function alongside the digests for the new images.
Rewrite the container client tests to use the new test registry
functionality.
Rewrite the blocking resolver tests to use the new test registry
functionality.
Adapt the blocking resolver test that resolves multiple containers at
once to test the async resolver as well.
Drop the old registry implementation that maintained its own internal
container repositories.  Everything is handled by the new implementation
now.
Use the new testregistry to upload a container using
osbuild-upload-container and verify that it was uploaded successfully by
resolving the container using our own resolver.

The main() function of the osbuild-upload-resolver is split into an
upload() function that does the main work so it can be testable.  The
main() function now only handles command line flags and then calls into
the new function.
Support starting the registry with basic auth (username and password).
Test uploading a container with credentials (username and password).
Rewrite the container UploadImage() function to shell out to skopeo
copy.  It takes care of all the options we currently support by
converting them to command line options.  The functionality is tested by
the new osbuild-upload-container tests.
Drop the parseImageName() function and the policy property of the
client.  They're not needed anymore.
On RHEL and CentOS, the exclude_graphdriver_btrfs tag was needed to
compile without support for the btrfs driver from the containers/image
dependency.  That dependency is now gone and we don't need to specify
the tag anymore.
The same goes for the other graphdrivers: devicemapper and overlay.
Even though we could support those on the two distros, we sometimes
specified them to avoid needing the devel package dependency installed.
The containers/image pgp dependency is also gone.
Remove btrfs-progs-devel, device-mapper-devel, and gpgme-devel from the
dependency install script.
Remove mentions of btrfs-progs-devel and device-mapper-devel.

Also remove mentions of cmd/build.

This README should be replaced by the Image Builder readme soon.

See HMS-10586
Remove all mentions of:
- gpgme-devel
- btrfs-progs-devel
- device-mapper-devel
@achilleas-k
achilleas-k force-pushed the drop-dep/containers-image/part2 branch from 5bf4948 to 5236abc Compare August 20, 2026 19:05
@achilleas-k

Copy link
Copy Markdown
Member Author

copr builds are failing on missing systemd-escape, which we use to make mount unit names but don't strictly depend on. I should add it to the spec file really.

@achilleas-k

Copy link
Copy Markdown
Member Author

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.

1 participant