imgtestlib: use image-builder cmd, drop cmd/build/ (HMS-10298)#2462
imgtestlib: use image-builder cmd, drop cmd/build/ (HMS-10298)#2462avitova wants to merge 5 commits into
Conversation
|
|
||
| cmd = [ | ||
| "sudo", "-E", "./bin/image-builder", "build", image_type, | ||
| "--config", config_path, |
There was a problem hiding this comment.
Where does --config come from?
There was a problem hiding this comment.
Yeah, you are right, this was never supported. But tests passed locally previously; that is odd. I believe we ignore non-existent flags then?
|
You'll probably want to bump the Schutzbot seed if changing the build script I think? |
eb1dfd3 to
c657c12
Compare
b172aa9 to
725109a
Compare
|
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.confMight be what's needed to get that cross-arch build to work. |
| 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`) |
There was a problem hiding this comment.
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?
33da586 to
44c2edc
Compare
|
I am just trying to make Shutzbot tests not fail. 🥹 |
achilleas-k
left a comment
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
We should verify that --seed is properly plumbed through, I think it is but I also seem to recall it might not be.
There was a problem hiding this comment.
Oh, I see! Let me fix that!
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.
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.