1
0
Fork 0
mirror of https://code.forgejo.org/forgejo/runner.git synced 2025-08-16 18:01:34 +00:00
Commit graph

1811 commits

Author SHA1 Message Date
Kwonunn
9150081892 return 404 when not found 2025-03-21 13:45:51 +00:00
Kwonunn
62310a5a09 set external url header 2025-03-21 13:45:51 +00:00
Kwonunn
e54faaf56d fix tests for cache proxy 2025-03-21 13:45:51 +00:00
Kwonunn
43f1298653 fix: external url and mac function matching 2025-03-21 13:45:51 +00:00
Kwonunn
57a2a56e32 add unit tests for mac calculation 2025-03-21 13:45:51 +00:00
Kwonunn
aa0c46539c review: add retries to generating runid in case of collision 2025-03-21 13:45:51 +00:00
Kwonunn
ef43d7c615 review: fix various issues brought up by Gusted 2025-03-21 13:45:51 +00:00
Kwonunn
7a21d64333 review: discard params in clean 2025-03-21 13:45:51 +00:00
Kwonunn
11062e4d6a return 403 instead of 500 when not authorized correctly 2025-03-21 13:45:51 +00:00
Kwonunn
e3adb49c50 functional save and restore through proxy 2025-03-21 13:45:51 +00:00
Kwonunn
95e754c06b integrate the new cache proxy with the server viceice set up 2025-03-21 13:45:51 +00:00
Kwonunn
a6a1df7556 use safe sync.Map 2025-03-21 13:45:51 +00:00
Kwonunn
41032137ea add copyright notice 2025-03-21 13:45:51 +00:00
Kwonunn
d736bb3435 rename workflowid to runid 2025-03-21 13:45:51 +00:00
Kwonunn
ce51735d7a update the reverse proxy to read workflow id and inject new auth info 2025-03-21 13:45:51 +00:00
Kwonunn
f81731e2d9 add CreateWorkflowData 2025-03-21 13:45:51 +00:00
Kwonunn
d92f9305dc wip: begin implementation of new design in proxy 2025-03-21 13:45:51 +00:00
Kwonunn
975364553b fix cache proxy to work properly 2025-03-21 13:45:51 +00:00
Kwonunn
4b5ffd768f implement proxy server 2025-03-21 13:45:51 +00:00
Kwonunn
11006f4ef3 implement hmac generation 2025-03-21 13:45:51 +00:00
Kwonunn
8bc36fb69a create cache proxy based on cache server 2025-03-21 13:45:51 +00:00
Michael Kriese
7458ddfaf4 fix: join org and repo 2025-03-21 13:45:51 +00:00
Michael Kriese
21ca8102fa fix: validate timestamp 2025-03-21 13:45:51 +00:00
Michael Kriese
1082b31367 fix: partial secure cache 2025-03-21 13:45:51 +00:00
Nitrousoxide
e5e28d16a5
Update examples/docker-compose/README.md (#494)
The container for the "docker-cli" label defined in the compose file does not contain the bash shell in it, and the forgejo runner defaults to that, with apparently no fall-back to sh if bash is not found in the $PATH.  Thus, the demo_docker.yml example will fail to run unless you specifically define the shell to sh.  This corrects the example to specifically use sh instead of bash for the docker-cli example.

Reviewed-on: https://code.forgejo.org/forgejo/runner/pulls/494
Reviewed-by: earl-warren <earl-warren@noreply.code.forgejo.org>
Co-authored-by: Nitrousoxide <nitrousoxide@noreply.code.forgejo.org>
Co-committed-by: Nitrousoxide <nitrousoxide@noreply.code.forgejo.org>
2025-02-27 14:28:53 +00:00
Renovate Bot
ee24670e39
Update dependency go to v1.23.6 (#491)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [go](https://go.dev/) ([source](https://github.com/golang/go)) | toolchain | patch | `1.23.5` -> `1.23.6` |

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - "* 0-3 * * *" (UTC).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xNzguMSIsInVwZGF0ZWRJblZlciI6IjM5LjE3OC4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

Reviewed-on: https://code.forgejo.org/forgejo/runner/pulls/491
Reviewed-by: earl-warren <earl-warren@noreply.code.forgejo.org>
Co-authored-by: Renovate Bot <bot@kriese.eu>
Co-committed-by: Renovate Bot <bot@kriese.eu>
2025-02-25 12:44:43 +00:00
Earl Warren
e4e7917eb3
chore(docs): warning about the docker-compose example purpose (#489)
Fixes forgejo/runner#484

Reviewed-on: https://code.forgejo.org/forgejo/runner/pulls/489
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-02-25 11:05:19 +00:00
Renovate Bot
f6c2a77ef2
Update module github.com/docker/docker to v25.0.8+incompatible (#481)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [github.com/docker/docker](https://github.com/docker/docker) | require | patch | `v25.0.7+incompatible` -> `v25.0.8+incompatible` |

---

### Release Notes

<details>
<summary>docker/docker (github.com/docker/docker)</summary>

### [`v25.0.8+incompatible`](https://github.com/docker/docker/compare/v25.0.7...v25.0.8)

[Compare Source](https://github.com/docker/docker/compare/v25.0.7...v25.0.8)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "* 0-3 * * *" (UTC), Automerge - "* 0-3 * * *" (UTC).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xNTYuMSIsInVwZGF0ZWRJblZlciI6IjM5LjE3MS4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

Reviewed-on: https://code.forgejo.org/forgejo/runner/pulls/481
Reviewed-by: earl-warren <earl-warren@noreply.code.forgejo.org>
Co-authored-by: Renovate Bot <bot@kriese.eu>
Co-committed-by: Renovate Bot <bot@kriese.eu>
2025-02-25 10:38:54 +00:00
Earl Warren
e33d3b0048
fix(examples): systemd LXC units upgrade must install the runner (#479)
Install the version of the runner that the upgraded script needs.

Reviewed-on: https://code.forgejo.org/forgejo/runner/pulls/479
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-02-25 10:37:20 +00:00
Earl Warren
74dc687c1d
chore(ci): no complaints if the Go version is higher than required (#490)
Reviewed-on: https://code.forgejo.org/forgejo/runner/pulls/490
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-02-25 09:47:45 +00:00
Earl Warren
a6aae6b476
fix(examples): systemd LXC units needs future version (#478)
Once 6.2.2 is published, the example will need to upgrade to this version and not the previous one.

Reviewed-on: https://code.forgejo.org/forgejo/runner/pulls/478
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-01-31 09:48:49 +00:00
Earl Warren
5df67e66fe
feat: add upgrade to forgejo-runner-service.sh (#475)
for the purpose of indirectly upgrading lxc-helpers if a newer version is needed. Otherwise it has to be done manually and can easily be overlooked.

Reviewed-on: https://code.forgejo.org/forgejo/runner/pulls/475
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-01-30 19:37:17 +00:00
Earl Warren
624b47bc2f
chore(ci): skip cascade if [skip cascade] is found in the PR title (#476)
When there are multiple PRs in flight, using a var to disable the cascading PR that eventually runs the end to end tests (for instance because the change is about examples) is error prone.

Allowing each pull request to indivudually decide when it is relevant or not is more practical and fine grain.

## Testing

Using [an extra commit](1b8949ed3a) for debuging:

- https://code.forgejo.org/forgejo/runner/actions/runs/3328 skips the cascade on this PR
- https://code.forgejo.org/forgejo/runner/actions/runs/3326 tries to run the cascade on this PR  (and fails because it does not have secrets) because `[skip ZZ cascade]` is set in the title

Reviewed-on: https://code.forgejo.org/forgejo/runner/pulls/476
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-01-30 15:23:22 +00:00
Earl Warren
dd88c37fff
chore(examples): upgrade the runner version to 6.2.1 (#473)
Reviewed-on: https://code.forgejo.org/forgejo/runner/pulls/473
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-01-30 11:17:37 +00:00
Earl Warren
1c7dbeea62
chore(docs): 6.2.1 release notes (#472)
Reviewed-on: https://code.forgejo.org/forgejo/runner/pulls/472
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-01-29 17:22:03 +00:00
Renovate Bot
1bee5882b3
Update module code.forgejo.org/forgejo/act to v1.24.1 (#471)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [code.forgejo.org/forgejo/act](https://code.forgejo.org/forgejo/act) | replace | patch | `v1.24.0` -> `v1.24.1` |

---

### Release Notes

<details>
<summary>forgejo/act (code.forgejo.org/forgejo/act)</summary>

### [`v1.24.1`](https://code.forgejo.org/forgejo/act/compare/v1.24.0...v1.24.1)

[Compare Source](https://code.forgejo.org/forgejo/act/compare/v1.24.0...v1.24.1)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "* 0-3 * * *" (UTC), Automerge - "* 0-3 * * *" (UTC).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xMzYuMSIsInVwZGF0ZWRJblZlciI6IjM5LjEzNi4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

Reviewed-on: https://code.forgejo.org/forgejo/runner/pulls/471
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Renovate Bot <bot@kriese.eu>
Co-committed-by: Renovate Bot <bot@kriese.eu>
2025-01-29 11:17:15 +00:00
earl-warren
ea79e3de41 Merge pull request 'fix: ensure the LXC template does not have obsolete APT' (#102) from earl-warren/act:wip-apt-old into main
Reviewed-on: https://code.forgejo.org/forgejo/act/pulls/102
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
2025-01-29 10:02:37 +00:00
Earl Warren
4df32aa3df fix: ensure the LXC template does not have obsolete APT
Upgrade to lxc-helper 1.0.1
2025-01-29 10:30:14 +01:00
Earl Warren
50aec4962b chore(upgrade): sync lxc-helpers v1.0.3 2025-01-29 10:30:12 +01:00
Michael Kriese
54fead51c6 fix(jobparser): support workflow_call.inputs and workflow_call.outputs (#70)
- Closes #69
- #45
- https://codeberg.org/forgejo/forgejo/issues/6069

Reviewed-on: https://code.forgejo.org/forgejo/act/pulls/70
Reviewed-by: earl-warren <earl-warren@noreply.code.forgejo.org>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
Co-committed-by: Michael Kriese <michael.kriese@visualon.de>
2025-01-29 08:38:30 +00:00
Earl Warren
70154d2b7d
chore(ci): only run tests on the examples when they are modified (#463)
Save CPU horsepower.

Reviewed-on: https://code.forgejo.org/forgejo/runner/pulls/463
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-01-28 15:39:43 +00:00
earl-warren
d89873dda7
fix: forgejo-runner-service.sh must not leak the env to the runner (#461)
Reviewed-on: https://code.forgejo.org/forgejo/runner/pulls/461
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
2025-01-28 14:54:34 +00:00
Earl Warren
434e44b69e
fix: forgejo-runner-service.sh do not fail container does not exist
If the daemon cannot be stopped and the goal is to destroy the
container, just proceed instead of failing.
2025-01-28 15:46:45 +01:00
Earl Warren
625965c739
fix: forgejo-runner-service.sh must not leak the env to the runner 2025-01-28 15:46:45 +01:00
viceice
90ecfa1b29
build: use right mirror image of xx (#459)
Signed-off-by: viceice <michael.kriese@gmx.de>
Reviewed-on: https://code.forgejo.org/forgejo/runner/pulls/459
Reviewed-by: earl-warren <earl-warren@noreply.code.forgejo.org>
Co-authored-by: viceice <michael.kriese@gmx.de>
Co-committed-by: viceice <michael.kriese@gmx.de>
2025-01-28 12:39:41 +00:00
earl-warren
adad88969c
fix: forgejo-runner-service.sh misses LXC config & cache setting (#455)
Reviewed-on: https://code.forgejo.org/forgejo/runner/pulls/455
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
2025-01-27 16:15:40 +00:00
Earl Warren
b79578d98e
feat: forgejo-runner-service.sh safeguard to avoid overheating
re-creating the LXC container from scratch is expensive. When
rebooting or when multiple units start at the same time, it may cause
an execessive load.

Use a global lock to guard this operation so they happen in sequence
and not in parallel. They typically take around one minute to complete
which means that in the event of a reboot, it will take around 1
minutes * the number of runners for the unlucky one to start.

During this interval workflows will have to wait.
2025-01-27 14:23:58 +01:00
Earl Warren
0232fe1255
fix: forgejo-runner-service.sh config.yml must point to the cache
It is not the default $HOME/.cache/actcache and must be set in
config.yml otherwise it won't be used.
2025-01-27 12:39:58 +01:00
Earl Warren
253eb51687
fix: forgejo-runner-service.sh misses LXC config
When re-creating the LXC container, the INPUTS_LXC_CONFIG must be
set otherwise it will always use the default.
2025-01-27 10:00:51 +01:00
Earl Warren
5f92ffdbc6
feat: systemd unit example for managing LXC containers (#451)
Refs: https://code.forgejo.org/forgejo/runner/issues/450
Reviewed-on: https://code.forgejo.org/forgejo/runner/pulls/451
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-01-25 12:24:31 +00:00