`log` is `nil`, unless we are in verbose mode. Skip logging if no logger
was passed.
Long-term I think we should reconsider how we do our logging, and always
log these type of unexpected errors, and hence always have the logger be
non-nil. For now, fix the immediate problem.
The fact that loading the store from disk fails on upgrade is
unexpected, and should be fixed separately.
Fixes#685.
Signed-off-by: Tom Gundersen <teg@jklm.no>
RHEL 8 doesn't have golang in the i686 buildroot anymore. Fedora doesn't have
i686 images and kernel anymore. Also, osbuild-composer doesn't have support
for building i686.
Let's exclude i686 for these reasons, it's dead.
This adds placeholder architecture structs, but no image types are
hooked up.
This will allow osbuild-composer to run on these architectures, and
serve the weldr API, but without support for building any images.
Image type support will be added in the future.
Signed-off-by: Tom Gundersen <teg@jklm.no>
This is not a functional change, all produced manifests are as before.
This is in preparation for adding support for more architectures in a
follow-up patch.
Signed-off-by: Tom Gundersen <teg@jklm.no>
Rename the `Fedora32` type to simply `distribution`, to avoid the
stutter. Move `New()` to the bottom of the file, which is the only
non-generic part. Also make the linter happy.
No functional change.
Signed-off-by: Tom Gundersen <teg@jklm.no>
The new Fedora IoT image type uses org.osbuild.ostree.commit assembler with
tar option that was introduced in osbuild 15, therefore the dependency version
must be bumped.
This also bumps the submodule to 9cbedc04. That's basically version 15 of
osbuild with one fix related to secrets.
c886e1be changed the indentation of the NEWS file. This commit changes also
the indentation in the news template produced by `make release`.
Also - in front of the Location was changed to — to please David.
This is currently only used in tests. We broke backwards compatibility
when we split the repo name and the repo id. The tests expect this to be
indexed by name, not index.
This should probably be reworked or dropped, for now revert to the old
behavior.
Signed-off-by: Tom Gundersen <teg@jklm.no>
The 'id' field in the json files is exposed as 'name' in the weldr API,
and that is now its only use. Rename it to match.
Signed-off-by: Tom Gundersen <teg@jklm.no>
This is how it is used in the rest of the code, as a name to represent
the repository in the weldr API. Rename to match its use, and avoid
confusion with the ID passed to dnf-json, which is not the same.
Signed-off-by: Tom Gundersen <teg@jklm.no>
We don't have to go via a map, and also don't have to rely on the ID's
in the passed in repos are the same, by instead relying on RepoID being
the offset into the passed in repos array, as set in the previous patch.
Signed-off-by: Tom Gundersen <teg@jklm.no>
rpmmd now contains three repo config structs. RepoConfig is for use
throughout osbuild-composer. repository is for reading from our
internal json repository files before creating a RepoConfig.
dnfRepoConfig is is for use within rpmmd and it matches what dnf-json
expects from a repo.
Repos now contain support for rhsm. In order to connect to rhel's
cdn, dnf must pass an sslcacert, sslcakey, and sslclientcert. When a
repo is used for fetching metadata or depsolving it is checked for
rhsm secrets. If secrets are needed they are retrieved from the host
system. Packages requiring rhsm are marked as requiring
"org.osbuild.rhsm" secrets.
If a repo passed to dnf-json contains an sslcacert, sslclientkey, or
sslclientcert then dnf-json will include those values in that repo in
the dnf base.
Replace RHEL 8.2 nightly images with a RHEL 8 CDN subscribed instance so
we can test with the exact content a customer would have.
Signed-off-by: Major Hayden <major@redhat.com>
We do not properly test, and do not have properly defined use-cases for
the ext4-filesystem, partitioned-disk, nor tar image types. Drop them to
focus on delivering the things we car properly test.
Signed-off-by: Tom Gundersen <teg@jklm.no>
Setting the cache directory to `/var/cache` causes problems on the
remote worker startup and it needs to be removed.
Signed-off-by: Major Hayden <major@redhat.com>
There are times where it would be good to monitor that osbuild-composer
is up and running. Add a very simple status check that always returns
200/OK. This can be expanded later to verify that other parts of
osbuild-composer are working properly.
Signed-off-by: Major Hayden <major@redhat.com>
When fdd753615 added `--output-directory` to the invocation of osbuild,
it also removed `--store`.
This was a mistake: osbuild's default store is `.osbuild`, which is not
what we want. Restore the old behavior of passing a temporary directory.
The `jobs/:job_id/builds/:build_id/image` route was awkward: the
`:jobid` was actually weldr's compose id and `:build_id` was always `0`.
Change it to `jobs/:job_id/artifacts/:name`, where `:job_id` is now a
job id, and `:name` is the name of the artifact to upload. In the
future, it could support uploading more than one artifact.
This allows removing outputs from `store`, which is now back to being a
pure JSON-store. Take care that `weldr` returns (and deletes) images
from the new (or for backwards compatibility, the old) location.
The `org.osbuild.local` target continues to exist as a marker for the
worker to know whether it should upload artifacts.
Similarly to how some image types accept a size-argument, some image
types require ostree-specific options. For now this is only used by
Fedora IoT on Fedora 32.
composer-cli nor cockpit-composer currently has the ability to pass in
these options, but the change is backwards compatible and existing image
types are unaffected. If the options are omitted for image types that
require them, sensible defaults are chosen.
Signed-off-by: Tom Gundersen <teg@jklm.no>
When generating an osbuild manifest for an image type, we take a
customizations struct, which specifies the image-type-independent
customizations to apply. We also take the size argument, which is
specific to the image build and not part of the blueprint.
Introduce a new argument ImageOptions, which for now just wraps the size
argument. These options are specific to the image build/type, and
therefore does not belong with the other customizations.
For now this is a non-functional change, but follow-up commits will
introduce more types of image options.
Signed-off-by: Tom Gundersen <teg@jklm.no>
This adds the wrapper object and a simple test for the rpm-ostree stage.
See the osbuild documentation for details.
Signed-off-by: Tom Gundersen <teg@jklm.no>
This adds the wrapper object and a simple test for the ostree.commit
assembler.
See the osbuild documentation for details.
Signed-off-by: Tom Gundersen <teg@jklm.no>