Commit graph

1777 commits

Author SHA1 Message Date
Achilleas Koutsou
2e98f13c90 docs/news: add ostree + kernel params news entry 2021-02-12 14:25:48 +01:00
Achilleas Koutsou
d8c292ca79 distro/*: test expected failure for ostree
Test for each distro that runs through all architecture - image type
combinations and calls the Manifest() method with a kernel boot option
customization and checks if the ostree image types produce the expected
error.
2021-02-12 14:25:48 +01:00
Achilleas Koutsou
fd1cc343a5 distro/*: fail on kernel boot params with ostree
Kernel boot parameters have no effect on ostree type images (Fedora IoT
and RHEL for Edge).  Catch this and fail early in the pipeline creation
and communicate the issue to the user.
2021-02-12 14:25:48 +01:00
Martin Sehnoutka
f98e231f64 cloudapi: extend the API spec with /version and /openapi.json
These endpoints are useful for clients while exploring the API. They are
also required for deploying the service into clouddot.
2021-02-12 14:25:19 +01:00
Aleksandar Todorov
f56a07472a schutzbot: Use 8.4 nightly b/c latest is now 8.5 2021-02-12 14:22:04 +01:00
Aleksandar Todorov
4787fce3b7 Unstash rhel8nightly repo & json files
- even if they don't exist sometimes but ignore the errors
- make the nightly repository with a higher priority
- override rhel-8*.json files so that newly built images will
  also consume the nightly content
2021-02-12 14:22:04 +01:00
Alexander Todorov
fb8493b4df tests: Document how to manually replay nightly Pipeline 2021-02-12 14:22:04 +01:00
Alexander Todorov
4cd6b37ea4 Schutzbot nightly: download osbuild-composer-tests from Brew
because -tests.rpm isn't shipped with the distro the prepare
script downloads it from Brew, trying to match the same version
that exists in the actual nightly compose. Then prepares a repo on
S3 for the subsequent test jobs to use!

Use AWS_CREDS for ~/.s3cmd
2021-02-12 14:22:04 +01:00
Alexander Todorov
272cc434ad Schutzbot: send Telegram messages for RHEL nightly test status 2021-02-12 14:22:04 +01:00
Alexander Todorov
d08a8fce69 Use conditional steps in EL8 nightly pipeline. Refs #912
- use detect_build_cause() funtion and set a global env.BUILD_CAUSE
  variable for use in conditionals
- add a cron job trigger - this will work together with the
  GitHub pull request trigger
- use conditional blocks for all steps we want to be executed
  outside of cron jobs
- only EL8 jobs will be executed unconditionally, both in cron
  and for PRs. The preparation stage for cron jobs makes sure to
  use the same name for osbuild-mock.repo so that the jobs can
  unstash it later!
2021-02-12 14:22:04 +01:00
Jacob Kozol
2cae456094 distro/rhel84: remove dbxtool
dbxtool is not available on s390x or ppc64le. So, it cannot be included
for now without breaking image builds for these architectures.
2021-02-11 14:12:35 +01:00
Tom Gundersen
8667d446b1 news: add news entry
Adds news entry for cloudapi package selection.
2021-02-11 14:12:11 +01:00
Tom Gundersen
e513905424 cloudapi: add support for additional packages
Optionally allow a pacakge set to be included in the compose request.

The specified packages are added to the base packages before
depsolving. As the base packages differ between the image types
the package customizations may have different results on the different
images part of the compose request.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2021-02-11 14:12:11 +01:00
Aleksandar Todorov
e878752f6e tests: Add info log message for UEFI boot
makes it easier to find in the results log
2021-02-11 11:12:17 +01:00
Tomas Hozza
af3c572f9a distro: Disable RHSM DNF plugins on RHEL qcow2 images
Modify RHEL 8.3 and 8.4 KVM guest images definition to produce osbuild
manifest with `org.osbuild.rhsm` stage to disable both RHSM DNF plugins
(`product-id` and `subscription-manager`).

Update `/docs/news/unreleased/osbuild-rhsm-stage.md` to note that RHEL
8.3 and 8.4 qcow2 image definitions are updated to disable RHSM DNF
plugins by default.

Enhance `tools/image-info` tool to add RHSM-specific section to its
output in case RHSM DNF plugins configurations exist in the tree.

Regenerate all RHEL image test cases affected by the patch set.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-02-11 11:10:47 +01:00
Tomas Hozza
1d48c92953 Add support for org.osbuild.rhsm stage
Add support to configure `org.osbuild.rhsm` osbuild stage. This stage
allows the configuration of Red Hat Subscription Manager (RHSM) related
components. Currently it is possible to configure only the enablement
status of RHSM DNF plugins.

Add `/docs/news/unreleased/osbuild-rhsm-stage.md` with information about
the added support for `org.osbuild.rhsm` osbuild stage.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-02-11 11:10:47 +01:00
Achilleas Koutsou
f19e7a9c64 HACKING: Typo fixes 2021-02-11 09:37:36 +01:00
Achilleas Koutsou
444702c10b HACKING: Minor typo fix
Small typo spotted in env variable
2021-02-11 09:37:36 +01:00
Major Hayden
538f64eb67 Send webhooks without credentials
We can now send webhook data to an SQS queue at AWS without signing the
request with credentials. This allows us to trigger Schutzbot from
forks and from branches on the main repository.

Signed-off-by: Major Hayden <major@redhat.com>
2021-02-10 18:31:56 +00:00
Major Hayden
51aa1c771c Trigger schutzbot using github actions
Signed-off-by: Major Hayden <major@redhat.com>
2021-02-10 08:38:42 +01:00
Jacob Kozol
56c4922c8f docs/news: rhel84 add support for org.osbuild.sysconfig stage 2021-02-09 14:13:25 +01:00
Jacob Kozol
eea18fc897 distro/rhel84: add sysconfig stage
The org.osbuild.sysconfig stage is now supported. Config updates can be
made to the kernel and network files. Currently, the same values are
used for all image types in rhel84. The image-info script is updated to
allow testing the sysconfig info.
2021-02-09 14:13:25 +01:00
Jacob Kozol
12f8a1540c docs/news: update osbuild to version 24 2021-02-09 14:13:25 +01:00
Jacob Kozol
52823e3c43 spec: update to osbuild version 24
In order to add the newly supported sysconfig stage, the osbuild
dependency needs to be updated to version 24. The version is updated to
24 in the specfile and README. Also, for testing purposes, the Schutzfile
now points to the commit hash for osbuild version 24 for rhel-8.3 tests.
2021-02-09 14:13:25 +01:00
Achilleas Koutsou
a7d982d9be image-tests: fix hostname typo in customizations
The test case generation script contained a typo in the blueprint
customizations dictionary: "hosname" instead of "hostname".

Fixed typo and regenerated relevant test cases.
2021-02-08 09:11:07 +01:00
Chloe Kaubisch
899d78f7e1
cloudapi: expose upload status
Expose a more detailed job status result - specifically, include upload status
alongside image status. Expand openapi.yml accordingly and add an UploadStatus
field to the OSBuildJobResult struct. At the moment, only represent the
"success" and "failure" states of UploadStatus - to differentiate between
"pending" and "running" would involve significant design decisions and should be
addressed in a separate commit.
2021-02-05 12:34:28 +01:00
Brian C. Lane
80f833a69b weldr: Fix confusing TOML support for source API
There is some confusion surrounding the format of the source TOML that
can be sent to the server. The format it accepts doesn't match the
output from composer-cli which includes the source id in [] eg.

[k8s]
name = "kubernetes packages"
...

This patch changes the parsing to allow the id to be set as 'id = "k8s"'
or passed as a map in [k8s]. If the id is passed in the body it takes
precedence over the map name.
2021-02-04 15:50:04 -08:00
Brian C. Lane
6bfa7a3e0e weldr: Add tests for V1 source API and better id support 2021-02-04 15:50:04 -08:00
Ondřej Budai
40fc8a8734 27
Release osbuild-composer version 27

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-02-04 15:44:39 +01:00
Ondřej Budai
6456fbe6a5 image-info: do not include inputhash in the report
The algorithm from calculating changed in osbuild 24, thus breaking the
testsuite. As the the inputhash is merely a implementation detail, there's
no need to test it in the image tests. Nevertheless, the inputhash is also
tested in the osbuild's testsuite.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-02-04 13:39:23 +01:00
Ondřej Budai
2b41190cf3 go.mod: bump azure-storage-blob-go/azblob
Due to https://github.com/Azure/azure-storage-blob-go/issues/236 , we had to
use a weird version of this library (see 1b051922).

A new release came out yesterday that's tagged correctly so let's use it
so we can remove the hack from go.mod.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-02-03 12:36:04 +01:00
Brian C. Lane
440753a274 weldr: undo unknown commit should return UnknownCommit 2021-02-03 12:23:58 +01:00
Brian C. Lane
98b2dab128 weldr: Add tests for blueprints/undo
Test undo, and undo of an unknown commit.
2021-02-03 12:23:58 +01:00
Tomas Hozza
0d1c2bc0bf image-tests: fixup for rhel-8 aarch64 edge test case after PR#1178
Tom was too quick to merge PR#1178 and as a result, one image test case
was not properly regenerated in that PR. The CI passed for PR#1178,
because RHEL-8.3 images in CI are not tested on aarch64.

Add properly regenerated image test case for rhel-8 aarch64 edge commit.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-02-02 11:40:13 +01:00
Tomas Hozza
89df6ab328 image-tests: remove 'subscription' customization, update repos, regenerate
Remove 'subscription' customization from 'format-request-map.json',
because it currently has no effect on image test cases. The reason is
that this customization of image is possible only via Cloud API in
composer and setting imageOptions. However image test cases currently
support image customization only via Blueprint customizations.

Update repo links in 'repos.json' to the latest rpmrepo snapshots.

Regenerate all image test cases affected by updates to 'repos.json'
and 'format-request-map.json'. This includes all `rhel-8` and `rhel-84`
image test cases.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-02-01 23:20:01 +00:00
Tomas Hozza
463a81550c tools: Fix application of blueprint overrides in generate-test-cases
Blueprint overrides from `format-request-map.json` were previously not applied
when generating image test cases due to a bug. As a result, there were
multiple "blueprint" sections in the generated image test case, if the
image type had an override configured.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-02-01 23:20:01 +00:00
Ondřej Budai
777c66458d readme: bump osbuild dependency
This was somehow forgotten in the past.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-02-01 15:32:58 +01:00
Ondřej Budai
f2318f8c5f go: bump to 1.14
The oldest distros we support are Fedora 32 and RHEL 8.3. As both have
Go 1.14, we're safe to upgrade.

Also, I had to change prepare-source.sh because go fmt now refuses to run on
a project which has issues in go.mod, go.sum or modules.text. I think this
should be a harmless change.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-02-01 15:32:58 +01:00
Ondřej Budai
2241a8d9ed go: vendor the oapi-codegen cmd
See the comment in tools.go, I cannot fully explain what's happening here.
Somehow, Go 1.14 wants to use the vendored version of oapi-codegen but
without this file, oapi-codegen isn't vendored so the generation fails.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-02-01 15:32:58 +01:00
Tomas Hozza
1a3cbb282a image-info: Add workaround for listing services by status
`image-info` tools parses output of `systemctl list-unit-files` run on a
different tree (with `--root` option), to determine the list of enabled
and disabled services on the inspected image. However since Fedora 33
(and presumably since systemd v246), the output of `systemctl
list-unit-files` changed. Some units previously reported as "enabled" or
"disabled" are now reported as "alias", which means, that they are just
a symlink to a different unit.

There is no systemd command, that would take an "alias" unit and would
report its state as "enabled" or "disabled" and could run on a different
tree (with "--root" option).

To make the list of reported services in the given state consistent on
systems with older and new (v246+) systemd version, check all "alias"
units and append them to the list of services with a specific status,
if their target is also listed in in the list.

Example of the `systemctl list-unit-files` output change:

~]# rpm -q systemd
systemd-246.6-3.fc33.x86_64
~]# systemctl list-unit-files ctrl-alt-del.target
UNIT FILE           STATE VENDOR PRESET
ctrl-alt-del.target alias -

~]# rpm -q systemd
systemd-245.8-2.fc32.x86_64
~]# systemctl list-unit-files ctrl-alt-del.target
UNIT FILE           STATE   VENDOR PRESET
ctrl-alt-del.target enabled disabled

This change makes it possible to produce consistent output for an
inspected image, regardless if the `image-info` tool is run on Fedora
32, Fedora 33 or RHEL-8.

Also regenerate all Fedora 33 test cases, since this commit changes the
content of produced list of enabled / disabled services since Fedora 33.
The list is now consistent with what would be produced by `image-info`
for an image on older Fedora (e.g. 32) or RHEL-8.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-02-01 11:22:57 +01:00
Jacob Kozol
9b7fb4fb63 docs/news: rhel84 remove rng from added packaged/services 2021-02-01 11:20:35 +01:00
Jacob Kozol
ee5d73eb41 distro/rhel84: remove rng-tools from qcow2
rng-tools was added back into the qcow2 packages by mistake. It should
be an excluded package and rngd.service should not be enabled.
2021-02-01 11:20:35 +01:00
Tomas Hozza
55825042f7 tools: Add script to generate all test cases in VMs
Add the `generate-all-test-cases` tool, which generates all defined image
test cases based on provided "distro x arch x image-type" combination
matrix and CLI arguments. Test cases are generated by running the
`generate-test-cases` tool inside an architecture-specific VM.

The tool requires a qcow2 image to be provided for each requested
architecture. These images are used to create ephemeral VMs used
for test case generation.

There appears to be an issue with entropy on all VMs for other
architecture than the host's one. It makes the generation of the first
test case usually fail due to the `go get` command failing with a "TLS
handshake timeout" error. There is a workaround to retry the generation
of a test case a maximum of 3 times in this case. In the usual case,
the test case generation passes on the second try. All subsequent test
case generations should complete successfully on the first try.

Add the `distro-arch-imagetype-map.json` file as the default source of
the "distro x arch x image-type" combination matrix for generating test
cases. Its content is based on the current content of the
`test/data/manifests` directory.

Update `test/README.md` to mention the `generate-all-test-cases` tool.
Add a note, that `generate-test-cases` must be run on a host with the
same architecture, as the intended test case's.

Known issues:
- The tool does not work with RHEL images because of missing "9p"
  filesystem support.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-02-01 10:22:28 +01:00
Achilleas Koutsou
8ebcca23ae HACKING: Describe disadvantages of container setup 2021-01-30 13:20:11 +00:00
Achilleas Koutsou
14183ba10a containers: Make config path configurable
Container configuration directory can be set in the .env file which is
automatically used by docker-compose.  The default value is the one used
previously (containers/config).
The HACKING.md guide is updated to describe how to set this and how it
affects other commands.
2021-01-30 13:20:11 +00:00
Achilleas Koutsou
4b1581a71c tools: Add internal container names to certs
We add both localhost and the internal container names of each service
to the certificates so both VM and containerised setups should work with
the same setup.
2021-01-30 13:20:11 +00:00
Achilleas Koutsou
0069f9d3f9 spec: Add tools/gen-certs.sh to test package 2021-01-30 13:20:11 +00:00
Achilleas Koutsou
524d8ec42d HACKING: Add Containers section
Describes how to set up and run the containers for local testing.
2021-01-30 13:20:11 +00:00
Achilleas Koutsou
adf399ddf7 tools: Separate cert generation into its own script
The script can be run on its own to generate certificates for local
testing. This should not affect the way provision.sh works.
2021-01-30 13:20:11 +00:00
Achilleas Koutsou
7c3a3c785f containers: docker-compose for multi-container setup
Defines how to build and run two containers for osbuild-composer and
worker in the same subnet for testing.
2021-01-30 13:20:11 +00:00