Commit graph

284 commits

Author SHA1 Message Date
Michael Vogt
62bf88cc62 bib: pass the boot-mode to AWS when doing combined build/upload
This commit passes the boot mode to AWS when doing a combined
build/upload. Here we know what boot mode to use and we can
pass it easily.

This also adds a "XXX" to think about how to handle what to
do when uploading a pre-existing image where we do not know
the boot mode.
2025-06-07 12:29:18 +00:00
Michael Vogt
2996bbc0d1 image-builder: fix cross-arch uploading
This commit fixes the cross-arch uploading in the most simple
case by reading the `--arch` when `image-builder build --upload`
is used. Note that this is not a complete fix as it will not
take boot mode into account nor will it (by default) DTRT when
`image-builder upload` is used on a previously build images
for a different architecture.

Thanks to `FrostyX` for reporting the issue.
2025-06-07 12:29:18 +00:00
Simon de Vlieger
f4f8b557a5 packit: rename epel9-next
We've had issues proposing downstream for epel9-next due to branch name
failures. Let's see if this resolves that.

Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
2025-06-05 07:45:58 +00:00
schutzbot
06930c3af1 Post release version bump
[skip ci]
2025-05-30 14:01:37 +00:00
Simon de Vlieger
26bf19373a test/main: update types used
Image types were renamed [1] in images for the Fedora distribution.
While aliases were left behind for compatibility those are not used
when directly requesting manifests it seems.

Let's rename them to their canonical names.

[1]: 65194a4bf

Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
2025-05-28 08:19:05 +00:00
Simon de Vlieger
33f7822c28 test/main: update registrations test
There was previously a bug in the Insights client configuration stage
which omitted a key [1]. A testcase hardcoded this invalid format. Let's
update it to the expected value.

[1]: 389b629ce2

Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
2025-05-28 08:19:05 +00:00
Simon de Vlieger
89ce20101b test/main: no more fedora-40
Fedora 40 was removed from `images` as it is EOL, we can no longer use
it in our test cases. Bump to Fedora 42.

Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
2025-05-28 08:19:05 +00:00
Simon de Vlieger
92095eac06 deps: update
Update dependencies to get the latest images into `image-builder`; this
includes Alma Linux, a Vagrant image type for Fedora, and WSL
improvements for Fedora.

Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
2025-05-28 08:19:05 +00:00
schutzbot
de4879d4e6 Post release version bump
[skip ci]
2025-05-14 08:21:06 +00:00
Lukas Zapletal
392a04fd12 refactor: use standard logger instead of logrus 2025-05-12 18:21:37 +00:00
schutzbot
48cd004bed Post release version bump
[skip ci]
2025-04-30 08:21:01 +00:00
Michael Vogt
7af1a8d8b3 README.md: add a section about adding "registrations"
This is a small followup for
https://github.com/osbuild/image-builder-cli/pull/201
to include information about how to use the new
`--registrations` option.
2025-04-28 09:51:43 +00:00
Lukas Zapletal
4c9f2b4ba4 manifest: use Sync instead of Close 2025-04-24 06:18:10 +00:00
Michael Vogt
c829e60649 manifest: handle "close()" errors in sbomWriter()
This commit adds error handling for the `f.Close()` errors when
we write the SBOM. Errors on close for RW fds are rare but we
should handle them so we return the result of `f.Close()` now
when returning in sbomWriter(). We still keep the `defer f.Close()`
to ensure we do not leak file descriptors when e.g. `io.Copy()`
fails. In the "happy" case f is closed without an error and
then the defer f.Close() runs and will error with "ErrClosed"
but we can ignore that.

An alternative implementaiton might be:
```golang
func sbomWriter(outputDir, filename string, content io.Reader) (err error) {
	...
	f, err := os.Create(p)
	if err != nil {
		return err
	}
	defer func() { err = errors.Join(err, f.Close()) }()
	...
	return nil
}
```
no super strong opinion here.

Thanks to Flo for finding this issues!
2025-04-23 06:46:39 +00:00
Tomáš Hozza
1a2f4be378 Add unit test for describe-image
Add a unit test for testing that providing only the required command
line arguments produces expected output.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2025-04-17 13:20:55 +00:00
Michael Vogt
aecbe5928a main: add new --registrations options
This new flag allows to add a file with registration data. This
is meant to eventually hold all sort of registrations like
ansible or satelite but initially only contains the redhat
subscription. Currently only JSON is supported.

It looks like:
```json:
{
  "redhat": {
    "subscription": {
      "activation_key": "ak_123",
      "organization": "org_123",
      "server_url": "server_url_123",
      "base_url": "base_url_123",
      "insights": true,
      "rhc": true,
      "proxy": "proxy_123"
    }
  }
}
```

This is not part of the blueprint (today) because its more
ephemeral than the things we usually put into the blueprint.

This allows us to build images that are immediately registered. It
also keeps our options open in the future. If we move to a new
blueprint format where we support multiple blueprints and also
ephemeral data like this the "registrations" flag just becomes an
alias for "--blueprint".
2025-04-17 13:17:24 +00:00
schutzbot
020dbd6f41 Post release version bump
[skip ci]
2025-04-17 06:49:37 +00:00
Simon de Vlieger
81162a0736 deps: bump images and osbuild
Some important PRs have landed there, I'd like to do an extra release to
push these out.

Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
2025-04-16 19:58:29 +00:00
schutzbot
8bd065dbca Post release version bump
[skip ci]
2025-04-16 08:22:33 +00:00
Michael Vogt
6454da7b7e workflow: add createrepo_c package to test dependencies
This will fix the issue that TestManifestExtraRepo was not
run.
2025-04-10 10:26:01 +00:00
Michael Vogt
e3d23aa5ad test: fix missing conversion of a test blueprint to toml
This commit fixes the issue that a test blueprint was not converted
from json to TOML. This was not caught in CI apparently because
our test container misses createrepo_c.
2025-04-10 10:26:01 +00:00
Florian Schüller
e8e0d9c4e8 doc/00-installation: Add link to package details
There should be a link to the package details, not only
the reference to the main fedora page.
2025-04-09 15:14:41 +00:00
Simon de Vlieger
6f883c1407 doc: mention root perms for build
Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
2025-04-09 08:18:20 +00:00
Simon de Vlieger
ea1a42773a doc: document manifest
Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
2025-04-09 08:18:20 +00:00
Simon de Vlieger
1a85fc9248 doc: document describe
Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
2025-04-09 08:18:20 +00:00
Simon de Vlieger
11bf725453 doc: document build --arch
Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
2025-04-09 08:18:20 +00:00
Michael Vogt
f06b07c247 main: add disk customization to blueprint smoke test
Adding the disk customization to the blueprint test helps to
ensure that strict TOML checking works as expected. There was
a (brief) regression because manifest generation with disk
toml was not tested.
2025-04-09 05:32:45 +00:00
Michael Vogt
a2f71ad44c Reapply "blueprintload: enable strict checking for toml"
This reverts commit f25b5e325e.
2025-04-09 05:32:45 +00:00
Michael Vogt
7fbae14142 go.mod: bump version of github.com/osbuild/blueprint 2025-04-09 05:32:45 +00:00
Michael Vogt
c5f0f62ed2 go.mod: bump image version
This gives us the improved error reporting from dnfjson from
PR#1393
2025-04-09 05:32:45 +00:00
Simon de Vlieger
a893c2316e ci: release into epel-9-next
Instead of directly releasing to epel-9 we should release into
epel-9-next and do manual merges/releases when/if RHEL and/or CentOS
catch up with our dependencies.

Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
2025-04-08 14:26:53 +00:00
Simon de Vlieger
9847b44619 main: describe non-hidden
The describe format has become quite useful, we should list it in the
help page.

Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
2025-04-08 10:05:13 +00:00
Simon de Vlieger
5057bd4791 main: hide completion command
The `completion` command doesn't need to be quite so discoverable. Let's
have only actual subcommands listed and mention this in (future)
documentation instead.

Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
2025-04-08 08:38:23 +00:00
Simon de Vlieger
c99aa91265 main: describe auto-detect distro
Other commands such as `manifest`, and `build` auto detect the
distribution if none is given. `describe` is the odd one out that
requires `--distro`. Let's also autoselect there.

Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
2025-04-08 08:38:19 +00:00
Simon de Vlieger
274a75387b main: rename list-images to list
Rename the `list-images` command to `list`. We don't have `-image(s)` in
our other subcommands so this is for consistency.

We keep a `list-images` alias behind for compatibility reasons.

Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
2025-04-08 07:34:20 +00:00
Simon de Vlieger
a963712152 main: also eat depsolve warnings in manifest
Let's consume the depsolve warnings everywhere, including during
manifest generation.

Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
2025-04-08 07:27:35 +00:00
Simon de Vlieger
77498d99c8 deps: bump osbuild version
New images requires newer osbuild.

Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
2025-04-08 07:27:35 +00:00
Simon de Vlieger
ad9943e99d main: eat depsolve warnings
When running `image-builder` warnings are emitted during manifest
generation. Depending on the definitions or customizations packages
can be excluded from groups which leads to:

```
No match for group package "dracut-config-rescue"
```

Interspersing with normal output. Let's pass along another byte buffer
for the warnings from manifest generation to be written into.

Note that this also needs plumbing [1] to land in `images` first.

[1]: https://github.com/osbuild/images/pull/1384

Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
2025-04-08 07:27:35 +00:00
Simon de Vlieger
bda86863ff deps: update images to main
Pull in the `main` branch from images to ensure we have the support
needed for eating warnings.

Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
2025-04-08 07:27:35 +00:00
Simon de Vlieger
412fe34b41 main: rename describe-image to describe
Leaves behind a compatibility alias.

Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
2025-04-04 07:02:28 +00:00
Michael Vogt
0f348301d9 main: add base partition table to describe-image
This commit adds the (base) partition table to the `describe-image`
command. It needs https://github.com/osbuild/images/pull/1376

It currently looks like:
```yaml
$ image-builder describe-image qcow2 --distro fedora-41
@WARNING - the output format is not stable yet and may change
distro: fedora-41
...
partition_table:
  uuid: D209C89E-EA5E-4FBD-B161-B461CCE297E0
  type: gpt
  partitions:
    - size: 1048576
      type: 21686148-6449-6E6F-744E-656564454649
      bootable: true
      uuid: FAC7F1FB-3E8D-4137-A512-961DE09A5549
    - size: 209715200
      type: C12A7328-F81F-11D2-BA4B-00A0C93EC93B
      uuid: 68B2905B-DF3E-4FB3-80FA-49D1E773AA33
      payload:
        type: vfat
        uuid: 7B77-95E7
        label: EFI-SYSTEM
        mountpoint: /boot/efi
        fstab_options: defaults,uid=0,gid=0,umask=077,shortname=winnt
        fstab_passno: 2
    - size: 524288000
      type: 0FC63DAF-8483-4772-8E79-3D69D8477DE4
      uuid: CB07C243-BC44-4717-853E-28852021225B
      payload:
        type: ext4
        label: boot
        mountpoint: /boot
        fstab_options: defaults
    - size: 2147483648
      type: 0FC63DAF-8483-4772-8E79-3D69D8477DE4
      uuid: 6264D520-3FB9-423F-8AB8-7A0A8E3D3562
      payload:
        type: ext4
        label: root
        mountpoint: /
        fstab_options: defaults
```
2025-04-03 17:25:16 +00:00
Michael Vogt
1d2095f09e go.mod: update to latest version of images to get PR#1376 2025-04-03 17:25:16 +00:00
Tomáš Hozza
1b6ecf9012 SPEC: bump the minimum required osbuild version
Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2025-04-02 20:57:17 +00:00
Tomáš Hozza
724ffd4a77 GH Action: check the SPEC osbuild/images deps minimum version
Add a check which leverages the osbuild/images@check-spec-deps-action
action to check that the SPEC files requires at least the minimum
versions for dependencies specified by the `osbuild/images`.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2025-04-02 20:57:17 +00:00
schutzbot
a5994eb570 Post release version bump
[skip ci]
2025-04-02 08:22:29 +00:00
Michael Vogt
958f95f634 progress: set --cache-max-size in osbuild
This commit allows controlling the `osbuild --cache-max-size`
option. By default it will set the cache to 20GiB but allows
this to be controlled by the user.

Thanks to Simon for raising this.
2025-04-01 11:30:44 +00:00
Brian C. Lane
2cfe043f5e main: Add a --version flag to show the build version
This embeds the version at build time and displays it when passed the
--version flag.
2025-04-01 06:50:24 +00:00
Simon de Vlieger
63bb56e12d import: refer to pkg
Change the progress imports to refer to `pkg/progress` inside this
repository as it was imported from `bootc-image-builder`.

Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
2025-03-31 19:42:59 +00:00
Simon de Vlieger
f4bbd3e048 import: move bib files to correct path
Moves the files imported from `bootc-image-builder` directly under `pkg`
so they can be imported in reverse. Also fix up any import paths at the
same time.

Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
2025-03-31 19:42:59 +00:00
Michael Vogt
7ac659490c progress: add new BuildLog option
This commit adds a new `BuildLog` option to the `OSBuildOptions`
that can be used to generate a streamed buildlog (e.g. to a file
or a websocket).

This will be used in `ibcli` with a new `--with-buildlog` option.
2025-03-31 19:42:59 +00:00