1
0
Fork 0
mirror of https://code.forgejo.org/forgejo/runner.git synced 2025-09-15 18:57:01 +00:00
Commit graph

707 commits

Author SHA1 Message Date
_
c455fb07f2 fix(git): add support for parsing weirder remote URLs 2025-03-31 23:45:06 -07:00
_
3f6addab2a fix(tests): explicitly set git-config user.name/user.email to avoid spurious test failures 2025-03-31 23:45:06 -07:00
benniekiss
53de9c1c27 fix GOOS parsing to match expected GHA RUNNER_OS values (#106)
This PR is a carryover from [upstream](https://github.com/nektos/act/pull/2422):

> github actions reports RUNNER_OS for linux and windows with [capital letters](https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/variables#default-environment-variables) (Linux, Windows). This should increase compatibility when runner uses `-self-hosted`
>
> Currently, when workflows are run within containers, RUNNER_OS is [hardcoded](https://code.forgejo.org/forgejo/act/search/branch/main?path=&q=RUNNER_OS&mode=exact) to `Linux` correctly, so this will make RUNNER_OS more consistent.

Reviewed-on: https://code.forgejo.org/forgejo/act/pulls/106
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Reviewed-by: earl-warren <earl-warren@noreply.code.forgejo.org>
Co-authored-by: benniekiss <benniekiss@noreply.code.forgejo.org>
Co-committed-by: benniekiss <benniekiss@noreply.code.forgejo.org>
2025-03-31 07:52:49 +00:00
Kwonunn
835a9d2068 fix: move reading cache to separate function 2025-03-24 10:48:28 +01:00
Kwonunn
639b83c26c fix: do not immediately close the db after opening it 2025-03-24 10:17:04 +01:00
Earl Warren
187e1df52c fix: reduce the time during which the database stays open
* During get/upload, close the database while reading/writing so
  it does not stay open for longer than necessary. This may be helpful
  when uploads run in parallel.
* Be more informative when returning error 500
* Make useCache handle errors
* Return 500 immediately when writing the cache fails instead of falling
  through to 200

Refs: https://code.forgejo.org/forgejo/runner/issues/509
2025-03-23 23:25:09 +01:00
Kwonunn
ef94958cd5 review: Gusted review 2025-03-21 13:45:51 +00:00
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
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
e0facd1ee5 fix(tests): binds are not sorted
That creates false negative in test runs. Just keep one, there is no
value in having more.
2025-01-22 22:24:27 +01:00
Earl Warren
d92e4a8aff feat: --hostname is allowed in container options (#95)
It is useful to set an alternative hostname when running a service
such as:

```yaml
services:
  minio:
    image: data.forgejo.org/oci/bitnami/minio:2024.8.17
    options: >-
      --hostname alternate.minio
```

Reviewed-on: https://code.forgejo.org/forgejo/act/pulls/95
Reviewed-by: Kwonunn <kwonunn@noreply.code.forgejo.org>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-01-22 18:22:29 +00:00
Earl Warren
790d1776e7 fix: do not ignore the config container.options when starting a job 2025-01-11 08:45:08 +01:00
Earl Warren
ed911869e1 fix: filter job container options with an allow list
The workflow can only contain the following options for a container:

- --volume
- --tmpfs
2025-01-09 12:10:21 +01:00
Earl Warren
1a77a34726 chore(refactor): split parseOptions out of mergeContainerConfigs 2025-01-09 12:10:21 +01:00
Earl Warren
fc518884f9 chore(refactor): split Options into ConfigOptions & JobOptions
They are both command line options to be parsed as if provided to
docker-run, but they are not to be trusted in the same way.
2025-01-09 12:10:21 +01:00
Vitaliy Potyarkin
591770bf63 refactor: Improve logging of error messages
Logging bare errors might lead to long troubleshooting sessions when error
is not specific enough. This commit adds helpful context messages to
logged errors.

Signed-off-by: Vitaliy Potyarkin <v.potyarkin@yadro.com>
2025-01-09 12:36:30 +03:00
xtex
606d8701ed feat: export runtime token as FORGEJO_TOKEN 2025-01-04 20:01:43 +08:00
Earl Warren
58966f5a8a chore(lint): fix lint errors
- upgrade to golangci-lint@v1.62.2
- make it renovate friendly
- remove most frequent lint check that are not of consequence (unused
  args, etc.)
- fix remaining lint errors
- add renovate custom manager to update the Makefile variable
2024-12-30 21:11:02 +00:00
Vitaliy Potyarkin
324188e239 fix: Do not fail on nil error
Commit 5a351d33df has introduced a
regression due to which copyDir() would fail after closing the archive
successfully

Signed-off-by: Vitaliy Potyarkin <v.potyarkin@yadro.com>
2024-12-27 17:56:23 +03:00
Earl Warren
07c56a4032 chore(tests): add ./pkg/container tests
remove a failed test verifying exposed port which are not used in the
Forgejo runner anyway
2024-12-27 11:59:35 +01:00
Michael Kriese
d8376ed890 fix(cache-server): use consistent uint64 2024-11-22 01:01:12 +01:00
Earl Warren
ef243fbf2f fix: log skipped job and step result as info instead of debug
This allows the Forgejo runner to obtain the job result from the
logs even when it is not in debug mode.
2024-11-21 12:18:04 +00:00
Earl Warren
c42fa5f412 fix: [FORGEJO] do not share the act-toolcache volume
In the context of Forgejo the act-toolcache must not be mounted
otherwise independent workflows will race against each other when
writing to it. For instance if a setup-go action is run at the same
time as another, there is a probability that they both write the same
file at the same time, which could lead to a truncated or invalid
content.
2024-11-20 09:42:15 +00:00
ChristopherHX
017db5edae fix: cache adjust restore order of exact key matches (#2267)
* wip: adjust restore order

* fixup

* add tests

* cleanup

* fix typo

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
(cherry picked from commit 88ac88c5413a430b41d767a942c8e70e778e1d61)
2024-11-07 16:25:40 +01:00