Commit graph

3319 commits

Author SHA1 Message Date
Tomas Hozza
8e6826e743 Move OSBuildMetadataToRPMs and PackageMetadataToSignature to osbuild2
Move `OSBuildMetadataToRPMs()` and `PackageMetadataToSignature()`
functions from the `rpmmd` package to `osbuild2` package to prevent
import cycles while de-duplicating `rpmStageInputs()` function from
`stage_inputs.go` of distro definitions.

Rename `PackageMetadataToSignature()` to
`RPMPackageMetadataToSignature()`, since it takes specifically
`RPMPackageMetadata` type as an argument.

Adjust affected parts of code (unit tests, cloudapi, worker).

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2022-02-18 09:26:35 +01:00
Tomas Hozza
0bd0f57231 Move qemuStageInputs() from distros to osbuild2
Move the `qemuStageInputs()` function duplicated in most
distro definitions to the `osbuild2` package as
`NewQemuStagePipelineFilesInputs()`.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2022-02-18 09:26:35 +01:00
Tomas Hozza
71ae94b40f Move xorrisofsStageInputs() from distros to osbuild2
Move the `xorrisofsStageInputs()` function duplicated in all
distro definitions to the `osbuild2` package as
`NewXorrisofsStagePipelineTreeInputs()`.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2022-02-18 09:26:35 +01:00
Tomas Hozza
c9b72033ee Move copyPipelineTreeInputs() from distros to osbuild2
Move the `copyPipelineTreeInputs()` function duplicated in many
distro definitions to the `osbuild2` package as
`NewCopyStagePipelineTreeInputs()`.

This will prevent creating another copy of the code in rhel-84 for
the `gce` image.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2022-02-18 09:26:35 +01:00
Tomas Hozza
0efbe0c55e RHEL-90 beta: remove duplicate import in pipelines.go
Signed-off-by: Tomas Hozza <thozza@redhat.com>
2022-02-18 09:26:35 +01:00
Tomas Hozza
8713b8002a Move kernelVerStr() from distros to rpmmd
Move the `kernelVerStr()` function duplicated in many
distro definitions to the `rpmmd` package as
`GetVerStrFromPackageSpecListPanic()`.

I could not come up with a better name, sorry.

This will prevent creating another copy of the code in rhel-84 for
the `gce` image.

This change initially exposed a bug in the original implementation of
`kernelVerStr()`. Since on the first line, we allocate an empty structure
into `kernelPkg` variable, it can never be `nil` and the function never
panicked even if there was no `kernel` package in the PackageSpec list.

Fix all unit tests to provide valid arguments when calling `Manifest()`
method of image types.

Signed-off-by: Tomas Hozza <thozza@redhat.com>

kernelVerStr fixup

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2022-02-18 09:26:35 +01:00
Tomas Hozza
a392d71da6 Move kernelCmdlineStageOptions() from distros to osbuild2
Move the `kernelCmdlineStageOptions()` function duplicated in many
distro definitions to the `osbuild2` package as
`NewKernelCmdlineStageOptions()`.

This will prevent creating another copy of the code in rhel-84 for the
`gce` image.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2022-02-18 09:26:35 +01:00
Jakub Rusz
43bfcc5389 tests/upgrade: gather more logs
Also disable firwalld AllowZoneDrifting because it's not supported in
RHEL-9.
2022-02-18 09:25:01 +01:00
Ondřej Budai
5d304d2957 packer: make the worker image smaller
This should save us some money. 10 GB is the size of the underlying
RHEL 8.5 AMI so this should be the minimum.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2022-02-18 09:24:07 +01:00
Jakub Rusz
8331af3ffd ci/nightly: report composer NVR in slack
Storing composer NVR in a file after it's installed and reporting on
Slack. Also reducing duplications of artifacts in .gitlab-ci.yml
2022-02-17 11:14:31 +01:00
Ondřej Budai
9c80a17ee5 fsjobqueue: refactor to allow dequeuing by multiple criteria
Previous implementation of fsjobqueue is amazing but it has its drawbacks:
- dequeueing can be done only based on a job type
- it's limited to 100 jobs per a job type

As we soon want to be able to dequeue also by another criteria (job channel),
we need to refactor the queue.

The new implementation is more naive but also more flexible. It basically
works like the dbjobqueue - dequeueing goroutines listen for newly added
jobs. When that happens, a signal is sent to all of them and they all inspect
all pending jobs and dequeue ones that match their needs. Ones that don't find
a suitable job, are waiting for the next signal.

This is certainly slower implementation as every time a new job is added into
the queue, all dequeueing goroutines will have to iterate over all
pending jobs. I think that's fine because fsjobqueue is not recommended
to use for composer instances with heavy load.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2022-02-16 17:14:36 +01:00
Ondřej Budai
b34571c1ec github: fetch more PRs when triggering gitlab
By default, the API will fetch only 30 open PRs. This is enough currently
as we have 35 open ones. Bump the limit to the maximum. 100 should be enough
for some time. 🤞

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2022-02-16 11:01:43 +01:00
Xiaofeng Wang
0bfc6cb4dd CI: Run ostree.sh on large RHEL 8.6 VM to have more memory
Fix "qemu-kvm: cannot set up guest memory 'pc.ram': Cannot allocate
memory" error
2022-02-16 10:49:55 +01:00
Xiaofeng Wang
b378fee2e5 test: conditional greenboot package checks in ansible playbooks
Co-Authored-By: Achilleas Koutsou <achilleas@koutsou.net>
2022-02-16 10:49:55 +01:00
Achilleas Koutsou
1b0b54f853 test: regenerate RHEL 8.6 and 9.0 manifests
Repositories were update for the two distros so we've regenerated all
the manifests.
2022-02-16 10:49:55 +01:00
Jakub Rusz
14ee64321b Schutzfile: update rhel-9 rpmrepo snapshot 2022-02-16 10:49:55 +01:00
Achilleas Koutsou
59dcab700e distro/rhel86: conditional greenboot packages for centos
CS8 and RHEL 8.6 share package sets but the greenboot package names were
only changed in RHEL 8.6.
2022-02-16 10:49:55 +01:00
Achilleas Koutsou
e0822bff44 repos: update repos for test case generators
test/data/repositories:
    new snapshots for RHEL 8.6 (20220201) and 9.0 (20220208)

Switching RHEL 8.6 and RHEL 9.0 to the latest rpmrepo snapshots:
    We need updated packages for greenboot, used by edge image types, so
    we technically only need to change the architectures that are
    supported by edge, but let's update all of them for consistency.

test/data/repositories:
    Remove rhel-90 symlink to beta

Keep the rhel-90-beta.json repository definitions, but make rhel-90.json
a file that contains the previously named rhel-90-ga.json definitions.
2022-02-16 10:49:55 +01:00
Peter Robinson
35b5b2b042 Update greenboot packaging names
In the greenboot 0.13 release we updated packaging due to the increase
in new tests and it not making sense to have packaging so granular.

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
2022-02-16 10:49:55 +01:00
Ondřej Budai
11893485cd github: split checks into 3 jobs
To speed it up a bit.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2022-02-16 10:00:25 +01:00
Sanne Raymaekers
d492e8f702 cmd/osbuild-service-maintenance: GCP deletes by image name 2022-02-15 18:22:39 +01:00
Tomas Hozza
1273ef7b35 Regenerate all image test cases with the enhanced image-info
Signed-off-by: Tomas Hozza <thozza@redhat.com>
2022-02-15 15:56:56 +01:00
Tomas Hozza
2182996aae tools/image-info: extend the gathered information
Extend the information gathered by `image-info`. This is needed to
properly inspect GCE images.

Enhancements:
 - read all ssh client configuration files
 - read all sshd configuration files
 - read all YUM / DNF repos
 - read DNF Automatic configuration
 - fix reading of DNF configuration

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2022-02-15 15:56:56 +01:00
Brian C. Lane
9f29f8eb25 store: Filter out blank blueprint name
Filter out listing blueprints with no name. This prevents old state.json
data from continuing to cause problems with the UI.

Resolves: rhbz#1922845
2022-02-15 10:10:21 +01:00
Brian C. Lane
a186fd4705 weldr: Check for missing undo blueprint
When the server is restarted the blueprint changes, which are only held
in memory, are lost. This checks for missing changes and returns an
error.

The test is also adjusted for the new error.

Related: rhbz#1922845
2022-02-15 10:10:21 +01:00
Brian C. Lane
aa8cf41ac2 blueprint: Make sure name is not empty
The blueprint name should never be empty, as it can cause other problems
like with the blueprints list results. Return an error if one is pushed
to the store, either as a blueprint commit or as a blueprint workspace.

Also adjusts the new test for the new error.

Related: rhbz#1922845
2022-02-15 10:10:21 +01:00
Brian C. Lane
a3b415d1df test: Add fixture support for blueprint changes
There is a problem with blueprint changes, once the server is restarted
the previous changes are all lost because they are not serialized to
disk.

This adds test fixture support so that new tests can be added before
fixing the problem. It adds store.FixtureOldChanges with blueprints
changes and empty blueprints.

Related: rhbz#1922845
2022-02-15 10:10:21 +01:00
Achilleas Koutsou
346486cd3f cloudapi: test repository config conversion function 2022-02-14 17:38:41 +01:00
Achilleas Koutsou
679028bb8e cloudapi: copy all Repository fields to RepoConfig 2022-02-14 17:38:41 +01:00
Achilleas Koutsou
2d0755b924 cloudapi: test new repository collection function 2022-02-14 17:38:41 +01:00
Achilleas Koutsou
3320f2c57d cloudapi: separate repositories based on package_sets
- Any repository without package_sets is added to the general `Repos`
  field of the DepsolveJob, just like before.
- Repositories with package_sets are added to the `PackageSetsRepos`
  map, indexed by the package set names.
- Repositories defined in the customizations as `PayloadRepositories`
  are considered to be associated only with the `PayloadPackageSets`
  names from the image type and are added to the `PackageSetsRepos`
  under the payload sets.

The repository collection and conversion of repository structs (from
Repository to RepoConfig) has been moved to a separate function.
2022-02-14 17:38:41 +01:00
Achilleas Koutsou
2dde6d7e33 cloudapi: add tags to repositories in image request
Tags is an array of strings that associates repositories with package
sets.  A repository tagged with a package set name will be used only for
the named package sets.
2022-02-14 17:38:41 +01:00
Achilleas Koutsou
82eedf5b82 DepsolveJob: rename struct field for consistency
We have two fields, `Repos` and `PackageSets`.  Renaming
`PackageSetsRepositories` to `PackageSetsRepos` for consistency.
The struct is for internal use only so the rename has no impact as long
as the serialised name is the same (json tag).

Also it's shorter.

Added docstring to the struct that explains the arguments in the same
way as they are described for the `depsolve()` function.

Changing the name of the argument in the internal `depsolve()` function
for the same reasons.
2022-02-14 17:38:41 +01:00
Achilleas Koutsou
70f83775b2 osbuild-worker: small changes to internal function
Change order of arguments for depsolve function:
Put the two similar arguments (repos and packageSetsRepositories) next
to each other since they serve similar purposes.

Add docstring for depsolve function:
It is useful to clarify how the arguments are used even if it's an
unexported function.
2022-02-14 17:38:41 +01:00
Achilleas Koutsou
0e5bb66516 cloudapi: small comment for readability
Comment the code that reads the user-defined repositories to explaine
what's happening.
2022-02-14 17:38:41 +01:00
Tomas Hozza
ece6452e2a Use the latest RPMRepo snapshot for RHEL-9.0 image tests
This is needed to satisfy RPM dependencies of GCP guest tools, which
will be installed on the `gce` image type.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2022-02-14 12:39:12 +01:00
Jakub Rusz
f4b5c0956d tests: update IDs in Openstack image boot test
Update flavor and network ID for booting Openstack images in rhos-01
cloud.
2022-02-14 12:13:18 +02:00
Christian Kellner
b18b4e80a0 distro/{rhel86,rhel90}: specify a remote for deployments
When deploying an ostree commit, specify a remote, currently hard-
coded to `rhel-edge`, so that updates work automatically, if they
are served from the same location as the initial commit is pulled
from.

NB: now that the remote is specified in the raw image, remove the
corresponding bits form the tests.

Signed-off-by: Antonio Murdaca <runcom@linux.com>
2022-02-11 12:30:44 +01:00
Christian Kellner
4b84a3c70f osbuild2: add 'remote' option for ostree.pull
Add support for the `remote` option of the `ostree.pull` stage.
This can be used to tie a commit to a remote while pulling the
commit.
2022-02-11 12:30:44 +01:00
Christian Kellner
bebf046f84 osbuild2: add 'remote' option for ostree.deploy
Add support for the `remote` option of the `ostree.deploy` stage.
This can be used to deploy a commit that is tied to a remote.
2022-02-11 12:30:44 +01:00
lavocatt
984e58ede4 Post release version bump
[skip ci]
2022-02-11 09:12:23 +00:00
Ondřej Budai
5e639cba6f github: adapt the github trigger to work the same way as in osbuild
I basically just copied
7c9944ee18/.github/workflows/trigger-gitlab.yml

and:
- changed osbuild to osbuild-composer
- add a SKIP_CI mechanism

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2022-02-10 16:16:30 +01:00
Diaa Sami
c1ae5b0881 Relax TCP timeouts for koji connections
See COMPOSER-1354 and linked tickets
2022-02-10 14:58:10 +01:00
Ondřej Budai
631bd21ffe cloudapi/v2: add support for aws-*-rhui image types
For the brew use-case, we also need to build AWS images containing RHUI. This
commit is thus adding them.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2022-02-10 11:26:50 +00:00
Roy Golan
439699fcec Add oracle-oci.md under image-types/rhel8 2022-02-10 10:58:46 +01:00
Sanne Raymaekers
b3796a7319 tools/appsre-ansible: Explicitly specific mock config 2022-02-09 18:33:14 +01:00
Sanne Raymaekers
a173a3513d tools/appsre-build-worker-packer: Run on subscribed 8.5 machine 2022-02-09 16:54:22 +01:00
Juan Abia
3699c52b59 test: update govc env variables documentation
govc cli no longer uses GOVMOMI_* enviroment variables. As the govc
documentation indicates, this variables should be GOVC_*.

https://github.com/vmware/govmomi/blob/master/govc/README.md#usage

[skip-ci]
2022-02-09 16:00:37 +01:00
Tomas Hozza
f43d9f4744 Add missing F34 and F35 image test cases
Add F34 and F35 image test cases for all remaining image types, which
were previously not tested. With this PR, image test cases are now
generated for all image types on all architectures as supported by the
Fedora distro definition.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2022-02-09 15:29:33 +01:00
Gianluca Zuccarelli
e8d7519c7d templates/dashboard: worker metric queries
The prometheus queries have been updated with
the correct namepsace for the job metrics
Additionally, this commit fixes some of the
queries to add fallback values when the
query results are returned empty.
2022-02-09 14:09:50 +01:00