Code Monkey home page Code Monkey logo

image-builder's Introduction

Image Builder

Image Builder serves as an HTTP API on top of Osbuild Composer, and serves as the backend for Image Builder Frontend.

Image Builder is intended to be run within the console.redhat.com platform.

Project

OpenAPI spec

The latest OpenAPI specification:

Contributing

Please refer to the hacking guide to learn more.

Build

Project building and testing project is based on predefined make targets:

  • make build to trigger Go builder

Run Tests

To run the tests locally just call

make unit-tests

Before pushing something for a pull request you should run this check to avoid problems with required github actions

make push-check

Installation

To run the project use make run target

Repository

License

  • Apache-2.0
  • See LICENSE file for details.

image-builder's People

Contributors

achilleas-k avatar akhil-jha avatar amirfefer avatar atodorov avatar avitova avatar bcl avatar chloenayon avatar croissanne avatar dependabot[bot] avatar diaasami avatar elkoniu avatar ezr-ondrej avatar jrusz avatar juan-abia avatar kingsleyzissou avatar lavocatt avatar lucasgarfield avatar lzap avatar major avatar mgold1234 avatar ochosi avatar ondrejbudai avatar regexowl avatar schuellerf avatar schutzbot avatar teg avatar thozza avatar tpapaioa avatar yih-redhat avatar yuxisun1217 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

image-builder's Issues

Need pre-check dos2unix package in test/cases/api.sh

Once we migrate to GitLab the runners will come with some epositories pre-configured sometimes.

If want this to be a robust check then remove/disable everything under /etc/yum.repos.d before subscribing but still keep the rpm -q dos2unix check. That's a pre-condition and we want to fail if the pre-condition isn't met.

build edge image hang due to udevadm

I was testing Edge related APIs against this PR: #193
And when I tried to build a commit image, it hangs at udevadm step.

Reproduce steps:

  1. Send a request to build Edge commit image and upload to s3.
[root@vm02-iso image-builder]# curl -w %{http_code} -H 'x-rh-identity:  ${identity}' -H 'Content-Type: application/json' -d "@data.json" http://localhost:8086/api/image-builder/v1.0/compose
{"id":"a6193303-a3ff-442c-bb61-dd7f618d6d7a"}
201
[root@vm02-iso image-builder]# curl -w %{http_code} -H 'x-rh-identity:  ${identity}' http://localhost:8086/api/image-builder/v1.0/composes/a6193303-a3ff-442c-bb61-dd7f618d6d7a
{"image_status":{"status":"building"}}
200
  1. After hours the status is still building, then check the osbuild log:
[root@vm02-iso image-builder]# pgrep osbuild-worker
919938
[root@vm02-iso image-builder]# pstree -al 919938
osbuild-worker -unix /run/osbuild-composer/job.socket
  ├─osbuild /usr/bin/osbuild --store /var/cache/osbuild-worker/osbuild-store --output-directory /var/cache/osbuild-worker/output/555fcc00-e663-4f96-a5a8-fa1fda042c56-877396296 --json - --export assembler
  │   ├─bwrap --cap-add CAP_MAC_ADMIN --chdir / --die-with-parent --new-session --setenv PATH /usr/sbin:/usr/bin --setenv PYTHONPATH /run/osbuild/lib --unshare-ipc --unshare-pid --unshare-net --ro-bind /var/cache/osbuild-worker/osbuild-store/tmp/tmpvk1wdi0mobject/tmpss4l4mhz-reader/boot /boot --ro-bind /var/cache/osbuild-worker/osbuild-store/tmp/tmpvk1wdi0mobject/tmpss4l4mhz-reader/usr /usr --symlink usr/lib /lib --symlink usr/lib64 /lib64 --symlink usr/bin /bin --symlink usr/sbin /sbin --dev-bind /run/osbuild/osbuild-dev-ceufyz8e /dev --tmpfs /dev/shm --dir /etc --tmpfs /run --tmpfs /tmp --bind /var/cache/osbuild-worker/osbuild-store/tmp/osbuild-var-dsejipmf /var --proc /proc --bind /sys /sys --ro-bind-try /sys/fs/selinux /sys/fs/selinux --ro-bind-try /var/cache/osbuild-worker/osbuild-store/tmp/tmpvk1wdi0mobject/tmpss4l4mhz-reader/etc/mke2fs.conf /etc/mke2fs.conf --ro-bind /usr/lib/osbuild /run/osbuild/lib --ro-bind /usr/lib/python3.6/site-packages/osbuild /run/osbuild/lib/osbuild --bind /var/cache/osbuild-worker/osbuild-store/tmp/tmpyyd8r56qobject/tmpzyrkrg1d-writer /run/osbuild/tree --ro-bind /usr/lib/osbuild/stages/org.osbuild.rpm /run/osbuild/bin/org.osbuild.rpm --ro-bind /var/cache/osbuild-worker/osbuild-store/tmp/osbuild-sources-output-j5jxtcgj /run/osbuild/sources --ro-bind /var/cache/osbuild-worker/osbuild-store/tmp/store-server-934dvy1b/files-input-2ps1u69x /run/osbuild/inputs/packages --dir /run/osbuild/api --bind /run/osbuild/api-xi_o1jv3/osbuild /run/osbuild/api/osbuild --bind /run/osbuild/api-7ojiofx_/sources /run/osbuild/api/sources --bind /run/osbuild/api-vegeu_5k/remoteloop /run/osbuild/api/remoteloop -- /run/osbuild/lib/runners/org.osbuild.rhel82 /run/osbuild/bin/org.osbuild.rpm
  │   │   └─bwrap --cap-add CAP_MAC_ADMIN --chdir / --die-with-parent --new-session --setenv PATH /usr/sbin:/usr/bin --setenv PYTHONPATH /run/osbuild/lib --unshare-ipc --unshare-pid --unshare-net --ro-bind /var/cache/osbuild-worker/osbuild-store/tmp/tmpvk1wdi0mobject/tmpss4l4mhz-reader/boot /boot --ro-bind /var/cache/osbuild-worker/osbuild-store/tmp/tmpvk1wdi0mobject/tmpss4l4mhz-reader/usr /usr --symlink usr/lib /lib --symlink usr/lib64 /lib64 --symlink usr/bin /bin --symlink usr/sbin /sbin --dev-bind /run/osbuild/osbuild-dev-ceufyz8e /dev --tmpfs /dev/shm --dir /etc --tmpfs /run --tmpfs /tmp --bind /var/cache/osbuild-worker/osbuild-store/tmp/osbuild-var-dsejipmf /var --proc /proc --bind /sys /sys --ro-bind-try /sys/fs/selinux /sys/fs/selinux --ro-bind-try /var/cache/osbuild-worker/osbuild-store/tmp/tmpvk1wdi0mobject/tmpss4l4mhz-reader/etc/mke2fs.conf /etc/mke2fs.conf --ro-bind /usr/lib/osbuild /run/osbuild/lib --ro-bind /usr/lib/python3.6/site-packages/osbuild /run/osbuild/lib/osbuild --bind /var/cache/osbuild-worker/osbuild-store/tmp/tmpyyd8r56qobject/tmpzyrkrg1d-writer /run/osbuild/tree --ro-bind /usr/lib/osbuild/stages/org.osbuild.rpm /run/osbuild/bin/org.osbuild.rpm --ro-bind /var/cache/osbuild-worker/osbuild-store/tmp/osbuild-sources-output-j5jxtcgj /run/osbuild/sources --ro-bind /var/cache/osbuild-worker/osbuild-store/tmp/store-server-934dvy1b/files-input-2ps1u69x /run/osbuild/inputs/packages --dir /run/osbuild/api --bind /run/osbuild/api-xi_o1jv3/osbuild /run/osbuild/api/osbuild --bind /run/osbuild/api-7ojiofx_/sources /run/osbuild/api/sources --bind /run/osbuild/api-vegeu_5k/remoteloop /run/osbuild/api/remoteloop -- /run/osbuild/lib/runners/org.osbuild.rhel82 /run/osbuild/bin/org.osbuild.rpm
  │   │       └─org.osbuild.rhe /run/osbuild/lib/runners/org.osbuild.rhel82 /run/osbuild/bin/org.osbuild.rpm
  │   │           └─org.osbuild.rpm /run/osbuild/bin/org.osbuild.rpm
  │   │               └─rpm --verbose --root /run/osbuild/tree --define _pkgverify_level none --install /tmp/manifest.06sulvm9
  │   │                   └─sh /var/tmp/rpm-tmp.17hjYk 1
  │   │                       └─udevadm trigger --sysname-match=hw_random --settle
  │   └─4*[{osbuild}]
  └─6*[{osbuild-worker}]
  1. kill the udevadm process and the building continues and will succeed soon.
[root@vm02-iso image-builder]# pkill udevadm
[root@vm02-iso image-builder]# pstree -al 919938
osbuild-worker -unix /run/osbuild-composer/job.socket
  ├─osbuild /usr/bin/osbuild --store /var/cache/osbuild-worker/osbuild-store --output-directory /var/cache/osbuild-worker/output/555fcc00-e663-4f96-a5a8-fa1fda042c56-877396296 --json - --export assembler
  │   ├─bwrap --cap-add CAP_MAC_ADMIN --chdir / --die-with-parent --new-session --setenv PATH /usr/sbin:/usr/bin --setenv PYTHONPATH /run/osbuild/lib --unshare-ipc --unshare-pid --unshare-net --ro-bind /var/cache/osbuild-worker/osbuild-store/tmp/tmpvk1wdi0mobject/tmpss4l4mhz-reader/boot /boot --ro-bind /var/cache/osbuild-worker/osbuild-store/tmp/tmpvk1wdi0mobject/tmpss4l4mhz-reader/usr /usr --symlink usr/lib /lib --symlink usr/lib64 /lib64 --symlink usr/bin /bin --symlink usr/sbin /sbin --dev-bind /run/osbuild/osbuild-dev-ceufyz8e /dev --tmpfs /dev/shm --dir /etc --tmpfs /run --tmpfs /tmp --bind /var/cache/osbuild-worker/osbuild-store/tmp/osbuild-var-dsejipmf /var --proc /proc --bind /sys /sys --ro-bind-try /sys/fs/selinux /sys/fs/selinux --ro-bind-try /var/cache/osbuild-worker/osbuild-store/tmp/tmpvk1wdi0mobject/tmpss4l4mhz-reader/etc/mke2fs.conf /etc/mke2fs.conf --ro-bind /usr/lib/osbuild /run/osbuild/lib --ro-bind /usr/lib/python3.6/site-packages/osbuild /run/osbuild/lib/osbuild --bind /var/cache/osbuild-worker/osbuild-store/tmp/tmpyyd8r56qobject/tmpzyrkrg1d-writer /run/osbuild/tree --ro-bind /usr/lib/osbuild/stages/org.osbuild.rpm /run/osbuild/bin/org.osbuild.rpm --ro-bind /var/cache/osbuild-worker/osbuild-store/tmp/osbuild-sources-output-j5jxtcgj /run/osbuild/sources --ro-bind /var/cache/osbuild-worker/osbuild-store/tmp/store-server-934dvy1b/files-input-2ps1u69x /run/osbuild/inputs/packages --dir /run/osbuild/api --bind /run/osbuild/api-xi_o1jv3/osbuild /run/osbuild/api/osbuild --bind /run/osbuild/api-7ojiofx_/sources /run/osbuild/api/sources --bind /run/osbuild/api-vegeu_5k/remoteloop /run/osbuild/api/remoteloop -- /run/osbuild/lib/runners/org.osbuild.rhel82 /run/osbuild/bin/org.osbuild.rpm
  │   │   └─bwrap --cap-add CAP_MAC_ADMIN --chdir / --die-with-parent --new-session --setenv PATH /usr/sbin:/usr/bin --setenv PYTHONPATH /run/osbuild/lib --unshare-ipc --unshare-pid --unshare-net --ro-bind /var/cache/osbuild-worker/osbuild-store/tmp/tmpvk1wdi0mobject/tmpss4l4mhz-reader/boot /boot --ro-bind /var/cache/osbuild-worker/osbuild-store/tmp/tmpvk1wdi0mobject/tmpss4l4mhz-reader/usr /usr --symlink usr/lib /lib --symlink usr/lib64 /lib64 --symlink usr/bin /bin --symlink usr/sbin /sbin --dev-bind /run/osbuild/osbuild-dev-ceufyz8e /dev --tmpfs /dev/shm --dir /etc --tmpfs /run --tmpfs /tmp --bind /var/cache/osbuild-worker/osbuild-store/tmp/osbuild-var-dsejipmf /var --proc /proc --bind /sys /sys --ro-bind-try /sys/fs/selinux /sys/fs/selinux --ro-bind-try /var/cache/osbuild-worker/osbuild-store/tmp/tmpvk1wdi0mobject/tmpss4l4mhz-reader/etc/mke2fs.conf /etc/mke2fs.conf --ro-bind /usr/lib/osbuild /run/osbuild/lib --ro-bind /usr/lib/python3.6/site-packages/osbuild /run/osbuild/lib/osbuild --bind /var/cache/osbuild-worker/osbuild-store/tmp/tmpyyd8r56qobject/tmpzyrkrg1d-writer /run/osbuild/tree --ro-bind /usr/lib/osbuild/stages/org.osbuild.rpm /run/osbuild/bin/org.osbuild.rpm --ro-bind /var/cache/osbuild-worker/osbuild-store/tmp/osbuild-sources-output-j5jxtcgj /run/osbuild/sources --ro-bind /var/cache/osbuild-worker/osbuild-store/tmp/store-server-934dvy1b/files-input-2ps1u69x /run/osbuild/inputs/packages --dir /run/osbuild/api --bind /run/osbuild/api-xi_o1jv3/osbuild /run/osbuild/api/osbuild --bind /run/osbuild/api-7ojiofx_/sources /run/osbuild/api/sources --bind /run/osbuild/api-vegeu_5k/remoteloop /run/osbuild/api/remoteloop -- /run/osbuild/lib/runners/org.osbuild.rhel82 /run/osbuild/bin/org.osbuild.rpm
  │   │       └─org.osbuild.rhe /run/osbuild/lib/runners/org.osbuild.rhel82 /run/osbuild/bin/org.osbuild.rpm
  │   │           └─org.osbuild.rpm /run/osbuild/bin/org.osbuild.rpm
  │   │               └─rpm --verbose --root /run/osbuild/tree --define _pkgverify_level none --install /tmp/manifest.06sulvm9
  │   │                   └─sh /var/tmp/rpm-tmp.OGCbPk 0 0
  │   │                       └─update-mime-dat -n /usr/share/mime
  │   └─4*[{osbuild}]
  └─6*[{osbuild-worker}]

I can always reproduce this bug, and @achilleas-k is aware of this issue, opening this issue to track it.

Versioning discussion

We have to tackle this sooner rather than later, so I have a few points that warrant discussion:

semver

Clouddot uses semantic versioning. I say we do our very best to only make major version changes, just so we only have one way to increase a version.

each version has their own package

Because each version has it's own spec file, we need to pull the generated api and the handlers from the server package into their own packages. I propose having internal/v1, internal/v2, etc....

Handlers will be duplicated, but I think that's fine to keep maintainability.

shared code

We should try to keep utilities shared between these packages (the database, logger etc...) common as much as we can to avoid duplication. I think having the database common makes sense since any migration needs to be backwards compatible anyway.

The clouddot guidelines state to support old versions as long as is 'reasonably possible', and I think the moment we have to bend over backwards in these shared parts in order to keep an older version, we should drop that older version.

Versioned IB -> versioned composer (CO)

I'd like to start out with keeping the cloudapi client shared between versions, and try having all versions of IB work against a single version of CO. If this turns out to be very difficult, we'll have to start adding multiple versions to the cloudapi client.

The default user on `ami` image type changed since RHEL-8.5

The ami image type have been redefined since RHEL-8.5 based on the official RHEL EC2 images (osbuild/osbuild-composer#1607). As a result, the username of the default user created by cloud-init changed from cloud-user to ec2-user.

This required a change in the Cloud API test case (api.sh) in osbuild-composer:
https://github.com/osbuild/osbuild-composer/blob/53109945efb4ff648982fc6c52af723dede63bd5/test/cases/api.sh#L391-L396

An equivalent change will be needed in the api.sh test case of image-builder, once it will start to be tested with RHEL-8.5:

"rhel-8.2" | "rhel-8.3" | "rhel-8.4")
DISTRO="rhel-84"
SSH_USER="cloud-user"

Actually address gosec violations regarding files

Currently we're translating query parameters into a file path. And we're not doing it in the safest way in internal/server/distribution.go.

Currently it's not too bad however as it walks a specified directory and sees if the path matches the one generated from the query params, and then loads in specific fields from the json structure, but still we should do it properly and sanatize those params.

Improve authorization/ no cross-user compose access

/composes returns a list of composes done by a specific user, which is taken from the identity header.

/compose/{id} returns the status of a compose, however technically if you know a compose id of a different user, you could retrieve the status of a compose that isn't yours. This doesn't contain any secrets, but might contain some identifying information.

When querying a compose status, make sure that the compose belongs to the user. Either the account_number should match, or the org_id (if present) should match.

image-builder port name is too long

Deployment "image-builder" is invalid: spec.template.spec.containers[0].ports[0].name: Invalid value: "image-builder-api": must be no more than 15 characters

subscription test cases failed randomly

Sometimes the subscription test failed. The VM is not registered after boot up. e.g.
https://osbuildci.cloud.paas.psi.redhat.com/job/osbuild/job/image-builder/job/main/79/execution/node/65/log/

17:07:30  ++ ssh -oStrictHostKeyChecking=no -i ./keypair.pem [email protected] sudo subscription-manager identity
17:07:30  ++ grep 'org ID'
17:07:30  This system is not yet registered. Try 'subscription-manager register --help' for more information.
17:07:30  + subscribe_org_id=

Perhaps need to wait or loop retry several times to verify it.

Use jackc/tern for database migration

Currently we depend on lib/pq for migrations and jackc for the actual db operations. It makes sense to move the migrations over to jackc/tern. Furthermore lib/pq doesn't support sslmode prefer, which should be the sensible default.

Make it easier to run the integration tests locally

The unit tests with go test ./... are pretty straightforward.

The integration tests (cmd/image-builder-tests) require composer up and running, and also a container of image-builder to test the container variant; so they are harder to run.

Either have a script somewhere or a make target before running go test -tags=integration. And document it.

Prometheus metrics

As a first track number of 500s per endpoint (vs total amount of requests).

RFE: provide Azure account organization in AzureUploadStatus

In order to link a user to their uploaded Azure image the image-builder-frontend needs the organization that the user has authorized Image Builder on.

The link would follow this pattern: https://portal.azure.com/#@{organization url}/resource/subscriptions/{subscription id}/resourceGroups/{resource group}/providers/Microsoft.Compute/images/{image name}/overview

Currently, only the organization url is missing.

Rename references to account_id/accountId to account_number

In CRC org_id is used to refer to a number that organization admins have access to really. And account_number is the shared number over an organization.

So let's rename account_id/accountId references to account_number (but keep org_id as is). To keep it consistent and avoid future confusion. Migrate the db as well, since we currently have a single table without any references to account_id, we can just rename it to account_number.

Use `gce-byos` image type with GCP

Once the new gce-byos image type is introduced in osbuild-composer via osbuild/osbuild-composer#1365 and the version is deployed in the staging / production, Image Builder should use it by default for images intended for GCP.

In addition to changing the image type, Image Builder must pass additional repositories to the osbuild-composer. These repositories contain GCP guest tools and SDK. Their content is as follows:

{
    "name": "google-compute-engine",
    "baseurl": "https://packages.cloud.google.com/yum/repos/google-compute-engine-el8-x86_64-stable",
    "gpgkey": "-----BEGIN PGP PUBLIC KEY BLOCK-----\n\nmQENBGA9EFkBCAC1ilzST0wns+uwZyEA5IVtYeyAuXTaQUEAd70SqIlQpDd4EyVi\nx3SCanQIu8dG9Zq3+x28WBb2OuXP9oc06ybOWdu2m7N5PY0BUT4COA36JV/YrxmN\ns+5/M+YnDHppv63jgRIOkzXzXNo6SwTsl2xG9fKB3TS0IMvBkWdw5PGrBM5GghRc\necgoSAAwRbWJXORHGKVwlV6tOxQZ/xqA08hPJneMfsMFPOXsitgGRHoXjlUWLVeJ\n70mmIYsC/pBglIwCzmdD8Ee39MrlSXbuXVQiz38iHfnvXYpLEmgNXKzI0DH9tKg8\n323kALzqaJlLFOLJm/uVJXRUEfKS3LhVZQMzABEBAAG0UVJhcHR1cmUgQXV0b21h\ndGljIFNpZ25pbmcgS2V5IChjbG91ZC1yYXB0dXJlLXNpZ25pbmcta2V5LTIwMjEt\nMDMtMDEtMDhfMDFfMDkucHViKYkBKAQTAQgAHAUCYD0QWQkQ/uqRaTB+oHECGwMF\nCQPDCrACGQEAAHtlCACxSWMp3yRcLmsHhxGDt59nhSNXhouWiNePSMe5vETQA/lh\nip9Zx/NPRCa4q5jpIDBlEYOg67YanztcjSWGSI35Xblq43H4uLSxh4PtKzZMo+Uj\n8n2VNHOZXBdGcsODcU3ynF64r7eTQevUe2aU0KN2o656O3HrE4itOVKYwnnkmNsk\nG45b9b7DJnsQ6WPszUc8lNhsa2gBI6vfLl68vjj7PlWw030BM/RoMEPpoOApohHo\nsfnNhxJmE1AxwBkMEzyo2kZhPZGh85LDnDbAvjSFKqYSPReKmRFjLlo3DPVHZ/de\nQn6noHbgUChLo21FefhlZO6tysrb283MW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XovIwLGfkg6kYLEvNPvOIYNQWnrT6zZ+XcV47WkJ+i5SR+QpUI\nudMSWVf4nkv+XVHruxydafRIeocaXY0E8EuIHGBSB2KR3HxG6JbgUiWlCVRNt4Qd\n6udC6Ep7maKEIpO40M8UHRuKrp4iLGIhPm3ELGO6uc8rks8qOBMH4ozU+3PB9a0b\nGnPBEsZdOBI1phyftLyyuEvG8PeUYD+uzSx8jp9xbMg66gQRMP9XGzcCkD+b8w1o\n7v3J3juKKpgvx5Lqwvwv2ywqn/Wr5d5OBCHEw8KtU/tfxycz/oo6XUIshgEbS/+P\n6yKDuYhRp6qxrYXjmAszIT25cftb4d4=\n=/PbX\n-----END PGP PUBLIC KEY BLOCK-----",
    "check_gpg": true
},
{
    "name": "google-cloud-sdk",
    "baseurl": "https://packages.cloud.google.com/yum/repos/cloud-sdk-el8-x86_64",
    "gpgkey": "-----BEGIN PGP PUBLIC KEY BLOCK-----\n\nmQENBGA9EFkBCAC1ilzST0wns+uwZyEA5IVtYeyAuXTaQUEAd70SqIlQpDd4EyVi\nx3SCanQIu8dG9Zq3+x28WBb2OuXP9oc06ybOWdu2m7N5PY0BUT4COA36JV/YrxmN\ns+5/M+YnDHppv63jgRIOkzXzXNo6SwTsl2xG9fKB3TS0IMvBkWdw5PGrBM5GghRc\necgoSAAwRbWJXORHGKVwlV6tOxQZ/xqA08hPJneMfsMFPOXsitgGRHoXjlUWLVeJ\n70mmIYsC/pBglIwCzmdD8Ee39MrlSXbuXVQiz38iHfnvXYpLEmgNXKzI0DH9tKg8\n323kALzqaJlLFOLJm/uVJXRUEfKS3LhVZQMzABEBAAG0UVJhcHR1cmUgQXV0b21h\ndGljIFNpZ25pbmcgS2V5IChjbG91ZC1yYXB0dXJlLXNpZ25pbmcta2V5LTIwMjEt\nMDMtMDEtMDhfMDFfMDkucHViKYkBKAQTAQgAHAUCYD0QWQkQ/uqRaTB+oHECGwMF\nCQPDCrACGQEAAHtlCACxSWMp3yRcLmsHhxGDt59nhSNXhouW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sxkBmCCIjBa0B0LybDtdX\nXIq5kPJsIrC2zvERIPm1ez/9FyGmZKEFnBGeFC45z5U//pHdB1z03dYKGrKdDpID\n17kNbC5wl24k/IeYyTY9IutMXvuNbVSXaVtRABEBAAG0Okdvb2dsZSBDbG91ZCBQ\nYWNrYWdlcyBSUE0gU2lnbmluZyBLZXkgPGdjLXRlYW1AZ29vZ2xlLmNvbT6JATgE\nEwECACIFAlWKtqgCGy8GCwkIBwMCBhUIAgkKCwQWAgMBAh4BAheAAAoJEPCcOUw+\nG6jV+QwH/0wRH+XovIwLGfkg6kYLEvNPvOIYNQWnrT6zZ+XcV47WkJ+i5SR+QpUI\nudMSWVf4nkv+XVHruxydafRIeocaXY0E8EuIHGBSB2KR3HxG6JbgUiWlCVRNt4Qd\n6udC6Ep7maKEIpO40M8UHRuKrp4iLGIhPm3ELGO6uc8rks8qOBMH4ozU+3PB9a0b\nGnPBEsZdOBI1phyftLyyuEvG8PeUYD+uzSx8jp9xbMg66gQRMP9XGzcCkD+b8w1o\n7v3J3juKKpgvx5Lqwvwv2ywqn/Wr5d5OBCHEw8KtU/tfxycz/oo6XUIshgEbS/+P\n6yKDuYhRp6qxrYXjmAszIT25cftb4d4=\n=/PbX\n-----END PGP PUBLIC KEY BLOCK-----",
    "check_gpg": true
}

OpenShift template failed to apply

11:51:39 [2021-01-11 17:51:39] [ERROR] [saasherder.py:_process_template:328] - [https://github.com/osbuild/image-builder//templates/image-builder.yml:main] error fetching template: while parsing a block collection
11:51:39   in "<byte string>", line 170, column 11:
11:51:39               - image: "${COMPOSER_IMAGE}:${CO ... 
11:51:39               ^
11:51:39 expected <block end>, but found '?'
11:51:39   in "<byte string>", line 185, column 11:
11:51:39               volumeMounts:
11:51:39               ^

metrics: measure ratio of slow requests

Rather than measuring the average time, measure the ratio of slow (slower than the cut off) requests to fast ones.

I believe this follows the best practices of AppSRE better, where every event is success or failure and we measure the ratio between them.

buildCustomizations() always returns nil for error

From server.go:

    custom, err := buildCustomizations(composeRequest.Customizations)
    if err != nil {
        return err
    }

but the current implementation of buildCustomizations() function always returns nil for error. I'm not sure if it is missing an error condition check or there's simply no way for customizations to error out at the moment.

Comment from @ondrejbudai:

hmm... I guess there might be more validation
I'm not sure how Sanne wants to validate the API requests.

Opening issue so we don't forget about this.

Let the integration test assume image-builder on :8086

Right now the integration tests start image-builder on :8086 and expects a container on :8087. And then runs the same test against both. This is a bit strange.

The integration tests should just expect image-builder on :8086, and then schutzbot should just start a container before running the tests.

Azure test sometimes fails when downloading azure-cli

Failed job: https://gitlab.com/osbuild/ci/image-builder/-/jobs/1354688824

Installing:
 azure-cli         x86_64         2.25.0-1.el7          azure-cli          43 M
Transaction Summary
================================================================================
Install  1 Package
Total download size: 43 M
Installed size: 557 M
Downloading Packages:
[MIRROR] azure-cli-2.25.0-1.el7.x86_64.rpm: Curl error (35): SSL connect error for https://packages.microsoft.com/yumrepos/azure-cli/azure-cli-2.25.0-1.el7.x86_64.rpm [OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to packages.microsoft.com:443 ]
[MIRROR] azure-cli-2.25.0-1.el7.x86_64.rpm: Curl error (28): Timeout was reached for https://packages.microsoft.com/yumrepos/azure-cli/azure-cli-2.25.0-1.el7.x86_64.rpm [Connection timed out after 30001 milliseconds]
[MIRROR] azure-cli-2.25.0-1.el7.x86_64.rpm: Curl error (28): Timeout was reached for https://packages.microsoft.com/yumrepos/azure-cli/azure-cli-2.25.0-1.el7.x86_64.rpm [Connection timed out after 30001 milliseconds]
[MIRROR] azure-cli-2.25.0-1.el7.x86_64.rpm: Curl error (35): SSL connect error for https://packages.microsoft.com/yumrepos/azure-cli/azure-cli-2.25.0-1.el7.x86_64.rpm [OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to packages.microsoft.com:443 ]
[FAILED] azure-cli-2.25.0-1.el7.x86_64.rpm: No more mirrors to try - All mirrors were already tried without success
The downloaded packages were saved in cache until the next successful transaction.
You can remove cached packages by executing 'dnf clean packages'.
Failed to set locale, defaulting to C.UTF-8
Error: Error downloading packages:
  Cannot download azure-cli-2.25.0-1.el7.x86_64.rpm: All mirrors were tried

I've seen this several times, when trying manually or in osbuild-composer repository and I think it's the same issue. The way it's being installed is provided in official documentation so that should be fine. Usually a restart fixes it, so I guess adding some retry before failing the test could solve this easily...

Implement livenessProbe and readinessProbe endpoints

This could be something under /status or /health.

I think both of these can point to the same endpoint, a sensible readiness/health check would be stuff like:

  1. Is composer available? (maybe we need a /status endpoint there too, we just need to verify it's there and auth is good).
  2. Are there distributions available ? For the container /app/distributions should contain stuff.

In future we can also check if the database is there.

📜 Multiple instances of image-builder fail to send logs to cloudwatch

We are seeing this error in OpenShift:

Failed to fire hook: InvalidSequenceTokenException: The given sequenceToken is invalid. The next expected sequenceToken is: 49612946959762469195597770664378024234801679062591571890
{
  RespMetadata: {
    StatusCode: 400,
    RequestID: "da491f7a-ae72-4317-b52b-5038030bfd19"
  },
  ExpectedSequenceToken: "49612946959762469195597770664378024234801679062591571890",
  Message_: "The given sequenceToken is invalid. The next expected sequenceToken is: 49612946959762469195597770664378024234801679062591571890"
}

The issue seems to be related to one of the pods sending a message and incrementing its log sequence token, but then the other pod sends a log with the old sequence token. More details are in this stack overflow post.

Reconsider testing on EL8 with Schutzbot

Currently I see this in Jenkinsfile:

// TODO osbuild-composer-api isn't available in rhel8
// stage('EL8') {

however for clouddot we're expected to be deploying this on an EL8 system so IMO it makes sense to continue testing even if we don't ship any RPMs.

Are there any issues/problems preventing us from building and testing on EL8 ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.