This change makes sure we always download the latest image from
simplestreams. We no longer copy labels from simplestreams so we need
to lookup the hash of the image against simplestreams. This means that
in airgapped environments, the operator will have to manually tag images
and use the tag name in favor of remote:image_name.
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
* Add the ability to define an LXD provider which spins up containers
instead of virtual machines.
* Loading an LXD provider that is not reachable no longer crashes garm
on startup.
* Labels are no longer copied on image import. The LXD provider will
resolve the image fingerprint from the simplestreams server every time.
The image will be copied locally if a new version exists.
* CLI properly formats the IP addresses in runner show
* LXD provider now waits for an IP address before returning on Create
* Added a few mocks for testing
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
* added interface for the github client. This will help mocking it
out for testing.
* removed some unused code
* moved some code around
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
Adds :z to the bind mount, ensuring the container can access the files
when SELinux is enabled.
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
When /usr/bin/docker is a wrapper for podman (as common no Fedora),
Podman will be used which requires the full image name including the
registry. It does not require the chown step, because this results in
the files being owned by a temporary mapped ID due to the user
namespace in rootless mode (which is the default unless Podman is run
by the root user) - make the chown a no-op by using UID/GID 0.
* Vendors packages
* Adds a Makefile that uses docker to build a static binary against musl
using alpine linux.
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
Pools can now define a bootstrap timeout for runners. The timeout can
be defined per pool and indicates the amount of time after which a runner
is considered defunct and removed.
If a runner doesn't join github in the configured amount of time, and it
receives no updates indicating that it is installing the runner via instance
status updates, it is considered defunct.
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
Runners can now be manually removed using the CLI. Some restrictions apply:
* A runner must be idle in github. Github will not allow us to remove a runner
that is running a workflow.
* The runner status must be "running"
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
When deleting a VM, we try to force stop it. If the VM is already stopped,
LXD will return an error. Unfortunately, we can't import the drivers package
from LXD without also pulling in a bunch of linux specific CGO dependencies
which we want to avoid.
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
* Runner names are unique. Skip querying pool, then runner name. Just fetch
the runner, which has a PoolID field set that can be used to determine the
pool.
* Add Debian to the list of Linux OSs