Commit graph

63 commits

Author SHA1 Message Date
Tom Gundersen
a416570ea2 schutzbot: add CI integration
The CI is in two stages, for each supported distro.

First the RPMs are generated from the spec file in the repo for the
given distro and architecture.

Once all the RPM builds have succeeded successfully, a test machine is
provisioned with osbulid-composer installed, and koji API enabled.

The repository containing the RPMs of the code being tested is also
enabled on the test machine, and the cli client is installed.

Finally, the test/integration.sh script is executed, which currently
does nothing.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2020-09-10 00:05:44 +02:00
Tom Gundersen
ec033ed623 spec/cli: depend on koji
This should depend on the cli client, which is shipped in the koji package,
not the builder.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2020-09-10 00:05:44 +02:00
Tom Gundersen
d2e81fbf79 spec: don't use pycached macro
This does not work on RHEL8.2.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2020-09-10 00:05:44 +02:00
Christian Kellner
857ae4ad77 README.md: add general description 2020-09-09 16:12:26 +02:00
Christian Kellner
3f5de8a68d plugin/cli: eager check of target input
Check the target with name exists and has a destination tag, so
we can abort early.
2020-09-09 15:56:35 +02:00
Christian Kellner
3934382337 plugin/cli: honor global --quiet flag
If --quiet was requested globally, then don't print anything.
2020-09-09 15:51:11 +02:00
Christian Kellner
8099d79aa1 plugin/cli: support --wait, --nowait option
Can be used to explicitly opt in or out of waiting for the task to
finish. The help text is taken from the standard koji client.
2020-09-09 15:28:36 +02:00
Christian Kellner
79387f1f2c plugins/cli: use upstream description help text
For --repo and --release, use the help text from koji build-image.
2020-09-09 15:07:36 +02:00
Christian Kellner
81aebbc681 plugin/cli: use koji_cli.lib.OptionParser
Use koji's OptionParser instead of argparse to be better aligned
with the formatting of standard koji options.
2020-09-09 15:06:53 +02:00
Christian Kellner
6087e2d90e run-builder: inspect network to get gateway IP
Instead of inferring the gateway ip via the the network device for
the podman bridge, where the name can change, use podman network
inspect.

```js
The json looks like this:
[
  {
    "cniVersion": "0.4.0",
    "name": "org.osbuild.koji",
    "plugins": [
      {
        "bridge": "cni-podman1",
        "hairpinMode": true,
        "ipMasq": true,
        "ipam": {
          "ranges": [
            [
              {
                "gateway": "10.89.0.1",
                "subnet": "10.89.0.0/24"
              }
            ]
          ],
          "routes": [
            {
              "dst": "0.0.0.0/0"
            }
          ],
          "type": "host-local"
        },
        "isGateway": true,
        "type": "bridge"
      },
      {
        "capabilities": {
          "portMappings": true
        },
        "type": "portmap"
      },
      {
        "backend": "",
        "type": "firewall"
      },
      {
        "domainName": "dns.podman",
        "type": "dnsname"
      }
    ]
  }
]
```

So the podman format for this is very obviously:

  {{ (index (index (index .plugins 0).ipam.ranges 0) 0).gateway }}
2020-09-09 14:35:58 +02:00
Christian Kellner
dda203419c plugin/osbuild: adapt for composer API changes
The task id can and must now be passed to composer via the `koji`
object in the `ComposeRequest`. Do that.
2020-09-09 14:12:25 +02:00
Christian Kellner
c54a817da2 spec: package koji client plugin
Add the new plugin to a new sub-package.
2020-09-08 17:51:35 +02:00
Christian Kellner
49a6974e18 plugins/cli: initial version of the cli plugin
Re-uses code from compose.py. Needs to be installed into
  /usr/lib/python3.$/site-packages/koji_cli_plugins
Yes indeed.
2020-09-08 17:46:21 +02:00
Christian Kellner
4508a6f980 spec: only have one spec file
To avoid confusion, lets only use the template and the out-generated
spec file.
2020-09-08 17:10:02 +02:00
Christian Kellner
df628f26aa Support for generating rpms via meson
Add a meson script that can be used to create rpms from the source
tree. It can also be used to install the plugins.
2020-09-08 16:58:06 +02:00
Christian Kellner
8fb1342631 Make image_type and distro required arguments
Distro, in composer terms "distribution", and "image_type" are
required for composer, so make that explicit everywhere in the
code.
2020-09-08 16:13:48 +02:00
Christian Kellner
c735ebc6d0 container: support for koji web
Install and configure koji web.
2020-09-07 20:38:12 +02:00
Christian Kellner
c5db26596f plugin/builder: nicer errors on compose fail
When creating the compose requests fails, catch it and transform
it into a koji.GenericError, which will avoid showing the full
backtrace in the UI.
2020-09-07 20:35:32 +02:00
Christian Kellner
a9e187d38a plugin/hub: rename method to osbuildImage
Remove the 'Test' suffix.
2020-09-07 19:03:15 +02:00
Christian Kellner
cb7e4d76c5 plugins/builder: change location of config file
Make the path reflect the name of the package / project.
2020-09-07 18:39:13 +02:00
Christian Kellner
ccf6d60dac plugin/osbuild: simple whitespace changes
No semantic change.
2020-09-07 18:29:22 +02:00
Christian Kellner
0bbcef29e3 client.py: use compose.py instead 2020-09-07 18:28:47 +02:00
Christian Kellner
bfde0dfa14 spec: rename file to match the package name 2020-09-07 18:28:13 +02:00
Christian Kellner
faea80f73b spec: rename the package
Rename the package to `koji-osbuild`, which follows the same scheme
as the OSBS one (`koji-containerbuild`).
The upstream repo has been changed accordingly as well.
2020-09-07 18:26:46 +02:00
Christian Kellner
b94a4b398d compose: support --release
Use this to explicitly set the release.
2020-09-07 18:26:21 +02:00
Christian Kellner
0783e7491e compose: add distro argument
The plugin expects this, or it falls back to name-version, which is
not the right thing in most cases.
2020-09-07 18:25:27 +02:00
Christian Kellner
3ef4d5e566 plugin/osbuild: make release optional
If release was not in `opts`, use `session.getNextRelease` to
obtain the next release.
2020-09-07 18:23:28 +02:00
Christian Kellner
dbf2960792 plugins/osbuild: sync with composer's koji API
Send the NVR as part of the compose request. The result now also
contains the koji build id. The distro argument is taken from
the options.
2020-09-07 18:15:30 +02:00
Christian Kellner
750bf5421b container/builder: configure plugin via cfg file
Matches the config of the containers.
2020-09-06 20:11:37 +02:00
Christian Kellner
d31cadd304 plugins/builder: make urls configurable
Can't really hardcode those.
2020-09-06 20:10:59 +02:00
Christian Kellner
5eeb251882 spec: add spec file draft
Initial attempt at packaging.
2020-09-06 16:15:47 +02:00
Christian Kellner
a17b683f03 LICENSE: add ASL 2.0 2020-09-06 16:02:54 +02:00
Christian Kellner
5173d697e5 README.md: add development links 2020-09-05 19:38:30 +02:00
Christian Kellner
0749472d8c README.md: add make-tags.sh instructions 2020-09-05 19:34:07 +02:00
Christian Kellner
318c53d84b README.md: add compse.py instructions 2020-09-05 19:31:35 +02:00
Christian Kellner
f58ecb97ac plugin/builder: support repo overwrites
Allow the repository information to be overwritten by the user
via opts.
2020-09-05 19:28:17 +02:00
Christian Kellner
ecfdec8dbc make-tags: remove i686 from build tag 2020-09-05 19:27:55 +02:00
Christian Kellner
64ffe431ec compose.py: add osbuild plugin api client
A client that will create a compose request via the koji plugins.
2020-09-05 19:26:32 +02:00
Christian Kellner
b9b3680809 plugin/builder: make use of repo information
Don't hard-code the repo info, but get if via the build tag.
2020-09-05 18:54:52 +02:00
Christian Kellner
7fa31ce349 plugins/builder: check for supported arches
Fetch the supported architectures via the target and detect if
any of the requested are not supported.
2020-09-05 18:21:21 +02:00
Christian Kellner
9e2061f6f2 container/builder: add createrepo_c
Needed if we wanted to include external repos.
2020-09-05 18:20:24 +02:00
Christian Kellner
5c0965fe9f move 'make-tags.sh' to the top-level dir 2020-09-05 18:19:55 +02:00
Christian Kellner
7bd3f197a7 run-kojid: also add builder to createrepo channel
At least one builder needs to be able to create repos.
2020-09-05 18:14:44 +02:00
Christian Kellner
bbb9acf310 run-kojid: conditionally exec add-host-to-channel
Only execute add-host-to-channel if add-host was successful. The
former throws exceptions.
2020-09-05 18:13:01 +02:00
Christian Kellner
6cdc3e7177 plugin/builder: ability to use as executable
Turn the plugin into an executable.
2020-09-05 17:28:44 +02:00
Christian Kellner
025d3b1902 plugin/builder: create proper composer client
Make a proper client for the osbuild composer koji API and use it.
2020-09-05 17:27:55 +02:00
Christian Kellner
d5918bd789 README.md: update with latest instructions 2020-09-05 16:35:23 +02:00
Christian Kellner
814554c34f Remove old ssl and start scripts
Not needed anymore with the move to kerberos and run-koji-container.sh
2020-09-05 16:34:59 +02:00
Christian Kellner
8f09fa2813 .editorconfig: added
For the shell scripts
2020-09-05 16:34:41 +02:00
Christian Kellner
8f41087797 plugins/builder: proof-of-concept compose
Talk to composer and create a compose via a hand crafted compose
request.
2020-09-05 16:33:45 +02:00