Commit graph

297 commits

Author SHA1 Message Date
Michael Vogt
dd4547034b go.mod: update to latest version of image to get PR#1342
This will allow us to get boostrap buildroot support.
2025-03-25 11:58:24 +00:00
schutzbot
2c5f05e85b Post release version bump
[skip ci]
2025-03-14 14:53:28 +00:00
Simon de Vlieger
e7b9fbff1e ibcli: don't split outputfilename
A small test for a basename that includes dotted parts (as used by for
example Fedora's buildsystem).

Also some code changes to make this test pass, it seems that SBOM base
was determined based on some other filename which is now no longer
relevant?

Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
2025-03-14 14:47:36 +00:00
Michael Vogt
b51d1f983a image-builder: use testutil.Chdir() in TestBuildIntegrationHappy 2025-03-14 14:47:36 +00:00
Michael Vogt
2f0caddf91 testutil: add testutil.Chdir() helper
A tiny helper to run a specific function inside a different dir,
useful in our testsuite.
2025-03-14 14:47:36 +00:00
Michael Vogt
ccb4269b62 ibcli: add new --output-name flag
This commit adds a new `--output-name` flag that will rename
the resulting artifact after it was build. All auxillary artifacts
like buildlog, sbom etc are also name based on the same basename.

See also https://github.com/osbuild/images/pull/1039 for how
this could be simpler (especially the fake osbuild).

Closes: https://github.com/osbuild/image-builder-cli/issues/43
2025-03-14 14:47:36 +00:00
Michael Vogt
8635a22ad9 main: skip arch checks onIMAGE_BUILDER_EXPERIMENTAL=bootstrap
This commit skips the arch checks if the experimental "bootstrap"
option is used. The main use-case of this option is to bootstrap
a foreign architecture so just assume that and skip arch checks
when set.

This allows to write:
```
$ IMAGE_BUILDER_EXPERIMENTAL=bootstrap=ghcr.io/mvo5/fedora-buildroot:41 \
   ./image-builder build --arch=riscv64 minimal-raw --distro=fedora-41
```
and do a riscv64 cross arch build.
2025-03-12 18:10:46 +00:00
Michael Vogt
06e73caec1 main: show "success" message with output dir when build finishes
This commit adds a "success" message that also contains the output
dir when the build finishes.

Thanks to SimonS for suggesting this!
2025-03-12 17:03:59 +00:00
Simon de Vlieger
3eecad6b30 doc: fix typo
Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
2025-03-10 09:28:05 +00:00
Michael Vogt
c3ca146161 main: fix creating output dir for --with-buildlog
Trivial fix for the missing `mkdir()` call when `--with-buildlog`
is specified (and the matching test update).
2025-03-07 13:17:10 +00:00
Simon de Vlieger
3fd0373bc0 packit: enable epel-9 and epel-10
Let's ship our package in epel-9 and epel-10 as well as all the
supported Fedora branches. I've manually created, built, and created
updates for these branches already.

I'm not adding automation to the epel-10.0 branch in this PR as we need
to probably consider that more carefully. However, I *have* submitted
version 13 for epel-10.0 manually.

Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
2025-03-07 11:56:32 +00:00
dependabot[bot]
1087fd7187 build(deps): bump github.com/cheggaaa/pb/v3 in the go-deps group
Bumps the go-deps group with 1 update: [github.com/cheggaaa/pb/v3](https://github.com/cheggaaa/pb).


Updates `github.com/cheggaaa/pb/v3` from 3.1.6 to 3.1.7
- [Commits](https://github.com/cheggaaa/pb/compare/v3.1.6...v3.1.7)

---
updated-dependencies:
- dependency-name: github.com/cheggaaa/pb/v3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: go-deps
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-05 08:28:39 +00:00
schutzbot
e03922e299 Post release version bump
[skip ci]
2025-03-05 08:19:49 +00:00
Simon de Vlieger
dfa58fd6b5 chore: bump deps
Bump to latest `images` to make Fedora Minimal work with all the new
bits and bobs. Manual PR because the other one was being weird.

Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
2025-03-04 21:15:50 +00:00
Simon de Vlieger
0cc171e1f9 doc: build command
Introduce the `build` command.

Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
2025-03-04 09:13:51 +00:00
Simon de Vlieger
ca7ea33765 doc: rename output -> format
Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
2025-03-04 09:13:51 +00:00
Simon de Vlieger
08f8c13c5c doc: list-images
Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
2025-03-04 09:13:51 +00:00
Simon de Vlieger
887d3fee22 doc: sudo for build
Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
2025-03-04 09:13:51 +00:00
Simon de Vlieger
6b97573d2e doc: provide links in FAQ
Fill in the links that were placeholders to the appropriate places.

Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
2025-03-04 09:13:51 +00:00
Simon de Vlieger
dd954a7c6b doc: fix up Go installation
The Go example had a superfluous build argument and a missing build
argument.

Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
2025-03-04 09:13:51 +00:00
Simon de Vlieger
9064036048 doc: drop arguments from install examples
Drop the arguments from the install examples to keep the commands easier
to read. Arguments to be introduced under "usage".

Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
2025-03-04 09:13:51 +00:00
Simon de Vlieger
cefe2f8527 readme: update installation instructions
Mention installability in Fedora. Provide COPR enable instructions.
Mention the container.

Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
2025-03-03 10:37:39 +00:00
Simon de Vlieger
4d9cf723fd main: rename output to format
We had a chat about this and we feel that `format` is less ambiguous a
name for this argument.

Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
2025-02-27 10:58:11 +00:00
Simon de Vlieger
58aa0cf87b main: rename basedir -> base-dir
Rename the `basedir` argument to be consistent with `output-dir`
by hyphenation.

Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
2025-02-27 10:58:11 +00:00
Michael Vogt
2e741a70ad main: add build --with-buildlog
This commit adds a new `--with-buildlog` option that will automatically
create a buildlog in the output directory.
2025-02-25 12:08:51 +00:00
Michael Vogt
55d3b4916a go.mod: update to latest "bib" version 2025-02-25 12:08:51 +00:00
schutzbot
444c6cf087 Post release version bump
[skip ci]
2025-02-19 08:19:11 +00:00
Lukas Zapletal
6dd8515801 main: simplify upload error handling 2025-02-18 09:49:16 +00:00
Lukas Zapletal
8d03b2215c build: add bin/ to gitignore 2025-02-18 09:49:16 +00:00
schutzbot
ef8b8328cb Post release version bump
[skip ci]
2025-02-14 11:25:17 +00:00
Michael Vogt
a8d6751e19 docs: describe the way to add/override repositories
This commit adds some documentation on how the repositories can
be manipulated.
2025-02-13 11:31:06 +00:00
Michael Vogt
bc5be2ba8a main: add --force-repo flag
This commit adds an `--force-repo` flag that can be used
to replace all the base repositories with a base url to
a repository. This is useful for testing but also dangerous
as it will not do any checks and happily use a fedora-42 repository
for centos-8 depsolving.

This will make the use-case of the koji builder easier and is
also something that the `build` tool in `images` supports.
2025-02-13 11:31:06 +00:00
Michael Vogt
e2aeecec8e repos: make clearer why newRepoRegistry is a var
This commit reworks the `newRepoRegistry` func so that its easier
to see that it is a variable so that it can be overriden by the
tests. In the tests we want to use the `testrepos` we get from
images and in the real implementation we want to use the full
repo loader with search-paths and extra repos.
2025-02-12 12:57:27 +01:00
Michael Vogt
5f6d59013f go.mod: update to latest images release to get images PR#1211 2025-02-12 12:57:27 +01:00
Michael Vogt
a11e124133 main: add new --extra-repo flag
This commit adds a  new flag `--extra-repo` that can be used
to point to a repository url that is added to the base
repositories when depsolving. Note that *no* gpg checking
will be performed for such repos as there is no way to
add gpg-keys (yet) via this mechanism.

This means that with a repo created with e.g. `createrepo_c` like
```console
$ mkdir repo
$ (cd repo && dnf download hello)
$ createrepo_c ./repo
```
and a blueprint like:
```toml
[[packages]]
name = "hello"
```
a manifest is generated that gets hello from this local repo:
```console
$ image-builder  --extra-repo file:$(pwd)/repo manifest qcow2 --distro centos-9 --blueprint ./bp.toml |jq|grep hello
          "path": "hello-2.12.1-5.fc41.x86_64.rpm",
```
Note that this is part of the base repositories so anything with a
higher version number will get pulled from the extra-repo, even
system libraries or kernels. Note also that this repository does
not become part of the image so after the image build all rpms
from there are not updated (unless of course the normal repos
have higher versions of them).

Note as well that there is no safeguard right now against adding
extra repos for the wrong version of the distro, i.e. one could
add an extra repo build against/for fedora-42 on a fedora-40 image
which most likely will break with bad depsolve errors. But that
is okay, this option is meant for advanced users and testing.
2025-02-12 12:57:21 +01:00
Michael Vogt
25f21a3205 main: add upload support directly to build
This commit adds support to upload the build image directly to
the target cloud. Currently only ami/AWS is supported.

If the cloud specific configuration is given at the commandline
and the image type is a cloud image the cloud upload will happen
automatically (just like with bib). Incomplete upload config is
an error.
2025-02-11 13:38:04 +01:00
Michael Vogt
e41377b82a main: add new upload command
This commit adds a new `upload` command that can be used to
upload a raw image to the cloud. Currently only AWS is
supported but as images adds more clouds to the uploader interfac
we can easily expand more.

The cloud is currently detected via the file extension, that
mapping probably should also go into the `images` library.
2025-02-11 13:38:04 +01:00
Michael Vogt
0678d8ddfd main: update for new reporegistry.New() api (c.f. pr#1179)
This commit updates ibcli for the new API in images for the
`reporegistry.New()`. The main incompatible change is that the
`/repositories` part is not longer automatically added inside
the library so we need to add it on the call-site.

This needs https://github.com/osbuild/images/pull/1179
2025-02-10 20:40:56 +01:00
Michael Vogt
1a14f5bae3 go.mod: update images to v0.116.0 2025-02-10 20:40:53 +01:00
Michael Vogt
0a3c642772 go.mod: update to get the latest progress fixes from bib
This commit updates the `progress` package to get the latest
fixes, most notably
https://github.com/osbuild/bootc-image-builder/pull/820
2025-02-10 11:46:55 +01:00
Simon de Vlieger
036de52a39
describeimg: typo in describe output
`os_vesion` -> `os_version`

Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
2025-02-06 20:00:49 +01:00
Michael Vogt
7c6db68c98 main: add -v,--verbose switch that enables verbose build logging
This commit adds a new `-v,--verbose` switch that enables verbose
build logging.

Closes: https://github.com/osbuild/image-builder-cli/issues/112
2025-02-05 09:36:38 +00:00
schutzbot
8b09755cab Post release version bump
[skip ci]
2025-02-05 08:17:38 +00:00
Michael Vogt
19ef77337a main: reset the terminal properly on SIGINT,SIGTERM
This commit fixes the issue that on `CTRL-C` (SIGINT) the progress
is not properly cleared. It also catches SIGTERM for good measure.

No test right now as this is hard to test automatically :/

Closes: https://github.com/osbuild/image-builder-cli/issues/123
2025-02-04 13:11:11 +00:00
Michael Vogt
24dc23ac3b main: fix auto-detected distro that is non-visible, tweak order
This commit fixes the issue that the auto-detect distro is not
visible in the progress message. It also tweaks the order of
the message to show:
```
Building manifest for <distro>-<img-type>
```
to be more conistent.

Closes: https://github.com/osbuild/image-builder-cli/issues/121
2025-02-04 12:21:13 +00:00
schutzbot
fdab539045 Post release version bump
[skip ci]
2025-02-03 13:23:26 +00:00
Simon de Vlieger
379c97456b ci/packit: set downstream name
Since our upstream repository name differs from the downstream name we
should set the `downstream_package_name` [1] config option.

[1]: https://packit.dev/docs/configuration#downstream_package_name

Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
2025-02-03 11:28:26 +00:00
Simon de Vlieger
f9ff8ffbf1 specfile: build requires libxcrypt-compat
We received a commit downstream by Björn Esser. After asking around for
the reasoning behind the commit it seems that we're likely assuming that
this package is available in the buildroot.

Let's depend on it explicitly instead of assuming it is there.

Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
2025-02-03 11:27:37 +00:00
schutzbot
44d6622ba9 Post release version bump
[skip ci]
2025-02-03 08:38:08 +00:00
Simon de Vlieger
29e7814796 ci/packit: enable fedora PRs
Enable automatic builds and PR creation in Fedora since `image-builder`
has landed there.

Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
2025-02-03 08:26:21 +00:00