Commit graph

2674 commits

Author SHA1 Message Date
Gianluca Zuccarelli
b09040efd5 containers: worker client base url protocol
The base url for the osbuild-worker container was
missing the `https` protocol in the docker-compose file.
This commit adds this to prevent the worker from exiting
2021-09-23 13:28:27 +01:00
Gianluca Zuccarelli
7bf6dc4cd4 containers: update composer log level flag
The osbuild-composer log level flag was changed from
`-v` to `-verbose`. This change updates the container
entrypoint to reflect this.
2021-09-23 13:28:27 +01:00
Tomas Hozza
6bd7282f8b Regenerate relevant image test cases
Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-09-23 10:47:11 +02:00
Christian Kellner
d9fe813fa5 distro/rhel90: re-include nss-altfiles for edge
The `nss-altfiles` package is actually needed for OSTree based
systems, since in those the user/groups database is located in
the /usr/lib directory (in addition to /etc). It was removed
because it was not available in RHEL 9 (rhbz#1916260). This has
been fixed, so we need to re-include the package.
2021-09-23 10:47:11 +02:00
Tomas Hozza
008dfcc5b5 generate-test-cases: drop --with-customizations option
Generating image test case with all possible blueprint customizations is
supported only for `qcow2` image type. Generating `qcow2` images with
customizations was not a lot of fun. One had to use a special CLI option
for this case.

To streamline the generation of image test cases, drop the
`--with-customizations` option from the `generate-test-cases` script and
move the functionality to `format-request-map.json` by defining a new
`qcow2-customize` test case. This is very similar to what `*edge-rt`
test case already uses. This mean that when the test case for `qcow2`
image type is being generated, actually two test cases will be
generated. The filesystem customizations since RHEL-8.5 are handled
through distro-specific `overrides`.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-09-23 09:20:47 +02:00
Tomas Hozza
6502f527fd format-request-map.json: remove redundant overrides
Some of the `overrides` specified in `format-request-map.json` were
redundant, because the same blueprint customizations were already
specified in the image compose-request. Thus these values had no
additional values.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-09-23 09:20:47 +02:00
Tomas Hozza
0a3450ea3e generate-test-cases: don't leak "supported_arches" to compose request
Unfortunately, after the addition of `supported_arches` item to some
of the image type definitions in `format-request-map.json`, it started
to leak to the `compose-request` object in the generated image test
case.

Ensure that the item does not leak to the generated image test case,
since it is relevant only for the generator script.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-09-23 09:20:47 +02:00
Diaa Sami
4ea758a8bb tools: improve deploy-openstack script
Check first parameter and check for a dirty git repo before deploying
2021-09-22 12:24:08 +01:00
Brian C. Lane
e92424b5e3 weldr: deleting an unknown source should return an error
This adds a check to see if the source is valid and returns a 400 error
if it doesn't exist.
2021-09-22 11:24:31 +02:00
Tomas Hozza
50b85abd1c Update distro-arch-imagetype-map.json
Update distro-arch-imagetype-map.json to reflect currently generate
image type test cases.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-09-22 09:12:57 +02:00
Tomas Hozza
43f8d817bb test: update image test case generation part of README
Update README to reflect latest changes to the `generate=all-test-cases`
script.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-09-22 09:12:57 +02:00
Tomas Hozza
65919615df generate-all-test-cases: add option to keep created workdir on runner
Add a CLI option to keep the workdir created on the runner, after it
finishes its work. The workdir is deleted by default.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-09-22 09:12:57 +02:00
Tomas Hozza
57b0ed52ae generate-all-test-cases: report results when Runner finishes
Report per-distro list of image test cases which were successfully
generated or failed, after the Runner finishes its work.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-09-22 09:12:57 +02:00
Tomas Hozza
6203c1e430 generate-all-test-cases: support using existing remote hosts
Add a new command 'remote' allowing to generate image test cases on
existing remote hosts.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-09-22 09:12:57 +02:00
Tomas Hozza
6e08f0f363 generate-all-test-cases: remove '--keep-image-info' option
Remove the '--keep-image-info' script option. The output directory on
the Runner is always newly created at the beginning and empty, therefore
this option effectively can not be used with the `generate-test-cases`
script.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-09-22 09:12:57 +02:00
Tomas Hozza
5be077e793 generate-all-test-cases: move current generator method to 'qemu' command
The script currently allows generating image test cases only using QEMU
VMs. As part of the process to allow using different approaches for
generating image test cases, introduce CLI commands using subparsers and
move the current functionality under 'qemu' command.

As part of extracting the generic parts from the TestCaseMatrixGenerator
class, rename it to QEMUTestCaseMatrixGenerator and move all generic
parts to a new BaseTestCaseMatrixGenerator class.

Change filtering options such as '--arch', '--distro', '--image-type'
to take only one argument and append the value to a list if used
multiple times, instead of accepting multiple values. This resolves an
issue of 'nargs=*' argument being too greedy and consuming command as
an additional argument.

Modify the script doc text to match the changes.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-09-22 09:12:57 +02:00
Tomas Hozza
a0086327f4 generate-all-test-cases: fix log level in multiprocessing processes
When one run the script with debug logging (`-d`), the set log level
in the logger was not preserved in the newly created multiprocessing
processes.

Explicitly set the log level in newly created processes.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-09-22 09:12:57 +02:00
Tomas Hozza
2e35a59450 generate-all-test-cases: don't use virtfs to copy data from/to the VM
Previously the QEMU virtfs devices were used to export osbuild-composer
sources to the QEMU VMs and also to get generated image test cases from
them. This had multiple downsides. The virtfs QEMU option is not
supported on MacOS. In addition, the 9p protocol, which was needed to
mount these devices in the VM, is not supported on RHEL.

Remove all code related to mounting. The data is now copied to and from
the VM using rsync instead.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-09-22 09:12:57 +02:00
Tomas Hozza
f47893058a generate-all-test-cases: don't use paramiko for SSH
Don't use paramiko library for SSH connections to the Runner, but
instead execute the `ssh` command using Subprocess.

When one uses SSH ID files protected by password, the paramiko library
can not access them without it, even if the password is stored in the
ssh-agent running in the user session. On the other hand, running the
`ssh` command using Subprocess works just fine in this scenario.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-09-22 09:12:57 +02:00
Tomas Hozza
94c2a6268c generate-all-test-cases: use SSH keys instead of password for VMs
Previously passwords were used to log into provisioned QEMU VMs. This is
not practical if one would like to use e.g. rsync to transfer files from
and to the VM. The script now does not use passwords at all, but instead
configures the most recent SSH key from the system matching
'~/.ssh/id*.pub' as an authorized key on the VM. Alternatively the SSH
key to be used can be provided as an argument to the script.

In addition, the script no longer relies on external files for
cloud-init user-data. If no cloud-init user-data are provided as an
argument to the script creates default user-data file in a temporary
work directory and uses it. The reason for this change is mostly that the
default user-data became very short and need to be always extended with
the authorized SSH key anyway. In addition, this makes the script more
standalone by relying on fewer external file paths.

Delete the `tools/deploy/gen-test-data` which held the cloud-init
user-data previously used by default by the script.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-09-22 09:12:57 +02:00
Tomas Hozza
6f89cada2d generate-all-test-cases: don't use cloud-init to install RPMs
Previously cloud-init was used to install necessary packages on the
runner. This would not be practical in the future with other types of
runners, which would not use cloud-init. Install all necessary RPMs by
directly running DNF command on the runner.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-09-22 09:12:57 +02:00
Tomas Hozza
f6dbb51041 generate-all-test-cases: fix generating of cloud-init cdrom on MacOS
Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-09-22 09:12:57 +02:00
Tomas Hozza
fb2361907f generate-all-test-cases: separate generic parts of BaseRunner
The `BaseRunner` class represented a base QEMU runner. Rename it to
`BaseQEMURunner` and extract parts which are not QEMU specific to a new
`BaseRunner` class. This new base class will be later used as a baseline
for other types of runners which don't rely on QEMU.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-09-22 09:12:57 +02:00
dependabot[bot]
41b1d75187 build(deps): bump github.com/aws/aws-sdk-go from 1.40.43 to 1.40.46
Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.40.43 to 1.40.46.
- [Release notes](https://github.com/aws/aws-sdk-go/releases)
- [Changelog](https://github.com/aws/aws-sdk-go/blob/main/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-go/compare/v1.40.43...v1.40.46)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-22 00:30:25 +02:00
Tomas Hozza
2d2d9fe7f9 generate-test-cases: check supported_arches from format-request-map.json
Some image type test cases require additional repositories, which are
not available for all architectures. However, when an image type test
case is specified in the `format-request-map.json`, it is generated on any
architecture.

This behavior is creating issues when generating `*edge-commit` image
type test cases. This is because the `format-request-map.json` contains one
additional definition for `*edge-commit-rt`, which includes `kernel-rt`
package. However repositories with this package are available only for
x86_64. Therefore, when generating image test cases for `*edge-commit`,
the `generate-test-cases` script always generates two test cases,
but the generation of `*edge-commit-rt` always fails on non-x86_64
architectures.

Add a new optional member to the image type test case object in
`format-request-map.json`, called `supported_arches`. Its value is a
list of strings, specifying the supported architectures of the image
type test case. In case the member is not specified, the image test
case is supported on any architecture.

Extend the `generate-test-cases` script to skip image type test case
generation in case the case has the `supported_arches` specified and the
requested architecture is not in the list.

Fix #1478

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-09-21 14:41:38 +02:00
sanne
95f8bd253b schutzbot: Update terraform sha
Unbreaks fedora-33 updates-modular dnf error when installing the
gitlab-runner.
2021-09-21 12:35:55 +02:00
Simon Steinbeiss
b42cfc2e70 Drop RELEASING.md and point to dev guide
Instead of keeping a howto on releasing in every repository we move the
documentation to a central place in our "developer guide".
See https://github.com/osbuild/guides/pull/45
2021-09-20 10:51:36 +02:00
dependabot[bot]
4c212fe074 build(deps): bump github.com/Azure/go-autorest/autorest
Bumps [github.com/Azure/go-autorest/autorest](https://github.com/Azure/go-autorest) from 0.11.20 to 0.11.21.
- [Release notes](https://github.com/Azure/go-autorest/releases)
- [Changelog](https://github.com/Azure/go-autorest/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Azure/go-autorest/compare/autorest/v0.11.20...autorest/v0.11.21)

---
updated-dependencies:
- dependency-name: github.com/Azure/go-autorest/autorest
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-16 09:00:05 +02:00
dependabot[bot]
49ef4cba3e build(deps): bump github.com/aws/aws-sdk-go from 1.40.38 to 1.40.43
Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.40.38 to 1.40.43.
- [Release notes](https://github.com/aws/aws-sdk-go/releases)
- [Changelog](https://github.com/aws/aws-sdk-go/blob/main/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-go/compare/v1.40.38...v1.40.43)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-15 21:54:53 +02:00
dependabot[bot]
ebe3567aeb build(deps): bump github.com/openshift-online/ocm-sdk-go
Bumps [github.com/openshift-online/ocm-sdk-go](https://github.com/openshift-online/ocm-sdk-go) from 0.1.204 to 0.1.208.
- [Release notes](https://github.com/openshift-online/ocm-sdk-go/releases)
- [Changelog](https://github.com/openshift-online/ocm-sdk-go/blob/master/CHANGES.adoc)
- [Commits](https://github.com/openshift-online/ocm-sdk-go/compare/v0.1.204...v0.1.208)

---
updated-dependencies:
- dependency-name: github.com/openshift-online/ocm-sdk-go
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-15 21:54:45 +02:00
Diaa Sami
aa08e29243 34
Release osbuild-composer 34

Signed-off-by: Diaa Sami <disami@redhat.com>
2021-09-15 21:12:35 +02:00
dependabot[bot]
be2aaae146 build(deps): bump cloud.google.com/go/cloudbuild from 0.1.0 to 0.2.0
Bumps [cloud.google.com/go/cloudbuild](https://github.com/googleapis/google-cloud-go) from 0.1.0 to 0.2.0.
- [Release notes](https://github.com/googleapis/google-cloud-go/releases)
- [Changelog](https://github.com/googleapis/google-cloud-go/blob/master/CHANGES.md)
- [Commits](https://github.com/googleapis/google-cloud-go/compare/v0.1.0...v0.2.0)

---
updated-dependencies:
- dependency-name: cloud.google.com/go/cloudbuild
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-15 20:16:34 +02:00
Tomas Hozza
8970cd23ed Add a new entry to docs/news/unreleased
Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-09-15 14:46:25 +02:00
Tomas Hozza
eef9971027 osbuild2: add support for org.osbuild.tuned stage
Add support for a new osbuild stage `org.osbuild.tuned`, for
setting TuneD profile.

Add unit tests for the new stage.

Related to https://github.com/osbuild/osbuild/pull/797.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-09-15 14:46:25 +02:00
Tomas Hozza
8b623d9463 osbuild2: add support for org.osbuild.dnf.config stage
Add support for a new osbuild stage `org.osbuild.dnf.config`, for
configuring DNF.

Add unit tests for the new stage.

Related to https://github.com/osbuild/osbuild/pull/798.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-09-15 14:46:25 +02:00
Tomas Hozza
d9610b97fc osbuild2: add support for org.osbuild.sysctld stage
Add support for a new osbuild stage `org.osbuild.sysctld`, for
creating tmpfiles.d configuration files.

Add unit tests for the new stage.

Related to https://github.com/osbuild/osbuild/pull/804.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-09-15 14:46:25 +02:00
Tomas Hozza
a5097b2141 osbuild2: add support for org.osbuild.pam.limits.conf stage
Add support for a new osbuild stage `org.osbuild.pam.limits.conf`, for
creating pam_limits module configuration files.

Add unit tests for the new stage.

Related to:
- https://github.com/osbuild/osbuild/pull/802
- https://github.com/osbuild/osbuild/pull/807

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-09-15 14:46:25 +02:00
Tomas Hozza
3f52af2adb osbuild2: add support for org.osbuild.tmpfilesd stage
Add support for a new osbuild stage `org.osbuild.tmpfilesd`, for
creating tmpfiles.d configuration files.

Add unit tests for the new stage.

Related to https://github.com/osbuild/osbuild/pull/801.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-09-15 14:46:25 +02:00
Tomas Hozza
fbb70c2d10 osbuild2: add support for org.osbuild.selinux.config stage
Add support for a new osbuid stage `org.osbuild.selinux.config`,
for setting the desired SELinux policy state and type on the system.

Add unit tests for the new stage.

Related to https://github.com/osbuild/osbuild/pull/799.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-09-15 14:46:25 +02:00
Ondřej Budai
ca2dc71eea docs/news: add an entry about removing --excludedocs
Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-09-15 10:47:57 +02:00
Ondřej Budai
b4338881fa test: regenerate manifests
This commit also fixes the rpmrepo for 8.5 rt. The previously used one
was wrongly generated and had to be regenerated.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-09-15 10:47:57 +02:00
Ondřej Budai
39d77f26b6 distro/rhel90: always install docs in the rpm stage
When we firstly introduced the v2 manifests, we excluded docs from all rpm
stages because it doesn't make sense to include docs in edge images.

However, when we ported the other image types to v2, we left the flag on.
The side effect of --excludedocs is that we no longer install man pages into
the image. This the default behaviour of rpm and can be seen here:
b88f43b9a3/macros.in (L555)

This is actually quite a major regression in non-edge images, thus this commit
reverts this setting. It would be great to have the option not to install
docs in some rpm stages but as this is a difficult topic and we're already
past the deadline, we will consider this in the future.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-09-15 10:47:57 +02:00
Ondřej Budai
d895c336d6 distro/rhel85: always install docs in the rpm stage
When we firstly introduced the v2 manifests, we excluded docs from all rpm
stages because it doesn't make sense to include docs in edge images.

However, when we ported the other image types to v2, we left the flag on.
The side effect of --excludedocs is that we no longer install man pages into
the image. This the default behaviour of rpm and can be seen here:
b88f43b9a3/macros.in (L555)

This is actually quite a major regression in non-edge images, thus this commit
reverts this setting. It would be great to have the option not to install
docs in some rpm stages but as this is a difficult topic and we're already
past the deadline, we will consider this in the future.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-09-15 10:47:57 +02:00
Gianluca Zuccarelli
d4f511dd82 test/cases: check filesystem mountpoint depth
Add test case to check the ability to create partitions for
the /var, /var/log & /var/log/audit mountpoints. This test is
checking that mountpoints with a depth of 3 or greater can be configured.
2021-09-15 10:46:55 +02:00
Gianluca Zuccarelli
e41e82935d rhel90: enable multi-level mountpoints
Previously it was only possible to configure separate partitions
for mountpoints in the allow list and their immediate subdirectories
only i.e. /var & /var/log
This fix allows for an arbitrary level of mountpoints, i.e. /var/log/audit,
/var/a/b/c/d/e and so on
2021-09-15 10:46:55 +02:00
Gianluca Zuccarelli
16e80ffa33 rhel85: enable multi-level mountpoints
Previously it was only possible to configure separate partitions
for mountpoints in the allow list and their immediate subdirectories
only i.e. /var & /var/log
This fix allows for an arbitrary level of mountpoints, i.e. /var/log/audit,
/var/a/b/c/d/e and so on
2021-09-15 10:46:55 +02:00
sanne
5a9d8c792b cloudapi: V2
V2 is compliant with api.openshift.com design guidelines.

Errors are predefined, have codes, and are queryable.

All requests have an operationId set: a unique identifier which is
sortable by time. This is added to the response in case of an error.

All returned objects have the href, id, and kind field set.
2021-09-14 15:32:21 +02:00
Tomas Hozza
19eb65e9fd RHEL-8.5/9.0: keep RHSM DNF plugins enabled on ec2, ec2-ha and ami
The RHSM DNF plugins `product-id` and `subscription-manager` are now
by default enabled on the RHEL-8.5 and RHEL-9.0 `ec2`, `ec2-ha` and
`ami` images.

The desired default state of the RHSM DNF plugins has been decided by
the RHSM team.

Related to https://bugzilla.redhat.com/show_bug.cgi?id=1996670

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-09-14 11:47:09 +02:00
Brian C. Lane
ca47083b46 test: Add cross-distro test for distro support 2021-09-14 10:43:09 +01:00
Tom Gundersen
8b84d92264 repositories: exclude downstream from upstream
We don't want to give the impression we support building Fedora on RHEL or
CentOS Stream, or CentOS Stream on RHEL, so drop these repositories from
the package.

Also adjust dnf-json to use test repositories, rather than the upstream ones.
These are shipped in the test package, so makes sure we are unaffected by
what is shipped in the RPM shipped in the distros.
2021-09-14 10:43:09 +01:00