Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce how to configure cache when starting a Runner with Docker #25077

Merged
merged 5 commits into from
Jun 5, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions docs/content/doc/usage/actions/act-runner.en-us.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,29 @@ It is because the act runner will run jobs in docker containers, so it needs to
As mentioned, you can remove it if you want to run jobs in the host directly.
To be clear, the "host" actually means the container which is running the act runner now, instead of the host machine.

### Configuring cache when starting a Runner with Docker image
When starting a runner using a Docker image, it is essential to configure the cache action to ensure its proper functioning. Follow these steps:
sillyguodong marked this conversation as resolved.
Show resolved Hide resolved
1. Obtain the LAN IP address of the host machine where the runner container is located.
2. Find an available port number on the host machine where the runner container is running.
3. Configure the following settings in the configuration file:
```yaml
cache:
enabled: true
dir: ""
# Use the LAN IP obtained in step 1
host: "192.168.8.17"
# Use the port number obtained in step 2
port: 8088

```
4. When starting the container, map the cache port to the host machine:
```bash
docker run \
--name gitea-docker-runner \
-p 8088:8088 \
-d gitea/act_runner:nightly
```

### Labels

The labels of a runner are used to determine which jobs the runner can run, and how to run them.
Expand Down
22 changes: 22 additions & 0 deletions docs/content/doc/usage/actions/act-runner.zh-cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,28 @@ docker run \
如前所述,如果要在主机上直接运行Job,可以将其移除。
需要明确的是,这里的 "主机" 实际上指的是当前运行 Act Runner的容器,而不是主机机器本身。

### 当您使用 Docker 镜像启动 Runner,如何配置 Cache
当您使用 Docker 镜像启动 Runner,如果不进行以下配置,cache action 将无法正常工作。
1. 获取 Runner 容器所在主机的 LAN(本地局域网) IP 地址。
2. 获取一个 Runner 容器所在主机的空闲端口号。
3. 在配置文件中如下配置:
```yaml
cache:
enabled: true
dir: ""
# 使用步骤 1. 获取的 LAN IP
host: "192.168.8.17"
# 使用步骤 2. 获取的端口号
port: 8088
```
4. 启动容器时, 将 Cache 端口映射至主机。
```bash
docker run \
--name gitea-docker-runner \
-p 8088:8088 \
-d gitea/act_runner:nightly
```

### 标签

Runner的标签用于确定Runner可以运行哪些Job以及如何运行它们。
Expand Down