Commit graph

3899 commits

Author SHA1 Message Date
Jakub Rusz
7666049210 ci: re-enabled Installer test on centos-stream-9
Anaconda with the fix released in the centos-stream-9 repos. Also fixing
ostree runner matrix.
2022-04-06 12:53:35 +02:00
dependabot[bot]
91663d5534 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.21 to 0.11.25.
- [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.21...autorest/v0.11.25)

---
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>
2022-04-06 12:28:30 +02:00
Achilleas Koutsou
23d4281349 rhel84: panic if kernel not defined in installer 2022-04-06 12:09:09 +02:00
Achilleas Koutsou
a76f7a64dc distro: rename tarInstaller vars to imageInstaller
The image type is only ever known (externally) as image-installer.
Renaming the internal variables and functions to reflect the name makes
the code easier to navigate.
2022-04-06 12:09:09 +02:00
Achilleas Koutsou
8316cf7ef0 rhel85: enable anaconda users module in installers
The users anaconda module enables users to create user accounts at
install time if one is not already created in the payload.  This is
required for the cloud API (Image Builder service) for the image
installer where user customizations are not supported.  Without it, user
creation isn't possible on the installed system.

The module also enables user creation at install time through the
kickstart file for both the image-installer and the edge-installer
(Anaconda only).
Therefore, for the image-installer, the users and groups are no longer
created as part of the payload.

This commit adapts the changes from the following commits (originally
made in the RHEL 8.6 and RHEL 9.0 distros) to the rest of the RHEL
distro definitions:
ebc3330cbd
5825294dad
2022-04-06 12:09:09 +02:00
Achilleas Koutsou
b0f7ff7c31 distro/rhel85,rhel90beta: change osPipeline() args
Pass in the image type and remove the three args (enabledServices,
disabledServices, and defaultTarget) that can be obtained from it.
2022-04-06 12:09:09 +02:00
Achilleas Koutsou
2aacd036e0 osbuild2: remove 'name' from group stage options
The name field does not exist in the osbuild schema.  This has no effect
on the current manifests.
2022-04-06 12:09:09 +02:00
Achilleas Koutsou
7236212d63 distro: deduplicate anacondaStageOptions() in RHEL pipelines
Use single NewAnacondaStageOptions() from osbuild2 instead of
implementing in each distro.

Followup from 974b0a434b, copied to the
rest of the RHEL distro definitions.
2022-04-06 12:09:09 +02:00
Achilleas Koutsou
3d53ca5d8d distro: deduplicate *kickstartStageOptions()
Use single NewKickstartStageOptions() and replace image-type-specific
implementation from each distro.
- Followup from cb186df208, copied to the
  rest of the RHEL distro definitions.

NB: The change was not made in the Fedora distro definitions as they are
    currently being rewritten.
2022-04-06 12:09:09 +02:00
Achilleas Koutsou
42364f2cc6 distro: deduplicate groupStageOptions() in RHEL pipelines
Use single NewGroupsStageOptions() from osbuild1 and osbuild2 instead of
implementing in each distro.
- Followup from 2eef6e6e2d, copied to the
  rest of the RHEL distro definitions.
- Added NewGroupsStageOptions() to osbuild1 for rhel8 and rhel84.

NB: The change was not made in the Fedora distro definitions as they are
    currently being rewritten.
2022-04-06 12:09:09 +02:00
Achilleas Koutsou
333bec57ef distro: deduplicate userStageOptions() in RHEL pipelines
Use single NewUsersStageOptions() from osbuild1 and osbuild2 instead of
implementing in each distro.
- Followup from ca8b371142, copied to the
  rest of the RHEL distro definitions.
- Added NewUsersStageOptions() to osbuild1 for rhel8 and rhel84.

NB: The change was not made in the Fedora distro definitions as they are
    currently being rewritten.
2022-04-06 12:09:09 +02:00
Achilleas Koutsou
15243f1dc5 distro: allow user and group customizations for edge-installer
Followup from, f34380d5b5 and
3a1765a5a8, copied to the rest of the RHEL
distro definitions.

For now, these customizations have no effect on the manifest.

The new `with-users` variants of the edge-installer test cases include
the user customizations in the blueprint, but the manifests are
(currently) the same as the corresponding base cases.
2022-04-06 12:09:09 +02:00
Achilleas Koutsou
d3f217d40f test: (re)generate all supported installer test manifests
New test cases for RHEL 8.5.
New RPM GPG keys for RHEL 9.0.
2022-04-06 12:09:09 +02:00
Achilleas Koutsou
11be84c225 test: add RHEL 8.4 rhel-edge-installer test case
Include RHEL 8.4 rhel-edge-installer in the test cases.
2022-04-06 12:09:09 +02:00
Achilleas Koutsou
0554da5a4d distro-arch-imagetype-map: change indent to 2 spc
Change indent to match the rest of the json files in the project.
2022-04-06 12:09:09 +02:00
Gianluca Zuccarelli
cc7d555fb2 worker/errors: consider dep errors as 4xx status
All dependency errors, whether they are 4xx or 5xx,
are currently being considered as a 5xx error in parent
jobs. This is causing some of the build alerts to fire
off when a depsolve job has failed, for example, when
in reality, this is an expected result. This commit
ensures that dependency errors are being reported as
4xx status in monitoring.
2022-04-06 10:57:37 +02:00
Gianluca Zuccarelli
8241e1f948 worker/clienterrors: add empty manifest error
If a manifest is empty we should have a specific error
code for that case and treat it as a 4xx error since
this would be bad input for a build job
2022-04-06 10:57:37 +02:00
Xiaofeng Wang
62ab822695 test: Enable CS9 test for ostree-rebase and ostree 2022-04-06 08:59:37 +02:00
dependabot[bot]
f3141d2d71 build(deps): bump actions/setup-go from 2.1.5 to 3
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 2.1.5 to 3.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](https://github.com/actions/setup-go/compare/v2.1.5...v3)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-06 08:57:31 +02:00
dependabot[bot]
0756d6a76a build(deps): bump actions/checkout from 2.4.0 to 3
Bumps [actions/checkout](https://github.com/actions/checkout) from 2.4.0 to 3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2.4.0...v3)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-06 08:56:58 +02:00
dependabot[bot]
0c73e88cfa build(deps): bump actions/github-script from 5 to 6
Bumps [actions/github-script](https://github.com/actions/github-script) from 5 to 6.
- [Release notes](https://github.com/actions/github-script/releases)
- [Commits](https://github.com/actions/github-script/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/github-script
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-06 08:54:52 +02:00
Ondřej Budai
ba236180fc cloudapi: prevent dangling manifest goroutines
When composer exits, it doesn't wait for the manifest generation goroutines
to finish. This is generally a bad practice so let's introduce a bit of
syncing and a new Shutdown method to prevent this.

This also prevents the manifest generation goroutine from creating weird
states when interrupted on a random line of code.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2022-04-06 08:51:01 +02:00
Ondřej Budai
02091ba777 cloudapi: move context timeout inside manifest generator
Deduplicating the code a bit and also getting rid of the weird cancel
argument.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2022-04-06 08:51:01 +02:00
Ondřej Budai
42aa3b1f11 cloudapi: make assignment more idiomatic
Actually, my IDE is shouting at me that so changing this to make it happy.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2022-04-06 08:51:01 +02:00
Ondřej Budai
d957e1f6cc cloudapi: move enqueuing methods under server
I think it's a natural fit, they access some fields from the server so let's
find a new home for them there.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2022-04-06 08:51:01 +02:00
Ondřej Budai
a6f3dd91b6 cloudapi: split into handler and server
These "classes" are huge, let's split them into two files to make the file
smaller.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2022-04-06 08:51:01 +02:00
Diaa Sami
e773d4896b koji: fix excessive logging & monitoring
update koji init & finalize to use custom leveled logging
This is mainly affects logging, but it also changes functionality slightly
since init & finalize are now using the customCheckRetry, they are able
to retry the "TLS timeout" error.
2022-04-05 23:48:30 +02:00
Diaa Sami
7c4d74481a koji: fix excessive logging & monitoring
update koji upload to use custom leveled logging, this only affects
logging
since uploading uses a different connection to send the chunks, it is
done separately in this commit
2022-04-05 23:48:30 +02:00
Diaa Sami
ed5cd56c5a koji: promote relevant logs to Info for monitoring
Add support for promoting certain `Debug` log messages to `Info` so we
can monitor them while the logging level set to `Info`, having it set
to Debug is far too noisy.
2022-04-05 23:48:30 +02:00
Diaa Sami
e6475d0e0e koji: make function non-member
follow-up to PR-2397
2022-04-05 23:48:30 +02:00
Ondřej Budai
4f00081356 cloudapi/test: wait for the depsolving goroutine to finish
This allows us to use t.TempDir() everywhere. This was not possible before
because t.TempDir() fails the test if something was written in the temp dir
after the test case is finished. So by waiting on the depsolving goroutine
to finish, we can be sure that nothing is written in the tempdir anymore.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2022-04-05 09:27:43 +02:00
Ondřej Budai
fb87759aa7 cloudapi/test: properly end depsolving goroutine when cancel is called
Previously, the goroutine was never stopped because it was all the time
calling RequestJob that returned a TimeoutError.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2022-04-05 09:27:43 +02:00
Eng Zer Jun
00ea3eb285 test: use T.TempDir to create temporary test directory
The directory created by `T.TempDir` is automatically removed when the
test and all its subtests complete.

Reference: https://pkg.go.dev/testing#T.TempDir
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2022-04-05 09:27:43 +02:00
Tomas Hozza
c9a08da29f Move rpmStageOptions() from stage_options.go to osbuild2
Deduplicate the `rpmStageOptions()` function implemented in every distro
`stage_options.go` to `osbuild2` package.

RHEL-8.4 and code using osbuild v1 manifests are not touched.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2022-04-04 13:27:42 +02:00
Jakub Rusz
e1bb8ab47c tests/ci: split regression tests
Regression test suite has grown considerably and is taking too long to
run with a single wrapper. Splitting them into individual standalone
tests instead and making them run in parallel.
2022-04-04 12:18:53 +02:00
Jakub Rusz
b782b6cced tools/define-compose-url: change url back to nightly
The latest nightly link for 8.6 was missing only by accident, changing
back as it's fixed already.
2022-04-04 12:11:59 +02:00
Tomas Hozza
72019740c2 Cloud API: upload stream-optimized VMDK to S3
The VMDK image must be in stream-optimized format in order to be
imported to VSphere. osbuild-composer does not produce VMDK by default
as stream-optimized. Instead, it is converted on the fly when the image
build job has been submitted via Weldr API.

Since we are aiming mainly for the VSphere use case with the VMDK image
in the service, the image should be ready for importing to VSphere.

Implement a temporary workaround for the Cloud API and AWS S3 target to
upload stream-optimized VMDK image.

Adjust the `api.sh` test case to not convert the VMDK image downloaded
form S3, before importing it to VSphere.
2022-04-02 08:47:02 +01:00
Tomas Hozza
fa1424e724 Worker: explicitly close opened file after uploading it to the server 2022-04-02 08:47:02 +01:00
Tomas Hozza
c98b3afcc4 Add comments to some values in target.go 2022-04-02 08:47:02 +01:00
Tomas Hozza
3bf62ca789 CI: test Cloud API with vsphere image
Signed-off-by: Tomas Hozza <thozza@redhat.com>
2022-04-02 08:47:02 +01:00
Tomas Hozza
5acaaabc1d test/api.sh: do not print to stdout when dumping the DB
Ensure that the content of the database is not printed to the console
when dumped at the end of the test case. The output is still preserved
as a CI run artifact.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2022-04-02 08:47:02 +01:00
Tomas Hozza
7a44d00cec test/api.sh: cleanup the DB container
Kill and remove the DB container as part of the test case cleanup.
Without this change, running the test case more than once fails.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2022-04-02 08:47:02 +01:00
Tomas Hozza
27c260daaf test/api.sh: verify VMDK images from S3 in VSphere
Extend the `api.sh` test to verify the VMDK images uploaded to S3 in
VSphere by booting them and configuring using cloud-init.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2022-04-02 08:47:02 +01:00
Tomas Hozza
c6507c21b9 distro: add cloud-init to VMDK image on RHEL-85/86/90
Install `cloud-init` by default on the VMDK image on RHEL-85/86/90 and
as a result also CentOS Stream 8/9.

Regenerate image test cases.

Signed-off-by: Tomas Hozza <thozza@redhat.com>

test cases fixup
2022-04-02 08:47:02 +01:00
Ondřej Budai
fd49ed9a07 repositories: update key for RHEL 9.0
RHEL 9.0 will ship a brand new auxiliary key. Let's use it everywhere in our
RHEL 9 stuff. Taken from current RHEL 9.0's redhat-release package.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2022-04-01 19:22:23 +02:00
Jakub Rusz
b81e3f28fb Schutzfile: add centos-8 pin + update structure
It is now possible to specify mutliple repository files, updating the
structure to enable that + adding centos-stream 8 pin.
2022-03-31 18:10:23 +02:00
Xiaofeng Wang
87679fcab2 test: Add retries on ubi8 image and greenboot package downloading
To fix issue: https://github.com/osbuild/osbuild-composer/issues/2492,
retry 30 times when downloading ubi8 image and greenboot package.
2022-03-30 16:35:11 +02:00
Christian Kellner
45b1fc3cd1 osbuild2: honor GPG key setting for rpm inputs
We should honour `pkg.CheckGPG` when creating the file inputs for the
rpm stage. This was lost in the transition from v1 to v2 manifests.

Regenerate image test manifests.

Co-authored-by: Tomas Hozza <thozza@redhat.com>
Signed-off-by: Tomas Hozza <thozza@redhat.com>
2022-03-30 14:32:28 +02:00
Tomas Hozza
947acf74ab Regenerate affected image test cases 2022-03-29 11:43:54 +02:00
Christian Kellner
d29325164d osbuild2: set default boot entry to saved if a kernel is set
If a kernel is specified we already set the `SavedEntry`. To preserve
that the saved entry setting will survive grub2 config regeneration
we also need to set `Config.Default` to "saved". Do so. All older
pipelines have been prepared to reset this value to preserve the old
behavior. All new pipelines have been prepared to not overwrite this
setting when `ImageConfig.Grub2Config` is applied.
2022-03-29 11:43:54 +02:00