Commit graph

9 commits

Author SHA1 Message Date
Christian Kellner
14003137fc run-builder: supply --rm only for "fg"
When run in the background, remove the container in "builder_stop",
this should make it easier to print logs between starting and
stopping the container.
2020-09-17 10:48:37 +02:00
Christian Kellner
5b237ffe84 run-builder: set sensible bash flags
Do the usual "set -euo pipefail".
2020-09-17 10:48:37 +02:00
Christian Kellner
3fdf66a61c run-builder: use jq instead of inspect --format
Because podman on RHEL 8.2 does not understand --format, so we
basically do the same now via 'jq'.
2020-09-10 18:41:13 +01:00
Christian Kellner
dd2d3cf0a9 run-builder: argument checking
Check we have at least one positional argument, and it is either
"start", "stop" or "fg".
2020-09-10 18:41:13 +01:00
Christian Kellner
10e691d8c3 run-builder: support background execution
The run-builder script now takes a command line argument, which is
either
  start - run the container in the background
  stop  - stop the running container
  fg    - run the container in the foreground (old behavior)

This should prove useful in CI.
2020-09-10 18:41:13 +01: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
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
750bf5421b container/builder: configure plugin via cfg file
Matches the config of the containers.
2020-09-06 20:11:37 +02:00
Christian Kellner
24de422440 run-builder.sh: start script for the builder
Simple start script for the builder. It is not integrated in
run-koji-container.sh because here in this repo, the builder
might be restarted often when working on the builder plugin.
2020-09-05 16:31:53 +02:00