actions / runner

The Runner for GitHub Actions :rocket:
https://github.com/features/actions
MIT License
4.69k stars 915 forks source link

Add ability to opt out of agent auto-update #246

Closed myoung34 closed 2 years ago

myoung34 commented 4 years ago

Describe the enhancement

Running the agent within docker and having it auto update causes the container to throttle and never succeed without having to manage PID 1

It would be nice to have something in config.sh or run.sh, possibly environment variables to help opt out of auto-update

Code Snippet

n/a

Additional information

n/a

jenschelkopf commented 2 years ago

Ah, yes @myoung34. That issue is part of a repository where we track customer feedback internally. I got a little link happy :) I'll hide the comment so other people don't try it as well.

ChristopherHX commented 2 years ago

My little, but effective workaround of my own runner implementation written in golang, which obviously doesn't want to be replaced by the official runner: To opt out of auto update the connecting runner just must have a version >= latest during session creation.

In our fork we also added a change to prevent auto-updates, but since the GitHub backend only sends jobs to a runner if it's up to date, preventing auto-updates that way effectively disables the runner whenever new runner release is made.

As you can compile the runner in a fork or locally, why not change the runner version to 3.0.0 (file https://github.com/actions/runner/blob/main/src/runnerversion). If you run the dev script / workflow now your runner won't get updates for some month or even years. (no idea when github runners will reach 3.x.x, then use 4.0.0 and so on).

This method might bear the risk github requires a new runner feature like a new message encryption method (fips was the last one which were added) and your old runner version doesn't have that feature and fails to connect, because the actions service assumes the feature is present.

edudip-thomasp commented 2 years ago

So is there anything new on this topic? Auto-updating when running "runner" in Kubernetes is constantly failing. An option to opt out would be nice.

na-jakobs commented 2 years ago

I would like to see this as well 🥇

thboop commented 2 years ago

This has been implemented in runner 2.287.1, and is live on github.com. It will come to ghes/ghae in subsequent releases! 🎉 Please see this changelog for more details