Commit graph

308 commits

Author SHA1 Message Date
Simon de Vlieger
585d349d0f image-builder: --extra-artifacts split
Split out `--extra-artifacts` into `--with-sbom` and `--with-manifest`.

Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
2025-01-20 15:42:21 +00:00
Simon de Vlieger
ee38c45122 image-builder: rename --store to --cache
Closes #77.

Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
2025-01-20 15:42:21 +00:00
Michael Vogt
0580eb1106 main: add --extra-artifacts=manifest
This commit adds support for `--extra-artifacts=manifest`. If
that is given as part of the build an extra artifacts called
`<img-name>.osbuild-manifest.json` will be created in the
output directory.

Closes: https://github.com/osbuild/image-builder-cli/issues/42
2025-01-20 14:12:30 +00:00
Michael Vogt
c4357b3bfa build: introduce buildOptions 2025-01-20 14:12:30 +00:00
Simon de Vlieger
94afe7b150 test: use image-builder-test as a name
Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
2025-01-20 13:32:25 +00:00
Simon de Vlieger
c7b8ee9af0 HACKING: drop -cli
Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
2025-01-20 13:32:25 +00:00
Simon de Vlieger
efe3aeba45 spec: update descriptions
Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
2025-01-20 13:32:25 +00:00
Simon de Vlieger
94f7a6fc1f makefile: use -cli archive names
The Go macros have a bunch of expectations about package names and
archive names. Let's keep the archive names with `-cli` in them to
appease them.

These can only be dropped after we change repositories around and thus
change the `goipath`; after which these can drop their `-cli`.

Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
2025-01-20 13:32:25 +00:00
Simon de Vlieger
37791d3c76 readme: refer to new COPR
Refer to a COPR by the new `image-builder` name.

Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
2025-01-20 13:32:25 +00:00
Simon de Vlieger
6061960689 spec: rename to image-builder
`image-builder` will be the main entrypoint into the Image Builder
stack. We will rename the repositories later on; but let's start
referring to it in its new official name.

Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
2025-01-20 13:32:25 +00:00
Simon de Vlieger
0eb6c5e262 image-builder: newline in error message
Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
2025-01-20 06:55:24 +00:00
Michael Vogt
ca0c9e63bd README: document the new --extra-artifacts=sbom option
Small commit that tweaks the README to include this new option.
2025-01-19 21:57:14 +00:00
Michael Vogt
cc2d1ac692 main: add --output-dir option
This commit adds a new `--output-dir` option to override the
default output directory for the generated artifacts.

Note that this can also be used together with `manifest` when
extra artifacts (like the sbom) is requested.
2025-01-19 21:57:14 +00:00
Michael Vogt
d485bc3a44 ibcli: add new --extra-artifacts option with sbom support
This commit adds an option --extra-artifacts that can be
used to generate extra artifacts during the build or manifest
generation. Initially supported is `sbom` (but `manifest` is
planned too).

To use it run `--extra-artifacts=sbom` and it will generate
files like `centos-9-qcow2-x86_64.image-os.spdx.json` in
the output directory next to the generate runable artifact.

Closes: https://github.com/osbuild/image-builder-cli/issues/46
2025-01-19 21:57:14 +00:00
Michael Vogt
db7cad2239 main: tweak TestBuildIntegrationErrors
We do not need to pass a blueprint in this test.
2025-01-19 21:57:14 +00:00
Michael Vogt
bdb32554ff test: add new test_container_builds_image_librepo test
This commit adds a (smoke) integration test for librepo based
manifests. It needs a flanking test that also ensures that
--use-librepo really generates librepo sources.
2025-01-17 13:29:01 +00:00
Michael Vogt
687f69bb76 main: make "--use-librepo" the default
This commit switches the default to librepo. We do not have many
users yet so this is a great place to test the new librepo
functionality. It also is much more stable for fedora/centos
systems that often have flaky mirrors.

This also bumps the minimum required version of osbuild.
2025-01-17 13:29:01 +00:00
Michael Vogt
d75bb4fa0a manifestgen: make depsolve return the full dnfjson.DepsolveResult
This commit changes the signature of depsolve in `manifestgen`
to return the full `dnfjson.DepsolveResult`. This gives us
access to the sbom and also is a preparation for images PR#1142
where we will need this anyway.
2025-01-17 13:29:01 +00:00
Michael Vogt
44f27108b9 ibcli: introduce/use manifestOptions struct
This commit adds a new manifestOptions struct that is passed
to generateManifest. to cleanup the signature of generateManifest().

This can then also be used to carry a new e.g. `--rpmmd/--cachedir`
option.
2025-01-17 13:29:01 +00:00
Michael Vogt
f8ffa8a258 main: add experimental --use-librepo to support librepo downloads
This commit switches to the librepo enabled `images` library via:
```
go mod -replace github.com/osbuild/iamges=github.com/mvo5/images@librepo-sources-osbuild1974
```
which in turn needs osbuild PR#1974.

With that it then adds a new `--use-librepo` switch that will
enable librepo based downloading so that people can play with
the new backend.
2025-01-17 13:29:01 +00:00
Michael Vogt
78f62e21e2 go.mod: move to latest snapshot 2025-01-17 13:29:01 +00:00
Simon de Vlieger
2f13ed2ec7 spec: min osbuild version
Depend on a minimum osbuild version.

Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
2025-01-17 08:58:07 +00:00
Simon de Vlieger
d36e7ba0aa spec: require osbuild extras
Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
2025-01-17 08:58:07 +00:00
Simon de Vlieger
d6c4bba36d spec: require osbuild-depsolve-dnf
Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
2025-01-17 08:58:07 +00:00
Simon de Vlieger
5b2581f15e spec: require osbuild
We can't build images without having osbuild installed.

Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
2025-01-17 08:58:07 +00:00
Simon de Vlieger
ff62775628 cmd: exactly 1 arg
Since we only accept one image type (for now) we only need to accept
exactly one argument.

Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
2025-01-17 08:57:36 +00:00
Simon de Vlieger
0c255f2bdb cmd: fix usage
We don't pass `[blueprint]` positionally anymore.

Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
2025-01-17 08:57:36 +00:00
dependabot[bot]
bf6645554f build(deps): bump actions/setup-go from 4 to 5
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 4 to 5.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](https://github.com/actions/setup-go/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-17 08:03:08 +00:00
Florian Schüller
4799e233c2 pre-commit: re-enable golangci-lint
Followup of #54
2025-01-16 14:16:31 +00:00
Simon de Vlieger
3fb26dbffe doc: update README
Use the new `--blueprint` in the README.

Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
2025-01-16 12:31:13 +00:00
Simon de Vlieger
c1c60a3c77 cmd: --blueprint
Moves the blueprint argument to a named argument; freeing up space to
later be able to pass in multiple image types. This also slightly
simplifies the case where we're building without a blueprint available.

Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
2025-01-16 12:31:13 +00:00
Florian Schüller
ffb22eb837 spellcheck: ignore release_artifacts directory
Pyspelling does not seem to read `.gitignore` file,
so we'll manually exclude it for now.
2025-01-15 15:58:00 +00:00
Simon de Vlieger
8ba39144ce ci: expand spellcheck
Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
2025-01-14 10:11:41 +00:00
Michael Vogt
44f8f90310 README: add blueprint example
This commit adds an example for how to pass the blueprint and what
content the blueprint should have.
2025-01-13 13:46:14 +00:00
Michael Vogt
8f94516779 main: add ostree integration
This commit adds integration for the ostree options. It is modelled
loosely after weldr-client/composer-cli and the
```
start-ostree --{ref,parent,url}
```
and uses
```
--ostree-{ref,parent,url}
```

A simple smoke test is provided that uses fedora-iot. Ideas welcome
for an easier way :)
2025-01-10 14:37:47 +00:00
Florian Schüller
00e18fe1cd Makefile/packit: avoid duplicate implementation of "version" 2025-01-10 13:50:34 +00:00
Michael Vogt
4f1816c1b7 manifestgen: pass missing repoConfig to preManifest.Serialize()
When depsolve is run it returns a list of packageSpecs and the
matching repository config. This repo config is different/distinct
from the repository config that is passed into depsolve via the
package sets or the repositories that are loaded via the
reporegistry and needs to be passed into `manifest.Serialize()`.

The key different is that the depsovle `repoConfig` contains
the repo.Id that match the packageSpec.RepoId. With those two
matching IDs we can use librepo (see osbuild PR#1974) to infere
what mirror to use for what package.

This commit now passes the correct repoConfig into
preManifest.Serialize() now.

No test (sorry!) as this is really hard to test in isolation, there
is nothing observable today from repoConfig and it is impossible
to add a "witness" pipelien that could check that the right argument
is passed in `pipeline.serializeStart()`. So until we refactor
images you will have to take my word for this (sorry again).
2025-01-10 13:49:28 +00:00
Florian Schüller
30166b07fc Makefile: fix packer version by using git tag
For releases this does not change anything, as the version
in the spec file is the same as the git tag. For
intermediate/tainted versions packer seems to patch the spec
file to the version given in `.packit.yaml`
(which is the latest git-tag), then the filename and version
would be inconsistent.
2025-01-10 11:55:52 +00:00
Michael Vogt
0563b845be pre-commit: drop golangci-lint for now
The package crashes during check with:
```
golangci-lint............................................................Failed
- hook id: golangci-lint
- exit code: 3
level=warning msg="[runner] Can't run linter goanalysis_metalinter: buildir: failed to load package gpgme: could not load export data: no export data for \"github.com/proglottis/gpgme\""
level=error msg="Running error: can't run linter goanalysis_metalinter\nbuildir: failed to load package gpgme: could not load export data: no export data for \"github.com/proglottis/gpgme\""
```

which is not helpful
2025-01-10 08:30:28 +00:00
Michael Vogt
fb56109048 cmd: drop TestListImagesOverrideDatadir
With the new build-in repos this test is no longer relevant. We
need to look into a different way to test overrides but just
providing an empty datadir will no longer work so drop that.
2025-01-10 08:30:28 +00:00
Michael Vogt
d35c95a9bc lint: fix whitespace/spelling in README 2025-01-10 08:30:28 +00:00
Michael Vogt
ffc676e3d0 main: help golang-ci to find the "main" symbol in the tests 2025-01-10 08:30:28 +00:00
Michael Vogt
c1454864c4 pre-commit: bump golangci-lint to v1.63.1 to fix crash when importing slices 2025-01-10 08:30:28 +00:00
Michael Vogt
25043b2e70 workflow: switch to composite action to fix go/pytest
The go/pytest tests were broken because the reusable workflow
is not quite the right construct. We need the "composite action".
2025-01-10 08:30:28 +00:00
Michael Vogt
573f56a6ec workflow: rename .yml -> .yaml 2025-01-10 08:30:28 +00:00
Michael Vogt
692a487fe9 test: fix integration test 2025-01-10 08:30:28 +00:00
Michael Vogt
80cadaf291 repos: lookup <buildin>, /{etc,usr/share}/image-builder/repositories
This commit switches the default repositories to use the build-in
ones from images PR#1112. It is still possible to override using
`/etc/image-builder` and `/usr/share/image-builder` or `--datadir`.

This is implicitly tested via the container test that no longer
includes the files from osbuild-composer in the container.
2025-01-09 16:17:50 +00:00
Michael Vogt
6d9e91eb3c go.sum: update to latest images lib to get embeded repos 2025-01-09 16:17:50 +00:00
schutzbot
c1b1658929 Post release version bump
[skip ci]
2025-01-08 08:29:09 +00:00
Michael Vogt
d727d9aa76 manifestgen: port to the new images manifest seed
This moves to the new images Manifest() API from PR#1107.
2025-01-08 06:53:12 +00:00