Commit graph

2086 commits

Author SHA1 Message Date
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
Tomas Hozza
a2d4ba715f Extend information gathered by image-info tool
This is a preparation for defining EC2 images for RHEL-8.5.0. These
extensions to image-info tool represent modifications done to the
official EC2 images currently produced as RHEL release. It is important
to be able to analyse these aspects of images, before we define them in
osbuild-composer, to ensure that the resulting images will be consistent
with the current state.

- Read non-empty lines from /etc/hosts file and add them to the report.
- Read content of /etc/machine-id and add it to the report.
- Read uncommented key/values from /etc/systemd/logind.conf and add them
  to the report.
- Read all ifcfg-* files from /etc/sysconfig/network-scripts/ and add
  their values to the report.
- Read content of /etc/locale.conf and add it to the report.
- Read SELinux configuration from /etc/selinux/config and add it to the
  report.
- Inspect the filesystem tree for SELinux context mismatches and add
  them to the report.
- Read configuration files from /etc/modprobe.d/ and for now report only
  all blacklisted kernel modules.
- Read RHSM configuration from /etc/rhsm/rhsm.conf and add it to the
  report.
- Read cloud-init configuration from /etc/cloud/cloud.conf and add it to
  the report.
- Read all *.conf files from /etc/dracut.conf.d/ and add their content to
  the report.
- Read VC and X11 keyboard configuration and add it to the report.
- Read specific configuration directives from Chrony configuration and
  add them to the report. Specifically 'server', 'pool', 'peer' and
  'leapsectz'.
- Read drop-in configurations for *.service unit files from
  /etc/systemd/system/ and add them to the report.
- Read all configuration files from /etc/tmpfiles.d/ and add them to the
  report.
- Read all configuration files from /etc/sysctl.d/ and add them to the
  report.
- Read the Tuned active profile and profile mode and add them to the
  report.
- Read all configuration files from /etc/security/limits.d and add them
  to the report.
- Read sudoers configuration from /etc/sudoers and files in
  /etc/sudoers.d/ and add uncommented lines to the report. No
  sophisticated parsing is done, because the configuration format
  grammar is too complicated for the purpose of image-info.
- Read udev rules configuration files from /etc/udev/rules.d/ and add
  them to the report.
- Read DNF configuration and defined vars and add them to the report.
- Read profile ID and enabled features used by authselect.
- Enable SELinux, extended attributes and POSIX ACLs support when
  unpacking 'tar' image type to prevent potential mismatches

Regenerate all image test cases to reflect changes in the image-info
output. Modify the distro-arch-imagetype-map.json to cover all
combinations currently covered by existing image test cases.

Add doc strings to all read_* functions.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-06-09 18:23:00 +02:00
Alexander Todorov
2cabaa5477 tests: Use CI_BUILD_ID, not CI_PIPELINE_ID. Fixes #1448
PIPELINE_ID is the same across different jobs running in the same
pipeline while BUILD_ID is unique for every job.

Note: In the case where we have 1 test script/runner
CI_BUILD_ID == CI_JOB_ID
2021-06-08 09:07:43 +02:00
Martin Sehnoutka
71233fd860 distro: add fedora 34 and 35 aliases to f33
composer doesn't support f34 or f35, but it should be possible to build
these even with the f33 distro definition. Introduce f34 and f35 repos
and aliases for f33.
2021-06-05 20:31:45 +02:00
sanne
19db3ff1d4 cloudapi: Add x-rh-identity header filter 2021-06-05 14:47:38 +01:00
sanne
2a42d05a10 distribution: Add PVC to clouddot template
This will make the job queue persistent over redeployments.
2021-06-04 20:21:16 +02:00
Ondřej Budai
024236be6a readme: add IRC
Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-06-04 18:19:42 +01:00
Jakub Rusz
3a8c6c8ab8 tests: kill journalctl even if compose fails
This prevents Gitlab CI from getting stuck if something
goes wrong with the compose.
2021-06-04 14:18:11 +03:00
Alexander Todorov
8c1afdd727 CI: Remove Jenkinsfile, use GitLab instead 2021-06-04 10:48:04 +03:00
Alexander Todorov
9a4b5763e9 GitLab CI: Move Container build under rpmbuild stage
so taht it can be running in parallel instead of blocking all of
the other test jobs in the pipeline.
2021-06-03 11:45:09 +03:00
Alexander Todorov
0d04ab9752 GitLab CI: 1 test script/runner 2021-06-03 11:45:09 +03:00
Christian Kellner
b4773caebc schutzbot: send notifications to slack
Send notifications about successful and failed builds to slack instead
of Telegram.
2021-06-02 10:16:08 +02:00
Alexander Todorov
1927abea46 tests: Adjust vmware.sh for GitLab CI 2021-05-31 11:44:37 +02:00
Alexander Todorov
3f823be4b1 GitLab CI: Add vmware integration test 2021-05-31 11:44:37 +02:00
Alexander Todorov
591b0fa1be Disable Shutzbot in favor of GitLab CI 2021-05-31 11:44:37 +02:00
Alexander Todorov
3717ddfbbd GitLab CI: Add GCP tests 2021-05-31 11:44:37 +02:00
yih
661d59e534 add test case to push/pull edge container images in quay.io 2021-05-26 12:16:42 +03:00
Alexander Todorov
dedc4b9fc9 GitLab CI: User newer terraform SHA
brings in some of the missing openstack/ images definitions
2021-05-25 12:39:59 +03:00
Alexander Todorov
4a580222c3 GitLab CI: Add Fedora 32 & RHEL 8.4 to OSTree testing 2021-05-25 12:39:59 +03:00
Alexander Todorov
9478b9e40e GitLab CI: comment out test jobs which will currently fail
see ticket references for more info
2021-05-25 12:39:59 +03:00
Alexander Todorov
c891eecaef GitLab CI: Add Fedora 34 to Integration tests 2021-05-25 12:39:59 +03:00
Alexander Todorov
760d6010f5 GitLab CI: Add more Base runners 2021-05-25 12:39:59 +03:00
Alexander Todorov
8532fe16ee GitLab CI: Add container build stage 2021-05-25 12:39:59 +03:00
Alexander Todorov
e953cffb89 GitLab CI: Add 8.4-aarch64 to RPM build section 2021-05-25 12:39:59 +03:00
msehnout
4ab3dadb47 github: create issue template
Create a template to help us with the bug reporting process. This template includes a request for information we usually ask from the reporters. This way, they can include the information upfront.
2021-05-24 12:04:36 +03:00
Martin Sehnoutka
4a54ab43e5 test/cases: Introduce common "regression" test for all distros
Create an entry point for all regression test called "regression.sh" and
run it as part of the base tests for all our distros. This entry
point contains logic for running only the test cases that are
appropriate for a given distribution.
2021-05-20 13:07:07 +03:00
sanne
65b7ce10ba distribution: Add second service to composer clouddot deployment 2021-05-18 12:07:30 +02:00
sanne
0518933676 distribution: Add state directory
This should become a PersistentVolumeClaim in future, but let's get the
deployment running first.
2021-05-17 21:43:55 +02:00
Ondřej Budai
a19b883727 distro/rhel90: enable cloud-init
cloud-init was enabled explicitly in the image-factory kickstart and thus we
need to explicitly enable it too.

Fixes: rhbz#1960309
Fixes: COMPOSER-920
Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-05-17 14:55:50 +02:00
Ondřej Budai
bb60905309 test/libvirt: remove dead code
We don't test vmdk images in libvirt.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-05-17 14:55:50 +02:00
Ondřej Budai
3bf04d12f8 test/libvirt: use a minimal blueprint
All our images now support and have enabled cloud-init, there's no need
to explicitly enable it and install it in a kickstart.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-05-17 14:55:50 +02:00
Ondřej Budai
9029d169d9 test/libvirt: don't test vhd images
VHD images are meant for Azure and we indeed test if they're bootable in
test/cases/azure.sh . There's no reason to test them using libvirt anymore
so this commit just removes the test.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-05-17 14:55:50 +02:00
Tomas Hozza
aa6665ad01 Use RepoRegistry in composer and Weldr API
Modify composer to use RepoRegistry, instead of loading the host
repositories, when initializing WeldrAPI.

Modify WeldrAPI to use RepoRegistry, instead of a map of repository
definitions. Make sure that the RepoRegistry method specific to image
type is used in Welder where appropriate. Specifically when depsolving a
Blueprint, which is used to build a specific image type. Update Weldr
API unit tests to reflect the change.

Add a new method to RepoRegistry, allowing to get list of repositories,
which should be used for building an image for a given architecture,
without specifying the exact image type. Add relevant unit tests.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-05-14 15:43:00 +02:00
Tomas Hozza
fba9fe1072 Make the Distroregistry FromHost() return distro with correct name
Composer does not have 1:1 mapping of what can be the Host Distro name
and the names of supported distributions held in the Distroregistry.

The fact that the host distro `Name()` method as passed to the Weldr API
does not return the same name as what is used as distro name for
repository definitions. This makes it hard to use `distro.Distro` and
`distro.Arch` directly and rely on the values returned by them as their
name.

Add `New*HostDistro()` to all distro definitions, accepting the name
that should be returned by the distro's `Name()` method. This is useful
mainly if the host distro is Beta or Stream variant of the distro.

Change the distroregistry.Registry to contain host distro as a separate
value set when creating it using `New()` function. This value is
returned by `Registry.FromHost()` method. Determining the host distro is
handled by the `NewDefault()` function. Move the distro name mangling to
distroregistry package. Add relevant unit tests.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-05-14 15:43:00 +02:00
Tomas Hozza
dda9cce03e Add support for image type tags in rpmmd and add RepoRegistry API
Extend the RepoConfig structure to contain new field ImageTypeTags.
Extend also other structures and functions as needed, to support loading
repository definitions, which use this new field. The idea is that a
repository should be used for building all image types, unless it has
some ImageTypeTags defined. In such case, it should be used only for
building the specific image types, which names are specified in the new
field.

Add RepoRegistry as a higher-level API to load and manage repository
definitions for each distribution. Currently it provides one method,
which returns a set of repositories needed to build a given image
type. The RepoRegistry uses the new ImageTypeTags field in the RepoConfig
structure and returns all the needed repositories for the image type.

Modify rpmmd unit tests and add unit tests for RepoRegistry.

Add News entry describing the change done to RepoConfig and its JSON
representation.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-05-14 15:43:00 +02:00
Tomas Hozza
4c5d4de387 rpmmd: separate loading of repo definitions from file and add tests
Separate the loading of repo definitions from JSON file from
`LoadRepositories()` to a standalone function
`loadRepositoriesFromFile()`, to make it easy to reuse it in the future.

Add unit tests for `LoadRepositories()` function.

Exclude github.com/osbuild/osbuild-composer/internal/rpmmd/test package
from test coverage. Package with just tests and no other code makes `go
test` to fail. This should be fixed in go 1.17.
See https://github.com/golang/go/issues/27333

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-05-14 15:43:00 +02:00
Tomas Hozza
f7f064274a Tests: remove fedoratest and replace it with test_distro
fedoratest was yet another dummy distribution used by unit tests. After
the rework of test_distro, there is no reason to not use it as the only
distro implementation for testing purposes.

Remove fedoratest distro and replace it with test_distro in all affected
tests.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-05-14 15:43:00 +02:00
Tomas Hozza
e5dd45b71c Extend the "Test Distro" definition and modify affected tests
Extend the "Test Distro" implementation and definition to contain two
architectures and make the second architecture contain two image types.
Add New2() function returning another "Test Distro".

Modify the `internal/store` unit tests to reflect changes done to the
"Test Distro".

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-05-14 15:43:00 +02:00
Jakub Rusz
8dcf859473 tests: move some integration tests to gitlab CI
This also includes several modifications to tests scripts to
enable them running in gitlab CI.
2021-05-12 15:38:30 +03:00
Jakub Rusz
e613b2456b tests: modify DISTRO_CODE usage
Set DISTRO_CODE if unset for gitlab CI
2021-05-12 15:38:30 +03:00
Yuxin Sun
5e60485705 Update yuxisun responsibility
Signed-off-by: Yuxin Sun <yuxisun@redhat.com>
2021-05-12 15:11:54 +03:00