bug: dynamic matrix strategy fails on Forgejo and works with runner's exec command #525
Labels
No labels
FreeBSD
Kind/Breaking
Kind/Bug
Kind/Chore
Kind/DependencyUpdate
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
Windows
linux-powerpc64le
linux-riscv64
linux-s390x
run-end-to-end-tests
run-forgejo-tests
run-multi-platform-tests
No milestone
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
forgejo/runner#525
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Can you reproduce the bug on the Forgejo test instance?
No
Description
I have a workflow that runs a matrix strategy perfectly fine when using forgejo-runner exec (with rootless podman) on my PC, but runs a single job instead of the matrix within Forgejo. I have reproduced the issue here on https://code.forgejo.org with a test workflow, see
https://code.forgejo.org/bziemons/actions-test/src/commit/4926a1e05ec547bc53ee96161ebe83143f35d241/.forgejo/workflows/test.yml.
Forgejo Version
10.0.3
Runner Version
6.2.2, 6.3.1
How are you running Forgejo?
Forgejo runs in a podman container on my end built from the Dockerfile provided in the sources.
How are you running the Runner?
I use rootless podman to run the runner image
data.forgejo.org/forgejo/runner:6, providing the runner image access to the user's podman socket.Logs
Please refer to https://code.forgejo.org/bziemons/actions-test/actions/runs/2 and the working local runner exec log is attached as
test-local-exec.log.Workflow file
bug:to bug: matrix strategy fails on Forgejo and works with runner's exec commandThe feature was implemented in act here: https://github.com/nektos/act/pull/964
Is gitea/Forgejo missing the mid-workflow changes in the amount of jobs?
FWIW
forgejo/act@d1e0216039has the commit from https://github.com/nektos/act/pull/964This is a limitation of the runner and is probably related to some missing values being passed from one job to another in this context. IIRC there was a similar issue somewhere. Maybe related https://codeberg.org/forgejo/forgejo/issues/2188.
Since each matrix element leads to an independent job, Forgejo evaluates the matrix statically in order to create the jobs that are sent to the runner. There is no logic to do that in a multi-step process where the matrix is computed based on the outcome of a previous job. Of course ACT has no such problem because it is a single binary and not a server communicating with a client.
Example: https://codeberg.org/forgejo/forgejo/actions/runs/66599
Where
I was unaware that the jobs to run are determined before even starting the first job, but it makes sense. Reading into it I saw that, e.g., "runs-on" is (of course) important to Forgejo to orchestrate which runner to use. That information is difficult to obtain when new jobs are generated as the workflow progresses and requires the runner to communicate that somehow as you mention. Thank you for your insight.
What are the implications?
Is it okay to make changes to the actions/runner api endpoint here downstream on Forgejo or should this be done upstream? I am willing to put some work into this. I am very much interested in the Forgejo api for the runners.
Edit: just going to update the text after reading a bit more into it. I agree with the last paragraph here: https://forgejo.org/2024-02-forking-forward/#consequences-of-becoming-a-hard-fork
I am not even sure if a change to the actions API is necessary, so the upstream question is too hypothetical. As of writing I see that Forgejo Actions is still using https://gitea.com/gitea/actions-proto-def, which currently means there is a common API. I wanted to explore what is possible with the current API and (I think) a discussion about whether this feature should be implemented and how to move forward would be more appropriate then.
There also is an upstream issue on gitea: https://gitea.com/gitea/act_runner/issues/393
bug: matrix strategy fails on Forgejo and works with runner's exec commandto bug: dynamic matrix strategy fails on Forgejo and works with runner's exec commandI have created https://codeberg.org/forgejo/docs/pulls/1119 for documenting this behaviour.