56 lines
2.0 KiB
Markdown
56 lines
2.0 KiB
Markdown
# Forgejo runner
|
|
|
|
> The Forgejo Runner is a daemon that fetches workflows to run from a Forgejo instance, executes them, sends back with the logs and ultimately reports its success or failure.
|
|
|
|
!! WARNING: This recipe should be used with great caution, since it has access to the docker daemon. We recommend running it in a seperate vm or host !!
|
|
|
|
<!-- metadata -->
|
|
* **Category**: Apps
|
|
* **Status**: 5
|
|
* **LICENSE**: [GPLv3-or-later](https://code.forgejo.org/forgejo/runner/src/branch/main/LICENSE)
|
|
* **Maintainers**: [Klasse & Methode](https://klasse-methode.it) (@p4u1 @p4u1_f4u1:matrix.org)
|
|
* **Repository**: [code.forgejo.org/forgejo/runner](https://code.forgejo.org/forgejo/runner)
|
|
* **Documentation**: [forgejo.org/docs/next/admin/actions/](https://forgejo.org/docs/next/admin/actions/)
|
|
* **Image**: [`runner`](https://code.forgejo.org/forgejo/-/packages/container/runner/11), 4, upstream
|
|
* **Healthcheck**: No
|
|
* **Backups**: no
|
|
* **Email**: 0
|
|
* **Tests**: 0
|
|
* **SSO**: 0
|
|
<!-- endmetadata -->
|
|
|
|
## Registering
|
|
|
|
The forgejo runner needs to be registered at the forgejo instance. For that see the [official documentation](https://forgejo.org/docs/latest/admin/runner-installation/#standard-registration) on how to create a token.
|
|
|
|
```
|
|
abra app cmd --chaos <app> app register_runner <host> <name> <token>
|
|
```
|
|
|
|
## Enabling caching
|
|
|
|
To enable [caching](https://forgejo.org/docs/latest/admin/runner-installation/#cache-configuration) set `CACHE_ENABLED` to `true`:
|
|
```
|
|
CACHE_ENABLED=true
|
|
```
|
|
|
|
## Docker in Docker
|
|
|
|
To give an action container the ability to create more docker containers (e.g. for tests) you need to set the container network to "host". This can be done in the `.env` file:
|
|
```
|
|
CONTAINER_NETWORK=host
|
|
```
|
|
|
|
This allows you to access the docker host at "tcp://0.0.0.0:2375". See this part of an action workflow on how to access the docker host.
|
|
```
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
with:
|
|
endpoint: tcp://0.0.0.0:2375
|
|
platforms: linux/amd64
|
|
- name: run api tests
|
|
run: |
|
|
export DOCKER_HOST="tcp://0.0.0.0:2375"
|
|
make test-api
|
|
```
|