You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/content/1.getting-started/1.index.md
+9-14Lines changed: 9 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,6 @@ services:
16
16
ports:
17
17
- '3000:3000'
18
18
environment:
19
-
URL_ACCESS_TOKEN: random_token
20
19
API_BASE_URL: http://localhost:3000
21
20
volumes:
22
21
- cache-data:/app/.data
@@ -27,10 +26,6 @@ volumes:
27
26
28
27
### Environment Variables
29
28
30
-
#### `URL_ACCESS_TOKEN`
31
-
32
-
This token is used to authenticate runtime requests to the cache server. It should be a long random string. It is part of the URL used to access the cache server because we cannot use cookies or headers for authentication.
33
-
34
29
#### `API_BASE_URL`
35
30
36
31
- Example: `http://localhost:3000`
@@ -83,23 +78,23 @@ To leverage the GitHub Actions Cache Server with your self-hosted runners, you'l
83
78
84
79
### Configuring Environment Variables on Self-Hosted Runners
85
80
86
-
**`ACTIONS_CACHE_URL`**: This tells your self-hosted runner where to send cache requests. Set this environment variable to the `API_BASE_URL` of your cache server with the `URL_ACCESS_TOKEN` as first path parameter, making sure to include a trailing slash.
81
+
**`ACTIONS_RESULTS_URL`**: This tells your self-hosted runner where to send cache requests. Set this environment variable to the `API_BASE_URL` of your cache server, making sure to include a trailing slash.
87
82
88
-
For example, if your cache server's `API_BASE_URL` is `http://localhost:3000` and your `URL_ACCESS_TOKEN` is `random_token`, you would set `ACTIONS_CACHE_URL` to `http://localhost:3000/random_token/`.
83
+
For example, if your cache server's `API_BASE_URL` is `http://localhost:3000`, you would set `ACTIONS_RESULTS_URL` to `http://localhost:3000/`.
89
84
90
85
::u-alert
91
86
---
92
87
icon: 'tabler:alert-triangle'
93
88
class: ring-amber-400
94
89
color: amber
95
-
description: Make sure to add a trailing slash to the ACTIONS_CACHE_URL environment variable.
90
+
description: Make sure to add a trailing slash to the ACTIONS_RESULTS_URL environment variable.
96
91
variant: subtle
97
92
---
98
93
::
99
94
100
95
### Getting the Actions Runner to Use the Cache Server
101
96
102
-
The default self-hosted runner overwrites the `ACTIONS_CACHE_URL` environment variable with the GitHub-hosted cache server URL. To get the runner to use your self-hosted cache server, you'll need to modify the runner binary:
97
+
The default self-hosted runner overwrites the `ACTIONS_RESULTS_URL` environment variable with the GitHub-hosted cache server URL. To get the runner to use your self-hosted cache server, you'll need to modify the runner binary:
103
98
104
99
#### Docker
105
100
@@ -109,28 +104,28 @@ Just add the following lines to your Dockerfile:
109
104
FROM ghcr.io/actions/actions-runner:latest
110
105
111
106
# modify actions runner binaries to allow custom cache server implementation
112
-
RUN sed -i 's/\x41\x00\x43\x00\x54\x00\x49\x00\x4F\x00\x4E\x00\x53\x00\x5F\x00\x43\x00\x41\x00\x43\x00\x48\x00\x45\x00\x5F\x00\x55\x00\x52\x00\x4C\x00/\x41\x00\x43\x00\x54\x00\x49\x00\x4F\x00\x4E\x00\x53\x00\x5F\x00\x43\x00\x41\x00\x43\x00\x48\x00\x45\x00\x5F\x00\x4F\x00\x52\x00\x4C\x00/g' /home/runner/bin/Runner.Worker.dll
107
+
RUN sed -i 's/\x41\x00\x43\x00\x54\x00\x49\x00\x4F\x00\x4E\x00\x53\x00\x5F\x00\x52\x00\x45\x00\x53\x00\x55\x00\x4C\x00\x54\x00\x53\x00\x5F\x00\x55\x00\x52\x00\x4C\x00/\x41\x00\x43\x00\x54\x00\x49\x00\x4F\x00\x4E\x00\x53\x00\x5F\x00\x52\x00\x45\x00\x53\x00\x55\x00\x4C\x00\x54\x00\x53\x00\x5F\x00\x4F\x00\x52\x00\x4C\x00/g' /home/runner/bin/Runner.Worker.dll
113
108
```
114
109
115
110
#### Bare Metal
116
111
117
112
::code-group
118
113
119
114
```bash [Linux]
120
-
sed -i 's/\x41\x00\x43\x00\x54\x00\x49\x00\x4F\x00\x4E\x00\x53\x00\x5F\x00\x43\x00\x41\x00\x43\x00\x48\x00\x45\x00\x5F\x00\x55\x00\x52\x00\x4C\x00/\x41\x00\x43\x00\x54\x00\x49\x00\x4F\x00\x4E\x00\x53\x00\x5F\x00\x43\x00\x41\x00\x43\x00\x48\x00\x45\x00\x5F\x00\x4F\x00\x52\x00\x4C\x00/g' /path_to_your_runner/bin/Runner.Worker.dll
115
+
sed -i 's/\x41\x00\x43\x00\x54\x00\x49\x00\x4F\x00\x4E\x00\x53\x00\x5F\x00\x52\x00\x45\x00\x53\x00\x55\x00\x4C\x00\x54\x00\x53\x00\x5F\x00\x55\x00\x52\x00\x4C\x00/\x41\x00\x43\x00\x54\x00\x49\x00\x4F\x00\x4E\x00\x53\x00\x5F\x00\x52\x00\x45\x00\x53\x00\x55\x00\x4C\x00\x54\x00\x53\x00\x5F\x00\x4F\x00\x52\x00\x4C\x00/g' /path_to_your_runner/bin/Runner.Worker.dll
This will replace the strings `ACTIONS_CACHE_URL` with `ACTIONS_CACHE_ORL` in the runner binary. This will prevent the runner from overwriting the `ACTIONS_CACHE_URL` environment variable and allow it to use your self-hosted cache server.
128
+
This will replace the strings `ACTIONS_RESULTS_URL` with `ACTIONS_RESULTS_ORL` in the runner binary. This will prevent the runner from overwriting the `ACTIONS_RESULTS_URL` environment variable and allow it to use your self-hosted cache server.
134
129
135
130
Doing it this way is a bit of a hack, but it's easier than compiling your own runner binary from source and works great.
Copy file name to clipboardExpand all lines: docs/content/1.getting-started/4.how-it-works.md
+14-5Lines changed: 14 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -11,11 +11,11 @@ GitHub also has very good [documentation](https://docs.github.com/en/actions/usi
11
11
12
12
## 2. Getting the actions runner to use our cache server
13
13
14
-
The whole idea of creating a self-hosted cache server originated from the discovery that the official `actions/cache` action uses an environment variable `ACTIONS_CACHE_URL` to determine where to send cache requests. This means that we can simply set this environment variable to the base URL of our cache server and the runner will start using it ...right?
14
+
The whole idea of creating a self-hosted cache server originated from the discovery that the official `actions/cache` action uses an environment variable `ACTIONS_RESULTS_URL` to determine where to send cache requests. This means that we can simply set this environment variable to the base URL of our cache server and the runner will start using it ...right?
15
15
16
-
Well, not exactly. The `actions/cache` action uses the `ACTIONS_CACHE_URL` environment variable to determine the base URL of the cache server but we cannot overrid this environment variable in any way.
16
+
Well, not exactly. The `actions/cache` action uses the `ACTIONS_RESULTS_URL` environment variable to determine the base URL of the cache server but we cannot overrid this environment variable in any way.
17
17
18
-
The default actions runner always overrides the `ACTIONS_CACHE_URL` environment variable with an internal URL that points to the official GitHub cache server. This is the code that does it:
18
+
The default actions runner always overrides the `ACTIONS_RESULTS_URL` environment variable with an internal URL that points to the official GitHub cache server. This is the code that does it:
The line `Environment["ACTIONS_CACHE_URL"] = cacheUrl;` is the one that overrides the `ACTIONS_CACHE_URL` environment variable with the internal URL.
48
+
The line `Environment["ACTIONS_RESULTS_URL"] = resultsUrl;` is the one that overrides the `ACTIONS_RESULTS_URL` environment variable with the internal URL.
40
49
41
-
To allow overriding the `ACTIONS_CACHE_URL` environment variable, we need to modify the runner binary. This is a bit tricky because the runner is a compiled binary and we cannot simply modify the source code and recompile it. We need to modify the binary itself. So we did just that. We replaced the string `ACTIONS_CACHE_URL` with `ACTIONS_CACHE_ORL` (being careful to keep the same length) in the runner binary. This way, the runner will not override the `ACTIONS_CACHE_URL` environment variable and we can set it to our cache server's base URL.
50
+
To allow overriding the `ACTIONS_RESULTS_URL` environment variable, we need to modify the runner binary. This is a bit tricky because the runner is a compiled binary and we cannot simply modify the source code and recompile it. We need to modify the binary itself. So we did just that. We replaced the string `ACTIONS_RESULTS_URL` with `ACTIONS_RESULTS_ORL` (being careful to keep the same length) in the runner binary. This way, the runner will not override the `ACTIONS_RESULTS_URL` environment variable and we can set it to our cache server's base URL.
0 commit comments