Commit graph

3978 commits

Author SHA1 Message Date
Jakub Rusz
d388d30ef2 rpmplint: trust osbuild-composer repository
Git v2.35.2 brought some security fixes which prevents interaction with
repository if it's not owned by the user who cloned it. More info here:
https://github.blog/2022-04-12-git-security-vulnerability-announced/
2022-05-10 13:25:01 +02:00
Thomas Lavocat
ab7fe6558a worker: protect the instance from upgrading
Before the instance was vulnerable to an OTA update while processing a
request. Because there is no way of retriggering a job in Composer, it
is better to avoid this situation.
The way we are doing it is by setting the `protected` flag onto the
instance when a job is being processed. This way the AWS scheduler
does hopefully not shutdown the machine at the wrong time.

Main caveats of this solution:
* Starvation: If a worker keeps accepting new jobs, then it might not be
  updated.
* Inconsistency: There exist a window between the job acceptation and the
  protection where the worker can be shutdown without having the time to
  protect itself.
2022-05-10 11:45:29 +02:00
Jordi Gil
b6f61d26ea distro/fedora: extend kernel options for openstack, qcow2, vhd and vmdk types
* Use the same value from AMI to these image types:

"ro no_timer_check console=ttyS0,115200n8 biosdevname=0 net.ifnames=0"

* Regenerate manifests
2022-05-09 12:25:21 +02:00
Jordi Gil
69095f5034 distro/fedora: produce VMDK as stream-optimized
Added code in fedora/pipelines.go to add the subformat field in the
manifests

Added manifests for f34 and f35 for x86_64 only (image type not
available in aarch64)
2022-05-09 12:25:21 +02:00
Jordi Gil
3a079eec26 distro/fedora: Regenerated manifests
* IoT image types now correctly point to the fedora-identity-iot package
* QCOW2, VMDK and OCI types use Fedora Cloud as identity package
* Changed default target for AMI from graphical.target to multi-user.target. This matches the behaviour with the RHEL types, which all target the multi-user.
* Readded the image-info field for some manifests which was missing due to issues regenerating the manifests.
2022-05-09 12:25:21 +02:00
Jordi Gil
0c3d17983b distro/fedora: Added package 'fedora-release-iot' for iot-commit image type 2022-05-09 12:25:21 +02:00
Jordi Gil
f256303854 distro/fedora: Changed kernelOptions value for ec2/ami image to be ro no_timer_check console=ttyS0,115200n8 biosdevname=0 net.ifnames=0 2022-05-09 12:25:21 +02:00
Jordi Gil
b19b824e38 distro/fedora: Regenerated manifests for f34-aarch and f35-x86_64 that include the image-info field 2022-05-09 12:25:21 +02:00
Jordi Gil
7cf937d668 distro/fedora: removed specific locale and timezone for ec2/ami since they are the same as the default one for all image types 2022-05-09 12:25:21 +02:00
Jordi Gil
6593e30d63 distro/fedora: Regenerated test manifests using V2 API 2022-05-09 12:25:21 +02:00
Jordi Gil
6d89a0f333 distro/fedora: change default target for qcow2,oci,vhd image types to multi-user instead of graphical 2022-05-09 12:25:21 +02:00
Jordi Gil
dbd163d49c distro/fedora: use GetTestingImagePackageSpecSets() and remove references to "centos" 2022-05-09 12:25:21 +02:00
Jordi Gil
5936abf85e distro/fedora: refactor osBuild pipeline 2022-05-09 12:25:21 +02:00
Jordi Gil
9a4125a37d distro/fedora: Added packageSetChain references
* Removed specific function that packaged the fedora cloud package group to avoid collision between fedora-identity-cloud and fedora-identity-basic packages. With the introduction of the PackageSetChains() it is no longer necessary to filter the packages
2022-05-09 12:25:21 +02:00
Jordi Gil
426085c060 distro/fedora: added smartmontools-selinux for iot commit 2022-05-09 12:25:21 +02:00
Jordi Gil
40d5950f1e distro/fedora: Set default target for ami/ec2 image type to multi-user and remove extra console entry in kernel opts 2022-05-09 12:25:21 +02:00
Jordi Gil
1d0e5c3410 distro/fedora: changed x86_64 bootType to hybrid 2022-05-09 12:25:21 +02:00
Jordi Gil
96d9e63b77 distro/fedora: capitalized IoT in fedora 2022-05-09 12:25:21 +02:00
Xiaofeng Wang
0af53e4cad test: Add fedora-iot-container and fedora-iot-installer tests 2022-05-09 12:25:21 +02:00
Jordi Gil
00a84d1fdc distro: allow user and group customizations for iot-installer 2022-05-09 12:25:21 +02:00
Jordi Gil
6c11c27c48 distro/fedora: removed old fedora code 2022-05-09 12:25:21 +02:00
Jordi Gil
2beb707def distro/fedora: regenerated test manifests 2022-05-09 12:25:21 +02:00
Jordi Gil
f14dc2fb63 distro/fedora: refactor based on RHEL 9.0 code 2022-05-09 12:25:21 +02:00
Tomas Hozza
0bf67dfad5 Stop setting the StreamOptimized option in Weldr and Cloud APIs
The VMDK image is already produced as stream-optimized. Therefore stop
setting the `StreamOptimized` option in `OSBuildJob` structure by both,
Weldr and Cloud APIs.

Keep the handling of the option in worker for backward compatibility,
in case an older instance of Composer server is used, which does not
produce VMDK manifests as stream-optimized. In such case, the worker
needs to convert the image.
2022-05-04 16:22:29 +02:00
Tomas Hozza
be6675d54e distro(all): produce VMDK as stream-optimized
Modify pipelines in all distro definitions to produce stream-optimized VMDK
image.

Regenerate all VMDK test cases.

Bump worker dependency on osbuild to the version supporting VMDK
subformat in both QEMU assembler and stage
2022-05-04 16:22:29 +02:00
Tomas Hozza
c07cbb2de4 osbuild1: support VMDK subformat in QEMU assembler
Related to https://github.com/osbuild/osbuild/pull/1000
2022-05-04 16:22:29 +02:00
schutzbot
2232aec0ee Post release version bump
[skip ci]
2022-05-04 13:32:42 +00:00
dependabot[bot]
67727d1e5c build(deps): bump github.com/google/go-cmp from 0.5.7 to 0.5.8
Bumps [github.com/google/go-cmp](https://github.com/google/go-cmp) from 0.5.7 to 0.5.8.
- [Release notes](https://github.com/google/go-cmp/releases)
- [Commits](https://github.com/google/go-cmp/compare/v0.5.7...v0.5.8)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-04 13:29:07 +02:00
dependabot[bot]
22da2e307f build(deps): bump github.com/Azure/azure-sdk-for-go
Bumps [github.com/Azure/azure-sdk-for-go](https://github.com/Azure/azure-sdk-for-go) from 63.1.0+incompatible to 63.4.0+incompatible.
- [Release notes](https://github.com/Azure/azure-sdk-for-go/releases)
- [Changelog](https://github.com/Azure/azure-sdk-for-go/blob/main/CHANGELOG.md)
- [Commits](https://github.com/Azure/azure-sdk-for-go/compare/v63.1.0...v63.4.0)

---
updated-dependencies:
- dependency-name: github.com/Azure/azure-sdk-for-go
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-04 13:28:09 +02:00
dependabot[bot]
a040467de5 build(deps): bump cloud.google.com/go/compute from 1.6.0 to 1.6.1
Bumps [cloud.google.com/go/compute](https://github.com/googleapis/google-cloud-go) from 1.6.0 to 1.6.1.
- [Release notes](https://github.com/googleapis/google-cloud-go/releases)
- [Changelog](https://github.com/googleapis/google-cloud-go/blob/main/CHANGES.md)
- [Commits](https://github.com/googleapis/google-cloud-go/compare/pubsub/v1.6.0...pubsub/v1.6.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-04 13:05:10 +02:00
Simon de Vlieger
9840ef750b Devcontainer update to Fedora 36.
The staticfiles dependency updated to support Go 1.18 generics in the
2022.1 release. This prevents the devcontainer (which has Go 1.16) from
being built. This moves the container to Fedora 36 which provides Go
1.18.
2022-05-04 10:44:21 +02:00
Ygal Blum
fc87b1740e entrypoint - add parameters for socket bind address and port
entrypoint.py
-------------
Allow the user to set the port number also for the remote worker
Allow the user to set the binding address for the composer api or remote worker api
Set the default port of the composer API to 8080

Dockerfile-ubi
--------------
Remove setting the port for the composer API since the default is
already 8080
2022-05-04 09:13:40 +02:00
Ondřej Budai
082da070d1 test: generate manifests for rhel-87 and rhel-91
These are without image-info as discussed in the PR.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2022-05-03 18:13:28 +02:00
Ondřej Budai
c811860771 test-case-generators: add rhel-87 and rhel-91
Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2022-05-03 18:13:28 +02:00
Ondřej Budai
df011dbb06 tests: add rhel-87 repositories overrides
This is a bare minimum for our downstream testsuite to pass (otherwise
it will fail on non-existing 8.7 CDN repositories).

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2022-05-03 18:13:28 +02:00
Ondřej Budai
8575620591 distro: add an alias for rhel-91
We would benefit from having support for 9.1 downstream so let's add it in
the form of an alias. This is a bare minimum for having a proper 9.1 support.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2022-05-03 18:13:28 +02:00
Christian Kellner
f212e6690d image-info: dynamically detect the rpm database
Check for the rpm database in $tree/usr/share/rpm and explicitly
also in $tree/var/lib/rpm and if the respective location exists
pass it as argument to rpm. This should fix the situation where
the default database on the host is in a different location than
in the tree. Fedora < 36 and RHEL have the location in /var but
Fedora starting 36 and rpm-ostree have it in /usr.
2022-05-03 12:22:43 +02:00
Ondřej Budai
6fce34a5ea worker: add proxy support to composer and oauth calls
In the internal deployment, we want to talk with composer over a http/https
proxy. This proxy adds new composer.proxy field to the worker config that
causes the worker to connect to composer and the oauth server using
a specified proxy.

NB: The proxy is not supported when connection to composer via unix sockets.

For testing this, I added a small HTTP proxy implementation, pls don't
use this in production, it's just good enough for tests.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2022-05-03 06:19:31 +01:00
Ondřej Budai
9ee3997428 worker: use custom requester also for oauth refresh
Just so we can share e.g. proxy server or other http transport settings.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2022-05-03 06:19:31 +01:00
Ondřej Budai
71a4ceecaa worker/client: factor out common testing code
Just so we don't need to care about all the server-side setup in individual
test cases and we can just reuse the setup.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2022-05-03 06:19:31 +01:00
Ondřej Budai
b4d6ec5a75 worker/client: simplify the oauth test
Firstly, let's use t.TempDir(), it's less code.

Secondly, let's remove all the code that touches distributions, we can just
use random values, both worker server and client actually do't inspect
any values so they can be completely random.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2022-05-03 06:19:31 +01:00
Ondřej Budai
ed8bcd2f49 worker: move client test to its own file
This test actually verifies that the client code for OAuth works. As this was
the only code that tests client in the file, I think it deserves its own one.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2022-05-03 06:19:31 +01:00
Ondřej Budai
6e9901fe6b worker: exit(2) when address is missing from argv
Address is always required so not passing one is a clear error, let's return
exit code 2 which go itself returns when bad arguments are passed in.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2022-05-03 06:19:31 +01:00
Ondřej Budai
6e92263c23 worker: rename config field in Go to reflect its toml name
For the sake of consistency, not a functional change.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2022-05-03 06:19:31 +01:00
dependabot[bot]
5028b19a71 build(deps): bump github.com/aws/aws-sdk-go from 1.43.42 to 1.44.4
Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.43.42 to 1.44.4.
- [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.43.42...v1.44.4)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-02 10:01:01 +02:00
Christian Kellner
98b491fcac distro/rhel85: automatically convert to LVM on fs customizations
Whenever we create a new mountpoint due to a user customization,
ensure the layout uses LVM, i.e. convert plain layouts to it, if
needed. This does not apply to rpm-ostree based systems.
Add "lvm2" to the build pipeline and thus generate new manifests
and image infos.
Adjust the existing tests that assumed we can not create more
than 4 partitions on mbr layouts, since that is now not true
anymore.
This is a port from rhel86, commit 63aa155

The change in osPipeline() is required now to fix the Prefix for the
bootloader specification when LVM is used. The unspecified Prefix, which
was previously used for all cases, defaults to "/boot". When the layout
is converted to LVM, a boot partition is created and the BLS Prefix
should be set to "".

In the case where we don't have a partition table, the BLS stage is not
needed, but it was done unconditionally before, so keep the default
image definitions unchanged.

Co-Authored-By: Achilleas Koutsou <achilleas@koutsou.net>
2022-04-30 12:37:50 +01:00
Christian Kellner
bd6b8e7128 distro/rhel85: reformat distro build package list
One package on each line, makes future changes easier to follow.
No actual change of packages in this commit.
2022-04-30 12:37:50 +01:00
Tomas Hozza
8ee90334ba generate-all-test-cases: add manifests command
Add `manifests` command for generating image test cases without
`image-info` report, so only manifests.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2022-04-29 12:13:00 +02:00
Tomas Hozza
01864e4db7 Don't support gce-rhui image type on CentOS Stream 8
The RHUI variant of the GCE image is intended only for RHEL.
2022-04-29 09:24:40 +02:00
Achilleas Koutsou
d357f92f91 test: add fs customization to qcow2 test case
Added a filesystem customization to the qcow2 test case to test that the
filesystem is converted to an LVM layout.
Set overrides for distros that don't support fs customizations.
2022-04-29 08:55:36 +02:00