Commit graph

1361 commits

Author SHA1 Message Date
Tom Gundersen
5803abfeee osbuild/result: parse the metadata from the rpm stage
osbuild support returning metadata about each of the stages/assembler
runs. Parse the results from the rpm stage, which contains the header
fields from the installed RPMs, in particular the MD5 sum of the RPMs in
question. This information is needed to be passed as metadata to koji
when uploading images.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2020-08-26 12:12:37 +02:00
Tom Gundersen
ac5f69e757 osbuild: move result serialization from common
In the same way `osbuild.Manifest` is the input to the osbuild API,
`osbuild.Result` is the output. Move it to the `osbuild` package where
it belongs.

This is not a functional change.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2020-08-26 12:12:37 +02:00
Ondřej Budai
360bf2aa04 rerun prepare-source after a bad merge
#932 bumped the minimal Go version to 1.13. Prepare-source script had to be
rerun because of some changes in vendoring.

Unfortunately, while this PR was waiting to merged, #797 also touching
vendoring was merged. This "commit race condition" led to a failing check
on master branch because of bad vendoring.

This commit reruns the prepare-source script to fix the vendoring once again.
2020-08-25 11:16:12 +02:00
Ondřej Budai
b525cee26e ci: bump golangci-lint version 2020-08-25 10:42:54 +02:00
Ondřej Budai
d3f98a4b40 prepare sources for Go 1.13
Vendoring differs a bit betweem Go 1.12 and 1.13. This commit is a rerun of
tools/prepare-source.sh for Go 1.13
2020-08-25 10:42:21 +02:00
Ondřej Budai
5e6e77b565 bump minimal Go version to 1.13
All our downstream platforms now support Go 1.13:

RHEL 8.2: golang-1.13.4
Fedora 31: golang-1.13.14

There's no reason anymore to stay on 1.12, therefore this commit bumps
the minimal required Go version to 1.13
2020-08-25 10:42:21 +02:00
Ondřej Budai
8d1c187f3c upload/azure: delete the unused test
This test is not run anywhere because it was surpassed by image tests with
azure boot type which perform more than just uploading a randomly generated
file to Azure. Let's delete dead code.
2020-08-25 10:41:10 +02:00
Ondřej Budai
c711b9149e remove travis mentions in codebase
Travis is no longer used, let's ditch these.
2020-08-25 10:41:10 +02:00
Ondřej Budai
e399c05cb4 tests/image: remove travis constants
The tests are no longer run on Travis, therefore we don't need the special
setup to run them there.

This change should also fix #929 that is probably caused due to osbuild
executed in a weird way.

Fixes #929
2020-08-25 10:41:10 +02:00
Major Hayden
70c32ef7c5 awsupload: Add comments for Register()
Please the golang linter by adding a small comment for the Register
function.

Signed-off-by: Major Hayden <major@redhat.com>
2020-08-24 12:57:37 -05:00
Major Hayden
02306c978e awsupload: Better emoji for snapshot wait
The clock emoji isn't as well supported as the 🚚.

Signed-off-by: Major Hayden <major@redhat.com>
2020-08-24 12:57:37 -05:00
Major Hayden
6659ab58ad awsupload: Apply tags to imported snapshot
Applying a `Name` tag to the snapshot makes the name of the image appear
in the snapshot listing in EC2's console. It also makes it easier to
remove a snapshot after deregistering the AMI.

Signed-off-by: Major Hayden <major@redhat.com>
2020-08-24 12:57:37 -05:00
Major Hayden
fc7f6349eb awsupload: Add description to snapshots
Make it easier to tell which snapshot goes with each AMI by labeling
them with a description.

Signed-off-by: Major Hayden <major@redhat.com>
2020-08-24 12:57:37 -05:00
Major Hayden
1dbc271506 Add Install section to remote worker unit file
Although the obuild-remote-worker@.service unit can be started, it can't
be enabled at boot time since the `Install` section is missing in the
unit file.

Add a small `[Install]` section with the same `WantedBy` as
osbuild-composr.service.

Fixes #924.

Signed-off-by: Major Hayden <major@redhat.com>
2020-08-24 12:56:45 -05:00
Major Hayden
01c8daabf7 ⏱ Extend golangci-lint timeout to 5m0s
For reasons unknown, golangci-lint's default 1m0s timeout is *slightly*
too short for CI runs occasionally. Extend it to 5 minutes to ensure the
job always has enough time to run.

Signed-off-by: Major Hayden <major@redhat.com>
2020-08-24 12:21:38 -05:00
Tom Gundersen
b7fb52dc7d 20
Release osbuild-composer version 20.
2020-08-23 16:44:07 +02:00
Lars Karlitski
b5bd00d739 dnf-json: don't initialize dnf plugins
acf91a4 enabled fastestmirror but also calls `base.init_plugins()` to
initialize dnf plugins. This is not necessary and not what we want
conceptually.

Not necessary, because `fastestmirror` is a dnf built-in (it was a
plugin during yum-times [1]). The same patch sets the `fastestmirror`
option as well. Thus, this patch does not revert functionality.

Not what we want, because we're using dnf more as a library, explicitly
passing all options. Plugins depend on additional host configuration,
which we'd like to avoid pulling in. In particular, the
subscription-manager plugin tries reading certificates in `/etc/pki`,
which are not readable by the `osbuild-composer` user. This leads to
these errors in the journal:

    [ERROR] dnf-json:54297:MainThread @logutil.py:194 -
      [Errno 13] Permission denied: '/var/log/rhsm/rhsm.log' -
      Further logging output will be written to stderr
    [ERROR] dnf-json:54297:MainThread @identity.py:156 -
      Reload of consumer identity cert /etc/pki/consumer/cert.pem
      raised an exception with msg:
      [Errno 13] Permission denied: '/etc/pki/consumer/key.pem'

These errors are not fatal, but could confuse people when inspecting
logs to find unrelated problems. This patch makes them disappear.

[1] https://fedoraproject.org/wiki/Yum_to_DNF_Cheatsheet
2020-08-23 16:08:25 +02:00
Tom Gundersen
496f921eff schutzbot: don't boot-test vmdk images in libvirt
The vmdk images are meant to be imported into VMWare vCenter, not to be
booted directly.

Our image-info tests verifies that this work, they should be converted
into integration tests similar to the aws.sh script in the future.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2020-08-23 14:45:27 +02:00
Tom Gundersen
b0cd29f78b worker: support returning returning images as StreamOptimized
vCenter requires images to be uploaded as vmdk StreamOptimized. Lorax
always produced images on this format, so we should make sure to do the
same for our VMWare images.

Allow LocalTarget to request the images produced by osbuild be converted
to be streamOptimized before saving in composer, and hook the weldr API
up to enable this option for vmdk images.

Ideally this should simply be an option in osbuild, but that would
require some more work, which we will not manage in time for RHEL8.3.
Therefore do this minimal fix.

Note that that means the images produced by our manifests (including in
our image-test test cases) are not on the format that the weldr API
returns, so the tests we run on them would also, for now, need to
convert before uploading to vCenter.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2020-08-23 14:45:27 +02:00
Alexander Todorov
bdea79613c Return a string from runWithStdout() instead of []byte
and trim invisble newlines b/c they were messing up with ssh
2020-08-20 21:59:54 +02:00
Tom Gundersen
f3cba8ecfc vmwaretest: avoid using the cli
This is not shipped in RHEL, so use the library directly to query the IP
address. This is a massive hack, but let us revisit this after the next
release.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2020-08-20 21:59:54 +02:00
Alexander Todorov
5a395cda38 tests: manually convert to streamOptimized vmdk 2020-08-20 21:59:54 +02:00
Alexander Todorov
dcee05d8b6 Read vCenter credentials for Schutzbot & document them 2020-08-20 21:59:54 +02:00
Alexander Todorov
9cce43d384 tests: upload & test in vCenter. Closes #338 2020-08-20 21:59:54 +02:00
Alexander Todorov
02346faff8 Use /var/tmp for temporary files for image-info 2020-08-20 21:59:54 +02:00
Tom Gundersen
dc5434d627 schutzbot/deploy: do not override repos when deploying on 8.2
We will automatically detect whether to use GA or Beta content, so we
can drop the override as 8.2 is GA so will get GA content.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2020-08-19 15:06:21 +02:00
Tom Gundersen
cc677dea3c repositories: distinguish between RHEL8 beta and GA
We need the same RPMs to work equally well on a host running a beta
release (pulling beta content) as on a machine running GA (pulling GA
content). Detect this at run-time and point at the right repository.

Testing this is a bit hairy as we are building 8.3 images, but obviously
there is currently no 8.3 content at the GA URLs.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2020-08-19 15:06:21 +02:00
Tom Gundersen
a2f8a06e79 weldr/upload: don't expose AWS/Azure acconut details
Change the translation from our internal structs to the structs used for
weldr serialization to drop account details. These must obviously be
passed in to configure an upload, but exposing them in the logs may be
surprising.

There is no notion of user accounts in the weldr API, and the state
should not be considered private. However, this is likely to take people
by surprise, so let us guard the secrets entrusted to us.

Fixes #907.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2020-08-18 08:55:57 +02:00
Major Hayden
5d7aa2f699 Add friendly message for logs on running build
Improve the message returned by osbuild-composer when a user asks for
logs of a compose that is still running.

Signed-off-by: Major Hayden <major@redhat.com>
2020-08-17 09:10:50 +02:00
Major Hayden
20e64fa519 🐣 Bump osbuild to v20
Move the osbuild submodule to v20 to get that fresh new code. 🍞

Signed-off-by: Major Hayden <major@redhat.com>
2020-08-14 02:43:58 +02:00
Brian C. Lane
5471bd7f30 store: Add newImageBuildFromV0 test 2020-08-13 17:47:57 +02:00
Brian C. Lane
02ef8a7174 store: Add newComposesV0 and newComposesFromV0 tests 2020-08-13 17:47:57 +02:00
Brian C. Lane
428d1f9478 store: Add newComposeV0 and newComposeFromV0 tests 2020-08-13 17:47:57 +02:00
Tom Gundersen
06c8461684 19
Release osbuild-composer 19.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2020-08-10 21:46:25 +02:00
Jenn Giardino
1e57cbdad6 Add diagrams for other API layers (cloud and koji)
Also makes one minor formatting change to the original diagram
2020-08-10 19:47:39 +02:00
Jenn Giardino
bf10ed0fd1 readme: Update API diagram 2020-08-08 00:25:06 +02:00
Alexander Todorov
adc384002d Document which ENV variables are needed for testing in OpenStack 2020-08-07 19:58:37 +02:00
Alexander Todorov
b136332c7f Provide OpenStack environment for image tests
in the same way this is done for Azure we read the OS credentials
and provide them as ENV variables for the test

Note: uses `psi-openstack-creds` and not `psi-openstack-clouds-yaml`
which is a yaml file.
2020-08-07 19:58:37 +02:00
Alexander Todorov
0469be7a22 tests: Change boot typo to openstack. Refs #876
this will cause the images to be uploaded and booted in our
OpenStack cluster.
2020-08-07 19:58:37 +02:00
Brian C. Lane
55136323c5 store: Add newSourceConfigsFromV0 and newSourcesV0 tests 2020-08-06 15:25:02 +02:00
Brian C. Lane
542dfc4ec2 store: Add newChangesFromV0 and newChangesV0 tests 2020-08-06 15:25:02 +02:00
Brian C. Lane
79b84fe52f store: Add newWorkspaceFromV0 and newWorkspaceV0 tests 2020-08-06 15:25:02 +02:00
Brian C. Lane
f0e2f01421 store: Add newBlueprintsFromV0 and newVlueprintsV0 tests 2020-08-06 15:25:02 +02:00
Brian C. Lane
45f3901a6a store: Add newCommitsV0 tests 2020-08-06 15:25:02 +02:00
Major Hayden
a93143ea0c mockbuild: Fix path to latest repo
Using `cp` to copy the repo content caused the last part of the path to
be duplicated:

  Current: `master/latest/rhel82_x86_64/rhel82_x86_64/repodata/repomd.xml`
  Desired: `master/latest/rhel82_x86_64/repodata/repomd.xml`

Remove the VERSION_ID/ARCH from the destination to remove the duplicated
path.

Signed-off-by: Major Hayden <major@redhat.com>
2020-08-06 00:15:38 +02:00
Brian C. Lane
be2ce10b75 weldr: Fix out of range index for missing toml blueprint freeze
The API was crashing if the freeze request was called on a non-existent
blueprint. This changes it to return an empty string, matching
lorax-composer's behavior (since the output is toml it shouldn't return
json).
2020-08-05 11:43:35 +02:00
Martin Sehnoutka
55c86afaa6 test cases: fix f32 iot commit inputhash
The inputhash represents pipeline id, which is calculated from the
pipeline dictionary defined in the test case. The definition has been
modified without correction of the inputhash (because we did not run it
in our CI :-) ).

This patch fixed the inputhash to reflect the changes in the pipeline.
2020-08-03 17:46:49 +02:00
Martin Sehnoutka
b6e1e8b4ce schutzbot: don't skip image test for fedora iot commit
The SELinux bug has been fixed so there is no need to skip it.
2020-08-03 17:46:49 +02:00
Brian C. Lane
ec19003b70 store: Fix copy failure when initializing blueprints commit list
copy() will not append to a slice, so if the length is 0 nothing will be
copied. Initialize the slice with the length instead of the capacity.

This fixes a problem with blueprint commits vanishing when the server is
restarted.

This commit also includes a new test in json_test for the
newCommitsFromV0() function.
2020-08-02 11:21:20 +01:00
Major Hayden
093117559e 🦘 Skip checkout on prepare
Checking out the code from git during the prepare step is a waste of
time and disk space since we don't need the git repository cloned there.

Signed-off-by: Major Hayden <major@redhat.com>
2020-08-02 11:17:11 +01:00