Skip to content

imgtestlib: use image-builder cmd, drop cmd/build/ (HMS-10298)#2462

Open
avitova wants to merge 5 commits into
osbuild:mainfrom
avitova:use-ib-not-build
Open

imgtestlib: use image-builder cmd, drop cmd/build/ (HMS-10298)#2462
avitova wants to merge 5 commits into
osbuild:mainfrom
avitova:use-ib-not-build

Conversation

@avitova

@avitova avitova commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

I saw more possible approaches, such as splitting configs into two files: blueprint, and the options part. However, creating a temporary file for blueprint in /tmp sounds like a good option and keeps things clean. Let me know what you guys think.

Comment thread test/scripts/imgtestlib/build.py Outdated

cmd = [
"sudo", "-E", "./bin/image-builder", "build", image_type,
"--config", config_path,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Where does --config come from?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah, you are right, this was never supported. But tests passed locally previously; that is odd. I believe we ignore non-existent flags then?

@supakeen

supakeen commented Jun 25, 2026

Copy link
Copy Markdown
Member

You'll probably want to bump the Schutzbot seed if changing the build script I think?

@avitova avitova force-pushed the use-ib-not-build branch 4 times, most recently from eb1dfd3 to c657c12 Compare June 25, 2026 17:30
@avitova avitova changed the title imgtestlib: use image-builder cmd, drop cmd/build/ imgtestlib: use image-builder cmd, drop cmd/build/ (HMS-10298) Jun 25, 2026
@avitova avitova force-pushed the use-ib-not-build branch 3 times, most recently from b172aa9 to 725109a Compare June 26, 2026 09:39
@achilleas-k

Copy link
Copy Markdown
Member

While working on #2467, I saw this in the old bootc-image-builder github actions:

      - name: Workaround podman issues in GH actions
        run: |
          # see https://github.com/osbuild/bootc-image-builder/issues/446
          sudo rm -rf /var/lib/containers/storage
          sudo mkdir -p /etc/containers
          echo -e "[storage]\ndriver = \"overlay\"\nrunroot = \"/run/containers/storage\"\ngraphroot = \"/var/lib/containers/storage\"" | sudo tee /etc/containers/storage.conf

Might be what's needed to get that cross-arch build to work.
Still doesn't explain why it started failing now though.

Comment thread cmd/image-builder/main.go Outdated
manifestCmd.Flags().String("bootc-installer-payload-ref", "", `bootc installer payload ref`)
manifestCmd.Flags().String("bootc-default-fs", "", `default filesystem to use for the bootc install (e.g. ext4)`)
manifestCmd.Flags().Bool("bootc-no-default-kernel-args", false, `don't use the default kernel arguments`)
manifestCmd.Flags().Bool("bootc-remote", false, `use org.osbuild.skopeo sources instead of containers-storage`)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think using the osbuild stage names here isn't very helpful. We don't expect users of the CLI to know about osbuild internals so it's a bit of a layer violation, even though they appear in the output.
It'd be better to describe it in general terms, like:
"Pull bootc container from remote location instead of using it from local container storage"

The option could also use some workshopping. Maybe bootc-pull-container?

@avitova avitova force-pushed the use-ib-not-build branch 7 times, most recently from 33da586 to 44c2edc Compare July 7, 2026 08:43
@avitova avitova marked this pull request as ready for review July 7, 2026 08:43
@avitova avitova requested review from a team and thozza as code owners July 7, 2026 08:43
@avitova avitova requested review from lzap and supakeen July 7, 2026 08:43
@avitova

avitova commented Jul 7, 2026

Copy link
Copy Markdown
Contributor Author

I am just trying to make Shutzbot tests not fail. 🥹

@achilleas-k achilleas-k left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice work. Found one issue though.


from .gitlab import log_section
from .run import runcmd, runcmd_nc
from .testenv import get_host_distro, get_osbuild_commit, rng_seed_env

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is the test rng seed ignored now? That would invalidate the caching and cause constant rebuilds. We have a --seed are for the build subcommand, so it should be added to build the exact, predictable manifest that will be checked for in later runs.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We should verify that --seed is properly plumbed through, I think it is but I also seem to recall it might not be.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Oh, I see! Let me fix that!

avitova added 4 commits July 8, 2026 15:08
Wire new CLI flags --bootc-remote and --image-size through manifest so
that test configs can be built via image-builder build/manifest.

Related: HMS-10855
This commit swaps usage of build in tests to using image-builder
directly.
After swapping from build to image-builder in tests, it is possible to
use options instead of solely just a config file. This commit extracts
options from the json config: --ostree-ref, --ostree-url,
--ostree-parent, --bootc-installer-payload-ref, --bootc-remote,
--image-size, and --extra-repo. It also extracts the blueprint part of
the config into a standalone file, so that it can be used for building
with image-builder.
The commit also changes find_image_file function which now looks for
different filename, since image-builder creates a different file than
./bin/build.

Related: HMS-10855
The test keep failing due to missing fuse. Disabling the test since this
is experimental.
For uploaders for both AWS and Azure, we check for missing arguments,
and fail early when uploading, and skip upload during build when the
flag is not provided. For openstack, we do not do that. As a result,
upload to openstack fails. This commit adds a check for
--openstack-image before creating an openstack uploader and fails with
ErrUploadConfigNotProvided if not provided.
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.

3 participants