diff --git a/druid/config/gitea/README.md b/druid/config/gitea/README.md index 95f1dd3..2b1ef52 100644 --- a/druid/config/gitea/README.md +++ b/druid/config/gitea/README.md @@ -33,7 +33,8 @@ To force the runners to re-register (to apply updated labels, for example). 1. Stop and remove the containers. Run `docker ps -aq --filter name="gitea_runner-*" | xargs docker stop | xargs docker rm`. 2. Delete the `.runner` files for each runner. Run `find ~/data/gitea/ -name ".runner" -delete`. -3. Bring the runners back up. Run `docker compose up -d` from the gitea directory. +3. (Optional) Update runner config. Modify the `config.yaml` file as needed. [Official example config](https://gitea.com/gitea/act_runner/src/branch/main/internal/pkg/config/config.example.yaml). +4. Bring the runners back up. Run `docker compose up -d` from the gitea directory. # Delete Registed Runners Apparently a misconfigured Docker-in-Docker runner may sometimes retry registering over and over until the heat death of the universe. In that case you will end up with many "ghost" runners. In my case, 27,619. To resolve, you can either step through each one and click "edit", then "delete", then "confirm". Or you can just use the database. diff --git a/fighter/config/gitea/runner_ubuntu_internal_config.yaml b/fighter/config/gitea/config.yaml similarity index 82% rename from fighter/config/gitea/runner_ubuntu_internal_config.yaml rename to fighter/config/gitea/config.yaml index 15ea82a..920d06d 100644 --- a/fighter/config/gitea/runner_ubuntu_internal_config.yaml +++ b/fighter/config/gitea/config.yaml @@ -30,10 +30,15 @@ runner: # The interval for fetching the job from the Gitea instance. fetch_interval: 2s # The labels of a runner are used to determine which jobs the runner can run, and how to run them. - # Like: ["macos-arm64:host", "ubuntu-latest:docker://node:16-bullseye", "ubuntu-22.04:docker://node:16-bullseye"] + # Like: "macos-arm64:host" or "ubuntu-latest:docker://gitea/runner-images:ubuntu-latest" + # Find more images provided by Gitea at https://gitea.com/gitea/runner-images . # If it's empty when registering, it will ask for inputting labels. - # If it's empty when execute `deamon`, will use labels in `.runner` file. - labels: [] + # If it's empty when execute `daemon`, will use labels in `.runner` file. + labels: + - "ubuntu-latest:docker://gitea/runner-images:ubuntu-latest" + - "ubuntu-22.04:docker://gitea/runner-images:ubuntu-22.04" + - "ubuntu-20.04:docker://gitea/runner-images:ubuntu-20.04" + - "fighter:host" cache: # Enable cache server to use actions/cache. @@ -57,12 +62,15 @@ container: # Specifies the network to which the container will connect. # Could be host, bridge or the name of a custom network. # If it's empty, act_runner will create a network automatically. - network: host + network: "" # Whether to use privileged mode or not when launching task containers (privileged mode is required for Docker-in-Docker). privileged: false # And other options to be used when the container is started (eg, --add-host=my.gitea.url:host-gateway). options: # The parent directory of a job's working directory. + # NOTE: There is no need to add the first '/' of the path as act_runner will add it automatically. + # If the path starts with '/', the '/' will be trimmed. + # For example, if the parent directory is /path/to/my/dir, workdir_parent should be path/to/my/dir # If it's empty, /workspace will be used. workdir_parent: # Volumes (including bind mounts) can be mounted to containers. Glob syntax is supported, see https://github.com/gobwas/glob @@ -81,7 +89,9 @@ container: # If it's not empty or "-", the specified docker host will be used. An error will be returned if it doesn't work. docker_host: "" # Pull docker image(s) even if already present - force_pull: false + force_pull: true + # Rebuild docker image(s) even if already present + force_rebuild: false host: # The parent directory of a job's working directory. diff --git a/fighter/config/gitea/docker-compose.yml b/fighter/config/gitea/docker-compose.yml index 2e1f0fc..3a9ed2d 100644 --- a/fighter/config/gitea/docker-compose.yml +++ b/fighter/config/gitea/docker-compose.yml @@ -9,6 +9,6 @@ services: - path: ./runner_secrets.env required: false volumes: - - ./runner_ubuntu_internal_config.yaml:/config.yaml + - ./config.yaml:/config.yaml - $DOCKER_DATA/runner-ubuntu-internal:/data - /var/run/docker.sock:/var/run/docker.sock \ No newline at end of file