Commit graph

2126 commits

Author SHA1 Message Date
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
Achilleas Koutsou
5556137daf Append filename to S3 object upload 2021-06-18 14:02:09 +01:00
Achilleas Koutsou
e5b28c0bb3 New upload target: AWS S3
Uploads an artifact to an S£ bucket and returns a presigned URL to allow
the user to download the file.

Although it uses a lot of common code with the AWS AMI upload target,
it's treated as a completely separate target.
2021-06-18 14:02:09 +01:00
Achilleas Koutsou
14aea30bcd osbuild-worker: add export path to all upload calls
Exports are defined in all cases now.
2021-06-18 14:02:09 +01:00
Achilleas Koutsou
49a8d98c28 Move ResolveRef test to new package 2021-06-18 14:02:09 +01:00
Achilleas Koutsou
b2f5e1cd72 cloudapi: support ostree options
Move OSTree option handling outside of the weldr API to make it usable
by other packages. New subpackage at internal/ostree.

Add support for ostree options ("Ref" and "URL") in the Cloud API.
Validate OSTree options and resolve the parent reference the same way as
in the Weldr API.

Unlike the Weldr API, the Cloud API doesn't support specifying the
Parent reference directly.

The exports list is included in the job information on the queue.
2021-06-18 14:02:09 +01:00
Achilleas Koutsou
d701d237d0 Fix cache path creation in worker Dockerfile 2021-06-18 14:02:09 +01:00
sanne
cad7f7ff63 worker: Add test for the worker oauth2 auth 2021-06-17 10:08:35 +02:00
Ondřej Budai
0a304f659d worker/client: pass arch explicitly
The API client guessed the arch, let's pass it explicitly so a caller
can specify it.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-06-17 10:08:35 +02:00
sanne
8fa822c02e worker: Return basepath depending on route 2021-06-17 10:08:35 +02:00
sanne
0ea31c39d5 worker: Add identity filter and client oauth support 2021-06-17 10:08:35 +02:00
Alexander Todorov
968e7b210f CI: Store .repo file as artifacts. Fixes #1458
Note: only store them for the Base jobs b/c these files are produced
by deploy.sh and will be the same across jobs in the same pipeline.
2021-06-15 11:43:42 +03:00
Alexander Todorov
68219bd92a CI: Don't run cloud_cleaner in rpmbuild stage. Fixes #1457 2021-06-15 11:43:42 +03:00
Martin Sehnoutka
1fffb57a4c deploy-qemu: rewrite in python
The discussion about Bash syntax have reached the threshold where it is
necessary to rewrite the script in Python to make everyone's life
easier.
2021-06-15 09:53:53 +02:00
Ondřej Budai
b5c65b687a 30
Release osbuild-composer 30.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-06-10 14:59:08 +02:00
Ondřej Budai
602b97b2a8 schutzfile: remove osbuild pins for Fedora
osbuild 28 already landed in both Fedora 32 and Fedora 33

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-06-10 14:59:08 +02:00
Ondřej Budai
dd3099f03d ci: run centos stream 8 integration test on openstack
AWS doesn't have real KVM and it seems that booting Centos Stream image using
TCG stopped working (TCG was actually never supported on EL). Let's switch
to using OpenStack that has KVM support.

Also, I bumped the terraform repository because the older version didn't have
centos stream on OpenStack.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-06-10 11:39:05 +02:00
Ondřej Budai
bc1a7dc30c tests: fix journalctl killing once again
3a8c6c8a introduced a new logic for killing journalctl. Unfortunately, it
doesn't work properly. In ostree tests, multiple journalctls are spawned
but there can be only one trap active at a time. This caused all but the last
journalctls to hang indefinitely. Unfortunately, hanging background processes
is something that causes the GitLab CI to hang indefinitely as well.

This commit modifies the logic a bit: The trap is still set. However, there's
also an explicit kill of journalctl after the compose is finished. After the
process is successfully killed, the trap is removed.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-06-10 07:40:36 +02:00
Tomas Hozza
244cb35eca image-info: fix read_partition() call
One occurrance of read_partition() call have not been modified as part of
previous commit [1], which is a bug.

[1] 598c2b6939

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-06-09 18:23:00 +02:00