Is there a config option to force pull? #62

Open
opened 2023-07-19 17:37:56 +00:00 by fasterthanlime · 5 comments

Maybe more of a bug for forgejo/forgejo but, the whole reason I ran into #61 is because I was trying to get forgejo actions to pull my docker image before running the job, which I couldn't figure out how to do.

I ended up patching the runner, maybe I should've been patching act, idk. I'd expect a force_pull option in container maybe, next to image?

For now it seems like runner hardcodes ForcePull to false:

ForcePull: false,

Maybe more of a bug for `forgejo/forgejo` but, the whole reason I ran into https://code.forgejo.org/forgejo/runner/issues/61 is because I was trying to get forgejo actions to pull my docker image before running the job, which I couldn't figure out how to do. I ended up patching the runner, maybe I should've been patching act, idk. I'd expect a `force_pull` option in `container` maybe, next to `image`? For now it seems like runner hardcodes ForcePull to false: https://code.forgejo.org/forgejo/runner/src/commit/35f432bd649386401067cb2c0393672077b1c003/internal/app/run/runner.go#L194
dachary added the
Kind/Enhancement
label 2023-07-19 21:02:11 +00:00
Member

That would be an improvement, I ran into this as well. There is a proposed semantic here https://github.com/actions/runner/issues/791#issuecomment-1572296966

That would be an improvement, I ran into this as well. There is a proposed semantic here https://github.com/actions/runner/issues/791#issuecomment-1572296966
Contributor

@dachary Is this something we would want upstream to figure out/implement, or would we be willing to implement this in our fork? It seems like there are some PRs made against upstream to do this, but there was little input from maintainers.

https://github.com/actions/runner/pull/800

https://github.com/actions/runner/pull/1086

I assume we want to stay pretty close to upstream but this may be an instance where an optional field isn't too much of a divergence.

@dachary Is this something we would want upstream to figure out/implement, or would we be willing to implement this in our fork? It seems like there are some PRs made against upstream to do this, but there was little input from maintainers. https://github.com/actions/runner/pull/800 https://github.com/actions/runner/pull/1086 I assume we want to stay pretty close to upstream but this may be an instance where an optional field isn't too much of a divergence.
Member

It depends what the upstream is in this case: there are a few 😄 Some inspiration comes from GitHub but since it is not Free Software it is difficult to figure out why this option was never implemented. One may guess that there is so much horsepower that it just always pulls and be done with it. The core of the implementation of the runner comes from https://github.com/nektos/act/ and it could be implemented there, to offer better control over the cache. Although the target audience is only people running locally so they can always rm -fr the cache if needed. Then there is the Gitea act_runner where most of the code in the Forgejo comes from which may work on this particular issue as well.

AFAIK there has not been any activity in this area in the past weeks and if you want to give it a shot, noone will stand in your way. If I was to do it I think I'll start with implementing that as a patch to https://code.forgejo.org/forgejo/act.

It depends what the upstream is in this case: there are a few 😄 Some inspiration comes from GitHub but since it is not Free Software it is difficult to figure out why this option was never implemented. One may guess that there is so much horsepower that it just always pulls and be done with it. The core of the implementation of the runner comes from https://github.com/nektos/act/ and it could be implemented there, to offer better control over the cache. Although the target audience is only people running locally so they can always rm -fr the cache if needed. Then there is the Gitea act_runner where most of the code in the Forgejo comes from which may work on this particular issue as well. AFAIK there has not been any activity in this area in the past weeks and if you want to give it a shot, noone will stand in your way. If I was to do it I think I'll start with implementing that as a patch to https://code.forgejo.org/forgejo/act.
Contributor

Heh, yeah, good point. There's a lot of layers to this. I'll see if this is something I can pick up for Forgejo's own runner.

Heh, yeah, good point. There's a lot of layers to this. I'll see if this is something I can pick up for Forgejo's own runner.
Member

Some inspiration comes from GitHub but since it is not Free Software it is difficult to figure out why this option was never implemented

It is Free Software written in C#... how did I not know that.

> ~~Some inspiration comes from GitHub but since it is not Free Software it is difficult to figure out why this option was never implemented~~ It is Free Software written in C#... how did I not know that.
Sign in to join this conversation.
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: forgejo/runner#62
No description provided.