Commit graph

1279 commits

Author SHA1 Message Date
Tom Gundersen
fbfa191c81 rcm: drop sub-package
The osbuild-composer-rcm package was never finished, not in use and will be replaced by osbulid-composer-koji.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2020-07-17 19:13:15 +01:00
Tom Gundersen
79d27ded25 image-tests: avoid /var/tmp
`systemd-tmpfiles` will helpfully delete "old"  files in /var/tmp at regular
intervals. The files installed from rpm has the timestamps from when they
were packaged, which causes some to be cleaned up when the timer triggers.

The first timer triggers 15 minutes after boot, so we were sometimes hit
by this when our CI was under load.

Fixes #839 and #862.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2020-07-17 19:13:15 +01:00
Major Hayden
842b665659
Improve emoji selections 2020-07-17 11:46:12 -05:00
Major Hayden
20fd6521fb 🏇🏻 Speed up pipeline with parallelism (again)
Now that we're going about multi-arch testing in a different way, we can
restore some of the old parallelism that we used to have in the pipeline
so it will finish faster.

Signed-off-by: Major Hayden <major@redhat.com>
2020-07-17 11:43:54 -05:00
Major Hayden
60aafdaaab 📤 Temporarily disable aarch64 tests
The aarch64 tests are fairly unstable right now and they need work on
out of space issues (#870) and test cases (#861).

Signed-off-by: Major Hayden <major@redhat.com>
2020-07-17 09:24:12 -05:00
David Rheinsberg
cdcf212a52 spec: pull in systemd-nspawn
The composer-tests use systemd-nspawn, so make sure the `*-tests` RPM
depends on `systemd-container`.

Right now this dependency is recursively fulfilled by the `osbuild`
RPM. However, this might change if we switch to `bubblewrap` as a
sandbox. Furthermore, we should not fulfill our dependencies
recursively, but list them directly.
2020-07-17 07:42:27 -05:00
Ondřej Budai
2beb4e0a2b remove unneeded fedora 30 repositories
Fedora 30 support was dropped in e66368b0, this file has had no use since
then. This commit removes it.
2020-07-17 09:41:32 +02:00
Tom Gundersen
bca53a596c crypt: add automatic darwin support
Currently one would have to pass a `macos` flag explicitly to build on
OSX, but if we replace `macos` with `darwin` this happens automatically.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2020-07-17 07:48:22 +02:00
Ondřej Budai
813275b6c4 drop Travis CI
All tests were moved to schutzbot, there's no need to run them on Travis.
2020-07-16 12:45:54 -05:00
Ondřej Budai
693b4f0823 schutzbot: make image tests upload vhds to Azure
Support for uploading was already in, it's just needed to pass the right
environment variables.
2020-07-16 14:00:15 +02:00
Ondřej Budai
b4a57225a7 api/weldr: add missing modtime to tar returned by /compose/logs
This file was surely not created on 1970-01-01, this commit sets the ModTime
to the current datetime.
2020-07-15 08:58:25 +01:00
Ondřej Budai
454e471af8 api/weldr: bring tars back from the future
By default, go's tar archiver uses USTAR header format. Unfortunately, this
format doesn't support sub-second resolution for ModTime. Go solves this by
*rounding* the time. Sometimes, this creates an archive containing a file
with modtime from the future. When such archive is untarred by GNU tar,
the following message is produced:

tar: bf548dfd-0a90-40e6-bbf2-dcdd82fcbb4e.json: time stamp 2020-07-13
13:34:31 is 0.356223173 s in the future

We have two options here:

1) Use gnu header format that supports sub-second resolution. Unfortunately,
   it seems that not all tar archivers support this format (e.g. 7-zip).

2) The other option is to truncate the date (instead of rounding).

I went with option 2.

Also, this commit adds a test to check that the header is not from the future.
Without this fix, the test is actually failing, I verified this manually.

Fixes #854
2020-07-15 08:58:25 +01:00
Major Hayden
4b0409df5b Update Fedora 31/32 aarch test cases
Add Fedora 32 test cases with the base OS + updates (to work around
aarch64 bugs in the original release). Add updates for Fedora 31 for
consistency.

Fixes #861.

Signed-off-by: Major Hayden <major@redhat.com>
2020-07-15 09:46:06 +02:00
Major Hayden
dd65cdbe03 🖼 Add image tests for aarch64
Test image builds on aarch64 for Fedora 31/32 and RHEL 8 CDN.

More work towards finishing #834.

Signed-off-by: Major Hayden <major@redhat.com>
2020-07-15 09:46:06 +02:00
Major Hayden
f2775a39b4 🤦🏻‍♂️ Fix errors from pipeline restructuring
During the last PR that restructured the pipeline, some copy/paste
errors happened and RHEL8.3 lost some tests. Also, some of the log
directories for x86/aarch64 tests overlapped.

Signed-off-by: Major Hayden <major@redhat.com>
2020-07-15 09:46:06 +02:00
Major Hayden
45c159e7f8 🦾 Add aarch64 base tests; restructure stages
Add base aarch64 tests for Fedora 31/32 and RHEL 8 CDN.

Also restructure the pipeline so that a slow distro or slow architecture
won't hold up the faster-moving tests.

This helps a bit more with #834.

Signed-off-by: Major Hayden <major@redhat.com>
2020-07-14 14:25:40 +01:00
Lars Karlitski
bc1bca1538 generate-test-cases: stop and fail when osbuild fails 2020-07-13 22:17:33 +01:00
Lars Karlitski
c8a918cefa generate-test-cases: fix whitespace 2020-07-13 22:17:33 +01:00
Major Hayden
b01bd49241 🤷🏻‍♂️ Allow tests to run on AWS and PSI
In #842, we verified that our tests run on AWS properly and we should
now let Jenkins decide where to run the tests since they work in both
places.

Remove the hardcoded AWS label and allow tests to run where they please.

Signed-off-by: Major Hayden <major@redhat.com>
2020-07-13 15:23:03 -05:00
Major Hayden
c0fc2a7e79 🚫 Temporarily disable F32 iot_commit test
Bugs are being worked out in #798 and we can disable this test until
those bugs are fixed to avoid false failures in CI.

Signed-off-by: Major Hayden <major@redhat.com>
2020-07-13 19:54:13 +01:00
Major Hayden
43895f83ca Copy the mock template during mockbuild
Copying the file allows the mock build stage to be run again.

Signed-off-by: Major Hayden <major@redhat.com>
2020-07-13 11:19:07 -05:00
Major Hayden
41e255bc8c Make qemu integration tests more reliable
Set a static network configuration using cloud-init so that we don't
have to wait a long time for DHCP to work. Also, since we know the IP
and it is set earlier, this reduces the delay in testing on systems
without nested virt (like AWS).

Fixes #844.

Signed-off-by: Major Hayden <major@redhat.com>
2020-07-13 11:19:07 -05:00
Major Hayden
db5fb9908a Do RHN registration in deploy + mockbuild
Check to see if the instance is registered prior to attempting
registration. Also, ensure that registration happens during mock build
and during the deployment.

Signed-off-by: Major Hayden <major@redhat.com>
2020-07-13 11:19:07 -05:00
Major Hayden
785bdbae30 Allow base/integration tests to run in PSI + AWS
Make it easier to handle PSI outages or those times when PSI is
overloaded with jobs by allowing base and integration tests to
run on PSI OpenStack and AWS.

Signed-off-by: Major Hayden <major@redhat.com>
2020-07-13 11:19:07 -05:00
Christian Kellner
64652d1e3e travis: remove timeout for image test
Seems to not work anyway:

Timeout (30 minutes) reached. Terminating "sudo ./osbuild-image-tests -test.v test/cases/fedora_32-x86_64-vhd-boot.json"
/home/travis/.travis/functions: line 296: kill: (10660) - Operation not permitted
2020-07-13 11:31:06 +02:00
Christian Kellner
aa03f1617a image-info: read sector size, if available
Use the sector size reported by 'sfdisk', if available, otherwise
default to the standard value of '512' (as currently assumed).
2020-07-13 11:31:06 +02:00
Christian Kellner
5bca8bcacd image-info: support for peculiar partitions
Add support for partitions that can 'blkid' can not handle, like
the bios boot partition. For such partitions, 'blkid' will fail;
in that case all additional information will just be 'None'.
2020-07-13 11:31:06 +02:00
Christian Kellner
598c2b6939 image-info: always use raw images and loop devices
Convert any image that is not a raw image, e.g. a qcow2, to a raw
image and open the partitions via loop devices. This replaces the
usage of nbd, which was racy and flaky.
Instead on relying on the kernel for the partition parsing, this
is now done manually via loop devices and start + offset taken
from sfdisk. As a result the read_partition function has been
adapted to be called at later time, after the partitions were
opened via loop devices.

Not using nbd also means that the partition table is not scanned
by the kernel anymore and udev is not triggered. As a result the
'PARTUUID' property is not present for dos/mbr partition layouts,
since it is auto-generated by udev/blkid. Relevant blkid files
and functions are:
  blkid_partition_gen_uuid(par)
    called from probe_dos_pt()
    in file libblkid/src/partitions/dos.c line 295
    defined in libblkid/src/partitions/partitions.c line 1374
    which generates the uuid via snprintf using the format:
      '"%.33s-%02x", par->tab->id, par->partno'
Based on https://github.com/karelzak/util-linux at ce8985cc7

NB: the loop device code is imported from osbuild, making this
tool depend on osbuild's private library.

NB: As of the image conversion, more disk space is required to
examine non-raw images.
2020-07-13 11:31:06 +02:00
Christian Kellner
bd695c79d2 image-info: support for compressed images
If a compressed file is detected (xz, bzip2, gzip), uncompress it
before analyzing it. NB: this has to happen after the is_tarball
check, because a tarball would also count as compressed.
2020-07-13 11:31:06 +02:00
Christian Kellner
9c0fdd9981 image-info: ensure target is an absolute path
Specify the type for the 'target' command line argument to be an
absolute path. Also add a metavar description for the option.
2020-07-13 11:31:06 +02:00
Christian Kellner
ea9b1fa333 image-info: extract fstab reading code
Extract the code that reads /etc/fstab into its own method and
remove the redundant `f.read().split("#")`.
2020-07-13 11:31:06 +02:00
Christian Kellner
68296aac88 image-info: use contextlib.suppress for ENOENT
Instead of using try-except blocks to catch (and ignore) file-not-
found errors (FileNotFoundError/ENOENT), use contextlib.suppress.
2020-07-13 11:31:06 +02:00
Christian Kellner
113631b7c4 image-info: refactor append_partitions
Directly iterate over the partition list entries instead if using
indices. Optimize visual flow for the happy case by immediately
continuing if a partition has no file-system.
2020-07-13 11:31:06 +02:00
Christian Kellner
9a068d918f image-info: extract partition reporting code
Extract the code that reports the content of individual partitions
into its own function to make it overall more readable.
2020-07-13 11:31:06 +02:00
Christian Kellner
07a6be5a2f image-info: return dict from read_partition_table
Instead of return three a triplet of information, directly return
a dictionary, where the name for the keys are the names that are
used in the report.
2020-07-13 11:31:06 +02:00
Christian Kellner
cbc9ed0f11 image-info: remove unused arg in read_partition
Remove the unused 'type' argument.
2020-07-13 11:31:06 +02:00
Christian Kellner
b7a43b5812 image-info: read format info before image opening
Read the image information before opening the image. This prepares
for a change where we will use information about the image to
convert it to raw instead of using nbd.
2020-07-13 11:31:06 +02:00
Christian Kellner
44f0ba368f test: set PYTHONPATH for image-info on travis
Create a GetImageInfoCommand analogous to GetOsbuildCommand that
will adjust the PYTHONPATH for image-info on travis so that the
osbuild python module is accessible.
2020-07-13 11:31:06 +02:00
Major Hayden
84022a7889 dnf-json: flake8 cleanup
Signed-off-by: Major Hayden <major@redhat.com>
2020-07-10 12:20:02 -05:00
Major Hayden
acf91a4e54 🏃 Enable fastestmirror in dnf-json
The time it takes to depsolve a blueprint varies widely depending on
where the job is running and which mirrors are randomly chosen based on
the data returned in the metalink XML.

Use dnf's fastestmirror plugin to choose the fastest mirror for
downloading metadata. This returns consistent results in PSI + AWS and
every depsolve completed in under 60 seconds after 25 tests in each
cloud.

Fixes #845.

Signed-off-by: Major Hayden <major@redhat.com>
2020-07-10 12:20:02 -05:00
Ondřej Budai
d02e77de06 Revert "tests/image: run the tests in parallel (somewhat)"
Running tests in parallel is not stable under all conditions, this commit
removes it to make the tests more reliable.

This reverts commit e890e03d
2020-07-09 22:32:03 +02:00
Major Hayden
7403c5b368 🔎 Dynamically choose image test list
List the image tests that match the distro, distro version, and
architecture before running image tests. That ensures we run all of the
tests that are appropriate for the distro/version/arch combination.

Tests can be added or removed without changing the `run_image_tests.sh`
script.

Fixes #840.

Signed-off-by: Major Hayden <major@redhat.com>
2020-07-09 22:27:45 +02:00
Major Hayden
d8d1db50cd 🔨 Add aarch64 mock builds
Build osbuild/osbuild-composer packages on AWS using aarch64 instances.

Signed-off-by: Major Hayden <major@redhat.com>
2020-07-09 12:02:43 -05:00
Major Hayden
1492470d56 🤹🏻‍♂️ Prepare for multi-arch support
As we embark on a CI journey to other architectures, we need to be
explicit about choosing the right architecture for each CI node.

This is a portion of the work required for #834.

Signed-off-by: Major Hayden <major@redhat.com>
2020-07-09 09:37:23 -05:00
Major Hayden
ef0826599d Fix valk > talk typo 2020-07-09 08:53:23 -05:00
Major Hayden
3113ba02d8 Install awscli version 2 for AWS tests
Signed-off-by: Major Hayden <major@redhat.com>
2020-07-09 08:53:23 -05:00
Major Hayden
030adbd18c Use staging CDN for RHEL 8.3 beta content
The RHEL 8.3 beta content is not on the main cdn.redhat.com yet.

Signed-off-by: Major Hayden <major@redhat.com>
2020-07-09 08:53:23 -05:00
Major Hayden
0ce53cf479 Allow RHEL 8.3 failures to fail pipeline
Now that RHEL 8.3 pulls from the beta CDN, let's stop hiding the errors
and allow them to make the pipeline fail.

Signed-off-by: Major Hayden <major@redhat.com>
2020-07-09 08:53:23 -05:00
Major Hayden
dac085d035 🛃 Ensure the correct packages are installed
Some dnf bugs existed in early releases of Fedora 31 + 32 around
repository priorities being ignored (like BZ 1733582. Ensure that we are
running the latest version of dnf before we try to install from the mock
build repo (which has a much higher priority than Fedora's default
repos).

Also, check to see if EPEL is installed already before installing it
again.

Fixes #824. 🥰

Signed-off-by: Major Hayden <major@redhat.com>
2020-07-09 08:53:23 -05:00
Major Hayden
e88b9c4bd7 🛑 Stop using internal repositories
Remove the F31/F32 internal repositories since they are causing dnf
download errors from time to time.

The 8.2 repository override should have never been there in the first
place since we're using the CDN.

The 8.3 repository is no longer needed since we can register the RHEL
8.3 instances against the staging CDN and get beta content from there.

Fixes #822.

Signed-off-by: Major Hayden <major@redhat.com>
2020-07-09 08:53:23 -05:00