Commit graph

3899 commits

Author SHA1 Message Date
Achilleas Koutsou
55a2e8ddac disk: add function for resizing Entities based on dirs
New function that ensures that a partition can hold the total sum of all
the required sizes of specific directories on the partition.  The
function sums the required directory sizes grouped by their mountpoint
and then resizes the entity path of that Mountable.
2022-04-27 13:49:19 +02:00
Achilleas Koutsou
ce5a28c113 disk: add function for finding entity path for a dir
New function that returns the Entity path for the Mountpoint that
contains a given directory path.
2022-04-27 13:49:19 +02:00
Achilleas Koutsou
75a0a74064 disk: add docstring for resizeEntityBranch()
resizeEntityBranch() is a private function, but it's not immediately
clear how it works so a docstring is useful for internal development.
2022-04-27 13:49:19 +02:00
Achilleas Koutsou
f4d40e3973 Schutzfile: pin osbuild for new inputs schema
Pinning osbuild to 99abc1373d5c6a85eb1a6ca6eaade0ee3c27ec18 which adds
support for the new array-of-objects inputs schema.
2022-04-27 11:51:25 +02:00
Achilleas Koutsou
2b2181867f osbuild2: use source-array-ref for rpm stage inputs
The (new) source-array-ref object is an array of objects, which allows
for input references to have options (metadata) but still maintain their
order when (de)serialised.

Fixes https://github.com/osbuild/osbuild-composer/issues/2577
Related to https://github.com/osbuild/osbuild/pull/1003
2022-04-27 11:51:25 +02:00
Achilleas Koutsou
26a83262a8 osbuild2: new references format for rpm stage inputs 2022-04-27 11:51:25 +02:00
Achilleas Koutsou
b277d88d93 osbuild2: rename RPMStageReferenes to RPMStageSourceOptions
Matches the equivalent object reference in the osbuild schema:
org.osbuild.files/definitions/source-options
2022-04-27 11:51:25 +02:00
Achilleas Koutsou
0a695b21a1 osbuild2: add some docstrings for rpm input types
A few simple docstrings for the RPM input structs.
2022-04-27 11:51:25 +02:00
Sanne Raymaekers
e258947a58 cloudapi/v2: Fix generated GCP name
The generated gcp name had an invalid `.tar.gz` extension. This
extension still needs to be supplied for the object name however.

The integration tests supply the image name rather than relying in the
generated one, which is why this slipped through.
2022-04-26 13:58:54 +02:00
dependabot[bot]
0eff6c3de7 build(deps): bump google.golang.org/api from 0.74.0 to 0.75.0
Bumps [google.golang.org/api](https://github.com/googleapis/google-api-go-client) from 0.74.0 to 0.75.0.
- [Release notes](https://github.com/googleapis/google-api-go-client/releases)
- [Changelog](https://github.com/googleapis/google-api-go-client/blob/main/CHANGES.md)
- [Commits](https://github.com/googleapis/google-api-go-client/compare/v0.74.0...v0.75.0)

---
updated-dependencies:
- dependency-name: google.golang.org/api
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-25 15:05:03 +02:00
dependabot[bot]
a4434666d1 build(deps): bump github.com/hashicorp/go-retryablehttp
Bumps [github.com/hashicorp/go-retryablehttp](https://github.com/hashicorp/go-retryablehttp) from 0.7.0 to 0.7.1.
- [Release notes](https://github.com/hashicorp/go-retryablehttp/releases)
- [Commits](https://github.com/hashicorp/go-retryablehttp/compare/v0.7.0...v0.7.1)

---
updated-dependencies:
- dependency-name: github.com/hashicorp/go-retryablehttp
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-25 12:06:02 +02:00
dependabot[bot]
ed96faf9e0 build(deps): bump cloud.google.com/go/cloudbuild from 1.0.0 to 1.2.0
Bumps [cloud.google.com/go/cloudbuild](https://github.com/googleapis/google-cloud-go) from 1.0.0 to 1.2.0.
- [Release notes](https://github.com/googleapis/google-cloud-go/releases)
- [Changelog](https://github.com/googleapis/google-cloud-go/blob/main/CHANGES.md)
- [Commits](https://github.com/googleapis/google-cloud-go/compare/dlp/v1.0.0...dlp/v1.2.0)

---
updated-dependencies:
- dependency-name: cloud.google.com/go/cloudbuild
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-25 10:41:47 +02:00
dependabot[bot]
e8a87572a7 build(deps): bump github.com/Azure/go-autorest/autorest
Bumps [github.com/Azure/go-autorest/autorest](https://github.com/Azure/go-autorest) from 0.11.25 to 0.11.27.
- [Release notes](https://github.com/Azure/go-autorest/releases)
- [Changelog](https://github.com/Azure/go-autorest/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Azure/go-autorest/compare/autorest/v0.11.25...autorest/v0.11.27)

---
updated-dependencies:
- dependency-name: github.com/Azure/go-autorest/autorest
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-25 10:41:07 +02:00
Alexander Todorov
1e520719cb Don't run unsupported tests on 8.6 and 9.0
https://coreos.slack.com/archives/C0235DZB0DT/p1650536467098679?thread_ts=1650512166.141439&cid=C0235DZB0DT
2022-04-22 15:45:02 +02:00
Tomas Hozza
013eb6c9af RHEL-86/EC2 SAP: install ansible-core instead of ansible
Related to https://bugzilla.redhat.com/show_bug.cgi?id=2077356
2022-04-21 16:20:50 +02:00
Tomas Hozza
d474db38d5 RHEL-86/EC2 SAP: install compat-sap-c++-10
Related to https://bugzilla.redhat.com/show_bug.cgi?id=2074114
2022-04-21 16:20:50 +02:00
Tomas Hozza
082ce34a93 RHEL-90/EC2 SAP: install @Server package group
Related to:
- 9.0: https://bugzilla.redhat.com/show_bug.cgi?id=2076763
- 9.2: https://bugzilla.redhat.com/show_bug.cgi?id=2076761
2022-04-21 16:20:50 +02:00
Tomas Hozza
54ba98f8c1 RHEL-86/EC2 SAP: install @Server package group
Related to https://bugzilla.redhat.com/show_bug.cgi?id=2074107
2022-04-21 16:20:50 +02:00
Tomas Hozza
4bba54b1b3 RHEL-90/EC2 SAP: adjust PAM limits configuration
Related to:
- 9.0: https://bugzilla.redhat.com/show_bug.cgi?id=2076759
- 9.2: https://bugzilla.redhat.com/show_bug.cgi?id=2076760
2022-04-21 16:20:50 +02:00
Tomas Hozza
88fc9f9869 RHEL-86/EC2 SAP: adjust PAM limits configuration
Related to https://bugzilla.redhat.com/show_bug.cgi?id=2074101
2022-04-21 16:20:50 +02:00
schutzbot
c2c1f39d78 Post release version bump
[skip ci]
2022-04-20 13:35:43 +00:00
dependabot[bot]
9336d66c32 build(deps): bump cloud.google.com/go/storage from 1.18.2 to 1.22.0
Bumps [cloud.google.com/go/storage](https://github.com/googleapis/google-cloud-go) from 1.18.2 to 1.22.0.
- [Release notes](https://github.com/googleapis/google-cloud-go/releases)
- [Changelog](https://github.com/googleapis/google-cloud-go/blob/main/CHANGES.md)
- [Commits](https://github.com/googleapis/google-cloud-go/compare/storage/v1.18.2...spanner/v1.22.0)

---
updated-dependencies:
- dependency-name: cloud.google.com/go/storage
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-20 14:27:18 +02:00
dependabot[bot]
2ad93b28db build(deps): bump github.com/aws/aws-sdk-go from 1.43.38 to 1.43.42
Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.43.38 to 1.43.42.
- [Release notes](https://github.com/aws/aws-sdk-go/releases)
- [Changelog](https://github.com/aws/aws-sdk-go/blob/main/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-go/compare/v1.43.38...v1.43.42)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-20 14:26:34 +02:00
Ondřej Budai
45ab577733 gitlab: fix nightly testing
f21e5fd1c9 made nightly reporting jobs not
downloading any artifacts. Unfortunately, this broke the reporting because it
depends on COMPOSE_ID and COMPOSER_NVR artifacts. Let's revert the change for
these jobs until we find a better solution.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2022-04-20 13:41:56 +02:00
dependabot[bot]
b4bec690ab build(deps): bump github.com/prometheus/client_golang
Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.12.0 to 1.12.1.
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prometheus/client_golang/compare/v1.12.0...v1.12.1)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_golang
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-19 14:50:15 +02:00
dependabot[bot]
2ba68442d3 build(deps): bump github.com/vmware/govmomi from 0.26.1 to 0.27.4
Bumps [github.com/vmware/govmomi](https://github.com/vmware/govmomi) from 0.26.1 to 0.27.4.
- [Release notes](https://github.com/vmware/govmomi/releases)
- [Changelog](https://github.com/vmware/govmomi/blob/master/CHANGELOG.md)
- [Commits](https://github.com/vmware/govmomi/compare/v0.26.1...v0.27.4)

---
updated-dependencies:
- dependency-name: github.com/vmware/govmomi
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-19 14:49:19 +02:00
Sanne Raymaekers
1ded72b4dc templates/packer: Set region in vector config
Vector 0.21 needs region set otherwise the healthcheck will
fail.
2022-04-19 13:24:33 +02:00
dependabot[bot]
d38d4ab2c9 build(deps): bump github.com/spf13/cobra from 0.0.3 to 1.4.0
Bumps [github.com/spf13/cobra](https://github.com/spf13/cobra) from 0.0.3 to 1.4.0.
- [Release notes](https://github.com/spf13/cobra/releases)
- [Changelog](https://github.com/spf13/cobra/blob/v1.4.0/CHANGELOG.md)
- [Commits](https://github.com/spf13/cobra/compare/v0.0.3...v1.4.0)

---
updated-dependencies:
- dependency-name: github.com/spf13/cobra
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-18 23:18:30 +02:00
Jakub Rusz
717f28adfb workflows/trigger-gitlab: run Gitlab CI in new image-builder project
We have a new project in Gitlab
https://gitlab.com/redhat/services/products/image-builder/ci/osbuild-composer
and we want to run the CI there instead.
2022-04-14 21:45:07 +02:00
Tomas Hozza
f45bdf3fb3 Don't pass GPG keys for GCP repos and don't verify signatures on el9/c9s
Google repositories use RSA/SHA1 for signing packages. However the SHA1
has been disabled by default on el9/c9s. Since osbuild-composer imports
GPG keys specified in the repository definition unconditionally, this
creates issues when installing rpms signed with the key by osbuild [1].

Remove GPG keys in all el9/c9s GCP repo definitions and disable GPG
signature verification until [2] is resolved.

[1] https://github.com/osbuild/osbuild/issues/991
[2] https://issuetracker.google.com/issues/223626963

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2022-04-14 19:07:31 +01:00
Tomas Hozza
ee285e5e8a Weldr: support GCP upload target
Add support for importing the GCE image into GCP using Weldr API. The
credentials to be used can be specified in the upload settings and will
be then used by the worker to authenticate with GCP.

The GCP target credentials are passed to Weldr API as base64 encoded
content of the GCP credentials JSON file. The reason is that the JSON
file contains many values and its format could change in the future.
This way, the Weldr API does not rely on the credentials file content
format in any way.

Add a new test case for the GCP upload via Weldr and run it in CI.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2022-04-14 19:07:31 +01:00
Tomas Hozza
249661a948 worker: rework GCP credentials handling
Refactor the handling of GCP credentials in the worker to be equivalent
to what is done for AWS. The main idea is that the code decides which
credentials to use when processing each job. This change will allow
preferring credentials passed via upload `TargetOptions` with the job,
over the credentials configured in worker's configuration or the default
way of authenticating implemented by the Google library.

Move loading of GCP credentials to the internal `gcp` library into
`NewFromFile()` function accepting path to the file with credentials.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2022-04-14 19:07:31 +01:00
Tomas Hozza
29174bfbef test/api.sh: take advantage of GCP guest tools to SSH to the VM
Modify the Cloud API test case for GCP to use `gcloud` and GCP guest
tools installed in the image to connect to the VM instance over SSH.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2022-04-14 19:07:31 +01:00
Tomas Hozza
82a0bfc46d internal/cloud/gcp: delete unused internal API
Delete all internal `cloud/gcp` API related to importing virtual images
to GCP using Cloud Build API. This API is no longer needed.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2022-04-14 19:07:31 +01:00
Tomas Hozza
13844edcdb cloudapi: use ComputeImageInsert() and gce image for GCP
Signed-off-by: Tomas Hozza <thozza@redhat.com>
2022-04-14 19:07:31 +01:00
Tomas Hozza
8a064cef3e cmd/osbuild-upload-gcp: use ComputeImageInsert()
Signed-off-by: Tomas Hozza <thozza@redhat.com>
2022-04-14 19:07:31 +01:00
Tomas Hozza
264e554971 cloud/gcp: introduce ComputeImageInsert() method
Introduce a new `ComputeImageInsert()` method for importing images into
GCP. It uses the `compute.Images.Insert()` API [1], which has many
advantages over the currently used way of importing images using the
CloudBuild API. The advantages are mainly that the image is imported as
is and no additional cache files or VMs are created as part of the
import process. Therefore there is no need to do additional cleanup of
cache files after importing the image.

In addition, the import itself is approximately 30% faster for RHEL
images when using the `Insert()` call.

Nevertheless the `Insert()` call accepts only gzip-ed tarball with a RAW
disk, unlike the `Import()` call, which accepts basically any virtual
disk format.

[1] https://cloud.google.com/compute/docs/reference/rest/v1/images/insert

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2022-04-14 19:07:31 +01:00
Tomas Hozza
e7f6b95032 RHEL-84: add gce-rhui image type
Add the `gce-rhui` image type intended for Google Compute Engine. The image
uses Google's RHUI infrastructure to access Red Hat content.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2022-04-14 19:07:31 +01:00
Tomas Hozza
795294d98f RHEL-84: add gce image type
Add the `gce` image type intended for Google Compute Engine. The image
is BYOS - bring your own subscription and requires registering in order
to access Red Hat content.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2022-04-14 19:07:31 +01:00
Tomas Hozza
2a8e6123aa RHEL-84: extend imageTypeS2 to contain pipelines generator function
Extend RHEL-84 `imageTypeS2` structure to contain pipelines generator
function. Previously, the `imageTypeS2` implementation defaulted to only
a single pipelines generator method for EDGE image types. The ability to
pass a different generator function implementation is important to
enable addition of new image types relying on osbuild Manifest v2.

Rename the original pipeline generator method to `edgePipelines`.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2022-04-14 19:07:31 +01:00
Tomas Hozza
77b5ef459d RHEL-85: add gce-rhui image type
Add the `gce-rhui` image type intended for Google Compute Engine. The image
uses Google's RHUI infrastructure to access Red Hat content.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2022-04-14 19:07:31 +01:00
Tomas Hozza
6ffe63442e RHEL-85: add gce image type
Add the `gce` image type intended for Google Compute Engine. The image
is BYOS - bring your own subscription and requires registering in order
to access Red Hat content.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2022-04-14 19:07:31 +01:00
Tomas Hozza
0219ad1f43 RHEL-86: add gce-rhui image type
Add the `gce-rhui` image type intended for Google Compute Engine. The image
uses Google's RHUI infrastructure to access Red Hat content.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2022-04-14 19:07:31 +01:00
Tomas Hozza
db75c39c4d RHEL-86: add gce image type
Add the `gce` image type intended for Google Compute Engine. The image
is BYOS - bring your own subscription and requires registering in order
to access Red Hat content.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2022-04-14 19:07:31 +01:00
Tomas Hozza
5d27b7c784 RHEL-90: add gce image type
Add the `gce` image type intended for Google Compute Engine. The image
is BYOS - bring your own subscription and requires registering in order
to access Red Hat content.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2022-04-14 19:07:31 +01:00
Tomas Hozza
ea3e6f072e test/api.sh: filter repos by image type
Filter the list of repositories passed in compose request based on the
`image_type_tags` object member. This is the same approach used by the
Weldr API. If the `image_type_tags` does not exist, the repo is added to
the list. If the `image_type_tags` exists, the repo is added to the list
only if the image type name is in the tags array.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2022-04-14 19:07:31 +01:00
Tomas Hozza
46e15794f0 image-info: support analyzing gce image type
Signed-off-by: Tomas Hozza <thozza@redhat.com>
2022-04-14 19:07:31 +01:00
Tomas Hozza
800d57fda8 Extend ImageConfig and RHEL-86/90 osPipeline
Extend `ImageConfig` and RHEL-86/90 `osPipeline` with the following
configuration options:
 - DNF Automatic configuration
 - YUM / DNF repositories
 - Firewall configuration

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2022-04-14 19:07:31 +01:00
Tomas Hozza
5187ce999f image-types: Add research document for GCE image type
Signed-off-by: Tomas Hozza <thozza@redhat.com>
2022-04-14 19:07:31 +01:00
Tomas Hozza
01b94a5787 RHEL-85: introduce tarArchivePipeline()
Introduce `tarArchivePipeline()` function returning a pipeline,
which creates a Tar archive from another pipeline tree referenced by the
pipeline name.

Replace `tarStage()` with `osbuild.NewTarStage()`

Use the `tarArchivePipeline()` function in respective image type
pipelines.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2022-04-14 19:07:31 +01:00