diff --git a/README.md b/README.md index 69f4ee6f..175b0556 100644 --- a/README.md +++ b/README.md @@ -22,12 +22,10 @@ Welcome to GARM! -GARM enables you to create and automatically maintain pools of [self-hosted GitHub runners](https://docs.github.com/en/actions/hosting-your-own-runners/about-self-hosted-runners), with auto-scaling that can be used inside your github workflow runs. +GARM enables you to create and automatically maintain pools of self-hosted runners in both [Github](https://docs.github.com/en/actions/hosting-your-own-runners/about-self-hosted-runners) and [Gitea](https://github.com/go-gitea/gitea/) with auto-scaling that can be used inside your workflow runs. The goal of ```GARM``` is to be simple to set up, simple to configure and simple to use. The server itself is a single binary that can run on any GNU/Linux machine without any other requirements other than the providers you want to enable in your setup. It is intended to be easy to deploy in any environment and can create runners in virtually any system you can write a provider for (if one does not alreay exist). There is no complicated setup process and no extremely complex concepts to understand. Once set up, it's meant to stay out of your way. -GARM supports creating pools and scale sets in either GitHub itself or in your own deployment of [GitHub Enterprise Server](https://docs.github.com/en/enterprise-server@3.10/admin/overview/about-github-enterprise-server). For instructions on how to use ```GARM``` with GHE, see the [credentials](/doc/github_credentials.md) section of the documentation. - Through the use of providers, `GARM` can create runners in a variety of environments using the same `GARM` instance. Whether you want to create runners in your OpenStack cloud, your Azure cloud or your Kubernetes cluster, that is easily achieved by installing the appropriate providers, configuring them in `GARM` and creating pools that use them. You can create zero-runner pools for instances with high costs (large VMs, GPU enabled instances, etc) and have them spin up on demand, or you can create large pools of eagerly created k8s backed runners that can be used for your CI/CD pipelines at a moment's notice. You can mix them up and create pools in any combination of providers or resource allocations you want. GARM supports two modes of operation: @@ -62,6 +60,14 @@ Check out the [quickstart](/doc/quickstart.md) document for instructions on how Thanks to the efforts of the amazing folks at [@mercedes-benz](https://github.com/mercedes-benz/), GARM can now be integrated into k8s via their operator. Check out the [GARM operator](https://github.com/mercedes-benz/garm-operator/) for more details. +## Configuring GARM for GHES + +GARM supports creating pools and scale sets in either GitHub itself or in your own deployment of [GitHub Enterprise Server](https://docs.github.com/en/enterprise-server@3.10/admin/overview/about-github-enterprise-server). For instructions on how to use ```GARM``` with GHE, see the [credentials](/doc/github_credentials.md) section of the documentation. + +## Configuring GARM for Gitea + +GARM now has support for Gitea (>=1.24.0). For information on getting started with Gitea, see the [Gitea quickstart](/doc/gitea.md) document. + ## Using GARM GARM is designed with simplicity in mind. At least we try to keep it as simple as possible. We're aware that adding a new tool in your workflow can be painful, especially when you already have to deal with so many. The cognitive load for OPS has reached a level where it feels overwhelming at times to even wrap your head around a new tool. As such, we believe that tools should be simple, should take no more than a few hours to understand and set up and if you absolutely need to interact with the tool, it should be as intuitive as possible. Although we try our best to make this happen, we're aware that GARM has some rough edges, especially for new users. If you encounter issues or feel like the setup process was too complicated, please let us know. We're always looking to improve the user experience. diff --git a/doc/gitea.md b/doc/gitea.md new file mode 100644 index 00000000..2bf4e3d6 --- /dev/null +++ b/doc/gitea.md @@ -0,0 +1,361 @@ +# Using GARM with Gitea + +Starting with Gitea 1.24 and the latest version of GARM (upcomming v0.2.0 - currently `main`), GARM supports Gitea as a forge, side by side with GitHub/GHES. A new endpoint type has been added to represent Gitea instances, which you can configure and use along side your GitHub runners. + +You can essentially create runners for both GitHub and Gitea using the same GARM instance, using the same CLI and the same API. It's simply a matter of adding an endpoint and credentials. The rest is the same as for github. + +## Quickstart + +This is for testing purposes only. We'll assume you're running on an Ubuntu 24.04 VM or server. You can use anything you'd like, but this quickstart is tailored to get you up and running with the LXD provider. So we'll: + +* Initialize LXD +* Create a docker compose yaml +* Deploy Gitea and GARM +* Configure GARM to use Gitea + +You will have to install Docker-CE yourself. + +### Initialize LXD + +If you already have LXD initialized, you can skip this step. Otherwise, simply run: + +```bash +sudo lxd init --auto +``` + +This should set up LXD with default settings that should work on any system. + +LXD and Docker sometimes have issues with networking due to some conflicting iptables rules. In most cases, if you have docker installed and notice that you don't have access to the outside world from the containers, run the following command: + +```bash +sudo iptables -I DOCKER-USER -j ACCEPT +``` + +### Create the docker compose + +Create a docker compose file in `$HOME/compose.yaml`. This docker compose will deploy both gitea and GARM. If you already have a Gitea >=1.24.0, you can edit this docker compose to only deploy GARM. + +```yaml +version: "3" + +networks: + default: + external: false + +services: + gitea: + image: docker.gitea.com/gitea:1.24.0-rc0 + container_name: gitea + environment: + - USER_UID=1000 + - USER_GID=1000 + restart: always + networks: + - default + volumes: + - /etc/gitea/gitea:/data + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro + ports: + - "80:80" + - "22:22" + garm: + image: ghcr.io/cloudbase/garm:${GARM_VERSION:-nightly} + container_name: garm + environment: + - USER_UID=1000 + - USER_GID=1000 + restart: always + networks: + - default + volumes: + - /etc/garm:/etc/garm + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro + # Give GARM access to the LXD socker. We need this later in the LXD provider. + - /var/snap/lxd/common/lxd/unix.socket:/var/snap/lxd/common/lxd/unix.socket + ports: + - "9997:9997" +``` + +Create the folders for Gitea and GARM: + +```bash +sudo mkdir -p /etc/gitea /etc/garm +sudo chown 1000:1000 /etc/gitea /etc/garm +``` + +Create the GARM configuration file: + +```bash + +sudo tee /etc/garm/config.toml <