Commit graph

385 commits

Author SHA1 Message Date
Simon Steinbeiss
6f3c49139d packit: Push directly to dist-git 2022-02-16 12:39:25 +01:00
ochosi
b576875ac8 Post release version bump
[skip ci]
2022-02-15 23:38:15 +00:00
Simon Steinbeiss
560c7859d1 Pre-release version bump
This is necessary once so we can enable the upstream release bot workflow,
which consists of just pushing a tag and bumping the version number
directly after the release is done.
2022-02-15 23:29:56 +00:00
Christian Kellner
f559c18079 plugins: support for repo package sets
This adds support for specifing the package sets for repositories;
on the command line this can be done via `--repo-package-set` with
and argument of `;` separated package set names. This will result
in repo information being transported via dict instead of plain
strings. Thus the hub plugin's schema was modified accordingly.
Last but not least, the builder plugin now can decode these dicts
and setup the repos accordingly.
Test were added for plugins as well as the integration test changed
to use this new feature.
The first upstream commit that supports this feature is pinned.
2022-02-15 17:35:29 +01:00
Christian Kellner
5d2f6c6daa test/integration: properly match distro to host
When we are on an RHEL 8.x host we need to supply `rhel-8x` as
target distro. The previous code just used the major version so
we always built `rhel-8`, i.e. RHEL 8.3.
2022-02-15 17:35:29 +01:00
Tomas Kopecek
30f11bcf16 Lower task weight
It similar to BuildTask - so it doesn't do much on the builder and
doesn't use a lot of resources. It makes sense to have much lower weight
for this type of task.
2022-02-14 17:04:02 +00:00
Simon Steinbeiss
7743d20af9 Add upstream release bot and enable packit 2022-02-14 15:33:48 +01:00
Christian Kellner
78ed04dbd6 plugins: support for ostree specific options
OStree compose requests need special options, like the `ref` the
`parent` and the `url`. Add support for those options to all three
plugins:
  The command line plugin now takes `--ostree-{parent,ref,url}`
  and passes it to koji via the existing options dictionary.

  The JSON schemata in the hub plugin was adjusted to allow these
  new options.

  Finally the builder plugin will look for the new `ostree` dict
  inside the options, create an `OSTreeOptions` object from it,
  and attach it to each image request.

NB: since the ostree options are per image request and are thus
architecture dependent we support a "$arch" substition in the
`parent` and `ref` options that will be resolved by the plugin;
this allows to builds arch specific commits for with a single
compose request.

Add the respective unit tests.
2022-02-14 13:14:19 +01:00
Christian Kellner
ce21817676 schutzbot: pin composer (need integrated API)
Update composer to a commit that includes the new integrated
cloud API as well as exposing all the image types via it.
2022-02-11 16:36:07 +01:00
Christian Kellner
47af69254c builder: map koji api image types to cloud ones
Map the image types used by the koji API to the image types used
by the cloud api. This should allow for a smooth transition when
the plugin is upgraded, i.e. the pungi configuration can be used
unmodified. After all the plugins are upgraded the pungi config
should be changed to use the native image types and then this
mapping could be removed again.
2022-02-11 16:36:07 +01:00
Christian Kellner
4edca7a82a test/builder: validate image type in request
Take the current list of valid image types currently supported by
the cloud api and validdate it during the compose request. Also
allow a test "image_type" image type which is used all over the
place in the testing code.
2022-02-11 16:36:07 +01:00
Christian Kellner
54c59cc41c builder: use cloud api
Composer now[1] has integrated the koji API into the "cloud API"
and thus we can use this more general purpose and powerful API
instead of using the specialized koji API endpoint.
Adapt the request and response structures as well as the unit
tests to use that.

[1] PR #2214, commit 11e2ae45284bfb0d89ef1c1e0d2aa4ae230ea573
2022-02-11 16:36:07 +01:00
Chloe Kaubisch
cdfc041293 hacking.md: add contributing section
Add Contributing section to hacking.md with link to developer guide.
2022-02-08 17:03:56 +01:00
Christian Kellner
c56bcba78c README.md,HACKING.md: update for SSO/OAuth2
Add documentation how to properly configure and use OAuth2.
2022-02-02 17:47:44 +01:00
Christian Kellner
c1a887a9a9 test: switch to using oauth/sso
Switch the authentication method that the koji builder plugin
uses from mTLS to SSO. Since we are using the mock openid
server from the `osbuild-composer-tests` package. Make this
package a dependency of `koji-osbuild-tests`.
2022-02-02 13:33:21 +01:00
Christian Kellner
4e1039bed7 test: add helper script to run openid server
Add a new helper script to run the mock open id server that is
shipped inside the osbuild-composer-tests package.
2022-02-02 13:33:21 +01:00
Christian Kellner
940e122ae9 builder: support for sso via oauth2
Implement support for authentication via OAuth2 using the client
credentials "Client Credentials Grant" flow (4.4 of RFC 6749).
For this a new configuration section is added to the config file,
where the client_id, client_secret and token_url have to be
specified.
The impelmention does currently not support "refresh tokens", but
does support refreshing the token if an `expires_in` is present
in the token itself.
Corresponding unit tests have been added.

[1] https://datatracker.ietf.org/doc/html/rfc6749#section-4.4
2022-02-02 13:33:21 +01:00
Christian Kellner
ca05cc9f00 builder: wrap http calls
This is so that we can add retry logic when doing SSO/OAuth2.
2022-02-02 13:33:21 +01:00
Christian Kellner
1530f91794 ci: switch from rhel 8.4 to 8.5
Composer stopped building RPMs for 8.4, so we cannot pin commits
for new versions anymore. Switch to 8.5.
Update terraform commit accordingly.
2022-01-31 18:44:28 +00:00
Christian Kellner
4f0dcb8a7b schutzbot: don't start weldr API
We don't use that api, so let's disable it, otherwise it might
want to load repo configurations and fail; but we don't need
them anayway.
2022-01-31 18:44:28 +00:00
Christian Kellner
b80fd4d7f6 test: integration tests adapt to the host
Change the integration test so that it adapts to the host, i.e. it
will take the name, version and architecture for the tags and urls
for the repos from the host it is running on. This should make it
more future proof since we now have a central place where this is
configured: the ci configuration, i.e. `.gitlab-ci.yml`.
2022-01-31 15:55:26 +01:00
Christian Kellner
141f5561d2 ci: remove testing on Fedora 33
F33 is end of life (EOL) since 2021‑11‑30.
2022-01-31 15:55:26 +01:00
Christian Kellner
cd1928d8f3 schutzbot: update osbuild to 46
osbuild 30 is quite old, use a new one.
2022-01-28 18:02:43 +00:00
Christian Kellner
9f0cdfd8a6 cli: do not use translation helper
This got deprected upstream[1] and now spits out a warning.

[1] https://pagure.io/koji/c/32b5377392ade0f1d1e159288b000383e5c3a39b
2022-01-26 18:40:23 +01:00
Christian Kellner
e099b8a96e run-tests: explicitly specify --cached
Seems to be required for newer versions of `git`.
2022-01-26 18:02:33 +01:00
Christian Kellner
1a5977bad2 builder: move ssl arguments to global options
When the builder is used as a command line argument: move the
ssl related options to the global parser so they can be used
with status and wait too.
2022-01-26 18:02:33 +01:00
Christian Kellner
2ca0f3b370 builder: make repo a proper optional argument
When the builder is used as an command line binary: have `repo`
be a proper command line argument. It was currently specified
before arch which can be passed multiple times, but so does
repo; hence one of them needs to be optional.
2022-01-26 18:02:33 +01:00
Christian Kellner
9c5f38fc35 builder: small whitespace fix
Two lines before the first class. Will make auto-format happy;
and David.
2022-01-24 23:21:31 +01:00
Christian Kellner
5f16fb1e31 devcontainer: include openssl
Needed for certificate generation.
2022-01-24 23:21:31 +01:00
Christian Kellner
f4576cb255 builder: fix command line argument names
Fix the names for various command line arguments for when the
builder plugin is invoked as a stand-alone executable.
2022-01-24 23:21:31 +01:00
Christian Kellner
bbf8b74047 pylint: move config to setup.cfg
This is what we do in osbuild, lets do it here too, so we are in
sync about where the configuration is.
2022-01-24 23:21:31 +01:00
Christian Kellner
07b376e02f test: run-test.sh now works inside a container
The `run-test.sh` helper is meant to execute the tests as if it
was CI but using a container. If it is detected that we are
already running inside a container assume it is prepare so that
we can exectue the tests directly and do so.
2022-01-19 20:45:23 +01:00
Christian Kellner
a841845688 devcontainer: initial import
Add support for Visual Studio Code Dev Containers.
2022-01-19 20:45:23 +01:00
Ondřej Budai
cd8703640b schutzbot: remove ssh keys of team member that left us
bye 😢

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2022-01-05 13:08:54 +01:00
Alexander Todorov
16905e3c5f CI: Fix failure in Coverity Scan 2021-11-22 11:47:18 +01:00
Alexander Todorov
6dbc41dbdb ci: Enable Coverity Scan 2021-11-15 12:29:17 +00:00
Ondřej Budai
4b1e61045e gitlab: do not save the journal 2021-10-21 13:41:56 +02:00
Ondřej Budai
3c82326129 mockbuild: rotate a variable name 2021-10-21 13:41:56 +02:00
Ondřej Budai
26073e04b8 mockbuild: do not subscribe
All runners are already subscribed.
2021-10-21 13:41:56 +02:00
dependabot[bot]
98c4c90637 build(deps): bump ludeeus/action-shellcheck from 0.5.0 to 1.1.0
Bumps [ludeeus/action-shellcheck](https://github.com/ludeeus/action-shellcheck) from 0.5.0 to 1.1.0.
- [Release notes](https://github.com/ludeeus/action-shellcheck/releases)
- [Commits](https://github.com/ludeeus/action-shellcheck/compare/0.5.0...1.1.0)

---
updated-dependencies:
- dependency-name: ludeeus/action-shellcheck
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-06 15:08:36 +02:00
Alexander Todorov
4a751c1386 Handle RHEL subscriptions like in osbuid-composer repo 2021-10-05 12:18:46 +02:00
Alexander Todorov
ffc9ada217 Update Fedora-33 test runners
See
https://github.com/osbuild/koji-osbuild/pull/62#issuecomment-924369341,
95f8bd253b

Also requires to update the names of 8.4 runners.
2021-10-05 12:18:46 +02:00
Christian Kellner
a6cb711e1c test: use importlib instead of imp
Replace the usage of `imp` with `importlib` because the former
is deprecated and newer pylint will complain and break CI.
2021-10-05 12:18:46 +02:00
Alexander Todorov
98142d3325 Trigger CI jobs only for PRs and main
to minimize the resource usage when we & Dependabot push to branches
2021-10-05 11:08:25 +02:00
Alexander Todorov
17dd9582c8 Enable Dependabot 2021-10-05 11:08:25 +02:00
Christian Kellner
2b324d3d89 plugin/cli: remove type annotation
Remove the single string type annotation; it does not gain us much and
seems to be the only thing missing for python 2.7 (RHEL 7) support.
2021-08-17 02:28:07 +02:00
Alexander Todorov
f569c38ea9 Add support for GitLab CI
and remove Jenkins related files
2021-07-29 11:19:33 +02:00
Alexander Todorov
e778771f2b Remove rhel.repo to avoid dnf being confused
when building the containers the initial `dnf upgrade` will download
content from the latest nightly trees which turns the container into a
Beta system and subsequent `dnf isntall` gets confused!
2021-07-29 11:19:33 +02:00
Ondřej Budai
3f54467fd4 deploy: add a workaround for a dnf bug on F34 2021-07-23 15:24:05 +02:00
Ondřej Budai
3e69cea6fd mockbuild: use s3cmd put instead of sync to speed up the RPM upload
s3cmd sync actually downloads metadata for all objects in a s3 bucket.
We have built a lot of RPMs, thus this takes 5 minutes on AWS and 25 minutes
on my laptop (!!!).

Let's use recursive put instead. This doesn't delete any files on the remote
side. As we upload RPMs only once, this also shouldn't fail on "the
object already exists". Using this method, we should be able to upload the
RPMs in seconds.

The same patch was applied in osbuild-composer cf73edd2
2021-07-23 15:24:05 +02:00