Commit graph

2244 commits

Author SHA1 Message Date
Xiaofeng Wang
9a7016f451 Remove the subscription check on mock config for RHEL 8.5 2021-06-29 16:14:45 +02:00
Xiaofeng Wang
e00ba2f075 gitlab-ci: Add two new RHEL 8.5 runners on rpmbuild stage
Now CI is able to build RHEL 8.5 RPM package on both x86_64 and
aarch64
2021-06-29 16:14:45 +02:00
Xiaofeng Wang
bc43eab535 Update schutzbot/terraform to point to latest gitlab-ci-terraform
repo commit

The latest gitlab-ci-terraform repo commit includes new runners:
1. openstack/rhel-8.5-x86_64
2. aws/rhel-8.5-x86_64
3. aws/rhel-8.5-aarch64
2021-06-29 16:14:45 +02:00
Ondřej Budai
419ac4c769 ci: remove EXTRA_REPO_PATH_SEGMENT
EXTRA_REPO_PATH_SEGMENT was needed when both Jenkins and Gitlab CI
were running in parallel (so they don't override their artifacts).

Jenkins is now decommissioned so we can drop the variable.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-06-29 13:58:58 +02:00
Ondřej Budai
cc2c354371 tests: regenerate manifests for rhel 9.0
Previous commits bumped the repo snapshots and changed the manifest generation
for RHEL 9.0.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-06-29 13:56:26 +02:00
Ondřej Budai
39f1d4d485 tests: update snapshot for rhel 9.0
We have a newer one so let's use it.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-06-29 13:56:26 +02:00
Ondřej Budai
9bcd219528 distro/rhel90: make selinux stage the last one
There are currently some context mismatches in the image because of the new
files from the sysconfig stage. Let's move the selinux stage to the end so
we fix them.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-06-29 13:56:26 +02:00
Ondřej Budai
4c16b2f77e distro/rhel90: include qemu-guest-agent in qcow2
Fixes COMPOSER-990

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-06-29 13:56:26 +02:00
Ondřej Budai
c37705e7d5 distro/rhel90: move all package lists to a separate file
There's currently the Package Deletion Process going on in CentOS Stream 9.
When a maintainer wants to get rid of a package, several steps must be taken
before the package is completely removed from all places. We want to include
osbuild-composer in the process so packages that are used here are not deleted
without us noticing it. Thus, maintainers going through the process should be
able to easily see all packages that osbuild-composer includes in images.

This commit moves all package lists from rhel90/distro to rhel90/packages
to allow CentOS Stream maintainers to easily packages required by composer.

Not a functional change.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-06-29 13:56:26 +02:00
Ondřej Budai
42e4a5f6ac ci: remove fedora 34 hack from mockbuild
This is apparently not needed anymore, I checked with 20 jobs here:
https://gitlab.com/osbuild/ci/osbuild-composer/-/pipelines/328779200

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-06-29 11:53:56 +02:00
Achilleas Koutsou
0ddfc32957 test: verify selected package appears in metadata
Add postgresql to all builds and verify that it's listed in the metadata
2021-06-29 09:33:05 +01:00
Achilleas Koutsou
cfb244ab34 cloudapi: check if metadata is nil before converting 2021-06-29 09:33:05 +01:00
Achilleas Koutsou
51503cc000 cloudapi: collect RPMs from v2 result stages
Fix for v1 results: collect RPMs for main stages, not build.
Support for v2 results: filter out build stages from stage results,
which include stages from all pipelines (flattened).
2021-06-29 09:33:05 +01:00
Achilleas Koutsou
b46addea5c osbuild1: convert stage metadata from v2
While unmarshalling osbuild output and converting from v1 to v2, convert
the metadata as well.

Added checks to successful parsing and conversion test.
2021-06-29 09:33:05 +01:00
Achilleas Koutsou
1dcaa26966 osbuild2: add support for reading stage metadata
Metadata from stages in the output from osbuild in the v2 schema are
stored at the top level of the result structure.

Adding the same Metadata types from v1:
- org.osbuild.rpm stage
- org.osbuild.ostree.commit stage
- Raw metadata (for every other stage type)
2021-06-29 09:33:05 +01:00
Achilleas Koutsou
2212fedae3 docs/news: add news item for new feature 2021-06-29 09:33:05 +01:00
Achilleas Koutsou
7e01a9125b test: verify commit ID hash returned from API 2021-06-29 09:33:05 +01:00
Achilleas Koutsou
dce3e1de9e distro: test manifest version detection 2021-06-29 09:33:05 +01:00
Achilleas Koutsou
39e646ae68 cloudapi: return ostree commit ID with metadata
When the assembler (v1) or any stage (v2) has type ostree.commit,
retrieve the commit ID (hash) from the osbuild stage metadata and return
it with the rest of the metadata (package NEVRAs).
2021-06-29 09:33:05 +01:00
Achilleas Koutsou
e87394fea1 distro: method for detecting manifest version
Small helper method for distro.Manifest that can detect the schema
version of the Manifest.
2021-06-29 09:33:05 +01:00
Achilleas Koutsou
72f0f7ffed osbuild1: store all stage result metadata
Currently, metadata from osbuild is discarded for all stages except RPM.
Adding explicit support for the ostree.commit stage/assembler and
storing the metadata in a known type.
For all other stages, store the metadata directly without parsing.

The rawAssemblerResult is removed. Assembler results are treated as
stage results.
2021-06-29 09:33:05 +01:00
Achilleas Koutsou
df5921403d cloudapi: add compose/id/metadata endpoint
Returns NEVRAs, compiled from the job manifest.
Will also return the ostree commit ID for edge commit types.
2021-06-29 09:33:05 +01:00
Achilleas Koutsou
6b3920783f rpmmd: move RPM metadata tooling to internal pkg
Move the OSBuildStagesToRPMs function, associated test, and RPM type
from the worker into the rpmmd subpackge. We will use this function in
the cloud API to compile the NEVRAs for the new metadata endpoint.
2021-06-29 09:33:05 +01:00
Jakub Rusz
b1e40b5ce7 tests: modify image_tests for Gitlab CI 2021-06-28 13:49:57 +03:00
Ondřej Budai
579a5df698 upload/aws: add support for session tokens
If a user uses a temporary access key for login, a session token is also
needed.

This commit adds support for it to the internal aws library and also
to the osbuild-upload-aws helper. Note that this doesn't affect the main
osbuild-composer executable nor the worker. Everything here should work
as before and session tokens are not supported. Something for a follow up
if anyone needs it.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-06-28 13:14:19 +03:00
Jakub Rusz
bb2f866470 tests: updating README with info about nightly testing in Gitlab CI 2021-06-25 15:10:40 +03:00
Jakub Rusz
b6c579cbe3 tests: Enable use of custom osbuild-composer repo
This enables the user to specify custom REPO_URL for use during
internal RHEL build testing as ENV in scheduled pipelines.
It also gives the option to use osbuild build specified in
Schutzfile or from the nightly build repository.
2021-06-25 15:10:40 +03:00
Jakub Rusz
905c297bc7 tests: enable nightly test execution in gitlab CI
This adds several stages to the gitlab-ci.yaml file which are
triggered by a schedule specified in Gitlab->CI/CD->Schedules
2021-06-25 15:10:40 +03:00
Jakub Rusz
beead86da6 tests: update cloud-cleaner
In 0680214c9b20b76f82c381fb3472d83846ca0c71 the BUILD_ID was changed
in azure.sh test but not in cloud_cleaner causing cloud-cleaner to
not clean up properly. This fixes that.
2021-06-25 14:20:07 +03:00
Yuxin Sun
704a3675b9 Update fedora-33 test repo
Signed-off-by: Yuxin Sun <yuxisun@redhat.com>
2021-06-25 08:40:49 +03:00
Yuxin Sun
23cf70a0d7 Remove Fedora 33 ostree test
Signed-off-by: Yuxin Sun <yuxisun@redhat.com>
2021-06-24 12:12:26 +02:00
sanne
6fac4dcb70 distribution: Add cache dir to composer clouddot deployment 2021-06-23 10:33:22 +02:00
sanne
4f86b4fd45 worker: Use http.PostForm to post data
Avoid having to encode the data ourselves.
2021-06-23 10:33:22 +02:00
sanne
acf88309c2 worker: Trim offline token 2021-06-23 10:33:22 +02:00
sanne
9161553170 worker: Tidy up help message 2021-06-23 10:33:22 +02:00
Ondřej Budai
86baf4879a tools/deploy-qemu: use sys.exit instead of exit
exit is just a helper for the interactive shell, see:

https://stackoverflow.com/questions/6501121/difference-between-exit-and-sys-exit-in-python
Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-06-22 14:45:54 +02:00
Ondřej Budai
99d1d4e5d0 tools/deploy-qemu: use default temp dir location
Previously, the temporary directory was created in the script dir. It just
imo created unnecessary and confusing files in my git checkout. Let's just
use the default temporary directory because we don't really have special
needs for it.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-06-22 14:45:54 +02:00
Alexander Todorov
1eb51b7bab Test Azure images on HyperV Gen1 and Gen2
Related: rhbz#1896264
2021-06-22 13:44:19 +03:00
Aleksandar Todorov
24f297859c Azure: deploy to V2 Hyper-V generation
Related: rhbz#1896264
2021-06-22 13:44:19 +03:00
Tomas Hozza
e6c3d78ec4 image tests: ignore 'selinux/context-mismatch' in image-info report on RHEL-8
Add a new CLI option to `osbuild-image-tests` called
`-skip-selinux-ctx-check` to workaround the limitation of `setfiles` on
RHEL-8 [1]. If the option is passed to the binary, then the
'selinux/context-mismatch' part is removed from the "expected" and
"actual" image-info report, before these two reports are compared.

Modify `image_tests.sh` to run `osbuild-image-tests` with
`-skip-selinux-ctx-check` when run on RHEL-8.

[1] https://bugzilla.redhat.com/show_bug.cgi?id=1973754

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-06-22 13:25:59 +03:00
Tomas Hozza
bce603586e image-info: changes related to reading SELinux labels unknown to host
When `image-info` inspects ostree images, the `/usr/etc` is bind-mounted
to `/etc`. This results in conflicting SELinux policy specification for
these files and makes the outcome dependent on the `setfiles` build.
All the files in `/etc` have mismatch in the expected vs. actual SELinux
context.

Exclude `/etc` from the check of SELinux ctx mismatches in case the
analysed tree is from an ostree-based image.

Sort the list returned `read_selinux_ctx_mismatch()` based on the item's
`filename` key, to make the result consistent across runs.

`image-info` can not read SELinux labels from the images, which are not
known to the host. This makes the report content depend on the host
environment. As a temporary workaround, relabel the image-info script with
osbuild_exec_t label to allow it to read unknown SELinux labels.

Modify documentation in `test/README.md` to explain the issue with
`image-info` and unknown SELinux labels.

Modify the `generate-all-test-cases` to relabel `image-info` before
generating test cases.

Modify the `image_tests.sh` to relabel `image-info` before running image
test cases.

Add 'tar' image for 'rhel-8' on 's390x' back to the matrix of generated
test cases, as it was removed by mistake. Regenerate the image test
case. Remove 'tar' image from 'rhel-84' on 's390x' from the matrix of
generated test cases, as it is not supported.

Regenerate all affected image test cases.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-06-22 13:25:59 +03:00
sanne
95cd5b782e distribution: The composer-api listens on 9196
The openshift service is listening on 443, but composer is running on
9196.
2021-06-21 17:31:15 +02:00
Alexander Todorov
9b9f86967e Remove Fedora32 from CI matrix - already EOL 2021-06-21 16:15:53 +03:00
Tomas Hozza
0f3c25824d Image test cases: remove Fedora 32 (EOL)
Remove Fedora 32 image test case manifests, because the release
is already EOL. Remove Fedora 32 definitions from
`distro-arch-imagetype-map.json`. Remove Fedora 32 repositories
from `tools/test-case-generators/repos.json`.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-06-21 16:15:53 +03:00
Colin Walters
a6ccde879b rpm_ostree_stage: Minor fixes to comments
Just a drive by commit while I was reading the code.
2021-06-21 12:11:09 +02:00
Achilleas Koutsou
deb28fd139 GitLab CI: Separate API test script test matrix
Splitting the api.sh test into its own matrix. The addition of the new
target, aws.s3, made the existing integration test matrix grow beyond
the GitLab parallel job limit (50).
2021-06-18 14:02:09 +01:00
Achilleas Koutsou
8f778af653 test: add API test for S3 upload target
Run on RHEL only.
2021-06-18 14:02:09 +01:00
Achilleas Koutsou
b825738939 docs/news: add news item for change 2021-06-18 14:02:09 +01:00
Achilleas Koutsou
1a3447ed38 kojiapi: include image type exports in Koji job args
Koji image request handling now reads the exports defined by each image
type. All APIs now support reading the exports defined by each image
type. The worker still falls back to "assembler" in case the call comes
from an older version of composer.
2021-06-18 14:02:09 +01:00
Achilleas Koutsou
14a74cf173 ostree: add test for VerifyRef() 2021-06-18 14:02:09 +01:00