Commit graph

69 commits

Author SHA1 Message Date
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
Michael Vogt
59e6ce298a go.mod: update to images@v0.108.0 2025-01-08 06:53:12 +00:00
Florian Schüller
c408577b2d pre-commit: introduce make lint
Also make the linters part of the github actions.
2025-01-07 12:29:58 +00:00
Florian Schüller
734c132500 prepare all syntax for linters and spellchecks 2025-01-07 12:29:58 +00:00
schutzbot
b932d218e3 Post release version bump
[skip ci]
2024-12-25 08:28:26 +00:00
Simon Steinbeiss
51e4171caf actions: Add pr-best-practices workflow
This commit adds the pr-best-practices check, which prevents pull
requests without descriptions being merged and which allows developers
to quickly create Jira Tasks based on the /jira-epic command in pull
request descriptions or comments.
2024-12-20 15:41:37 +00:00
schutzbot
69b6ed5857 Post release version bump
[skip ci]
2024-12-20 14:30:01 +00:00
dependabot[bot]
02cb63b8fd build(deps): bump docker/login-action from 2 to 3
Bumps [docker/login-action](https://github.com/docker/login-action) from 2 to 3.
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](https://github.com/docker/login-action/compare/v2...v3)

---
updated-dependencies:
- dependency-name: docker/login-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-20 14:27:26 +00:00
schuellerf
6f26427ddf Post release version bump
[skip ci]
2024-12-20 14:05:26 +00:00
Florian Schüller
cad909e77a github/workflows/release.yml: enable creating release artifacts 2024-12-20 13:59:49 +00:00
Florian Schüller
be1cfec923 github/workflows/create-tag: initial version
Helper to create a tag for a new release.
2024-12-20 13:30:45 +00:00
Florian Schüller
99af073fa3 image-builder-cli.spec: fix building centos stream 10
Using the same approach as in osbuild-composer.
2024-12-20 12:33:48 +00:00
Florian Schüller
cdff269270 github/workflows: introduce release action
Using staging branch for now, due to the new
release_artifacts.
2024-12-20 08:08:59 +00:00
dependabot[bot]
c45b5e978f build(deps): bump the go-deps group with 2 updates
Bumps the go-deps group with 2 updates: [github.com/osbuild/images](https://github.com/osbuild/images) and [github.com/stretchr/testify](https://github.com/stretchr/testify).


Updates `github.com/osbuild/images` from 0.98.0 to 0.106.0
- [Release notes](https://github.com/osbuild/images/releases)
- [Commits](https://github.com/osbuild/images/compare/v0.98.0...v0.106.0)

Updates `github.com/stretchr/testify` from 1.9.0 to 1.10.0
- [Release notes](https://github.com/stretchr/testify/releases)
- [Commits](https://github.com/stretchr/testify/compare/v1.9.0...v1.10.0)

---
updated-dependencies:
- dependency-name: github.com/osbuild/images
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go-deps
- dependency-name: github.com/stretchr/testify
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go-deps
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-20 05:21:56 +00:00
Florian Schüller
1f94684f53 .packit.yaml: fix patching the spec file 2024-12-19 14:45:01 +00:00
Florian Schüller
2e4a8e194d Makefile: support building commit and version based tarball 2024-12-19 14:45:01 +00:00
Florian Schüller
7e181e30c9 .packit.yaml: implement version fallback until we have a tag 2024-12-19 14:45:01 +00:00
Tomáš Hozza
9b737c1949 Makefile: use version instead of commit for archive filename
RPM tooling expects the source tarball to match the name of the
package, suffixed with the version in the SPEC file. Modify the Makefile
to comply with this expectation.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2024-12-19 14:45:01 +00:00
Tomáš Hozza
c1a719e4e3 SPEC: use version 1
SPEC always uses the next version that will be released.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2024-12-19 14:45:01 +00:00
Tomáš Hozza
3ae39416c7 FIXUP: .packit.yaml: fix issues when building SRPM
FWIW, I never get || and && correctly in Bash for the first time :D

Also handle the case then the repository does not contain any version
tags yet by defaulting to "1".

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2024-12-19 14:45:01 +00:00
Tomáš Hozza
f4fa09abf3 FIXUP: .packit.yaml: fix issues when building SRPM
Packit needs golang to be installed when we build SRPM, because we need
to vendor code to generate the archive.

Moreover, we need to vendor code to be able to modify SPEC port upstream
clone to include bundled code.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2024-12-19 14:45:01 +00:00
Florian Schüller
89fec6d5d0 Makefile: assure bundle info in spec file
The release artifact should contain the spec file including the
bundle information.
2024-12-19 14:45:01 +00:00
Tomáš Hozza
b870c404a5 Add initial Packit configuration
For now, Packit should trigger COPR buils for PRs and merges to the
`main` branch.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2024-12-19 14:45:01 +00:00
Tomáš Hozza
f1b09b91a9 Makefile/release_artifacts: print the archive path
Packit needs expects the archive path to be printed when specifying a
custom action to build the archive. See [0].

[0] https://packit.dev/docs/configuration/actions#create-archive

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2024-12-19 14:45:01 +00:00
Florian Schüller
50c79f154d Makefile: support for make release_artifacts
Supports to package `vendor/` directory
which is not part of the repository.
2024-12-19 14:45:01 +00:00
Simon de Vlieger
60c22e3214 package: spec file
Provide a spec file for `image-builder-cli`. The spec file is based on
`osbuild-composer`'s spec file except it is simplified as (some)
usecases would currently cloud the intent of the specfile. We can add
back RHEL conditionals when/if we start shipping and building for RHEL.

Some tools from `osbuild-composer` are also included; most notably the
one that generates bundled dependencies from vendored modules.

Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
2024-12-19 14:45:01 +00:00
Simon de Vlieger
cdf627389e ci: dependabot
As we've now vendored our dependencies let's enable dependabot in the
same way we use it in our other Go projects.

Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
2024-12-19 14:45:01 +00:00
Simon de Vlieger
38af61d633 ci: enable aarch64 container builds
Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
2024-12-19 14:26:40 +00:00
Michael Vogt
119e8fcffa workflow: run tests as part of the merge group
This commit adds the missing `merge_group` to the pytest and go
test workflows.

Note that I added `types: [ "checks_requested" ]` (just like we
have for the container.yaml) but I'm not actually sure about it,
the GH docs are a bit unclear to me here, it seems they suggest
to keep this generic but then the example explicitly uses `type`
(I'm probably overthinking this fwiw).

[1] https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#merge_group
2024-12-19 12:08:08 +00:00
Michael Vogt
f89342a1bd ibcli: use /var/cache/image-builder/store as default for --store
This commit follows a suggestion from Ondrej to add a better
default for `--store`: /var/cache/image-builder/store.

This is nice as it will give users automatic caching and makes
the container also nicer.
2024-12-19 11:35:15 +00:00
Michael Vogt
083c220f0a test: move to centos-9 for the smoke test
This commit moves the smoke test from fedora-41 to centos-9. The
reason is that it seems the fedora mirrors in general are a bit
more flaky so /hopefully/ the centos one will help.

The real fix of course is to retry different mirrors on failure,
we will need to look into librepo integration in osbuild (again)
for this (hopefully soon!).
2024-12-19 11:33:13 +00:00
Michael Vogt
f631a16976 workflow: rename all .yml files to .yaml
The original `go.yml` got added via some GH automation. But we
are not MSDOS and we can affort more than 3 chars for a file
extension - so this commit renames all .yml to .yaml which is
what we use everywhere else.
2024-12-19 11:32:37 +00:00
Michael Vogt
058e3d6832 manifestgen: use temporary cache dir if no cacheDir is given
This commit creates a temporary directory for the defaultDepvolver()
if no cacheDir is given. This ensures that we do not clutter the
current working directory with `platform:foo` cache directories
that `solver.Depvolve()` creates.

Note that this is only tested indirectly via the integration test
in `test_container.py:test_container_builds_image()` that checks
that the output directory is clean.
2024-12-19 08:49:26 +00:00
Michael Vogt
cc4a730381 github: add new pytest based integration test run workflow
This commit adds a new workflow that runs the new `pytest` based
integration tests inside GH actions. It also extracts a common
`testdeps.yml` reusable workflow so that we do not duplicate the
package list of test dependencies.
2024-12-19 08:49:26 +00:00
Michael Vogt
e7d8a39fcf test: add minimal test for container based building of images
This commit adds a smoke test that builds the ibcli container
and runs a fedora-41 raw-minimal build to double check that
the container based building actually works.

Thanks to Ondrej for suggesting this.
2024-12-19 08:49:26 +00:00
Simon de Vlieger
fad02336b3 ci: build container
Automatically build the container for `image-builder-cli` and upload it
to `ghcr.io`. This builds only for x86 initially.

Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
2024-12-19 08:49:26 +00:00
Michael Vogt
5aa75ec1c1 Containerfile: initial version
This commit adds an initial Containerfile to build an `image-builder`
container.

Use all the DNF commands together and add a cleaning command to the end
of it. This makes fewer layers and keeps the image size slightly
smaller.

Co-authored-by: Simon de Vlieger <supakeen@redhat.com>
Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
2024-12-19 08:49:26 +00:00
Michael Vogt
b3f9fb88f1 main: add new --store argument to image-builder build
This commit adds a new `--store` flag to the `image-builder build`
command. This is used to specify a osbuild store directory to
store the intermediate build tree for faster rebuilding. It is
also useful for the container version of `image-builder-cli` to
allow mapping the users store into the container.
2024-12-19 08:49:26 +00:00
Michael Vogt
e5b3ccd6ed cmd: add new build command
This commit adds the `build` command. It takes the same flags as
`manifest` and will build the specified image.
2024-12-16 14:59:08 +00:00
Michael Vogt
ce8dd45821 testutil: new package to test run osbuild run functionality
This commit adds a new testutil.MockCommand() helper that will
mock a command in $PATH to allow easier testing of e.g. the
`image-builder-cli build` comamnd that will invoke osbuild.
2024-12-16 14:59:08 +00:00